diff --git a/doc/.~lock.exp02-ir.pptx# b/doc/.~lock.exp02-ir.pptx# deleted file mode 100644 index 711b71d..0000000 --- a/doc/.~lock.exp02-ir.pptx# +++ /dev/null @@ -1 +0,0 @@ -,wqz,wqz-virtual-machine,23.04.2023 18:45,file:///home/wqz/.config/libreoffice/4; \ No newline at end of file diff --git a/src/.antlr/SysY.interp b/src/.antlr/SysY.interp new file mode 100644 index 0000000..aac2f59 --- /dev/null +++ b/src/.antlr/SysY.interp @@ -0,0 +1,117 @@ +token literal names: +null +'const' +'int' +'float' +'void' +'if' +'else' +'while' +'break' +'continue' +'return' +'=' +'+' +'-' +'*' +'/' +'%' +'<' +'>' +'<=' +'>=' +'==' +'!=' +'&&' +'||' +'!' +'(' +')' +'[' +']' +'{' +'}' +',' +';' +null +null +null +null +null +null +null + +token symbolic names: +null +CONST +INT +FLOAT +VOID +IF +ELSE +WHILE +BREAK +CONTINUE +RETURN +ASSIGN +ADD +SUB +MUL +DIV +MODULO +LT +GT +LE +GE +EQ +NE +AND +OR +NOT +LPAREN +RPAREN +LBRACKET +RBRACKET +LBRACE +RBRACE +COMMA +SEMICOLON +ID +ILITERAL +FLITERAL +STRING +WS +LINECOMMENT +BLOCKCOMMENT + +rule names: +module +decl +btype +varDef +initValue +func +funcType +funcFParams +funcFParam +blockStmt +blockItem +stmt +assignStmt +expStmt +ifStmt +whileStmt +breakStmt +continueStmt +returnStmt +emptyStmt +exp +call +lValue +number +string +funcRParams + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 42, 256, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 3, 2, 3, 2, 6, 2, 57, 10, 2, 13, 2, 14, 2, 58, 3, 3, 5, 3, 62, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 68, 10, 3, 12, 3, 14, 3, 71, 11, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 5, 5, 80, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 7, 6, 87, 10, 6, 12, 6, 14, 6, 90, 11, 6, 5, 6, 92, 10, 6, 5, 6, 94, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 100, 10, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 110, 10, 9, 12, 9, 14, 9, 113, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 123, 10, 10, 12, 10, 14, 10, 126, 11, 10, 5, 10, 128, 10, 10, 3, 11, 3, 11, 7, 11, 132, 10, 11, 12, 11, 14, 11, 135, 11, 11, 3, 11, 3, 11, 3, 12, 3, 12, 5, 12, 141, 10, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 152, 10, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 169, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 5, 20, 185, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 202, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 222, 10, 22, 12, 22, 14, 22, 225, 11, 22, 3, 23, 3, 23, 3, 23, 5, 23, 230, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 239, 10, 24, 12, 24, 14, 24, 242, 11, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 7, 27, 251, 10, 27, 12, 27, 14, 27, 254, 11, 27, 3, 27, 2, 3, 42, 28, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 2, 10, 3, 2, 4, 5, 3, 2, 4, 6, 4, 2, 14, 15, 27, 27, 3, 2, 16, 18, 3, 2, 14, 15, 3, 2, 19, 22, 3, 2, 23, 24, 3, 2, 37, 38, 2, 267, 2, 56, 3, 2, 2, 2, 4, 61, 3, 2, 2, 2, 6, 74, 3, 2, 2, 2, 8, 76, 3, 2, 2, 2, 10, 93, 3, 2, 2, 2, 12, 95, 3, 2, 2, 2, 14, 104, 3, 2, 2, 2, 16, 106, 3, 2, 2, 2, 18, 114, 3, 2, 2, 2, 20, 129, 3, 2, 2, 2, 22, 140, 3, 2, 2, 2, 24, 151, 3, 2, 2, 2, 26, 153, 3, 2, 2, 2, 28, 158, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 170, 3, 2, 2, 2, 34, 176, 3, 2, 2, 2, 36, 179, 3, 2, 2, 2, 38, 182, 3, 2, 2, 2, 40, 188, 3, 2, 2, 2, 42, 201, 3, 2, 2, 2, 44, 226, 3, 2, 2, 2, 46, 233, 3, 2, 2, 2, 48, 243, 3, 2, 2, 2, 50, 245, 3, 2, 2, 2, 52, 247, 3, 2, 2, 2, 54, 57, 5, 4, 3, 2, 55, 57, 5, 12, 7, 2, 56, 54, 3, 2, 2, 2, 56, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 3, 3, 2, 2, 2, 60, 62, 7, 3, 2, 2, 61, 60, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 64, 5, 6, 4, 2, 64, 69, 5, 8, 5, 2, 65, 66, 7, 34, 2, 2, 66, 68, 5, 8, 5, 2, 67, 65, 3, 2, 2, 2, 68, 71, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 72, 3, 2, 2, 2, 71, 69, 3, 2, 2, 2, 72, 73, 7, 35, 2, 2, 73, 5, 3, 2, 2, 2, 74, 75, 9, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 79, 5, 46, 24, 2, 77, 78, 7, 13, 2, 2, 78, 80, 5, 10, 6, 2, 79, 77, 3, 2, 2, 2, 79, 80, 3, 2, 2, 2, 80, 9, 3, 2, 2, 2, 81, 94, 5, 42, 22, 2, 82, 91, 7, 32, 2, 2, 83, 88, 5, 10, 6, 2, 84, 85, 7, 34, 2, 2, 85, 87, 5, 10, 6, 2, 86, 84, 3, 2, 2, 2, 87, 90, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 91, 83, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 94, 3, 2, 2, 2, 93, 81, 3, 2, 2, 2, 93, 82, 3, 2, 2, 2, 94, 11, 3, 2, 2, 2, 95, 96, 5, 14, 8, 2, 96, 97, 7, 36, 2, 2, 97, 99, 7, 28, 2, 2, 98, 100, 5, 16, 9, 2, 99, 98, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 102, 7, 29, 2, 2, 102, 103, 5, 20, 11, 2, 103, 13, 3, 2, 2, 2, 104, 105, 9, 3, 2, 2, 105, 15, 3, 2, 2, 2, 106, 111, 5, 18, 10, 2, 107, 108, 7, 34, 2, 2, 108, 110, 5, 18, 10, 2, 109, 107, 3, 2, 2, 2, 110, 113, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 17, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 114, 115, 5, 6, 4, 2, 115, 127, 7, 36, 2, 2, 116, 117, 7, 30, 2, 2, 117, 124, 7, 31, 2, 2, 118, 119, 7, 30, 2, 2, 119, 120, 5, 42, 22, 2, 120, 121, 7, 31, 2, 2, 121, 123, 3, 2, 2, 2, 122, 118, 3, 2, 2, 2, 123, 126, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 128, 3, 2, 2, 2, 126, 124, 3, 2, 2, 2, 127, 116, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 19, 3, 2, 2, 2, 129, 133, 7, 32, 2, 2, 130, 132, 5, 22, 12, 2, 131, 130, 3, 2, 2, 2, 132, 135, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 136, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 136, 137, 7, 33, 2, 2, 137, 21, 3, 2, 2, 2, 138, 141, 5, 4, 3, 2, 139, 141, 5, 24, 13, 2, 140, 138, 3, 2, 2, 2, 140, 139, 3, 2, 2, 2, 141, 23, 3, 2, 2, 2, 142, 152, 5, 26, 14, 2, 143, 152, 5, 28, 15, 2, 144, 152, 5, 30, 16, 2, 145, 152, 5, 32, 17, 2, 146, 152, 5, 34, 18, 2, 147, 152, 5, 36, 19, 2, 148, 152, 5, 38, 20, 2, 149, 152, 5, 20, 11, 2, 150, 152, 5, 40, 21, 2, 151, 142, 3, 2, 2, 2, 151, 143, 3, 2, 2, 2, 151, 144, 3, 2, 2, 2, 151, 145, 3, 2, 2, 2, 151, 146, 3, 2, 2, 2, 151, 147, 3, 2, 2, 2, 151, 148, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 150, 3, 2, 2, 2, 152, 25, 3, 2, 2, 2, 153, 154, 5, 46, 24, 2, 154, 155, 7, 13, 2, 2, 155, 156, 5, 42, 22, 2, 156, 157, 7, 35, 2, 2, 157, 27, 3, 2, 2, 2, 158, 159, 5, 42, 22, 2, 159, 160, 7, 35, 2, 2, 160, 29, 3, 2, 2, 2, 161, 162, 7, 7, 2, 2, 162, 163, 7, 28, 2, 2, 163, 164, 5, 42, 22, 2, 164, 165, 7, 29, 2, 2, 165, 168, 5, 24, 13, 2, 166, 167, 7, 8, 2, 2, 167, 169, 5, 24, 13, 2, 168, 166, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 31, 3, 2, 2, 2, 170, 171, 7, 9, 2, 2, 171, 172, 7, 28, 2, 2, 172, 173, 5, 42, 22, 2, 173, 174, 7, 29, 2, 2, 174, 175, 5, 24, 13, 2, 175, 33, 3, 2, 2, 2, 176, 177, 7, 10, 2, 2, 177, 178, 7, 35, 2, 2, 178, 35, 3, 2, 2, 2, 179, 180, 7, 11, 2, 2, 180, 181, 7, 35, 2, 2, 181, 37, 3, 2, 2, 2, 182, 184, 7, 12, 2, 2, 183, 185, 5, 42, 22, 2, 184, 183, 3, 2, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 187, 7, 35, 2, 2, 187, 39, 3, 2, 2, 2, 188, 189, 7, 35, 2, 2, 189, 41, 3, 2, 2, 2, 190, 191, 8, 22, 1, 2, 191, 192, 7, 28, 2, 2, 192, 193, 5, 42, 22, 2, 193, 194, 7, 29, 2, 2, 194, 202, 3, 2, 2, 2, 195, 202, 5, 46, 24, 2, 196, 202, 5, 48, 25, 2, 197, 202, 5, 50, 26, 2, 198, 202, 5, 44, 23, 2, 199, 200, 9, 4, 2, 2, 200, 202, 5, 42, 22, 9, 201, 190, 3, 2, 2, 2, 201, 195, 3, 2, 2, 2, 201, 196, 3, 2, 2, 2, 201, 197, 3, 2, 2, 2, 201, 198, 3, 2, 2, 2, 201, 199, 3, 2, 2, 2, 202, 223, 3, 2, 2, 2, 203, 204, 12, 8, 2, 2, 204, 205, 9, 5, 2, 2, 205, 222, 5, 42, 22, 9, 206, 207, 12, 7, 2, 2, 207, 208, 9, 6, 2, 2, 208, 222, 5, 42, 22, 8, 209, 210, 12, 6, 2, 2, 210, 211, 9, 7, 2, 2, 211, 222, 5, 42, 22, 7, 212, 213, 12, 5, 2, 2, 213, 214, 9, 8, 2, 2, 214, 222, 5, 42, 22, 6, 215, 216, 12, 4, 2, 2, 216, 217, 7, 25, 2, 2, 217, 222, 5, 42, 22, 5, 218, 219, 12, 3, 2, 2, 219, 220, 7, 26, 2, 2, 220, 222, 5, 42, 22, 4, 221, 203, 3, 2, 2, 2, 221, 206, 3, 2, 2, 2, 221, 209, 3, 2, 2, 2, 221, 212, 3, 2, 2, 2, 221, 215, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 222, 225, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 43, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 226, 227, 7, 36, 2, 2, 227, 229, 7, 28, 2, 2, 228, 230, 5, 52, 27, 2, 229, 228, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 232, 7, 29, 2, 2, 232, 45, 3, 2, 2, 2, 233, 240, 7, 36, 2, 2, 234, 235, 7, 30, 2, 2, 235, 236, 5, 42, 22, 2, 236, 237, 7, 31, 2, 2, 237, 239, 3, 2, 2, 2, 238, 234, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 47, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 244, 9, 9, 2, 2, 244, 49, 3, 2, 2, 2, 245, 246, 7, 39, 2, 2, 246, 51, 3, 2, 2, 2, 247, 252, 5, 42, 22, 2, 248, 249, 7, 34, 2, 2, 249, 251, 5, 42, 22, 2, 250, 248, 3, 2, 2, 2, 251, 254, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 53, 3, 2, 2, 2, 254, 252, 3, 2, 2, 2, 25, 56, 58, 61, 69, 79, 88, 91, 93, 99, 111, 124, 127, 133, 140, 151, 168, 184, 201, 221, 223, 229, 240, 252] \ No newline at end of file diff --git a/src/.antlr/SysY.tokens b/src/.antlr/SysY.tokens new file mode 100644 index 0000000..251577d --- /dev/null +++ b/src/.antlr/SysY.tokens @@ -0,0 +1,73 @@ +CONST=1 +INT=2 +FLOAT=3 +VOID=4 +IF=5 +ELSE=6 +WHILE=7 +BREAK=8 +CONTINUE=9 +RETURN=10 +ASSIGN=11 +ADD=12 +SUB=13 +MUL=14 +DIV=15 +MODULO=16 +LT=17 +GT=18 +LE=19 +GE=20 +EQ=21 +NE=22 +AND=23 +OR=24 +NOT=25 +LPAREN=26 +RPAREN=27 +LBRACKET=28 +RBRACKET=29 +LBRACE=30 +RBRACE=31 +COMMA=32 +SEMICOLON=33 +ID=34 +ILITERAL=35 +FLITERAL=36 +STRING=37 +WS=38 +LINECOMMENT=39 +BLOCKCOMMENT=40 +'const'=1 +'int'=2 +'float'=3 +'void'=4 +'if'=5 +'else'=6 +'while'=7 +'break'=8 +'continue'=9 +'return'=10 +'='=11 +'+'=12 +'-'=13 +'*'=14 +'/'=15 +'%'=16 +'<'=17 +'>'=18 +'<='=19 +'>='=20 +'=='=21 +'!='=22 +'&&'=23 +'||'=24 +'!'=25 +'('=26 +')'=27 +'['=28 +']'=29 +'{'=30 +'}'=31 +','=32 +';'=33 diff --git a/src/.antlr/SysYLexer.interp b/src/.antlr/SysYLexer.interp new file mode 100644 index 0000000..d9cac6e --- /dev/null +++ b/src/.antlr/SysYLexer.interp @@ -0,0 +1,154 @@ +token literal names: +null +'const' +'int' +'float' +'void' +'if' +'else' +'while' +'break' +'continue' +'return' +'=' +'+' +'-' +'*' +'/' +'%' +'<' +'>' +'<=' +'>=' +'==' +'!=' +'&&' +'||' +'!' +'(' +')' +'[' +']' +'{' +'}' +',' +';' +null +null +null +null +null +null +null + +token symbolic names: +null +CONST +INT +FLOAT +VOID +IF +ELSE +WHILE +BREAK +CONTINUE +RETURN +ASSIGN +ADD +SUB +MUL +DIV +MODULO +LT +GT +LE +GE +EQ +NE +AND +OR +NOT +LPAREN +RPAREN +LBRACKET +RBRACKET +LBRACE +RBRACE +COMMA +SEMICOLON +ID +ILITERAL +FLITERAL +STRING +WS +LINECOMMENT +BLOCKCOMMENT + +rule names: +CONST +INT +FLOAT +VOID +IF +ELSE +WHILE +BREAK +CONTINUE +RETURN +ASSIGN +ADD +SUB +MUL +DIV +MODULO +LT +GT +LE +GE +EQ +NE +AND +OR +NOT +LPAREN +RPAREN +LBRACKET +RBRACKET +LBRACE +RBRACE +COMMA +SEMICOLON +ALPHA +ALPHANUM +NONDIGIT +ID +DecDigit +OctDigit +HexDigit +OctPrefix +HexPrefix +NonZeroDecDigit +Sign +DecFractional +Exponent +DecFloat +HexFractional +BinExponent +HexFloat +ILITERAL +FLITERAL +ESC +STRING +WS +LINECOMMENT +BLOCKCOMMENT + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 42, 417, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 7, 38, 236, 10, 38, 12, 38, 14, 38, 239, 11, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 7, 46, 257, 10, 46, 12, 46, 14, 46, 260, 11, 46, 3, 46, 3, 46, 6, 46, 264, 10, 46, 13, 46, 14, 46, 265, 3, 46, 6, 46, 269, 10, 46, 13, 46, 14, 46, 270, 3, 46, 3, 46, 5, 46, 275, 10, 46, 3, 47, 3, 47, 5, 47, 279, 10, 47, 3, 47, 6, 47, 282, 10, 47, 13, 47, 14, 47, 283, 3, 48, 3, 48, 5, 48, 288, 10, 48, 3, 48, 6, 48, 291, 10, 48, 13, 48, 14, 48, 292, 3, 48, 3, 48, 5, 48, 297, 10, 48, 3, 49, 7, 49, 300, 10, 49, 12, 49, 14, 49, 303, 11, 49, 3, 49, 3, 49, 6, 49, 307, 10, 49, 13, 49, 14, 49, 308, 3, 49, 6, 49, 312, 10, 49, 13, 49, 14, 49, 313, 3, 49, 3, 49, 5, 49, 318, 10, 49, 3, 50, 3, 50, 5, 50, 322, 10, 50, 3, 50, 6, 50, 325, 10, 50, 13, 50, 14, 50, 326, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 6, 51, 334, 10, 51, 13, 51, 14, 51, 335, 3, 51, 3, 51, 5, 51, 340, 10, 51, 3, 52, 3, 52, 7, 52, 344, 10, 52, 12, 52, 14, 52, 347, 11, 52, 3, 52, 3, 52, 7, 52, 351, 10, 52, 12, 52, 14, 52, 354, 11, 52, 3, 52, 3, 52, 6, 52, 358, 10, 52, 13, 52, 14, 52, 359, 5, 52, 362, 10, 52, 3, 53, 3, 53, 5, 53, 366, 10, 53, 3, 54, 3, 54, 3, 54, 3, 54, 5, 54, 372, 10, 54, 3, 55, 3, 55, 3, 55, 7, 55, 377, 10, 55, 12, 55, 14, 55, 380, 11, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 7, 57, 392, 10, 57, 12, 57, 14, 57, 395, 11, 57, 3, 57, 5, 57, 398, 10, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 7, 58, 408, 10, 58, 12, 58, 14, 58, 411, 11, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 5, 378, 393, 409, 2, 59, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 2, 71, 2, 73, 2, 75, 36, 77, 2, 79, 2, 81, 2, 83, 2, 85, 2, 87, 2, 89, 2, 91, 2, 93, 2, 95, 2, 97, 2, 99, 2, 101, 2, 103, 37, 105, 38, 107, 2, 109, 39, 111, 40, 113, 41, 115, 42, 3, 2, 14, 4, 2, 67, 92, 99, 124, 5, 2, 50, 59, 67, 92, 99, 124, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 4, 2, 45, 45, 47, 47, 4, 2, 71, 71, 103, 103, 4, 2, 82, 82, 114, 114, 5, 2, 11, 12, 15, 15, 34, 34, 2, 430, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 3, 117, 3, 2, 2, 2, 5, 123, 3, 2, 2, 2, 7, 127, 3, 2, 2, 2, 9, 133, 3, 2, 2, 2, 11, 138, 3, 2, 2, 2, 13, 141, 3, 2, 2, 2, 15, 146, 3, 2, 2, 2, 17, 152, 3, 2, 2, 2, 19, 158, 3, 2, 2, 2, 21, 167, 3, 2, 2, 2, 23, 174, 3, 2, 2, 2, 25, 176, 3, 2, 2, 2, 27, 178, 3, 2, 2, 2, 29, 180, 3, 2, 2, 2, 31, 182, 3, 2, 2, 2, 33, 184, 3, 2, 2, 2, 35, 186, 3, 2, 2, 2, 37, 188, 3, 2, 2, 2, 39, 190, 3, 2, 2, 2, 41, 193, 3, 2, 2, 2, 43, 196, 3, 2, 2, 2, 45, 199, 3, 2, 2, 2, 47, 202, 3, 2, 2, 2, 49, 205, 3, 2, 2, 2, 51, 208, 3, 2, 2, 2, 53, 210, 3, 2, 2, 2, 55, 212, 3, 2, 2, 2, 57, 214, 3, 2, 2, 2, 59, 216, 3, 2, 2, 2, 61, 218, 3, 2, 2, 2, 63, 220, 3, 2, 2, 2, 65, 222, 3, 2, 2, 2, 67, 224, 3, 2, 2, 2, 69, 226, 3, 2, 2, 2, 71, 228, 3, 2, 2, 2, 73, 230, 3, 2, 2, 2, 75, 232, 3, 2, 2, 2, 77, 240, 3, 2, 2, 2, 79, 242, 3, 2, 2, 2, 81, 244, 3, 2, 2, 2, 83, 246, 3, 2, 2, 2, 85, 248, 3, 2, 2, 2, 87, 251, 3, 2, 2, 2, 89, 253, 3, 2, 2, 2, 91, 274, 3, 2, 2, 2, 93, 276, 3, 2, 2, 2, 95, 296, 3, 2, 2, 2, 97, 317, 3, 2, 2, 2, 99, 319, 3, 2, 2, 2, 101, 339, 3, 2, 2, 2, 103, 361, 3, 2, 2, 2, 105, 365, 3, 2, 2, 2, 107, 371, 3, 2, 2, 2, 109, 373, 3, 2, 2, 2, 111, 383, 3, 2, 2, 2, 113, 387, 3, 2, 2, 2, 115, 403, 3, 2, 2, 2, 117, 118, 7, 101, 2, 2, 118, 119, 7, 113, 2, 2, 119, 120, 7, 112, 2, 2, 120, 121, 7, 117, 2, 2, 121, 122, 7, 118, 2, 2, 122, 4, 3, 2, 2, 2, 123, 124, 7, 107, 2, 2, 124, 125, 7, 112, 2, 2, 125, 126, 7, 118, 2, 2, 126, 6, 3, 2, 2, 2, 127, 128, 7, 104, 2, 2, 128, 129, 7, 110, 2, 2, 129, 130, 7, 113, 2, 2, 130, 131, 7, 99, 2, 2, 131, 132, 7, 118, 2, 2, 132, 8, 3, 2, 2, 2, 133, 134, 7, 120, 2, 2, 134, 135, 7, 113, 2, 2, 135, 136, 7, 107, 2, 2, 136, 137, 7, 102, 2, 2, 137, 10, 3, 2, 2, 2, 138, 139, 7, 107, 2, 2, 139, 140, 7, 104, 2, 2, 140, 12, 3, 2, 2, 2, 141, 142, 7, 103, 2, 2, 142, 143, 7, 110, 2, 2, 143, 144, 7, 117, 2, 2, 144, 145, 7, 103, 2, 2, 145, 14, 3, 2, 2, 2, 146, 147, 7, 121, 2, 2, 147, 148, 7, 106, 2, 2, 148, 149, 7, 107, 2, 2, 149, 150, 7, 110, 2, 2, 150, 151, 7, 103, 2, 2, 151, 16, 3, 2, 2, 2, 152, 153, 7, 100, 2, 2, 153, 154, 7, 116, 2, 2, 154, 155, 7, 103, 2, 2, 155, 156, 7, 99, 2, 2, 156, 157, 7, 109, 2, 2, 157, 18, 3, 2, 2, 2, 158, 159, 7, 101, 2, 2, 159, 160, 7, 113, 2, 2, 160, 161, 7, 112, 2, 2, 161, 162, 7, 118, 2, 2, 162, 163, 7, 107, 2, 2, 163, 164, 7, 112, 2, 2, 164, 165, 7, 119, 2, 2, 165, 166, 7, 103, 2, 2, 166, 20, 3, 2, 2, 2, 167, 168, 7, 116, 2, 2, 168, 169, 7, 103, 2, 2, 169, 170, 7, 118, 2, 2, 170, 171, 7, 119, 2, 2, 171, 172, 7, 116, 2, 2, 172, 173, 7, 112, 2, 2, 173, 22, 3, 2, 2, 2, 174, 175, 7, 63, 2, 2, 175, 24, 3, 2, 2, 2, 176, 177, 7, 45, 2, 2, 177, 26, 3, 2, 2, 2, 178, 179, 7, 47, 2, 2, 179, 28, 3, 2, 2, 2, 180, 181, 7, 44, 2, 2, 181, 30, 3, 2, 2, 2, 182, 183, 7, 49, 2, 2, 183, 32, 3, 2, 2, 2, 184, 185, 7, 39, 2, 2, 185, 34, 3, 2, 2, 2, 186, 187, 7, 62, 2, 2, 187, 36, 3, 2, 2, 2, 188, 189, 7, 64, 2, 2, 189, 38, 3, 2, 2, 2, 190, 191, 7, 62, 2, 2, 191, 192, 7, 63, 2, 2, 192, 40, 3, 2, 2, 2, 193, 194, 7, 64, 2, 2, 194, 195, 7, 63, 2, 2, 195, 42, 3, 2, 2, 2, 196, 197, 7, 63, 2, 2, 197, 198, 7, 63, 2, 2, 198, 44, 3, 2, 2, 2, 199, 200, 7, 35, 2, 2, 200, 201, 7, 63, 2, 2, 201, 46, 3, 2, 2, 2, 202, 203, 7, 40, 2, 2, 203, 204, 7, 40, 2, 2, 204, 48, 3, 2, 2, 2, 205, 206, 7, 126, 2, 2, 206, 207, 7, 126, 2, 2, 207, 50, 3, 2, 2, 2, 208, 209, 7, 35, 2, 2, 209, 52, 3, 2, 2, 2, 210, 211, 7, 42, 2, 2, 211, 54, 3, 2, 2, 2, 212, 213, 7, 43, 2, 2, 213, 56, 3, 2, 2, 2, 214, 215, 7, 93, 2, 2, 215, 58, 3, 2, 2, 2, 216, 217, 7, 95, 2, 2, 217, 60, 3, 2, 2, 2, 218, 219, 7, 125, 2, 2, 219, 62, 3, 2, 2, 2, 220, 221, 7, 127, 2, 2, 221, 64, 3, 2, 2, 2, 222, 223, 7, 46, 2, 2, 223, 66, 3, 2, 2, 2, 224, 225, 7, 61, 2, 2, 225, 68, 3, 2, 2, 2, 226, 227, 9, 2, 2, 2, 227, 70, 3, 2, 2, 2, 228, 229, 9, 3, 2, 2, 229, 72, 3, 2, 2, 2, 230, 231, 9, 4, 2, 2, 231, 74, 3, 2, 2, 2, 232, 237, 5, 73, 37, 2, 233, 236, 5, 71, 36, 2, 234, 236, 7, 97, 2, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 76, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 241, 9, 5, 2, 2, 241, 78, 3, 2, 2, 2, 242, 243, 9, 6, 2, 2, 243, 80, 3, 2, 2, 2, 244, 245, 9, 7, 2, 2, 245, 82, 3, 2, 2, 2, 246, 247, 7, 50, 2, 2, 247, 84, 3, 2, 2, 2, 248, 249, 7, 50, 2, 2, 249, 250, 9, 8, 2, 2, 250, 86, 3, 2, 2, 2, 251, 252, 9, 9, 2, 2, 252, 88, 3, 2, 2, 2, 253, 254, 9, 10, 2, 2, 254, 90, 3, 2, 2, 2, 255, 257, 5, 77, 39, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 261, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 263, 7, 48, 2, 2, 262, 264, 5, 77, 39, 2, 263, 262, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 275, 3, 2, 2, 2, 267, 269, 5, 77, 39, 2, 268, 267, 3, 2, 2, 2, 269, 270, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 273, 7, 48, 2, 2, 273, 275, 3, 2, 2, 2, 274, 258, 3, 2, 2, 2, 274, 268, 3, 2, 2, 2, 275, 92, 3, 2, 2, 2, 276, 278, 9, 11, 2, 2, 277, 279, 5, 89, 45, 2, 278, 277, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 281, 3, 2, 2, 2, 280, 282, 5, 77, 39, 2, 281, 280, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 94, 3, 2, 2, 2, 285, 287, 5, 91, 46, 2, 286, 288, 5, 93, 47, 2, 287, 286, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 297, 3, 2, 2, 2, 289, 291, 5, 77, 39, 2, 290, 289, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 290, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 295, 5, 93, 47, 2, 295, 297, 3, 2, 2, 2, 296, 285, 3, 2, 2, 2, 296, 290, 3, 2, 2, 2, 297, 96, 3, 2, 2, 2, 298, 300, 5, 81, 41, 2, 299, 298, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 304, 3, 2, 2, 2, 303, 301, 3, 2, 2, 2, 304, 306, 7, 48, 2, 2, 305, 307, 5, 81, 41, 2, 306, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 306, 3, 2, 2, 2, 308, 309, 3, 2, 2, 2, 309, 318, 3, 2, 2, 2, 310, 312, 5, 81, 41, 2, 311, 310, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 316, 7, 48, 2, 2, 316, 318, 3, 2, 2, 2, 317, 301, 3, 2, 2, 2, 317, 311, 3, 2, 2, 2, 318, 98, 3, 2, 2, 2, 319, 321, 9, 12, 2, 2, 320, 322, 5, 89, 45, 2, 321, 320, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 324, 3, 2, 2, 2, 323, 325, 5, 77, 39, 2, 324, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 100, 3, 2, 2, 2, 328, 329, 5, 85, 43, 2, 329, 330, 5, 97, 49, 2, 330, 331, 5, 99, 50, 2, 331, 340, 3, 2, 2, 2, 332, 334, 5, 81, 41, 2, 333, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 338, 5, 99, 50, 2, 338, 340, 3, 2, 2, 2, 339, 328, 3, 2, 2, 2, 339, 333, 3, 2, 2, 2, 340, 102, 3, 2, 2, 2, 341, 345, 5, 87, 44, 2, 342, 344, 5, 77, 39, 2, 343, 342, 3, 2, 2, 2, 344, 347, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 362, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 348, 352, 5, 83, 42, 2, 349, 351, 5, 79, 40, 2, 350, 349, 3, 2, 2, 2, 351, 354, 3, 2, 2, 2, 352, 350, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 362, 3, 2, 2, 2, 354, 352, 3, 2, 2, 2, 355, 357, 5, 85, 43, 2, 356, 358, 5, 81, 41, 2, 357, 356, 3, 2, 2, 2, 358, 359, 3, 2, 2, 2, 359, 357, 3, 2, 2, 2, 359, 360, 3, 2, 2, 2, 360, 362, 3, 2, 2, 2, 361, 341, 3, 2, 2, 2, 361, 348, 3, 2, 2, 2, 361, 355, 3, 2, 2, 2, 362, 104, 3, 2, 2, 2, 363, 366, 5, 95, 48, 2, 364, 366, 5, 101, 51, 2, 365, 363, 3, 2, 2, 2, 365, 364, 3, 2, 2, 2, 366, 106, 3, 2, 2, 2, 367, 368, 7, 94, 2, 2, 368, 372, 7, 36, 2, 2, 369, 370, 7, 94, 2, 2, 370, 372, 7, 94, 2, 2, 371, 367, 3, 2, 2, 2, 371, 369, 3, 2, 2, 2, 372, 108, 3, 2, 2, 2, 373, 378, 7, 36, 2, 2, 374, 377, 5, 107, 54, 2, 375, 377, 11, 2, 2, 2, 376, 374, 3, 2, 2, 2, 376, 375, 3, 2, 2, 2, 377, 380, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 379, 381, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 381, 382, 7, 36, 2, 2, 382, 110, 3, 2, 2, 2, 383, 384, 9, 13, 2, 2, 384, 385, 3, 2, 2, 2, 385, 386, 8, 56, 2, 2, 386, 112, 3, 2, 2, 2, 387, 388, 7, 49, 2, 2, 388, 389, 7, 49, 2, 2, 389, 393, 3, 2, 2, 2, 390, 392, 11, 2, 2, 2, 391, 390, 3, 2, 2, 2, 392, 395, 3, 2, 2, 2, 393, 394, 3, 2, 2, 2, 393, 391, 3, 2, 2, 2, 394, 397, 3, 2, 2, 2, 395, 393, 3, 2, 2, 2, 396, 398, 7, 15, 2, 2, 397, 396, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 400, 7, 12, 2, 2, 400, 401, 3, 2, 2, 2, 401, 402, 8, 57, 2, 2, 402, 114, 3, 2, 2, 2, 403, 404, 7, 49, 2, 2, 404, 405, 7, 44, 2, 2, 405, 409, 3, 2, 2, 2, 406, 408, 11, 2, 2, 2, 407, 406, 3, 2, 2, 2, 408, 411, 3, 2, 2, 2, 409, 410, 3, 2, 2, 2, 409, 407, 3, 2, 2, 2, 410, 412, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, 412, 413, 7, 44, 2, 2, 413, 414, 7, 49, 2, 2, 414, 415, 3, 2, 2, 2, 415, 416, 8, 58, 2, 2, 416, 116, 3, 2, 2, 2, 33, 2, 235, 237, 258, 265, 270, 274, 278, 283, 287, 292, 296, 301, 308, 313, 317, 321, 326, 335, 339, 345, 352, 359, 361, 365, 371, 376, 378, 393, 397, 409, 3, 8, 2, 2] \ No newline at end of file diff --git a/src/.antlr/SysYLexer.java b/src/.antlr/SysYLexer.java new file mode 100644 index 0000000..c107f6f --- /dev/null +++ b/src/.antlr/SysYLexer.java @@ -0,0 +1,276 @@ +// Generated from /home/wqz/sysy/sysy/src/SysY.g4 by ANTLR 4.9.2 +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class SysYLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + CONST=1, INT=2, FLOAT=3, VOID=4, IF=5, ELSE=6, WHILE=7, BREAK=8, CONTINUE=9, + RETURN=10, ASSIGN=11, ADD=12, SUB=13, MUL=14, DIV=15, MODULO=16, LT=17, + GT=18, LE=19, GE=20, EQ=21, NE=22, AND=23, OR=24, NOT=25, LPAREN=26, RPAREN=27, + LBRACKET=28, RBRACKET=29, LBRACE=30, RBRACE=31, COMMA=32, SEMICOLON=33, + ID=34, ILITERAL=35, FLITERAL=36, STRING=37, WS=38, LINECOMMENT=39, BLOCKCOMMENT=40; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK", "CONTINUE", + "RETURN", "ASSIGN", "ADD", "SUB", "MUL", "DIV", "MODULO", "LT", "GT", + "LE", "GE", "EQ", "NE", "AND", "OR", "NOT", "LPAREN", "RPAREN", "LBRACKET", + "RBRACKET", "LBRACE", "RBRACE", "COMMA", "SEMICOLON", "ALPHA", "ALPHANUM", + "NONDIGIT", "ID", "DecDigit", "OctDigit", "HexDigit", "OctPrefix", "HexPrefix", + "NonZeroDecDigit", "Sign", "DecFractional", "Exponent", "DecFloat", "HexFractional", + "BinExponent", "HexFloat", "ILITERAL", "FLITERAL", "ESC", "STRING", "WS", + "LINECOMMENT", "BLOCKCOMMENT" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'const'", "'int'", "'float'", "'void'", "'if'", "'else'", "'while'", + "'break'", "'continue'", "'return'", "'='", "'+'", "'-'", "'*'", "'/'", + "'%'", "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'&&'", "'||'", + "'!'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "';'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK", + "CONTINUE", "RETURN", "ASSIGN", "ADD", "SUB", "MUL", "DIV", "MODULO", + "LT", "GT", "LE", "GE", "EQ", "NE", "AND", "OR", "NOT", "LPAREN", "RPAREN", + "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "SEMICOLON", "ID", + "ILITERAL", "FLITERAL", "STRING", "WS", "LINECOMMENT", "BLOCKCOMMENT" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public SysYLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "SysY.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2*\u01a1\b\1\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\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\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\3\2\3\2\3\2\3\2\3"+ + "\2\3\2\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6"+ + "\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3"+ + "\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3"+ + "\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21\3\22"+ + "\3\22\3\23\3\23\3\24\3\24\3\24\3\25\3\25\3\25\3\26\3\26\3\26\3\27\3\27"+ + "\3\27\3\30\3\30\3\30\3\31\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35"+ + "\3\35\3\36\3\36\3\37\3\37\3 \3 \3!\3!\3\"\3\"\3#\3#\3$\3$\3%\3%\3&\3&"+ + "\3&\7&\u00ec\n&\f&\16&\u00ef\13&\3\'\3\'\3(\3(\3)\3)\3*\3*\3+\3+\3+\3"+ + ",\3,\3-\3-\3.\7.\u0101\n.\f.\16.\u0104\13.\3.\3.\6.\u0108\n.\r.\16.\u0109"+ + "\3.\6.\u010d\n.\r.\16.\u010e\3.\3.\5.\u0113\n.\3/\3/\5/\u0117\n/\3/\6"+ + "/\u011a\n/\r/\16/\u011b\3\60\3\60\5\60\u0120\n\60\3\60\6\60\u0123\n\60"+ + "\r\60\16\60\u0124\3\60\3\60\5\60\u0129\n\60\3\61\7\61\u012c\n\61\f\61"+ + "\16\61\u012f\13\61\3\61\3\61\6\61\u0133\n\61\r\61\16\61\u0134\3\61\6\61"+ + "\u0138\n\61\r\61\16\61\u0139\3\61\3\61\5\61\u013e\n\61\3\62\3\62\5\62"+ + "\u0142\n\62\3\62\6\62\u0145\n\62\r\62\16\62\u0146\3\63\3\63\3\63\3\63"+ + "\3\63\6\63\u014e\n\63\r\63\16\63\u014f\3\63\3\63\5\63\u0154\n\63\3\64"+ + "\3\64\7\64\u0158\n\64\f\64\16\64\u015b\13\64\3\64\3\64\7\64\u015f\n\64"+ + "\f\64\16\64\u0162\13\64\3\64\3\64\6\64\u0166\n\64\r\64\16\64\u0167\5\64"+ + "\u016a\n\64\3\65\3\65\5\65\u016e\n\65\3\66\3\66\3\66\3\66\5\66\u0174\n"+ + "\66\3\67\3\67\3\67\7\67\u0179\n\67\f\67\16\67\u017c\13\67\3\67\3\67\3"+ + "8\38\38\38\39\39\39\39\79\u0188\n9\f9\169\u018b\139\39\59\u018e\n9\39"+ + "\39\39\39\3:\3:\3:\3:\7:\u0198\n:\f:\16:\u019b\13:\3:\3:\3:\3:\3:\5\u017a"+ + "\u0189\u0199\2;\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31"+ + "\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65"+ + "\34\67\359\36;\37= ?!A\"C#E\2G\2I\2K$M\2O\2Q\2S\2U\2W\2Y\2[\2]\2_\2a\2"+ + "c\2e\2g%i&k\2m\'o(q)s*\3\2\16\4\2C\\c|\5\2\62;C\\c|\5\2C\\aac|\3\2\62"+ + ";\3\2\629\5\2\62;CHch\4\2ZZzz\3\2\63;\4\2--//\4\2GGgg\4\2RRrr\5\2\13\f"+ + "\17\17\"\"\2\u01ae\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13"+ + "\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2"+ + "\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2"+ + "!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3"+ + "\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2"+ + "\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2K"+ + "\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2"+ + "\2\2\3u\3\2\2\2\5{\3\2\2\2\7\177\3\2\2\2\t\u0085\3\2\2\2\13\u008a\3\2"+ + "\2\2\r\u008d\3\2\2\2\17\u0092\3\2\2\2\21\u0098\3\2\2\2\23\u009e\3\2\2"+ + "\2\25\u00a7\3\2\2\2\27\u00ae\3\2\2\2\31\u00b0\3\2\2\2\33\u00b2\3\2\2\2"+ + "\35\u00b4\3\2\2\2\37\u00b6\3\2\2\2!\u00b8\3\2\2\2#\u00ba\3\2\2\2%\u00bc"+ + "\3\2\2\2\'\u00be\3\2\2\2)\u00c1\3\2\2\2+\u00c4\3\2\2\2-\u00c7\3\2\2\2"+ + "/\u00ca\3\2\2\2\61\u00cd\3\2\2\2\63\u00d0\3\2\2\2\65\u00d2\3\2\2\2\67"+ + "\u00d4\3\2\2\29\u00d6\3\2\2\2;\u00d8\3\2\2\2=\u00da\3\2\2\2?\u00dc\3\2"+ + "\2\2A\u00de\3\2\2\2C\u00e0\3\2\2\2E\u00e2\3\2\2\2G\u00e4\3\2\2\2I\u00e6"+ + "\3\2\2\2K\u00e8\3\2\2\2M\u00f0\3\2\2\2O\u00f2\3\2\2\2Q\u00f4\3\2\2\2S"+ + "\u00f6\3\2\2\2U\u00f8\3\2\2\2W\u00fb\3\2\2\2Y\u00fd\3\2\2\2[\u0112\3\2"+ + "\2\2]\u0114\3\2\2\2_\u0128\3\2\2\2a\u013d\3\2\2\2c\u013f\3\2\2\2e\u0153"+ + "\3\2\2\2g\u0169\3\2\2\2i\u016d\3\2\2\2k\u0173\3\2\2\2m\u0175\3\2\2\2o"+ + "\u017f\3\2\2\2q\u0183\3\2\2\2s\u0193\3\2\2\2uv\7e\2\2vw\7q\2\2wx\7p\2"+ + "\2xy\7u\2\2yz\7v\2\2z\4\3\2\2\2{|\7k\2\2|}\7p\2\2}~\7v\2\2~\6\3\2\2\2"+ + "\177\u0080\7h\2\2\u0080\u0081\7n\2\2\u0081\u0082\7q\2\2\u0082\u0083\7"+ + "c\2\2\u0083\u0084\7v\2\2\u0084\b\3\2\2\2\u0085\u0086\7x\2\2\u0086\u0087"+ + "\7q\2\2\u0087\u0088\7k\2\2\u0088\u0089\7f\2\2\u0089\n\3\2\2\2\u008a\u008b"+ + "\7k\2\2\u008b\u008c\7h\2\2\u008c\f\3\2\2\2\u008d\u008e\7g\2\2\u008e\u008f"+ + "\7n\2\2\u008f\u0090\7u\2\2\u0090\u0091\7g\2\2\u0091\16\3\2\2\2\u0092\u0093"+ + "\7y\2\2\u0093\u0094\7j\2\2\u0094\u0095\7k\2\2\u0095\u0096\7n\2\2\u0096"+ + "\u0097\7g\2\2\u0097\20\3\2\2\2\u0098\u0099\7d\2\2\u0099\u009a\7t\2\2\u009a"+ + "\u009b\7g\2\2\u009b\u009c\7c\2\2\u009c\u009d\7m\2\2\u009d\22\3\2\2\2\u009e"+ + "\u009f\7e\2\2\u009f\u00a0\7q\2\2\u00a0\u00a1\7p\2\2\u00a1\u00a2\7v\2\2"+ + "\u00a2\u00a3\7k\2\2\u00a3\u00a4\7p\2\2\u00a4\u00a5\7w\2\2\u00a5\u00a6"+ + "\7g\2\2\u00a6\24\3\2\2\2\u00a7\u00a8\7t\2\2\u00a8\u00a9\7g\2\2\u00a9\u00aa"+ + "\7v\2\2\u00aa\u00ab\7w\2\2\u00ab\u00ac\7t\2\2\u00ac\u00ad\7p\2\2\u00ad"+ + "\26\3\2\2\2\u00ae\u00af\7?\2\2\u00af\30\3\2\2\2\u00b0\u00b1\7-\2\2\u00b1"+ + "\32\3\2\2\2\u00b2\u00b3\7/\2\2\u00b3\34\3\2\2\2\u00b4\u00b5\7,\2\2\u00b5"+ + "\36\3\2\2\2\u00b6\u00b7\7\61\2\2\u00b7 \3\2\2\2\u00b8\u00b9\7\'\2\2\u00b9"+ + "\"\3\2\2\2\u00ba\u00bb\7>\2\2\u00bb$\3\2\2\2\u00bc\u00bd\7@\2\2\u00bd"+ + "&\3\2\2\2\u00be\u00bf\7>\2\2\u00bf\u00c0\7?\2\2\u00c0(\3\2\2\2\u00c1\u00c2"+ + "\7@\2\2\u00c2\u00c3\7?\2\2\u00c3*\3\2\2\2\u00c4\u00c5\7?\2\2\u00c5\u00c6"+ + "\7?\2\2\u00c6,\3\2\2\2\u00c7\u00c8\7#\2\2\u00c8\u00c9\7?\2\2\u00c9.\3"+ + "\2\2\2\u00ca\u00cb\7(\2\2\u00cb\u00cc\7(\2\2\u00cc\60\3\2\2\2\u00cd\u00ce"+ + "\7~\2\2\u00ce\u00cf\7~\2\2\u00cf\62\3\2\2\2\u00d0\u00d1\7#\2\2\u00d1\64"+ + "\3\2\2\2\u00d2\u00d3\7*\2\2\u00d3\66\3\2\2\2\u00d4\u00d5\7+\2\2\u00d5"+ + "8\3\2\2\2\u00d6\u00d7\7]\2\2\u00d7:\3\2\2\2\u00d8\u00d9\7_\2\2\u00d9<"+ + "\3\2\2\2\u00da\u00db\7}\2\2\u00db>\3\2\2\2\u00dc\u00dd\7\177\2\2\u00dd"+ + "@\3\2\2\2\u00de\u00df\7.\2\2\u00dfB\3\2\2\2\u00e0\u00e1\7=\2\2\u00e1D"+ + "\3\2\2\2\u00e2\u00e3\t\2\2\2\u00e3F\3\2\2\2\u00e4\u00e5\t\3\2\2\u00e5"+ + "H\3\2\2\2\u00e6\u00e7\t\4\2\2\u00e7J\3\2\2\2\u00e8\u00ed\5I%\2\u00e9\u00ec"+ + "\5G$\2\u00ea\u00ec\7a\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec"+ + "\u00ef\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2\u00eeL\3\2\2\2"+ + "\u00ef\u00ed\3\2\2\2\u00f0\u00f1\t\5\2\2\u00f1N\3\2\2\2\u00f2\u00f3\t"+ + "\6\2\2\u00f3P\3\2\2\2\u00f4\u00f5\t\7\2\2\u00f5R\3\2\2\2\u00f6\u00f7\7"+ + "\62\2\2\u00f7T\3\2\2\2\u00f8\u00f9\7\62\2\2\u00f9\u00fa\t\b\2\2\u00fa"+ + "V\3\2\2\2\u00fb\u00fc\t\t\2\2\u00fcX\3\2\2\2\u00fd\u00fe\t\n\2\2\u00fe"+ + "Z\3\2\2\2\u00ff\u0101\5M\'\2\u0100\u00ff\3\2\2\2\u0101\u0104\3\2\2\2\u0102"+ + "\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103\u0105\3\2\2\2\u0104\u0102\3\2"+ + "\2\2\u0105\u0107\7\60\2\2\u0106\u0108\5M\'\2\u0107\u0106\3\2\2\2\u0108"+ + "\u0109\3\2\2\2\u0109\u0107\3\2\2\2\u0109\u010a\3\2\2\2\u010a\u0113\3\2"+ + "\2\2\u010b\u010d\5M\'\2\u010c\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e"+ + "\u010c\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0110\3\2\2\2\u0110\u0111\7\60"+ + "\2\2\u0111\u0113\3\2\2\2\u0112\u0102\3\2\2\2\u0112\u010c\3\2\2\2\u0113"+ + "\\\3\2\2\2\u0114\u0116\t\13\2\2\u0115\u0117\5Y-\2\u0116\u0115\3\2\2\2"+ + "\u0116\u0117\3\2\2\2\u0117\u0119\3\2\2\2\u0118\u011a\5M\'\2\u0119\u0118"+ + "\3\2\2\2\u011a\u011b\3\2\2\2\u011b\u0119\3\2\2\2\u011b\u011c\3\2\2\2\u011c"+ + "^\3\2\2\2\u011d\u011f\5[.\2\u011e\u0120\5]/\2\u011f\u011e\3\2\2\2\u011f"+ + "\u0120\3\2\2\2\u0120\u0129\3\2\2\2\u0121\u0123\5M\'\2\u0122\u0121\3\2"+ + "\2\2\u0123\u0124\3\2\2\2\u0124\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125"+ + "\u0126\3\2\2\2\u0126\u0127\5]/\2\u0127\u0129\3\2\2\2\u0128\u011d\3\2\2"+ + "\2\u0128\u0122\3\2\2\2\u0129`\3\2\2\2\u012a\u012c\5Q)\2\u012b\u012a\3"+ + "\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2\u012d\u012e\3\2\2\2\u012e"+ + "\u0130\3\2\2\2\u012f\u012d\3\2\2\2\u0130\u0132\7\60\2\2\u0131\u0133\5"+ + "Q)\2\u0132\u0131\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0132\3\2\2\2\u0134"+ + "\u0135\3\2\2\2\u0135\u013e\3\2\2\2\u0136\u0138\5Q)\2\u0137\u0136\3\2\2"+ + "\2\u0138\u0139\3\2\2\2\u0139\u0137\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b"+ + "\3\2\2\2\u013b\u013c\7\60\2\2\u013c\u013e\3\2\2\2\u013d\u012d\3\2\2\2"+ + "\u013d\u0137\3\2\2\2\u013eb\3\2\2\2\u013f\u0141\t\f\2\2\u0140\u0142\5"+ + "Y-\2\u0141\u0140\3\2\2\2\u0141\u0142\3\2\2\2\u0142\u0144\3\2\2\2\u0143"+ + "\u0145\5M\'\2\u0144\u0143\3\2\2\2\u0145\u0146\3\2\2\2\u0146\u0144\3\2"+ + "\2\2\u0146\u0147\3\2\2\2\u0147d\3\2\2\2\u0148\u0149\5U+\2\u0149\u014a"+ + "\5a\61\2\u014a\u014b\5c\62\2\u014b\u0154\3\2\2\2\u014c\u014e\5Q)\2\u014d"+ + "\u014c\3\2\2\2\u014e\u014f\3\2\2\2\u014f\u014d\3\2\2\2\u014f\u0150\3\2"+ + "\2\2\u0150\u0151\3\2\2\2\u0151\u0152\5c\62\2\u0152\u0154\3\2\2\2\u0153"+ + "\u0148\3\2\2\2\u0153\u014d\3\2\2\2\u0154f\3\2\2\2\u0155\u0159\5W,\2\u0156"+ + "\u0158\5M\'\2\u0157\u0156\3\2\2\2\u0158\u015b\3\2\2\2\u0159\u0157\3\2"+ + "\2\2\u0159\u015a\3\2\2\2\u015a\u016a\3\2\2\2\u015b\u0159\3\2\2\2\u015c"+ + "\u0160\5S*\2\u015d\u015f\5O(\2\u015e\u015d\3\2\2\2\u015f\u0162\3\2\2\2"+ + "\u0160\u015e\3\2\2\2\u0160\u0161\3\2\2\2\u0161\u016a\3\2\2\2\u0162\u0160"+ + "\3\2\2\2\u0163\u0165\5U+\2\u0164\u0166\5Q)\2\u0165\u0164\3\2\2\2\u0166"+ + "\u0167\3\2\2\2\u0167\u0165\3\2\2\2\u0167\u0168\3\2\2\2\u0168\u016a\3\2"+ + "\2\2\u0169\u0155\3\2\2\2\u0169\u015c\3\2\2\2\u0169\u0163\3\2\2\2\u016a"+ + "h\3\2\2\2\u016b\u016e\5_\60\2\u016c\u016e\5e\63\2\u016d\u016b\3\2\2\2"+ + "\u016d\u016c\3\2\2\2\u016ej\3\2\2\2\u016f\u0170\7^\2\2\u0170\u0174\7$"+ + "\2\2\u0171\u0172\7^\2\2\u0172\u0174\7^\2\2\u0173\u016f\3\2\2\2\u0173\u0171"+ + "\3\2\2\2\u0174l\3\2\2\2\u0175\u017a\7$\2\2\u0176\u0179\5k\66\2\u0177\u0179"+ + "\13\2\2\2\u0178\u0176\3\2\2\2\u0178\u0177\3\2\2\2\u0179\u017c\3\2\2\2"+ + "\u017a\u017b\3\2\2\2\u017a\u0178\3\2\2\2\u017b\u017d\3\2\2\2\u017c\u017a"+ + "\3\2\2\2\u017d\u017e\7$\2\2\u017en\3\2\2\2\u017f\u0180\t\r\2\2\u0180\u0181"+ + "\3\2\2\2\u0181\u0182\b8\2\2\u0182p\3\2\2\2\u0183\u0184\7\61\2\2\u0184"+ + "\u0185\7\61\2\2\u0185\u0189\3\2\2\2\u0186\u0188\13\2\2\2\u0187\u0186\3"+ + "\2\2\2\u0188\u018b\3\2\2\2\u0189\u018a\3\2\2\2\u0189\u0187\3\2\2\2\u018a"+ + "\u018d\3\2\2\2\u018b\u0189\3\2\2\2\u018c\u018e\7\17\2\2\u018d\u018c\3"+ + "\2\2\2\u018d\u018e\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0190\7\f\2\2\u0190"+ + "\u0191\3\2\2\2\u0191\u0192\b9\2\2\u0192r\3\2\2\2\u0193\u0194\7\61\2\2"+ + "\u0194\u0195\7,\2\2\u0195\u0199\3\2\2\2\u0196\u0198\13\2\2\2\u0197\u0196"+ + "\3\2\2\2\u0198\u019b\3\2\2\2\u0199\u019a\3\2\2\2\u0199\u0197\3\2\2\2\u019a"+ + "\u019c\3\2\2\2\u019b\u0199\3\2\2\2\u019c\u019d\7,\2\2\u019d\u019e\7\61"+ + "\2\2\u019e\u019f\3\2\2\2\u019f\u01a0\b:\2\2\u01a0t\3\2\2\2!\2\u00eb\u00ed"+ + "\u0102\u0109\u010e\u0112\u0116\u011b\u011f\u0124\u0128\u012d\u0134\u0139"+ + "\u013d\u0141\u0146\u014f\u0153\u0159\u0160\u0167\u0169\u016d\u0173\u0178"+ + "\u017a\u0189\u018d\u0199\3\b\2\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/.antlr/SysYLexer.tokens b/src/.antlr/SysYLexer.tokens new file mode 100644 index 0000000..251577d --- /dev/null +++ b/src/.antlr/SysYLexer.tokens @@ -0,0 +1,73 @@ +CONST=1 +INT=2 +FLOAT=3 +VOID=4 +IF=5 +ELSE=6 +WHILE=7 +BREAK=8 +CONTINUE=9 +RETURN=10 +ASSIGN=11 +ADD=12 +SUB=13 +MUL=14 +DIV=15 +MODULO=16 +LT=17 +GT=18 +LE=19 +GE=20 +EQ=21 +NE=22 +AND=23 +OR=24 +NOT=25 +LPAREN=26 +RPAREN=27 +LBRACKET=28 +RBRACKET=29 +LBRACE=30 +RBRACE=31 +COMMA=32 +SEMICOLON=33 +ID=34 +ILITERAL=35 +FLITERAL=36 +STRING=37 +WS=38 +LINECOMMENT=39 +BLOCKCOMMENT=40 +'const'=1 +'int'=2 +'float'=3 +'void'=4 +'if'=5 +'else'=6 +'while'=7 +'break'=8 +'continue'=9 +'return'=10 +'='=11 +'+'=12 +'-'=13 +'*'=14 +'/'=15 +'%'=16 +'<'=17 +'>'=18 +'<='=19 +'>='=20 +'=='=21 +'!='=22 +'&&'=23 +'||'=24 +'!'=25 +'('=26 +')'=27 +'['=28 +']'=29 +'{'=30 +'}'=31 +','=32 +';'=33 diff --git a/src/.antlr/SysYParser.java b/src/.antlr/SysYParser.java new file mode 100644 index 0000000..4c46549 --- /dev/null +++ b/src/.antlr/SysYParser.java @@ -0,0 +1,1919 @@ +// Generated from /home/wqz/sysy/sysy/src/SysY.g4 by ANTLR 4.9.2 +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class SysYParser extends Parser { + static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + CONST=1, INT=2, FLOAT=3, VOID=4, IF=5, ELSE=6, WHILE=7, BREAK=8, CONTINUE=9, + RETURN=10, ASSIGN=11, ADD=12, SUB=13, MUL=14, DIV=15, MODULO=16, LT=17, + GT=18, LE=19, GE=20, EQ=21, NE=22, AND=23, OR=24, NOT=25, LPAREN=26, RPAREN=27, + LBRACKET=28, RBRACKET=29, LBRACE=30, RBRACE=31, COMMA=32, SEMICOLON=33, + ID=34, ILITERAL=35, FLITERAL=36, STRING=37, WS=38, LINECOMMENT=39, BLOCKCOMMENT=40; + public static final int + RULE_module = 0, RULE_decl = 1, RULE_btype = 2, RULE_varDef = 3, RULE_initValue = 4, + RULE_func = 5, RULE_funcType = 6, RULE_funcFParams = 7, RULE_funcFParam = 8, + RULE_blockStmt = 9, RULE_blockItem = 10, RULE_stmt = 11, RULE_assignStmt = 12, + RULE_expStmt = 13, RULE_ifStmt = 14, RULE_whileStmt = 15, RULE_breakStmt = 16, + RULE_continueStmt = 17, RULE_returnStmt = 18, RULE_emptyStmt = 19, RULE_exp = 20, + RULE_call = 21, RULE_lValue = 22, RULE_number = 23, RULE_string = 24, + RULE_funcRParams = 25; + private static String[] makeRuleNames() { + return new String[] { + "module", "decl", "btype", "varDef", "initValue", "func", "funcType", + "funcFParams", "funcFParam", "blockStmt", "blockItem", "stmt", "assignStmt", + "expStmt", "ifStmt", "whileStmt", "breakStmt", "continueStmt", "returnStmt", + "emptyStmt", "exp", "call", "lValue", "number", "string", "funcRParams" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'const'", "'int'", "'float'", "'void'", "'if'", "'else'", "'while'", + "'break'", "'continue'", "'return'", "'='", "'+'", "'-'", "'*'", "'/'", + "'%'", "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'&&'", "'||'", + "'!'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "';'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK", + "CONTINUE", "RETURN", "ASSIGN", "ADD", "SUB", "MUL", "DIV", "MODULO", + "LT", "GT", "LE", "GE", "EQ", "NE", "AND", "OR", "NOT", "LPAREN", "RPAREN", + "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "SEMICOLON", "ID", + "ILITERAL", "FLITERAL", "STRING", "WS", "LINECOMMENT", "BLOCKCOMMENT" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "SysY.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public SysYParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + public static class ModuleContext extends ParserRuleContext { + public List decl() { + return getRuleContexts(DeclContext.class); + } + public DeclContext decl(int i) { + return getRuleContext(DeclContext.class,i); + } + public List func() { + return getRuleContexts(FuncContext.class); + } + public FuncContext func(int i) { + return getRuleContext(FuncContext.class,i); + } + public ModuleContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_module; } + } + + public final ModuleContext module() throws RecognitionException { + ModuleContext _localctx = new ModuleContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_module); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(54); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + setState(54); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { + case 1: + { + setState(52); + decl(); + } + break; + case 2: + { + setState(53); + func(); + } + break; + } + } + setState(56); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << CONST) | (1L << INT) | (1L << FLOAT) | (1L << VOID))) != 0) ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class DeclContext extends ParserRuleContext { + public BtypeContext btype() { + return getRuleContext(BtypeContext.class,0); + } + public List varDef() { + return getRuleContexts(VarDefContext.class); + } + public VarDefContext varDef(int i) { + return getRuleContext(VarDefContext.class,i); + } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public TerminalNode CONST() { return getToken(SysYParser.CONST, 0); } + public List COMMA() { return getTokens(SysYParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(SysYParser.COMMA, i); + } + public DeclContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_decl; } + } + + public final DeclContext decl() throws RecognitionException { + DeclContext _localctx = new DeclContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_decl); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(59); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==CONST) { + { + setState(58); + match(CONST); + } + } + + setState(61); + btype(); + setState(62); + varDef(); + setState(67); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(63); + match(COMMA); + setState(64); + varDef(); + } + } + setState(69); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(70); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BtypeContext extends ParserRuleContext { + public TerminalNode INT() { return getToken(SysYParser.INT, 0); } + public TerminalNode FLOAT() { return getToken(SysYParser.FLOAT, 0); } + public BtypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_btype; } + } + + public final BtypeContext btype() throws RecognitionException { + BtypeContext _localctx = new BtypeContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_btype); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(72); + _la = _input.LA(1); + if ( !(_la==INT || _la==FLOAT) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VarDefContext extends ParserRuleContext { + public LValueContext lValue() { + return getRuleContext(LValueContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(SysYParser.ASSIGN, 0); } + public InitValueContext initValue() { + return getRuleContext(InitValueContext.class,0); + } + public VarDefContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_varDef; } + } + + public final VarDefContext varDef() throws RecognitionException { + VarDefContext _localctx = new VarDefContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_varDef); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(74); + lValue(); + setState(77); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==ASSIGN) { + { + setState(75); + match(ASSIGN); + setState(76); + initValue(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class InitValueContext extends ParserRuleContext { + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode LBRACE() { return getToken(SysYParser.LBRACE, 0); } + public List initValue() { + return getRuleContexts(InitValueContext.class); + } + public InitValueContext initValue(int i) { + return getRuleContext(InitValueContext.class,i); + } + public List COMMA() { return getTokens(SysYParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(SysYParser.COMMA, i); + } + public InitValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_initValue; } + } + + public final InitValueContext initValue() throws RecognitionException { + InitValueContext _localctx = new InitValueContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_initValue); + int _la; + try { + int _alt; + setState(91); + _errHandler.sync(this); + switch (_input.LA(1)) { + case ADD: + case SUB: + case NOT: + case LPAREN: + case ID: + case ILITERAL: + case FLITERAL: + case STRING: + enterOuterAlt(_localctx, 1); + { + setState(79); + exp(0); + } + break; + case LBRACE: + enterOuterAlt(_localctx, 2); + { + setState(80); + match(LBRACE); + setState(89); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << SUB) | (1L << NOT) | (1L << LPAREN) | (1L << LBRACE) | (1L << ID) | (1L << ILITERAL) | (1L << FLITERAL) | (1L << STRING))) != 0)) { + { + setState(81); + initValue(); + setState(86); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,5,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(82); + match(COMMA); + setState(83); + initValue(); + } + } + } + setState(88); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,5,_ctx); + } + } + } + + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FuncContext extends ParserRuleContext { + public FuncTypeContext funcType() { + return getRuleContext(FuncTypeContext.class,0); + } + public TerminalNode ID() { return getToken(SysYParser.ID, 0); } + public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); } + public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); } + public BlockStmtContext blockStmt() { + return getRuleContext(BlockStmtContext.class,0); + } + public FuncFParamsContext funcFParams() { + return getRuleContext(FuncFParamsContext.class,0); + } + public FuncContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_func; } + } + + public final FuncContext func() throws RecognitionException { + FuncContext _localctx = new FuncContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_func); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(93); + funcType(); + setState(94); + match(ID); + setState(95); + match(LPAREN); + setState(97); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==INT || _la==FLOAT) { + { + setState(96); + funcFParams(); + } + } + + setState(99); + match(RPAREN); + setState(100); + blockStmt(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FuncTypeContext extends ParserRuleContext { + public TerminalNode VOID() { return getToken(SysYParser.VOID, 0); } + public TerminalNode INT() { return getToken(SysYParser.INT, 0); } + public TerminalNode FLOAT() { return getToken(SysYParser.FLOAT, 0); } + public FuncTypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_funcType; } + } + + public final FuncTypeContext funcType() throws RecognitionException { + FuncTypeContext _localctx = new FuncTypeContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_funcType); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(102); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << INT) | (1L << FLOAT) | (1L << VOID))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FuncFParamsContext extends ParserRuleContext { + public List funcFParam() { + return getRuleContexts(FuncFParamContext.class); + } + public FuncFParamContext funcFParam(int i) { + return getRuleContext(FuncFParamContext.class,i); + } + public List COMMA() { return getTokens(SysYParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(SysYParser.COMMA, i); + } + public FuncFParamsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_funcFParams; } + } + + public final FuncFParamsContext funcFParams() throws RecognitionException { + FuncFParamsContext _localctx = new FuncFParamsContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_funcFParams); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(104); + funcFParam(); + setState(109); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(105); + match(COMMA); + setState(106); + funcFParam(); + } + } + setState(111); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FuncFParamContext extends ParserRuleContext { + public BtypeContext btype() { + return getRuleContext(BtypeContext.class,0); + } + public TerminalNode ID() { return getToken(SysYParser.ID, 0); } + public List LBRACKET() { return getTokens(SysYParser.LBRACKET); } + public TerminalNode LBRACKET(int i) { + return getToken(SysYParser.LBRACKET, i); + } + public List RBRACKET() { return getTokens(SysYParser.RBRACKET); } + public TerminalNode RBRACKET(int i) { + return getToken(SysYParser.RBRACKET, i); + } + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public FuncFParamContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_funcFParam; } + } + + public final FuncFParamContext funcFParam() throws RecognitionException { + FuncFParamContext _localctx = new FuncFParamContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_funcFParam); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(112); + btype(); + setState(113); + match(ID); + setState(125); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==LBRACKET) { + { + setState(114); + match(LBRACKET); + setState(115); + match(RBRACKET); + setState(122); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==LBRACKET) { + { + { + setState(116); + match(LBRACKET); + setState(117); + exp(0); + setState(118); + match(RBRACKET); + } + } + setState(124); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockStmtContext extends ParserRuleContext { + public TerminalNode LBRACE() { return getToken(SysYParser.LBRACE, 0); } + public TerminalNode RBRACE() { return getToken(SysYParser.RBRACE, 0); } + public List blockItem() { + return getRuleContexts(BlockItemContext.class); + } + public BlockItemContext blockItem(int i) { + return getRuleContext(BlockItemContext.class,i); + } + public BlockStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_blockStmt; } + } + + public final BlockStmtContext blockStmt() throws RecognitionException { + BlockStmtContext _localctx = new BlockStmtContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_blockStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(127); + match(LBRACE); + setState(131); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << CONST) | (1L << INT) | (1L << FLOAT) | (1L << IF) | (1L << WHILE) | (1L << BREAK) | (1L << CONTINUE) | (1L << RETURN) | (1L << ADD) | (1L << SUB) | (1L << NOT) | (1L << LPAREN) | (1L << LBRACE) | (1L << SEMICOLON) | (1L << ID) | (1L << ILITERAL) | (1L << FLITERAL) | (1L << STRING))) != 0)) { + { + { + setState(128); + blockItem(); + } + } + setState(133); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(134); + match(RBRACE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BlockItemContext extends ParserRuleContext { + public DeclContext decl() { + return getRuleContext(DeclContext.class,0); + } + public StmtContext stmt() { + return getRuleContext(StmtContext.class,0); + } + public BlockItemContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_blockItem; } + } + + public final BlockItemContext blockItem() throws RecognitionException { + BlockItemContext _localctx = new BlockItemContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_blockItem); + try { + setState(138); + _errHandler.sync(this); + switch (_input.LA(1)) { + case CONST: + case INT: + case FLOAT: + enterOuterAlt(_localctx, 1); + { + setState(136); + decl(); + } + break; + case IF: + case WHILE: + case BREAK: + case CONTINUE: + case RETURN: + case ADD: + case SUB: + case NOT: + case LPAREN: + case LBRACE: + case SEMICOLON: + case ID: + case ILITERAL: + case FLITERAL: + case STRING: + enterOuterAlt(_localctx, 2); + { + setState(137); + stmt(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StmtContext extends ParserRuleContext { + public AssignStmtContext assignStmt() { + return getRuleContext(AssignStmtContext.class,0); + } + public ExpStmtContext expStmt() { + return getRuleContext(ExpStmtContext.class,0); + } + public IfStmtContext ifStmt() { + return getRuleContext(IfStmtContext.class,0); + } + public WhileStmtContext whileStmt() { + return getRuleContext(WhileStmtContext.class,0); + } + public BreakStmtContext breakStmt() { + return getRuleContext(BreakStmtContext.class,0); + } + public ContinueStmtContext continueStmt() { + return getRuleContext(ContinueStmtContext.class,0); + } + public ReturnStmtContext returnStmt() { + return getRuleContext(ReturnStmtContext.class,0); + } + public BlockStmtContext blockStmt() { + return getRuleContext(BlockStmtContext.class,0); + } + public EmptyStmtContext emptyStmt() { + return getRuleContext(EmptyStmtContext.class,0); + } + public StmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_stmt; } + } + + public final StmtContext stmt() throws RecognitionException { + StmtContext _localctx = new StmtContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_stmt); + try { + setState(149); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(140); + assignStmt(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(141); + expStmt(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(142); + ifStmt(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(143); + whileStmt(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(144); + breakStmt(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(145); + continueStmt(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(146); + returnStmt(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(147); + blockStmt(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(148); + emptyStmt(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class AssignStmtContext extends ParserRuleContext { + public LValueContext lValue() { + return getRuleContext(LValueContext.class,0); + } + public TerminalNode ASSIGN() { return getToken(SysYParser.ASSIGN, 0); } + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public AssignStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignStmt; } + } + + public final AssignStmtContext assignStmt() throws RecognitionException { + AssignStmtContext _localctx = new AssignStmtContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_assignStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(151); + lValue(); + setState(152); + match(ASSIGN); + setState(153); + exp(0); + setState(154); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpStmtContext extends ParserRuleContext { + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public ExpStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expStmt; } + } + + public final ExpStmtContext expStmt() throws RecognitionException { + ExpStmtContext _localctx = new ExpStmtContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_expStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(156); + exp(0); + setState(157); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IfStmtContext extends ParserRuleContext { + public TerminalNode IF() { return getToken(SysYParser.IF, 0); } + public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); } + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); } + public List stmt() { + return getRuleContexts(StmtContext.class); + } + public StmtContext stmt(int i) { + return getRuleContext(StmtContext.class,i); + } + public TerminalNode ELSE() { return getToken(SysYParser.ELSE, 0); } + public IfStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifStmt; } + } + + public final IfStmtContext ifStmt() throws RecognitionException { + IfStmtContext _localctx = new IfStmtContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_ifStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(159); + match(IF); + setState(160); + match(LPAREN); + setState(161); + exp(0); + setState(162); + match(RPAREN); + setState(163); + stmt(); + setState(166); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { + case 1: + { + setState(164); + match(ELSE); + setState(165); + stmt(); + } + break; + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class WhileStmtContext extends ParserRuleContext { + public TerminalNode WHILE() { return getToken(SysYParser.WHILE, 0); } + public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); } + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); } + public StmtContext stmt() { + return getRuleContext(StmtContext.class,0); + } + public WhileStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_whileStmt; } + } + + public final WhileStmtContext whileStmt() throws RecognitionException { + WhileStmtContext _localctx = new WhileStmtContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_whileStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(168); + match(WHILE); + setState(169); + match(LPAREN); + setState(170); + exp(0); + setState(171); + match(RPAREN); + setState(172); + stmt(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class BreakStmtContext extends ParserRuleContext { + public TerminalNode BREAK() { return getToken(SysYParser.BREAK, 0); } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public BreakStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_breakStmt; } + } + + public final BreakStmtContext breakStmt() throws RecognitionException { + BreakStmtContext _localctx = new BreakStmtContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_breakStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(174); + match(BREAK); + setState(175); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ContinueStmtContext extends ParserRuleContext { + public TerminalNode CONTINUE() { return getToken(SysYParser.CONTINUE, 0); } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public ContinueStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_continueStmt; } + } + + public final ContinueStmtContext continueStmt() throws RecognitionException { + ContinueStmtContext _localctx = new ContinueStmtContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_continueStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(177); + match(CONTINUE); + setState(178); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ReturnStmtContext extends ParserRuleContext { + public TerminalNode RETURN() { return getToken(SysYParser.RETURN, 0); } + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public ReturnStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_returnStmt; } + } + + public final ReturnStmtContext returnStmt() throws RecognitionException { + ReturnStmtContext _localctx = new ReturnStmtContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_returnStmt); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(180); + match(RETURN); + setState(182); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << SUB) | (1L << NOT) | (1L << LPAREN) | (1L << ID) | (1L << ILITERAL) | (1L << FLITERAL) | (1L << STRING))) != 0)) { + { + setState(181); + exp(0); + } + } + + setState(184); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class EmptyStmtContext extends ParserRuleContext { + public TerminalNode SEMICOLON() { return getToken(SysYParser.SEMICOLON, 0); } + public EmptyStmtContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_emptyStmt; } + } + + public final EmptyStmtContext emptyStmt() throws RecognitionException { + EmptyStmtContext _localctx = new EmptyStmtContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_emptyStmt); + try { + enterOuterAlt(_localctx, 1); + { + setState(186); + match(SEMICOLON); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class ExpContext extends ParserRuleContext { + public ExpContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_exp; } + + public ExpContext() { } + public void copyFrom(ExpContext ctx) { + super.copyFrom(ctx); + } + } + public static class RelationExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode LT() { return getToken(SysYParser.LT, 0); } + public TerminalNode GT() { return getToken(SysYParser.GT, 0); } + public TerminalNode LE() { return getToken(SysYParser.LE, 0); } + public TerminalNode GE() { return getToken(SysYParser.GE, 0); } + public RelationExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class MultiplicativeExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode MUL() { return getToken(SysYParser.MUL, 0); } + public TerminalNode DIV() { return getToken(SysYParser.DIV, 0); } + public TerminalNode MODULO() { return getToken(SysYParser.MODULO, 0); } + public MultiplicativeExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class LValueExpContext extends ExpContext { + public LValueContext lValue() { + return getRuleContext(LValueContext.class,0); + } + public LValueExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class NumberExpContext extends ExpContext { + public NumberContext number() { + return getRuleContext(NumberContext.class,0); + } + public NumberExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class AndExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode AND() { return getToken(SysYParser.AND, 0); } + public AndExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class UnaryExpContext extends ExpContext { + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode ADD() { return getToken(SysYParser.ADD, 0); } + public TerminalNode SUB() { return getToken(SysYParser.SUB, 0); } + public TerminalNode NOT() { return getToken(SysYParser.NOT, 0); } + public UnaryExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class ParenExpContext extends ExpContext { + public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); } + public ExpContext exp() { + return getRuleContext(ExpContext.class,0); + } + public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); } + public ParenExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class StringExpContext extends ExpContext { + public StringContext string() { + return getRuleContext(StringContext.class,0); + } + public StringExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class OrExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode OR() { return getToken(SysYParser.OR, 0); } + public OrExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class CallExpContext extends ExpContext { + public CallContext call() { + return getRuleContext(CallContext.class,0); + } + public CallExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class AdditiveExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode ADD() { return getToken(SysYParser.ADD, 0); } + public TerminalNode SUB() { return getToken(SysYParser.SUB, 0); } + public AdditiveExpContext(ExpContext ctx) { copyFrom(ctx); } + } + public static class EqualExpContext extends ExpContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public TerminalNode EQ() { return getToken(SysYParser.EQ, 0); } + public TerminalNode NE() { return getToken(SysYParser.NE, 0); } + public EqualExpContext(ExpContext ctx) { copyFrom(ctx); } + } + + public final ExpContext exp() throws RecognitionException { + return exp(0); + } + + private ExpContext exp(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + ExpContext _localctx = new ExpContext(_ctx, _parentState); + ExpContext _prevctx = _localctx; + int _startState = 40; + enterRecursionRule(_localctx, 40, RULE_exp, _p); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(199); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { + case 1: + { + _localctx = new ParenExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + + setState(189); + match(LPAREN); + setState(190); + exp(0); + setState(191); + match(RPAREN); + } + break; + case 2: + { + _localctx = new LValueExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(193); + lValue(); + } + break; + case 3: + { + _localctx = new NumberExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(194); + number(); + } + break; + case 4: + { + _localctx = new StringExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(195); + string(); + } + break; + case 5: + { + _localctx = new CallExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(196); + call(); + } + break; + case 6: + { + _localctx = new UnaryExpContext(_localctx); + _ctx = _localctx; + _prevctx = _localctx; + setState(197); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << SUB) | (1L << NOT))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(198); + exp(7); + } + break; + } + _ctx.stop = _input.LT(-1); + setState(221); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + setState(219); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { + case 1: + { + _localctx = new MultiplicativeExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(201); + if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); + setState(202); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MUL) | (1L << DIV) | (1L << MODULO))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(203); + exp(7); + } + break; + case 2: + { + _localctx = new AdditiveExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(204); + if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); + setState(205); + _la = _input.LA(1); + if ( !(_la==ADD || _la==SUB) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(206); + exp(6); + } + break; + case 3: + { + _localctx = new RelationExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(207); + if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); + setState(208); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LT) | (1L << GT) | (1L << LE) | (1L << GE))) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(209); + exp(5); + } + break; + case 4: + { + _localctx = new EqualExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(210); + if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); + setState(211); + _la = _input.LA(1); + if ( !(_la==EQ || _la==NE) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + setState(212); + exp(4); + } + break; + case 5: + { + _localctx = new AndExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(213); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(214); + match(AND); + setState(215); + exp(3); + } + break; + case 6: + { + _localctx = new OrExpContext(new ExpContext(_parentctx, _parentState)); + pushNewRecursionContext(_localctx, _startState, RULE_exp); + setState(216); + if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); + setState(217); + match(OR); + setState(218); + exp(2); + } + break; + } + } + } + setState(223); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + public static class CallContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(SysYParser.ID, 0); } + public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); } + public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); } + public FuncRParamsContext funcRParams() { + return getRuleContext(FuncRParamsContext.class,0); + } + public CallContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_call; } + } + + public final CallContext call() throws RecognitionException { + CallContext _localctx = new CallContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_call); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(224); + match(ID); + setState(225); + match(LPAREN); + setState(227); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << SUB) | (1L << NOT) | (1L << LPAREN) | (1L << ID) | (1L << ILITERAL) | (1L << FLITERAL) | (1L << STRING))) != 0)) { + { + setState(226); + funcRParams(); + } + } + + setState(229); + match(RPAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LValueContext extends ParserRuleContext { + public TerminalNode ID() { return getToken(SysYParser.ID, 0); } + public List LBRACKET() { return getTokens(SysYParser.LBRACKET); } + public TerminalNode LBRACKET(int i) { + return getToken(SysYParser.LBRACKET, i); + } + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public List RBRACKET() { return getTokens(SysYParser.RBRACKET); } + public TerminalNode RBRACKET(int i) { + return getToken(SysYParser.RBRACKET, i); + } + public LValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_lValue; } + } + + public final LValueContext lValue() throws RecognitionException { + LValueContext _localctx = new LValueContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_lValue); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(231); + match(ID); + setState(238); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(232); + match(LBRACKET); + setState(233); + exp(0); + setState(234); + match(RBRACKET); + } + } + } + setState(240); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class NumberContext extends ParserRuleContext { + public TerminalNode ILITERAL() { return getToken(SysYParser.ILITERAL, 0); } + public TerminalNode FLITERAL() { return getToken(SysYParser.FLITERAL, 0); } + public NumberContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_number; } + } + + public final NumberContext number() throws RecognitionException { + NumberContext _localctx = new NumberContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_number); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(241); + _la = _input.LA(1); + if ( !(_la==ILITERAL || _la==FLITERAL) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class StringContext extends ParserRuleContext { + public TerminalNode STRING() { return getToken(SysYParser.STRING, 0); } + public StringContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_string; } + } + + public final StringContext string() throws RecognitionException { + StringContext _localctx = new StringContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_string); + try { + enterOuterAlt(_localctx, 1); + { + setState(243); + match(STRING); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class FuncRParamsContext extends ParserRuleContext { + public List exp() { + return getRuleContexts(ExpContext.class); + } + public ExpContext exp(int i) { + return getRuleContext(ExpContext.class,i); + } + public List COMMA() { return getTokens(SysYParser.COMMA); } + public TerminalNode COMMA(int i) { + return getToken(SysYParser.COMMA, i); + } + public FuncRParamsContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_funcRParams; } + } + + public final FuncRParamsContext funcRParams() throws RecognitionException { + FuncRParamsContext _localctx = new FuncRParamsContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_funcRParams); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(245); + exp(0); + setState(250); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==COMMA) { + { + { + setState(246); + match(COMMA); + setState(247); + exp(0); + } + } + setState(252); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 20: + return exp_sempred((ExpContext)_localctx, predIndex); + } + return true; + } + private boolean exp_sempred(ExpContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return precpred(_ctx, 6); + case 1: + return precpred(_ctx, 5); + case 2: + return precpred(_ctx, 4); + case 3: + return precpred(_ctx, 3); + case 4: + return precpred(_ctx, 2); + case 5: + return precpred(_ctx, 1); + } + return true; + } + + public static final String _serializedATN = + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3*\u0100\4\2\t\2\4"+ + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\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\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\3\2\3\2\6\29\n\2\r\2\16\2:\3\3\5\3>\n\3\3\3\3\3\3"+ + "\3\3\3\7\3D\n\3\f\3\16\3G\13\3\3\3\3\3\3\4\3\4\3\5\3\5\3\5\5\5P\n\5\3"+ + "\6\3\6\3\6\3\6\3\6\7\6W\n\6\f\6\16\6Z\13\6\5\6\\\n\6\5\6^\n\6\3\7\3\7"+ + "\3\7\3\7\5\7d\n\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\t\7\tn\n\t\f\t\16\tq\13"+ + "\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\7\n{\n\n\f\n\16\n~\13\n\5\n\u0080\n"+ + "\n\3\13\3\13\7\13\u0084\n\13\f\13\16\13\u0087\13\13\3\13\3\13\3\f\3\f"+ + "\5\f\u008d\n\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u0098\n\r\3\16"+ + "\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ + "\5\20\u00a9\n\20\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\23\3\23"+ + "\3\23\3\24\3\24\5\24\u00b9\n\24\3\24\3\24\3\25\3\25\3\26\3\26\3\26\3\26"+ + "\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00ca\n\26\3\26\3\26\3\26\3\26"+ + "\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26"+ + "\7\26\u00de\n\26\f\26\16\26\u00e1\13\26\3\27\3\27\3\27\5\27\u00e6\n\27"+ + "\3\27\3\27\3\30\3\30\3\30\3\30\3\30\7\30\u00ef\n\30\f\30\16\30\u00f2\13"+ + "\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\7\33\u00fb\n\33\f\33\16\33\u00fe"+ + "\13\33\3\33\2\3*\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60"+ + "\62\64\2\n\3\2\4\5\3\2\4\6\4\2\16\17\33\33\3\2\20\22\3\2\16\17\3\2\23"+ + "\26\3\2\27\30\3\2%&\2\u010b\28\3\2\2\2\4=\3\2\2\2\6J\3\2\2\2\bL\3\2\2"+ + "\2\n]\3\2\2\2\f_\3\2\2\2\16h\3\2\2\2\20j\3\2\2\2\22r\3\2\2\2\24\u0081"+ + "\3\2\2\2\26\u008c\3\2\2\2\30\u0097\3\2\2\2\32\u0099\3\2\2\2\34\u009e\3"+ + "\2\2\2\36\u00a1\3\2\2\2 \u00aa\3\2\2\2\"\u00b0\3\2\2\2$\u00b3\3\2\2\2"+ + "&\u00b6\3\2\2\2(\u00bc\3\2\2\2*\u00c9\3\2\2\2,\u00e2\3\2\2\2.\u00e9\3"+ + "\2\2\2\60\u00f3\3\2\2\2\62\u00f5\3\2\2\2\64\u00f7\3\2\2\2\669\5\4\3\2"+ + "\679\5\f\7\28\66\3\2\2\28\67\3\2\2\29:\3\2\2\2:8\3\2\2\2:;\3\2\2\2;\3"+ + "\3\2\2\2<>\7\3\2\2=<\3\2\2\2=>\3\2\2\2>?\3\2\2\2?@\5\6\4\2@E\5\b\5\2A"+ + "B\7\"\2\2BD\5\b\5\2CA\3\2\2\2DG\3\2\2\2EC\3\2\2\2EF\3\2\2\2FH\3\2\2\2"+ + "GE\3\2\2\2HI\7#\2\2I\5\3\2\2\2JK\t\2\2\2K\7\3\2\2\2LO\5.\30\2MN\7\r\2"+ + "\2NP\5\n\6\2OM\3\2\2\2OP\3\2\2\2P\t\3\2\2\2Q^\5*\26\2R[\7 \2\2SX\5\n\6"+ + "\2TU\7\"\2\2UW\5\n\6\2VT\3\2\2\2WZ\3\2\2\2XV\3\2\2\2XY\3\2\2\2Y\\\3\2"+ + "\2\2ZX\3\2\2\2[S\3\2\2\2[\\\3\2\2\2\\^\3\2\2\2]Q\3\2\2\2]R\3\2\2\2^\13"+ + "\3\2\2\2_`\5\16\b\2`a\7$\2\2ac\7\34\2\2bd\5\20\t\2cb\3\2\2\2cd\3\2\2\2"+ + "de\3\2\2\2ef\7\35\2\2fg\5\24\13\2g\r\3\2\2\2hi\t\3\2\2i\17\3\2\2\2jo\5"+ + "\22\n\2kl\7\"\2\2ln\5\22\n\2mk\3\2\2\2nq\3\2\2\2om\3\2\2\2op\3\2\2\2p"+ + "\21\3\2\2\2qo\3\2\2\2rs\5\6\4\2s\177\7$\2\2tu\7\36\2\2u|\7\37\2\2vw\7"+ + "\36\2\2wx\5*\26\2xy\7\37\2\2y{\3\2\2\2zv\3\2\2\2{~\3\2\2\2|z\3\2\2\2|"+ + "}\3\2\2\2}\u0080\3\2\2\2~|\3\2\2\2\177t\3\2\2\2\177\u0080\3\2\2\2\u0080"+ + "\23\3\2\2\2\u0081\u0085\7 \2\2\u0082\u0084\5\26\f\2\u0083\u0082\3\2\2"+ + "\2\u0084\u0087\3\2\2\2\u0085\u0083\3\2\2\2\u0085\u0086\3\2\2\2\u0086\u0088"+ + "\3\2\2\2\u0087\u0085\3\2\2\2\u0088\u0089\7!\2\2\u0089\25\3\2\2\2\u008a"+ + "\u008d\5\4\3\2\u008b\u008d\5\30\r\2\u008c\u008a\3\2\2\2\u008c\u008b\3"+ + "\2\2\2\u008d\27\3\2\2\2\u008e\u0098\5\32\16\2\u008f\u0098\5\34\17\2\u0090"+ + "\u0098\5\36\20\2\u0091\u0098\5 \21\2\u0092\u0098\5\"\22\2\u0093\u0098"+ + "\5$\23\2\u0094\u0098\5&\24\2\u0095\u0098\5\24\13\2\u0096\u0098\5(\25\2"+ + "\u0097\u008e\3\2\2\2\u0097\u008f\3\2\2\2\u0097\u0090\3\2\2\2\u0097\u0091"+ + "\3\2\2\2\u0097\u0092\3\2\2\2\u0097\u0093\3\2\2\2\u0097\u0094\3\2\2\2\u0097"+ + "\u0095\3\2\2\2\u0097\u0096\3\2\2\2\u0098\31\3\2\2\2\u0099\u009a\5.\30"+ + "\2\u009a\u009b\7\r\2\2\u009b\u009c\5*\26\2\u009c\u009d\7#\2\2\u009d\33"+ + "\3\2\2\2\u009e\u009f\5*\26\2\u009f\u00a0\7#\2\2\u00a0\35\3\2\2\2\u00a1"+ + "\u00a2\7\7\2\2\u00a2\u00a3\7\34\2\2\u00a3\u00a4\5*\26\2\u00a4\u00a5\7"+ + "\35\2\2\u00a5\u00a8\5\30\r\2\u00a6\u00a7\7\b\2\2\u00a7\u00a9\5\30\r\2"+ + "\u00a8\u00a6\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\37\3\2\2\2\u00aa\u00ab"+ + "\7\t\2\2\u00ab\u00ac\7\34\2\2\u00ac\u00ad\5*\26\2\u00ad\u00ae\7\35\2\2"+ + "\u00ae\u00af\5\30\r\2\u00af!\3\2\2\2\u00b0\u00b1\7\n\2\2\u00b1\u00b2\7"+ + "#\2\2\u00b2#\3\2\2\2\u00b3\u00b4\7\13\2\2\u00b4\u00b5\7#\2\2\u00b5%\3"+ + "\2\2\2\u00b6\u00b8\7\f\2\2\u00b7\u00b9\5*\26\2\u00b8\u00b7\3\2\2\2\u00b8"+ + "\u00b9\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bb\7#\2\2\u00bb\'\3\2\2\2"+ + "\u00bc\u00bd\7#\2\2\u00bd)\3\2\2\2\u00be\u00bf\b\26\1\2\u00bf\u00c0\7"+ + "\34\2\2\u00c0\u00c1\5*\26\2\u00c1\u00c2\7\35\2\2\u00c2\u00ca\3\2\2\2\u00c3"+ + "\u00ca\5.\30\2\u00c4\u00ca\5\60\31\2\u00c5\u00ca\5\62\32\2\u00c6\u00ca"+ + "\5,\27\2\u00c7\u00c8\t\4\2\2\u00c8\u00ca\5*\26\t\u00c9\u00be\3\2\2\2\u00c9"+ + "\u00c3\3\2\2\2\u00c9\u00c4\3\2\2\2\u00c9\u00c5\3\2\2\2\u00c9\u00c6\3\2"+ + "\2\2\u00c9\u00c7\3\2\2\2\u00ca\u00df\3\2\2\2\u00cb\u00cc\f\b\2\2\u00cc"+ + "\u00cd\t\5\2\2\u00cd\u00de\5*\26\t\u00ce\u00cf\f\7\2\2\u00cf\u00d0\t\6"+ + "\2\2\u00d0\u00de\5*\26\b\u00d1\u00d2\f\6\2\2\u00d2\u00d3\t\7\2\2\u00d3"+ + "\u00de\5*\26\7\u00d4\u00d5\f\5\2\2\u00d5\u00d6\t\b\2\2\u00d6\u00de\5*"+ + "\26\6\u00d7\u00d8\f\4\2\2\u00d8\u00d9\7\31\2\2\u00d9\u00de\5*\26\5\u00da"+ + "\u00db\f\3\2\2\u00db\u00dc\7\32\2\2\u00dc\u00de\5*\26\4\u00dd\u00cb\3"+ + "\2\2\2\u00dd\u00ce\3\2\2\2\u00dd\u00d1\3\2\2\2\u00dd\u00d4\3\2\2\2\u00dd"+ + "\u00d7\3\2\2\2\u00dd\u00da\3\2\2\2\u00de\u00e1\3\2\2\2\u00df\u00dd\3\2"+ + "\2\2\u00df\u00e0\3\2\2\2\u00e0+\3\2\2\2\u00e1\u00df\3\2\2\2\u00e2\u00e3"+ + "\7$\2\2\u00e3\u00e5\7\34\2\2\u00e4\u00e6\5\64\33\2\u00e5\u00e4\3\2\2\2"+ + "\u00e5\u00e6\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e8\7\35\2\2\u00e8-\3"+ + "\2\2\2\u00e9\u00f0\7$\2\2\u00ea\u00eb\7\36\2\2\u00eb\u00ec\5*\26\2\u00ec"+ + "\u00ed\7\37\2\2\u00ed\u00ef\3\2\2\2\u00ee\u00ea\3\2\2\2\u00ef\u00f2\3"+ + "\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1/\3\2\2\2\u00f2\u00f0"+ + "\3\2\2\2\u00f3\u00f4\t\t\2\2\u00f4\61\3\2\2\2\u00f5\u00f6\7\'\2\2\u00f6"+ + "\63\3\2\2\2\u00f7\u00fc\5*\26\2\u00f8\u00f9\7\"\2\2\u00f9\u00fb\5*\26"+ + "\2\u00fa\u00f8\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd"+ + "\3\2\2\2\u00fd\65\3\2\2\2\u00fe\u00fc\3\2\2\2\318:=EOX[]co|\177\u0085"+ + "\u008c\u0097\u00a8\u00b8\u00c9\u00dd\u00df\u00e5\u00f0\u00fc"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file