# Generated from Cmm2.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3O")
        buf.write("\u0152\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\3\2\3\2\3\2\7\2")
        buf.write("\62\n\2\f\2\16\2\65\13\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3=")
        buf.write("\n\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4H\n\4\3\5")
        buf.write("\3\5\3\5\3\5\3\5\3\6\5\6P\n\6\3\6\3\6\3\6\3\6\3\6\3\6")
        buf.write("\3\6\3\6\5\6Z\n\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\7\6c\n\6")
        buf.write("\f\6\16\6f\13\6\3\6\5\6i\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3")
        buf.write("\7\5\7r\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\5\t{\n\t\3\t\3")
        buf.write("\t\5\t\177\n\t\3\n\5\n\u0082\n\n\3\n\3\n\3\13\5\13\u0087")
        buf.write("\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r")
        buf.write("\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\7\16\u009e\n")
        buf.write("\16\f\16\16\16\u00a1\13\16\5\16\u00a3\n\16\3\16\3\16\3")
        buf.write("\17\3\17\5\17\u00a9\n\17\3\17\3\17\3\20\3\20\5\20\u00af")
        buf.write("\n\20\3\20\5\20\u00b2\n\20\3\21\3\21\5\21\u00b6\n\21\3")
        buf.write("\21\3\21\3\21\3\21\3\21\7\21\u00bd\n\21\f\21\16\21\u00c0")
        buf.write("\13\21\5\21\u00c2\n\21\3\21\5\21\u00c5\n\21\3\21\3\21")
        buf.write("\3\21\7\21\u00ca\n\21\f\21\16\21\u00cd\13\21\3\21\3\21")
        buf.write("\3\22\3\22\5\22\u00d3\n\22\3\22\3\22\3\22\3\22\3\22\7")
        buf.write("\22\u00da\n\22\f\22\16\22\u00dd\13\22\5\22\u00df\n\22")
        buf.write("\3\22\5\22\u00e2\n\22\3\22\3\22\3\22\3\23\3\23\3\23\3")
        buf.write("\23\7\23\u00eb\n\23\f\23\16\23\u00ee\13\23\3\23\3\23\3")
        buf.write("\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00fb")
        buf.write("\n\24\3\25\3\25\3\25\3\25\3\25\3\25\7\25\u0103\n\25\f")
        buf.write("\25\16\25\u0106\13\25\3\26\3\26\3\26\3\26\3\26\3\26\3")
        buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u0115\n\26\3\26")
        buf.write("\3\26\3\26\3\26\3\26\5\26\u011c\n\26\3\26\3\26\3\26\3")
        buf.write("\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26")
        buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26")
        buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26")
        buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26")
        buf.write("\7\26\u014d\n\26\f\26\16\26\u0150\13\26\3\26\2\4(*\27")
        buf.write("\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*\2\t\3\2")
        buf.write("\r\20\3\2\21\23\3\2\r\16\3\2\24\25\3\2\26\31\3\2\32\33")
        buf.write("\4\2\6\6#,\2\u0180\2\63\3\2\2\2\4<\3\2\2\2\6G\3\2\2\2")
        buf.write("\bI\3\2\2\2\nh\3\2\2\2\fj\3\2\2\2\16s\3\2\2\2\20~\3\2")
        buf.write("\2\2\22\u0081\3\2\2\2\24\u0086\3\2\2\2\26\u0088\3\2\2")
        buf.write("\2\30\u0090\3\2\2\2\32\u0098\3\2\2\2\34\u00a6\3\2\2\2")
        buf.write("\36\u00ac\3\2\2\2 \u00b5\3\2\2\2\"\u00d2\3\2\2\2$\u00e6")
        buf.write("\3\2\2\2&\u00fa\3\2\2\2(\u00fc\3\2\2\2*\u011b\3\2\2\2")
        buf.write(",\62\5\4\3\2-\62\5\"\22\2.\62\5 \21\2/\62\5$\23\2\60\62")
        buf.write("\7\3\2\2\61,\3\2\2\2\61-\3\2\2\2\61.\3\2\2\2\61/\3\2\2")
        buf.write("\2\61\60\3\2\2\2\62\65\3\2\2\2\63\61\3\2\2\2\63\64\3\2")
        buf.write("\2\2\64\3\3\2\2\2\65\63\3\2\2\2\66\67\5\6\4\2\678\7\3")
        buf.write("\2\28=\3\2\2\29:\5\b\5\2:;\7\3\2\2;=\3\2\2\2<\66\3\2\2")
        buf.write("\2<9\3\2\2\2=\5\3\2\2\2>?\5&\24\2?@\7L\2\2@H\3\2\2\2A")
        buf.write("B\5&\24\2BC\7L\2\2CD\7\4\2\2DE\5*\26\2EF\7\5\2\2FH\3\2")
        buf.write("\2\2G>\3\2\2\2GA\3\2\2\2H\7\3\2\2\2IJ\5&\24\2JK\7L\2\2")
        buf.write("KL\7\6\2\2LM\5*\26\2M\t\3\2\2\2NP\5(\25\2ON\3\2\2\2OP")
        buf.write("\3\2\2\2PQ\3\2\2\2Qi\7\3\2\2Ri\5\4\3\2ST\7;\2\2Ti\7\3")
        buf.write("\2\2UV\7<\2\2Vi\7\3\2\2WY\7A\2\2XZ\5(\25\2YX\3\2\2\2Y")
        buf.write("Z\3\2\2\2Z[\3\2\2\2[i\7\3\2\2\\i\5\f\7\2]i\5\16\b\2^i")
        buf.write("\5\26\f\2_i\5\30\r\2`d\7\7\2\2ac\5\n\6\2ba\3\2\2\2cf\3")
        buf.write("\2\2\2db\3\2\2\2de\3\2\2\2eg\3\2\2\2fd\3\2\2\2gi\7\b\2")
        buf.write("\2hO\3\2\2\2hR\3\2\2\2hS\3\2\2\2hU\3\2\2\2hW\3\2\2\2h")
        buf.write("\\\3\2\2\2h]\3\2\2\2h^\3\2\2\2h_\3\2\2\2h`\3\2\2\2i\13")
        buf.write("\3\2\2\2jk\7\67\2\2kl\7\t\2\2lm\5(\25\2mn\7\n\2\2nq\5")
        buf.write("\n\6\2op\78\2\2pr\5\n\6\2qo\3\2\2\2qr\3\2\2\2r\r\3\2\2")
        buf.write("\2st\79\2\2tu\7\t\2\2uv\5(\25\2vw\7\n\2\2wx\5\n\6\2x\17")
        buf.write("\3\2\2\2y{\5(\25\2zy\3\2\2\2z{\3\2\2\2{|\3\2\2\2|\177")
        buf.write("\7\3\2\2}\177\5\4\3\2~z\3\2\2\2~}\3\2\2\2\177\21\3\2\2")
        buf.write("\2\u0080\u0082\5(\25\2\u0081\u0080\3\2\2\2\u0081\u0082")
        buf.write("\3\2\2\2\u0082\u0083\3\2\2\2\u0083\u0084\7\3\2\2\u0084")
        buf.write("\23\3\2\2\2\u0085\u0087\5(\25\2\u0086\u0085\3\2\2\2\u0086")
        buf.write("\u0087\3\2\2\2\u0087\25\3\2\2\2\u0088\u0089\7:\2\2\u0089")
        buf.write("\u008a\7\t\2\2\u008a\u008b\5\20\t\2\u008b\u008c\5\22\n")
        buf.write("\2\u008c\u008d\5\24\13\2\u008d\u008e\7\n\2\2\u008e\u008f")
        buf.write("\5\n\6\2\u008f\27\3\2\2\2\u0090\u0091\7E\2\2\u0091\u0092")
        buf.write("\5\n\6\2\u0092\u0093\79\2\2\u0093\u0094\7\t\2\2\u0094")
        buf.write("\u0095\5(\25\2\u0095\u0096\7\n\2\2\u0096\u0097\7\3\2\2")
        buf.write("\u0097\31\3\2\2\2\u0098\u0099\7L\2\2\u0099\u00a2\7\t\2")
        buf.write("\2\u009a\u009f\5*\26\2\u009b\u009c\7\13\2\2\u009c\u009e")
        buf.write("\5*\26\2\u009d\u009b\3\2\2\2\u009e\u00a1\3\2\2\2\u009f")
        buf.write("\u009d\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a3\3\2\2\2")
        buf.write("\u00a1\u009f\3\2\2\2\u00a2\u009a\3\2\2\2\u00a2\u00a3\3")
        buf.write("\2\2\2\u00a3\u00a4\3\2\2\2\u00a4\u00a5\7\n\2\2\u00a5\33")
        buf.write("\3\2\2\2\u00a6\u00a8\5&\24\2\u00a7\u00a9\7-\2\2\u00a8")
        buf.write("\u00a7\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\u00aa\3\2\2\2")
        buf.write("\u00aa\u00ab\7L\2\2\u00ab\35\3\2\2\2\u00ac\u00ae\5&\24")
        buf.write("\2\u00ad\u00af\7-\2\2\u00ae\u00ad\3\2\2\2\u00ae\u00af")
        buf.write("\3\2\2\2\u00af\u00b1\3\2\2\2\u00b0\u00b2\7L\2\2\u00b1")
        buf.write("\u00b0\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\37\3\2\2\2\u00b3")
        buf.write("\u00b6\5&\24\2\u00b4\u00b6\7@\2\2\u00b5\u00b3\3\2\2\2")
        buf.write("\u00b5\u00b4\3\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\u00b8\7")
        buf.write("L\2\2\u00b8\u00c4\7\t\2\2\u00b9\u00be\5\34\17\2\u00ba")
        buf.write("\u00bb\7\13\2\2\u00bb\u00bd\5\34\17\2\u00bc\u00ba\3\2")
        buf.write("\2\2\u00bd\u00c0\3\2\2\2\u00be\u00bc\3\2\2\2\u00be\u00bf")
        buf.write("\3\2\2\2\u00bf\u00c2\3\2\2\2\u00c0\u00be\3\2\2\2\u00c1")
        buf.write("\u00b9\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2\u00c5\3\2\2\2")
        buf.write("\u00c3\u00c5\7@\2\2\u00c4\u00c1\3\2\2\2\u00c4\u00c3\3")
        buf.write("\2\2\2\u00c5\u00c6\3\2\2\2\u00c6\u00c7\7\n\2\2\u00c7\u00cb")
        buf.write("\7\7\2\2\u00c8\u00ca\5\n\6\2\u00c9\u00c8\3\2\2\2\u00ca")
        buf.write("\u00cd\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cb\u00cc\3\2\2\2")
        buf.write("\u00cc\u00ce\3\2\2\2\u00cd\u00cb\3\2\2\2\u00ce\u00cf\7")
        buf.write("\b\2\2\u00cf!\3\2\2\2\u00d0\u00d3\5&\24\2\u00d1\u00d3")
        buf.write("\7@\2\2\u00d2\u00d0\3\2\2\2\u00d2\u00d1\3\2\2\2\u00d3")
        buf.write("\u00d4\3\2\2\2\u00d4\u00d5\7L\2\2\u00d5\u00e1\7\t\2\2")
        buf.write("\u00d6\u00db\5\36\20\2\u00d7\u00d8\7\13\2\2\u00d8\u00da")
        buf.write("\5\36\20\2\u00d9\u00d7\3\2\2\2\u00da\u00dd\3\2\2\2\u00db")
        buf.write("\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc\u00df\3\2\2\2")
        buf.write("\u00dd\u00db\3\2\2\2\u00de\u00d6\3\2\2\2\u00de\u00df\3")
        buf.write("\2\2\2\u00df\u00e2\3\2\2\2\u00e0\u00e2\7@\2\2\u00e1\u00de")
        buf.write("\3\2\2\2\u00e1\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3")
        buf.write("\u00e4\7\n\2\2\u00e4\u00e5\7\3\2\2\u00e5#\3\2\2\2\u00e6")
        buf.write("\u00e7\7?\2\2\u00e7\u00e8\7L\2\2\u00e8\u00ec\7\7\2\2\u00e9")
        buf.write("\u00eb\5\4\3\2\u00ea\u00e9\3\2\2\2\u00eb\u00ee\3\2\2\2")
        buf.write("\u00ec\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed\u00ef\3")
        buf.write("\2\2\2\u00ee\u00ec\3\2\2\2\u00ef\u00f0\7\b\2\2\u00f0\u00f1")
        buf.write("\7\3\2\2\u00f1%\3\2\2\2\u00f2\u00fb\7\65\2\2\u00f3\u00fb")
        buf.write("\7\66\2\2\u00f4\u00fb\7F\2\2\u00f5\u00fb\7G\2\2\u00f6")
        buf.write("\u00fb\7H\2\2\u00f7\u00fb\7I\2\2\u00f8\u00f9\7?\2\2\u00f9")
        buf.write("\u00fb\7L\2\2\u00fa\u00f2\3\2\2\2\u00fa\u00f3\3\2\2\2")
        buf.write("\u00fa\u00f4\3\2\2\2\u00fa\u00f5\3\2\2\2\u00fa\u00f6\3")
        buf.write("\2\2\2\u00fa\u00f7\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\'")
        buf.write("\3\2\2\2\u00fc\u00fd\b\25\1\2\u00fd\u00fe\5*\26\2\u00fe")
        buf.write("\u0104\3\2\2\2\u00ff\u0100\f\3\2\2\u0100\u0101\7\13\2")
        buf.write("\2\u0101\u0103\5*\26\2\u0102\u00ff\3\2\2\2\u0103\u0106")
        buf.write("\3\2\2\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105")
        buf.write(")\3\2\2\2\u0106\u0104\3\2\2\2\u0107\u0108\b\26\1\2\u0108")
        buf.write("\u0109\7\t\2\2\u0109\u010a\5(\25\2\u010a\u010b\7\n\2\2")
        buf.write("\u010b\u011c\3\2\2\2\u010c\u011c\7/\2\2\u010d\u011c\7")
        buf.write("\60\2\2\u010e\u011c\7.\2\2\u010f\u011c\7L\2\2\u0110\u0111")
        buf.write("\7K\2\2\u0111\u0114\7\t\2\2\u0112\u0115\5*\26\2\u0113")
        buf.write("\u0115\5&\24\2\u0114\u0112\3\2\2\2\u0114\u0113\3\2\2\2")
        buf.write("\u0115\u0116\3\2\2\2\u0116\u0117\7\n\2\2\u0117\u011c\3")
        buf.write("\2\2\2\u0118\u011c\5\32\16\2\u0119\u011a\t\2\2\2\u011a")
        buf.write("\u011c\5*\26\17\u011b\u0107\3\2\2\2\u011b\u010c\3\2\2")
        buf.write("\2\u011b\u010d\3\2\2\2\u011b\u010e\3\2\2\2\u011b\u010f")
        buf.write("\3\2\2\2\u011b\u0110\3\2\2\2\u011b\u0118\3\2\2\2\u011b")
        buf.write("\u0119\3\2\2\2\u011c\u014e\3\2\2\2\u011d\u011e\f\16\2")
        buf.write("\2\u011e\u011f\t\3\2\2\u011f\u014d\5*\26\17\u0120\u0121")
        buf.write("\f\r\2\2\u0121\u0122\t\4\2\2\u0122\u014d\5*\26\16\u0123")
        buf.write("\u0124\f\f\2\2\u0124\u0125\t\5\2\2\u0125\u014d\5*\26\r")
        buf.write("\u0126\u0127\f\13\2\2\u0127\u0128\t\6\2\2\u0128\u014d")
        buf.write("\5*\26\f\u0129\u012a\f\n\2\2\u012a\u012b\t\7\2\2\u012b")
        buf.write("\u014d\5*\26\13\u012c\u012d\f\t\2\2\u012d\u012e\7\34\2")
        buf.write("\2\u012e\u014d\5*\26\n\u012f\u0130\f\b\2\2\u0130\u0131")
        buf.write("\7\35\2\2\u0131\u014d\5*\26\t\u0132\u0133\f\7\2\2\u0133")
        buf.write("\u0134\7\36\2\2\u0134\u014d\5*\26\b\u0135\u0136\f\6\2")
        buf.write("\2\u0136\u0137\7\37\2\2\u0137\u014d\5*\26\7\u0138\u0139")
        buf.write("\f\5\2\2\u0139\u013a\7 \2\2\u013a\u014d\5*\26\6\u013b")
        buf.write("\u013c\f\4\2\2\u013c\u013d\7!\2\2\u013d\u013e\5(\25\2")
        buf.write("\u013e\u013f\7\"\2\2\u013f\u0140\5*\26\4\u0140\u014d\3")
        buf.write("\2\2\2\u0141\u0142\f\3\2\2\u0142\u0143\t\b\2\2\u0143\u014d")
        buf.write("\5*\26\3\u0144\u0145\f\23\2\2\u0145\u0146\7\f\2\2\u0146")
        buf.write("\u014d\7L\2\2\u0147\u0148\f\20\2\2\u0148\u0149\7\4\2\2")
        buf.write("\u0149\u014a\5*\26\2\u014a\u014b\7\5\2\2\u014b\u014d\3")
        buf.write("\2\2\2\u014c\u011d\3\2\2\2\u014c\u0120\3\2\2\2\u014c\u0123")
        buf.write("\3\2\2\2\u014c\u0126\3\2\2\2\u014c\u0129\3\2\2\2\u014c")
        buf.write("\u012c\3\2\2\2\u014c\u012f\3\2\2\2\u014c\u0132\3\2\2\2")
        buf.write("\u014c\u0135\3\2\2\2\u014c\u0138\3\2\2\2\u014c\u013b\3")
        buf.write("\2\2\2\u014c\u0141\3\2\2\2\u014c\u0144\3\2\2\2\u014c\u0147")
        buf.write("\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3\2\2\2\u014e")
        buf.write("\u014f\3\2\2\2\u014f+\3\2\2\2\u0150\u014e\3\2\2\2$\61")
        buf.write("\63<GOYdhqz~\u0081\u0086\u009f\u00a2\u00a8\u00ae\u00b1")
        buf.write("\u00b5\u00be\u00c1\u00c4\u00cb\u00d2\u00db\u00de\u00e1")
        buf.write("\u00ec\u00fa\u0104\u0114\u011b\u014c\u014e")
        return buf.getvalue()


class Cmm2Parser ( Parser ):

    grammarFileName = "Cmm2.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "';'", "'['", "']'", "'='", "'{'", "'}'", 
                     "'('", "')'", "','", "'.'", "'+'", "'-'", "'!'", "'~'", 
                     "'*'", "'/'", "'%'", "'<<'", "'>>'", "'<'", "'<='", 
                     "'>'", "'>='", "'=='", "'!='", "'&'", "'^'", "'|'", 
                     "'&&'", "'||'", "'?'", "':'", "'+='", "'-='", "'*='", 
                     "'/='", "'%='", "'<<='", "'>>='", "'&='", "'^='", "'|='", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'int'", "'char'", "'if'", "'else'", "'while'", "'for'", 
                     "'break'", "'continue'", "'true'", "'false'", "'struct'", 
                     "'void'", "'return'", "'switch'", "'case'", "'default'", 
                     "'do'", "'double'", "'long'", "'short'", "'float'", 
                     "'unsigned'", "'sizeof'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "FUNCTION_ARGUMENT_OPTION", 
                      "FLOAT_NUMBER", "INT_NUMBER", "STRING_CONSTANT", "CHAR_CONSTANT", 
                      "DEC_NUMBER", "OCT_NUMBER", "HEX_NUMBER", "Int", "Char", 
                      "If", "Else", "While", "For", "Break", "Continue", 
                      "True_cmm", "False_cmm", "Struct", "Void", "Return", 
                      "Switch", "Case", "Default", "Do", "Double", "Long", 
                      "Short", "Float", "Unsigned", "Sizeof", "VAR", "WS", 
                      "COMMENT", "MULTILINE_COMMENT" ]

    RULE_build = 0
    RULE_declare_statement = 1
    RULE_declare_expression = 2
    RULE_declare_assign_expression = 3
    RULE_statement = 4
    RULE_if_statement = 5
    RULE_while_statement = 6
    RULE_for_1 = 7
    RULE_for_2 = 8
    RULE_for_3 = 9
    RULE_for_statement = 10
    RULE_do_statement = 11
    RULE_function_call_expression = 12
    RULE_function_argument = 13
    RULE_forward_function_argument = 14
    RULE_function_definition = 15
    RULE_forward_function_definition = 16
    RULE_struct_definition = 17
    RULE_type_cmm = 18
    RULE_comma_expression = 19
    RULE_expression = 20

    ruleNames =  [ "build", "declare_statement", "declare_expression", "declare_assign_expression", 
                   "statement", "if_statement", "while_statement", "for_1", 
                   "for_2", "for_3", "for_statement", "do_statement", "function_call_expression", 
                   "function_argument", "forward_function_argument", "function_definition", 
                   "forward_function_definition", "struct_definition", "type_cmm", 
                   "comma_expression", "expression" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    T__40=41
    T__41=42
    FUNCTION_ARGUMENT_OPTION=43
    FLOAT_NUMBER=44
    INT_NUMBER=45
    STRING_CONSTANT=46
    CHAR_CONSTANT=47
    DEC_NUMBER=48
    OCT_NUMBER=49
    HEX_NUMBER=50
    Int=51
    Char=52
    If=53
    Else=54
    While=55
    For=56
    Break=57
    Continue=58
    True_cmm=59
    False_cmm=60
    Struct=61
    Void=62
    Return=63
    Switch=64
    Case=65
    Default=66
    Do=67
    Double=68
    Long=69
    Short=70
    Float=71
    Unsigned=72
    Sizeof=73
    VAR=74
    WS=75
    COMMENT=76
    MULTILINE_COMMENT=77

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.7.1")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class BuildContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def declare_statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Declare_statementContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Declare_statementContext,i)


        def forward_function_definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Forward_function_definitionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Forward_function_definitionContext,i)


        def function_definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Function_definitionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Function_definitionContext,i)


        def struct_definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Struct_definitionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Struct_definitionContext,i)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_build

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBuild" ):
                listener.enterBuild(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBuild" ):
                listener.exitBuild(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBuild" ):
                return visitor.visitBuild(self)
            else:
                return visitor.visitChildren(self)




    def build(self):

        localctx = Cmm2Parser.BuildContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_build)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 49
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__0) | (1 << Cmm2Parser.Int) | (1 << Cmm2Parser.Char) | (1 << Cmm2Parser.Struct) | (1 << Cmm2Parser.Void))) != 0) or ((((_la - 68)) & ~0x3f) == 0 and ((1 << (_la - 68)) & ((1 << (Cmm2Parser.Double - 68)) | (1 << (Cmm2Parser.Long - 68)) | (1 << (Cmm2Parser.Short - 68)) | (1 << (Cmm2Parser.Float - 68)))) != 0):
                self.state = 47
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,0,self._ctx)
                if la_ == 1:
                    self.state = 42
                    self.declare_statement()
                    pass

                elif la_ == 2:
                    self.state = 43
                    self.forward_function_definition()
                    pass

                elif la_ == 3:
                    self.state = 44
                    self.function_definition()
                    pass

                elif la_ == 4:
                    self.state = 45
                    self.struct_definition()
                    pass

                elif la_ == 5:
                    self.state = 46
                    self.match(Cmm2Parser.T__0)
                    pass


                self.state = 51
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Declare_statementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def declare_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Declare_expressionContext,0)


        def declare_assign_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Declare_assign_expressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_declare_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeclare_statement" ):
                listener.enterDeclare_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeclare_statement" ):
                listener.exitDeclare_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDeclare_statement" ):
                return visitor.visitDeclare_statement(self)
            else:
                return visitor.visitChildren(self)




    def declare_statement(self):

        localctx = Cmm2Parser.Declare_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_declare_statement)
        try:
            self.state = 58
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 52
                self.declare_expression()
                self.state = 53
                self.match(Cmm2Parser.T__0)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 55
                self.declare_assign_expression()
                self.state = 56
                self.match(Cmm2Parser.T__0)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Declare_expressionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return Cmm2Parser.RULE_declare_expression

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class Declare_normalContext(Declare_expressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.Declare_expressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeclare_normal" ):
                listener.enterDeclare_normal(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeclare_normal" ):
                listener.exitDeclare_normal(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDeclare_normal" ):
                return visitor.visitDeclare_normal(self)
            else:
                return visitor.visitChildren(self)


    class Declare_arrayContext(Declare_expressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.Declare_expressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)
        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeclare_array" ):
                listener.enterDeclare_array(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeclare_array" ):
                listener.exitDeclare_array(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDeclare_array" ):
                return visitor.visitDeclare_array(self)
            else:
                return visitor.visitChildren(self)



    def declare_expression(self):

        localctx = Cmm2Parser.Declare_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_declare_expression)
        try:
            self.state = 69
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
            if la_ == 1:
                localctx = Cmm2Parser.Declare_normalContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 60
                self.type_cmm()
                self.state = 61
                self.match(Cmm2Parser.VAR)
                pass

            elif la_ == 2:
                localctx = Cmm2Parser.Declare_arrayContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 63
                self.type_cmm()
                self.state = 64
                self.match(Cmm2Parser.VAR)
                self.state = 65
                self.match(Cmm2Parser.T__1)
                self.state = 66
                self.expression(0)
                self.state = 67
                self.match(Cmm2Parser.T__2)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Declare_assign_expressionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_declare_assign_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeclare_assign_expression" ):
                listener.enterDeclare_assign_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeclare_assign_expression" ):
                listener.exitDeclare_assign_expression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDeclare_assign_expression" ):
                return visitor.visitDeclare_assign_expression(self)
            else:
                return visitor.visitChildren(self)




    def declare_assign_expression(self):

        localctx = Cmm2Parser.Declare_assign_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_declare_assign_expression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 71
            self.type_cmm()
            self.state = 72
            self.match(Cmm2Parser.VAR)
            self.state = 73
            self.match(Cmm2Parser.T__3)
            self.state = 74
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class StatementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return Cmm2Parser.RULE_statement

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class Continue_statementContext(StatementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.StatementContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Continue(self):
            return self.getToken(Cmm2Parser.Continue, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterContinue_statement" ):
                listener.enterContinue_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitContinue_statement" ):
                listener.exitContinue_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitContinue_statement" ):
                return visitor.visitContinue_statement(self)
            else:
                return visitor.visitChildren(self)


    class Normal_statementContext(StatementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.StatementContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)

        def declare_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.Declare_statementContext,0)

        def if_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.If_statementContext,0)

        def while_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.While_statementContext,0)

        def for_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.For_statementContext,0)

        def do_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.Do_statementContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNormal_statement" ):
                listener.enterNormal_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNormal_statement" ):
                listener.exitNormal_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNormal_statement" ):
                return visitor.visitNormal_statement(self)
            else:
                return visitor.visitChildren(self)


    class Block_statementContext(StatementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.StatementContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.StatementContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.StatementContext,i)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBlock_statement" ):
                listener.enterBlock_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBlock_statement" ):
                listener.exitBlock_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBlock_statement" ):
                return visitor.visitBlock_statement(self)
            else:
                return visitor.visitChildren(self)


    class Break_statementContext(StatementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.StatementContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Break(self):
            return self.getToken(Cmm2Parser.Break, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBreak_statement" ):
                listener.enterBreak_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBreak_statement" ):
                listener.exitBreak_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBreak_statement" ):
                return visitor.visitBreak_statement(self)
            else:
                return visitor.visitChildren(self)


    class Return_statementContext(StatementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.StatementContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Return(self):
            return self.getToken(Cmm2Parser.Return, 0)
        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReturn_statement" ):
                listener.enterReturn_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReturn_statement" ):
                listener.exitReturn_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitReturn_statement" ):
                return visitor.visitReturn_statement(self)
            else:
                return visitor.visitChildren(self)



    def statement(self):

        localctx = Cmm2Parser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_statement)
        self._la = 0 # Token type
        try:
            self.state = 102
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.T__0, Cmm2Parser.T__6, Cmm2Parser.T__10, Cmm2Parser.T__11, Cmm2Parser.T__12, Cmm2Parser.T__13, Cmm2Parser.FLOAT_NUMBER, Cmm2Parser.INT_NUMBER, Cmm2Parser.STRING_CONSTANT, Cmm2Parser.Sizeof, Cmm2Parser.VAR]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 77
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                    self.state = 76
                    self.comma_expression(0)


                self.state = 79
                self.match(Cmm2Parser.T__0)
                pass
            elif token in [Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 80
                self.declare_statement()
                pass
            elif token in [Cmm2Parser.Break]:
                localctx = Cmm2Parser.Break_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 81
                self.match(Cmm2Parser.Break)
                self.state = 82
                self.match(Cmm2Parser.T__0)
                pass
            elif token in [Cmm2Parser.Continue]:
                localctx = Cmm2Parser.Continue_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 83
                self.match(Cmm2Parser.Continue)
                self.state = 84
                self.match(Cmm2Parser.T__0)
                pass
            elif token in [Cmm2Parser.Return]:
                localctx = Cmm2Parser.Return_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 85
                self.match(Cmm2Parser.Return)
                self.state = 87
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                    self.state = 86
                    self.comma_expression(0)


                self.state = 89
                self.match(Cmm2Parser.T__0)
                pass
            elif token in [Cmm2Parser.If]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 90
                self.if_statement()
                pass
            elif token in [Cmm2Parser.While]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 91
                self.while_statement()
                pass
            elif token in [Cmm2Parser.For]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 92
                self.for_statement()
                pass
            elif token in [Cmm2Parser.Do]:
                localctx = Cmm2Parser.Normal_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 93
                self.do_statement()
                pass
            elif token in [Cmm2Parser.T__4]:
                localctx = Cmm2Parser.Block_statementContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 94
                self.match(Cmm2Parser.T__4)
                self.state = 98
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__0) | (1 << Cmm2Parser.T__4) | (1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT) | (1 << Cmm2Parser.Int) | (1 << Cmm2Parser.Char) | (1 << Cmm2Parser.If) | (1 << Cmm2Parser.While) | (1 << Cmm2Parser.For) | (1 << Cmm2Parser.Break) | (1 << Cmm2Parser.Continue) | (1 << Cmm2Parser.Struct) | (1 << Cmm2Parser.Return))) != 0) or ((((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & ((1 << (Cmm2Parser.Do - 67)) | (1 << (Cmm2Parser.Double - 67)) | (1 << (Cmm2Parser.Long - 67)) | (1 << (Cmm2Parser.Short - 67)) | (1 << (Cmm2Parser.Float - 67)) | (1 << (Cmm2Parser.Sizeof - 67)) | (1 << (Cmm2Parser.VAR - 67)))) != 0):
                    self.state = 95
                    self.statement()
                    self.state = 100
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 101
                self.match(Cmm2Parser.T__5)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class If_statementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def If(self):
            return self.getToken(Cmm2Parser.If, 0)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.StatementContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.StatementContext,i)


        def Else(self):
            return self.getToken(Cmm2Parser.Else, 0)

        def getRuleIndex(self):
            return Cmm2Parser.RULE_if_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIf_statement" ):
                listener.enterIf_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIf_statement" ):
                listener.exitIf_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIf_statement" ):
                return visitor.visitIf_statement(self)
            else:
                return visitor.visitChildren(self)




    def if_statement(self):

        localctx = Cmm2Parser.If_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_if_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            self.match(Cmm2Parser.If)
            self.state = 105
            self.match(Cmm2Parser.T__6)
            self.state = 106
            self.comma_expression(0)
            self.state = 107
            self.match(Cmm2Parser.T__7)
            self.state = 108
            self.statement()
            self.state = 111
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                self.state = 109
                self.match(Cmm2Parser.Else)
                self.state = 110
                self.statement()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class While_statementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def While(self):
            return self.getToken(Cmm2Parser.While, 0)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def statement(self):
            return self.getTypedRuleContext(Cmm2Parser.StatementContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_while_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWhile_statement" ):
                listener.enterWhile_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWhile_statement" ):
                listener.exitWhile_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitWhile_statement" ):
                return visitor.visitWhile_statement(self)
            else:
                return visitor.visitChildren(self)




    def while_statement(self):

        localctx = Cmm2Parser.While_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_while_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 113
            self.match(Cmm2Parser.While)
            self.state = 114
            self.match(Cmm2Parser.T__6)
            self.state = 115
            self.comma_expression(0)
            self.state = 116
            self.match(Cmm2Parser.T__7)
            self.state = 117
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class For_1Context(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def declare_statement(self):
            return self.getTypedRuleContext(Cmm2Parser.Declare_statementContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_for_1

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_1" ):
                listener.enterFor_1(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_1" ):
                listener.exitFor_1(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_1" ):
                return visitor.visitFor_1(self)
            else:
                return visitor.visitChildren(self)




    def for_1(self):

        localctx = Cmm2Parser.For_1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_for_1)
        self._la = 0 # Token type
        try:
            self.state = 124
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.T__0, Cmm2Parser.T__6, Cmm2Parser.T__10, Cmm2Parser.T__11, Cmm2Parser.T__12, Cmm2Parser.T__13, Cmm2Parser.FLOAT_NUMBER, Cmm2Parser.INT_NUMBER, Cmm2Parser.STRING_CONSTANT, Cmm2Parser.Sizeof, Cmm2Parser.VAR]:
                self.enterOuterAlt(localctx, 1)
                self.state = 120
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                    self.state = 119
                    self.comma_expression(0)


                self.state = 122
                self.match(Cmm2Parser.T__0)
                pass
            elif token in [Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                self.enterOuterAlt(localctx, 2)
                self.state = 123
                self.declare_statement()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class For_2Context(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_for_2

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_2" ):
                listener.enterFor_2(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_2" ):
                listener.exitFor_2(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_2" ):
                return visitor.visitFor_2(self)
            else:
                return visitor.visitChildren(self)




    def for_2(self):

        localctx = Cmm2Parser.For_2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_for_2)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 127
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                self.state = 126
                self.comma_expression(0)


            self.state = 129
            self.match(Cmm2Parser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class For_3Context(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_for_3

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_3" ):
                listener.enterFor_3(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_3" ):
                listener.exitFor_3(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_3" ):
                return visitor.visitFor_3(self)
            else:
                return visitor.visitChildren(self)




    def for_3(self):

        localctx = Cmm2Parser.For_3Context(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_for_3)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 132
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                self.state = 131
                self.comma_expression(0)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class For_statementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def For(self):
            return self.getToken(Cmm2Parser.For, 0)

        def for_1(self):
            return self.getTypedRuleContext(Cmm2Parser.For_1Context,0)


        def for_2(self):
            return self.getTypedRuleContext(Cmm2Parser.For_2Context,0)


        def for_3(self):
            return self.getTypedRuleContext(Cmm2Parser.For_3Context,0)


        def statement(self):
            return self.getTypedRuleContext(Cmm2Parser.StatementContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_for_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_statement" ):
                listener.enterFor_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_statement" ):
                listener.exitFor_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_statement" ):
                return visitor.visitFor_statement(self)
            else:
                return visitor.visitChildren(self)




    def for_statement(self):

        localctx = Cmm2Parser.For_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_for_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 134
            self.match(Cmm2Parser.For)
            self.state = 135
            self.match(Cmm2Parser.T__6)
            self.state = 136
            self.for_1()
            self.state = 137
            self.for_2()
            self.state = 138
            self.for_3()
            self.state = 139
            self.match(Cmm2Parser.T__7)
            self.state = 140
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Do_statementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Do(self):
            return self.getToken(Cmm2Parser.Do, 0)

        def statement(self):
            return self.getTypedRuleContext(Cmm2Parser.StatementContext,0)


        def While(self):
            return self.getToken(Cmm2Parser.While, 0)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_do_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDo_statement" ):
                listener.enterDo_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDo_statement" ):
                listener.exitDo_statement(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDo_statement" ):
                return visitor.visitDo_statement(self)
            else:
                return visitor.visitChildren(self)




    def do_statement(self):

        localctx = Cmm2Parser.Do_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_do_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 142
            self.match(Cmm2Parser.Do)
            self.state = 143
            self.statement()
            self.state = 144
            self.match(Cmm2Parser.While)
            self.state = 145
            self.match(Cmm2Parser.T__6)
            self.state = 146
            self.comma_expression(0)
            self.state = 147
            self.match(Cmm2Parser.T__7)
            self.state = 148
            self.match(Cmm2Parser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Function_call_expressionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.ExpressionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,i)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_function_call_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_call_expression" ):
                listener.enterFunction_call_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_call_expression" ):
                listener.exitFunction_call_expression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFunction_call_expression" ):
                return visitor.visitFunction_call_expression(self)
            else:
                return visitor.visitChildren(self)




    def function_call_expression(self):

        localctx = Cmm2Parser.Function_call_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_function_call_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 150
            self.match(Cmm2Parser.VAR)
            self.state = 151
            self.match(Cmm2Parser.T__6)
            self.state = 160
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT))) != 0) or _la==Cmm2Parser.Sizeof or _la==Cmm2Parser.VAR:
                self.state = 152
                self.expression(0)
                self.state = 157
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==Cmm2Parser.T__8:
                    self.state = 153
                    self.match(Cmm2Parser.T__8)
                    self.state = 154
                    self.expression(0)
                    self.state = 159
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 162
            self.match(Cmm2Parser.T__7)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Function_argumentContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.op = None # Token

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def FUNCTION_ARGUMENT_OPTION(self):
            return self.getToken(Cmm2Parser.FUNCTION_ARGUMENT_OPTION, 0)

        def getRuleIndex(self):
            return Cmm2Parser.RULE_function_argument

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_argument" ):
                listener.enterFunction_argument(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_argument" ):
                listener.exitFunction_argument(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFunction_argument" ):
                return visitor.visitFunction_argument(self)
            else:
                return visitor.visitChildren(self)




    def function_argument(self):

        localctx = Cmm2Parser.Function_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_function_argument)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 164
            self.type_cmm()
            self.state = 166
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==Cmm2Parser.FUNCTION_ARGUMENT_OPTION:
                self.state = 165
                localctx.op = self.match(Cmm2Parser.FUNCTION_ARGUMENT_OPTION)


            self.state = 168
            self.match(Cmm2Parser.VAR)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Forward_function_argumentContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.op = None # Token

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def FUNCTION_ARGUMENT_OPTION(self):
            return self.getToken(Cmm2Parser.FUNCTION_ARGUMENT_OPTION, 0)

        def getRuleIndex(self):
            return Cmm2Parser.RULE_forward_function_argument

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterForward_function_argument" ):
                listener.enterForward_function_argument(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitForward_function_argument" ):
                listener.exitForward_function_argument(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitForward_function_argument" ):
                return visitor.visitForward_function_argument(self)
            else:
                return visitor.visitChildren(self)




    def forward_function_argument(self):

        localctx = Cmm2Parser.Forward_function_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_forward_function_argument)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 170
            self.type_cmm()
            self.state = 172
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==Cmm2Parser.FUNCTION_ARGUMENT_OPTION:
                self.state = 171
                localctx.op = self.match(Cmm2Parser.FUNCTION_ARGUMENT_OPTION)


            self.state = 175
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==Cmm2Parser.VAR:
                self.state = 174
                self.match(Cmm2Parser.VAR)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Function_definitionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.StatementContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.StatementContext,i)


        def function_argument(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Function_argumentContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Function_argumentContext,i)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_function_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_definition" ):
                listener.enterFunction_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_definition" ):
                listener.exitFunction_definition(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFunction_definition" ):
                return visitor.visitFunction_definition(self)
            else:
                return visitor.visitChildren(self)




    def function_definition(self):

        localctx = Cmm2Parser.Function_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_function_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 179
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                self.state = 177
                self.type_cmm()
                pass
            elif token in [Cmm2Parser.Void]:
                self.state = 178
                self.match(Cmm2Parser.Void)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 181
            self.match(Cmm2Parser.VAR)
            self.state = 182
            self.match(Cmm2Parser.T__6)
            self.state = 194
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.T__7, Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                self.state = 191
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 51)) & ~0x3f) == 0 and ((1 << (_la - 51)) & ((1 << (Cmm2Parser.Int - 51)) | (1 << (Cmm2Parser.Char - 51)) | (1 << (Cmm2Parser.Struct - 51)) | (1 << (Cmm2Parser.Double - 51)) | (1 << (Cmm2Parser.Long - 51)) | (1 << (Cmm2Parser.Short - 51)) | (1 << (Cmm2Parser.Float - 51)))) != 0):
                    self.state = 183
                    self.function_argument()
                    self.state = 188
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==Cmm2Parser.T__8:
                        self.state = 184
                        self.match(Cmm2Parser.T__8)
                        self.state = 185
                        self.function_argument()
                        self.state = 190
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)



                pass
            elif token in [Cmm2Parser.Void]:
                self.state = 193
                self.match(Cmm2Parser.Void)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 196
            self.match(Cmm2Parser.T__7)
            self.state = 197
            self.match(Cmm2Parser.T__4)
            self.state = 201
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__0) | (1 << Cmm2Parser.T__4) | (1 << Cmm2Parser.T__6) | (1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13) | (1 << Cmm2Parser.FLOAT_NUMBER) | (1 << Cmm2Parser.INT_NUMBER) | (1 << Cmm2Parser.STRING_CONSTANT) | (1 << Cmm2Parser.Int) | (1 << Cmm2Parser.Char) | (1 << Cmm2Parser.If) | (1 << Cmm2Parser.While) | (1 << Cmm2Parser.For) | (1 << Cmm2Parser.Break) | (1 << Cmm2Parser.Continue) | (1 << Cmm2Parser.Struct) | (1 << Cmm2Parser.Return))) != 0) or ((((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & ((1 << (Cmm2Parser.Do - 67)) | (1 << (Cmm2Parser.Double - 67)) | (1 << (Cmm2Parser.Long - 67)) | (1 << (Cmm2Parser.Short - 67)) | (1 << (Cmm2Parser.Float - 67)) | (1 << (Cmm2Parser.Sizeof - 67)) | (1 << (Cmm2Parser.VAR - 67)))) != 0):
                self.state = 198
                self.statement()
                self.state = 203
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 204
            self.match(Cmm2Parser.T__5)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Forward_function_definitionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def forward_function_argument(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Forward_function_argumentContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Forward_function_argumentContext,i)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_forward_function_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterForward_function_definition" ):
                listener.enterForward_function_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitForward_function_definition" ):
                listener.exitForward_function_definition(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitForward_function_definition" ):
                return visitor.visitForward_function_definition(self)
            else:
                return visitor.visitChildren(self)




    def forward_function_definition(self):

        localctx = Cmm2Parser.Forward_function_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_forward_function_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 208
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                self.state = 206
                self.type_cmm()
                pass
            elif token in [Cmm2Parser.Void]:
                self.state = 207
                self.match(Cmm2Parser.Void)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 210
            self.match(Cmm2Parser.VAR)
            self.state = 211
            self.match(Cmm2Parser.T__6)
            self.state = 223
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.T__7, Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                self.state = 220
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 51)) & ~0x3f) == 0 and ((1 << (_la - 51)) & ((1 << (Cmm2Parser.Int - 51)) | (1 << (Cmm2Parser.Char - 51)) | (1 << (Cmm2Parser.Struct - 51)) | (1 << (Cmm2Parser.Double - 51)) | (1 << (Cmm2Parser.Long - 51)) | (1 << (Cmm2Parser.Short - 51)) | (1 << (Cmm2Parser.Float - 51)))) != 0):
                    self.state = 212
                    self.forward_function_argument()
                    self.state = 217
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==Cmm2Parser.T__8:
                        self.state = 213
                        self.match(Cmm2Parser.T__8)
                        self.state = 214
                        self.forward_function_argument()
                        self.state = 219
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)



                pass
            elif token in [Cmm2Parser.Void]:
                self.state = 222
                self.match(Cmm2Parser.Void)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 225
            self.match(Cmm2Parser.T__7)
            self.state = 226
            self.match(Cmm2Parser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Struct_definitionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def declare_statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.Declare_statementContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.Declare_statementContext,i)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_struct_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStruct_definition" ):
                listener.enterStruct_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStruct_definition" ):
                listener.exitStruct_definition(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStruct_definition" ):
                return visitor.visitStruct_definition(self)
            else:
                return visitor.visitChildren(self)




    def struct_definition(self):

        localctx = Cmm2Parser.Struct_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_struct_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 228
            self.match(Cmm2Parser.Struct)
            self.state = 229
            self.match(Cmm2Parser.VAR)
            self.state = 230
            self.match(Cmm2Parser.T__4)
            self.state = 234
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 51)) & ~0x3f) == 0 and ((1 << (_la - 51)) & ((1 << (Cmm2Parser.Int - 51)) | (1 << (Cmm2Parser.Char - 51)) | (1 << (Cmm2Parser.Struct - 51)) | (1 << (Cmm2Parser.Double - 51)) | (1 << (Cmm2Parser.Long - 51)) | (1 << (Cmm2Parser.Short - 51)) | (1 << (Cmm2Parser.Float - 51)))) != 0):
                self.state = 231
                self.declare_statement()
                self.state = 236
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 237
            self.match(Cmm2Parser.T__5)
            self.state = 238
            self.match(Cmm2Parser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Type_cmmContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Int(self):
            return self.getToken(Cmm2Parser.Int, 0)

        def Char(self):
            return self.getToken(Cmm2Parser.Char, 0)

        def Double(self):
            return self.getToken(Cmm2Parser.Double, 0)

        def Long(self):
            return self.getToken(Cmm2Parser.Long, 0)

        def Short(self):
            return self.getToken(Cmm2Parser.Short, 0)

        def Float(self):
            return self.getToken(Cmm2Parser.Float, 0)

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def getRuleIndex(self):
            return Cmm2Parser.RULE_type_cmm

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterType_cmm" ):
                listener.enterType_cmm(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitType_cmm" ):
                listener.exitType_cmm(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitType_cmm" ):
                return visitor.visitType_cmm(self)
            else:
                return visitor.visitChildren(self)




    def type_cmm(self):

        localctx = Cmm2Parser.Type_cmmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_type_cmm)
        try:
            self.state = 248
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [Cmm2Parser.Int]:
                self.enterOuterAlt(localctx, 1)
                self.state = 240
                self.match(Cmm2Parser.Int)
                pass
            elif token in [Cmm2Parser.Char]:
                self.enterOuterAlt(localctx, 2)
                self.state = 241
                self.match(Cmm2Parser.Char)
                pass
            elif token in [Cmm2Parser.Double]:
                self.enterOuterAlt(localctx, 3)
                self.state = 242
                self.match(Cmm2Parser.Double)
                pass
            elif token in [Cmm2Parser.Long]:
                self.enterOuterAlt(localctx, 4)
                self.state = 243
                self.match(Cmm2Parser.Long)
                pass
            elif token in [Cmm2Parser.Short]:
                self.enterOuterAlt(localctx, 5)
                self.state = 244
                self.match(Cmm2Parser.Short)
                pass
            elif token in [Cmm2Parser.Float]:
                self.enterOuterAlt(localctx, 6)
                self.state = 245
                self.match(Cmm2Parser.Float)
                pass
            elif token in [Cmm2Parser.Struct]:
                self.enterOuterAlt(localctx, 7)
                self.state = 246
                self.match(Cmm2Parser.Struct)
                self.state = 247
                self.match(Cmm2Parser.VAR)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Comma_expressionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)


        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def getRuleIndex(self):
            return Cmm2Parser.RULE_comma_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComma_expression" ):
                listener.enterComma_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComma_expression" ):
                listener.exitComma_expression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComma_expression" ):
                return visitor.visitComma_expression(self)
            else:
                return visitor.visitChildren(self)



    def comma_expression(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = Cmm2Parser.Comma_expressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 38
        self.enterRecursionRule(localctx, 38, self.RULE_comma_expression, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 251
            self.expression(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 258
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,29,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = Cmm2Parser.Comma_expressionContext(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_comma_expression)
                    self.state = 253
                    if not self.precpred(self._ctx, 1):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                    self.state = 254
                    self.match(Cmm2Parser.T__8)
                    self.state = 255
                    self.expression(0) 
                self.state = 260
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,29,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.unrollRecursionContexts(_parentctx)
        return localctx

    class ExpressionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return Cmm2Parser.RULE_expression

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class ExpAssignContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.ExpressionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,i)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpAssign" ):
                listener.enterExpAssign(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpAssign" ):
                listener.exitExpAssign(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpAssign" ):
                return visitor.visitExpAssign(self)
            else:
                return visitor.visitChildren(self)


    class ExpFunctionCallContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def function_call_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Function_call_expressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpFunctionCall" ):
                listener.enterExpFunctionCall(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpFunctionCall" ):
                listener.exitExpFunctionCall(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpFunctionCall" ):
                return visitor.visitExpFunctionCall(self)
            else:
                return visitor.visitChildren(self)


    class ExpDotContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)

        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpDot" ):
                listener.enterExpDot(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpDot" ):
                listener.exitExpDot(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpDot" ):
                return visitor.visitExpDot(self)
            else:
                return visitor.visitChildren(self)


    class ExpTerOpContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.ExpressionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,i)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpTerOp" ):
                listener.enterExpTerOp(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpTerOp" ):
                listener.exitExpTerOp(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpTerOp" ):
                return visitor.visitExpTerOp(self)
            else:
                return visitor.visitChildren(self)


    class ExpArrayContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.ExpressionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,i)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpArray" ):
                listener.enterExpArray(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpArray" ):
                listener.exitExpArray(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpArray" ):
                return visitor.visitExpArray(self)
            else:
                return visitor.visitChildren(self)


    class ExpLeftUnaryContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpLeftUnary" ):
                listener.enterExpLeftUnary(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpLeftUnary" ):
                listener.exitExpLeftUnary(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpLeftUnary" ):
                return visitor.visitExpLeftUnary(self)
            else:
                return visitor.visitChildren(self)


    class ExpOpContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(Cmm2Parser.ExpressionContext)
            else:
                return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,i)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpOp" ):
                listener.enterExpOp(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpOp" ):
                listener.exitExpOp(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpOp" ):
                return visitor.visitExpOp(self)
            else:
                return visitor.visitChildren(self)


    class ExpAtomContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INT_NUMBER(self):
            return self.getToken(Cmm2Parser.INT_NUMBER, 0)
        def STRING_CONSTANT(self):
            return self.getToken(Cmm2Parser.STRING_CONSTANT, 0)
        def FLOAT_NUMBER(self):
            return self.getToken(Cmm2Parser.FLOAT_NUMBER, 0)
        def VAR(self):
            return self.getToken(Cmm2Parser.VAR, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpAtom" ):
                listener.enterExpAtom(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpAtom" ):
                listener.exitExpAtom(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpAtom" ):
                return visitor.visitExpAtom(self)
            else:
                return visitor.visitChildren(self)


    class ExpParContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def comma_expression(self):
            return self.getTypedRuleContext(Cmm2Parser.Comma_expressionContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpPar" ):
                listener.enterExpPar(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpPar" ):
                listener.exitExpPar(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpPar" ):
                return visitor.visitExpPar(self)
            else:
                return visitor.visitChildren(self)


    class ExpSizeofContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a Cmm2Parser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expression(self):
            return self.getTypedRuleContext(Cmm2Parser.ExpressionContext,0)

        def type_cmm(self):
            return self.getTypedRuleContext(Cmm2Parser.Type_cmmContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpSizeof" ):
                listener.enterExpSizeof(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpSizeof" ):
                listener.exitExpSizeof(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpSizeof" ):
                return visitor.visitExpSizeof(self)
            else:
                return visitor.visitChildren(self)



    def expression(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = Cmm2Parser.ExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 40
        self.enterRecursionRule(localctx, 40, self.RULE_expression, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 281
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,31,self._ctx)
            if la_ == 1:
                localctx = Cmm2Parser.ExpParContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 262
                self.match(Cmm2Parser.T__6)
                self.state = 263
                self.comma_expression(0)
                self.state = 264
                self.match(Cmm2Parser.T__7)
                pass

            elif la_ == 2:
                localctx = Cmm2Parser.ExpAtomContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 266
                self.match(Cmm2Parser.INT_NUMBER)
                pass

            elif la_ == 3:
                localctx = Cmm2Parser.ExpAtomContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 267
                self.match(Cmm2Parser.STRING_CONSTANT)
                pass

            elif la_ == 4:
                localctx = Cmm2Parser.ExpAtomContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 268
                self.match(Cmm2Parser.FLOAT_NUMBER)
                pass

            elif la_ == 5:
                localctx = Cmm2Parser.ExpAtomContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 269
                self.match(Cmm2Parser.VAR)
                pass

            elif la_ == 6:
                localctx = Cmm2Parser.ExpSizeofContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 270
                self.match(Cmm2Parser.Sizeof)
                self.state = 271
                self.match(Cmm2Parser.T__6)
                self.state = 274
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [Cmm2Parser.T__6, Cmm2Parser.T__10, Cmm2Parser.T__11, Cmm2Parser.T__12, Cmm2Parser.T__13, Cmm2Parser.FLOAT_NUMBER, Cmm2Parser.INT_NUMBER, Cmm2Parser.STRING_CONSTANT, Cmm2Parser.Sizeof, Cmm2Parser.VAR]:
                    self.state = 272
                    self.expression(0)
                    pass
                elif token in [Cmm2Parser.Int, Cmm2Parser.Char, Cmm2Parser.Struct, Cmm2Parser.Double, Cmm2Parser.Long, Cmm2Parser.Short, Cmm2Parser.Float]:
                    self.state = 273
                    self.type_cmm()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 276
                self.match(Cmm2Parser.T__7)
                pass

            elif la_ == 7:
                localctx = Cmm2Parser.ExpFunctionCallContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 278
                self.function_call_expression()
                pass

            elif la_ == 8:
                localctx = Cmm2Parser.ExpLeftUnaryContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 279
                localctx.op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__10) | (1 << Cmm2Parser.T__11) | (1 << Cmm2Parser.T__12) | (1 << Cmm2Parser.T__13))) != 0)):
                    localctx.op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 280
                self.expression(13)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 332
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,33,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 330
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,32,self._ctx)
                    if la_ == 1:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 283
                        if not self.precpred(self._ctx, 12):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
                        self.state = 284
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__14) | (1 << Cmm2Parser.T__15) | (1 << Cmm2Parser.T__16))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 285
                        self.expression(13)
                        pass

                    elif la_ == 2:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 286
                        if not self.precpred(self._ctx, 11):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
                        self.state = 287
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==Cmm2Parser.T__10 or _la==Cmm2Parser.T__11):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 288
                        self.expression(12)
                        pass

                    elif la_ == 3:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 289
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 290
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==Cmm2Parser.T__17 or _la==Cmm2Parser.T__18):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 291
                        self.expression(11)
                        pass

                    elif la_ == 4:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 292
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 293
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__19) | (1 << Cmm2Parser.T__20) | (1 << Cmm2Parser.T__21) | (1 << Cmm2Parser.T__22))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 294
                        self.expression(10)
                        pass

                    elif la_ == 5:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 295
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 296
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==Cmm2Parser.T__23 or _la==Cmm2Parser.T__24):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 297
                        self.expression(9)
                        pass

                    elif la_ == 6:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 298
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 299
                        localctx.op = self.match(Cmm2Parser.T__25)
                        self.state = 300
                        self.expression(8)
                        pass

                    elif la_ == 7:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 301
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 302
                        localctx.op = self.match(Cmm2Parser.T__26)
                        self.state = 303
                        self.expression(7)
                        pass

                    elif la_ == 8:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 304
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 305
                        localctx.op = self.match(Cmm2Parser.T__27)
                        self.state = 306
                        self.expression(6)
                        pass

                    elif la_ == 9:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 307
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 308
                        localctx.op = self.match(Cmm2Parser.T__28)
                        self.state = 309
                        self.expression(5)
                        pass

                    elif la_ == 10:
                        localctx = Cmm2Parser.ExpOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 310
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 311
                        localctx.op = self.match(Cmm2Parser.T__29)
                        self.state = 312
                        self.expression(4)
                        pass

                    elif la_ == 11:
                        localctx = Cmm2Parser.ExpTerOpContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 313
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 314
                        self.match(Cmm2Parser.T__30)
                        self.state = 315
                        self.comma_expression(0)
                        self.state = 316
                        self.match(Cmm2Parser.T__31)
                        self.state = 317
                        self.expression(2)
                        pass

                    elif la_ == 12:
                        localctx = Cmm2Parser.ExpAssignContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 319
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 320
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << Cmm2Parser.T__3) | (1 << Cmm2Parser.T__32) | (1 << Cmm2Parser.T__33) | (1 << Cmm2Parser.T__34) | (1 << Cmm2Parser.T__35) | (1 << Cmm2Parser.T__36) | (1 << Cmm2Parser.T__37) | (1 << Cmm2Parser.T__38) | (1 << Cmm2Parser.T__39) | (1 << Cmm2Parser.T__40) | (1 << Cmm2Parser.T__41))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 321
                        self.expression(1)
                        pass

                    elif la_ == 13:
                        localctx = Cmm2Parser.ExpDotContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 322
                        if not self.precpred(self._ctx, 17):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 17)")
                        self.state = 323
                        self.match(Cmm2Parser.T__9)
                        self.state = 324
                        self.match(Cmm2Parser.VAR)
                        pass

                    elif la_ == 14:
                        localctx = Cmm2Parser.ExpArrayContext(self, Cmm2Parser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 325
                        if not self.precpred(self._ctx, 14):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 14)")
                        self.state = 326
                        self.match(Cmm2Parser.T__1)
                        self.state = 327
                        self.expression(0)
                        self.state = 328
                        self.match(Cmm2Parser.T__2)
                        pass

             
                self.state = 334
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,33,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.unrollRecursionContexts(_parentctx)
        return localctx



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[19] = self.comma_expression_sempred
        self._predicates[20] = self.expression_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def comma_expression_sempred(self, localctx:Comma_expressionContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 1)
         

    def expression_sempred(self, localctx:ExpressionContext, predIndex:int):
            if predIndex == 1:
                return self.precpred(self._ctx, 12)
         

            if predIndex == 2:
                return self.precpred(self._ctx, 11)
         

            if predIndex == 3:
                return self.precpred(self._ctx, 10)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 9)
         

            if predIndex == 5:
                return self.precpred(self._ctx, 8)
         

            if predIndex == 6:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 7:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 8:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 9:
                return self.precpred(self._ctx, 4)
         

            if predIndex == 10:
                return self.precpred(self._ctx, 3)
         

            if predIndex == 11:
                return self.precpred(self._ctx, 2)
         

            if predIndex == 12:
                return self.precpred(self._ctx, 1)
         

            if predIndex == 13:
                return self.precpred(self._ctx, 17)
         

            if predIndex == 14:
                return self.precpred(self._ctx, 14)
         




