From c87597060ad84c20d3c7a4923d893dca64021666 Mon Sep 17 00:00:00 2001 From: wangziwenhk Date: Fri, 4 Oct 2024 17:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RiddleLexer.g4 | 1 + RiddleParser.g4 | 1 + parser/RiddleLexer.cpp | 273 ++++++------ parser/RiddleLexer.h | 20 +- parser/RiddleLexer.interp | 5 +- parser/RiddleLexer.tokens | 148 +++---- parser/RiddleParser.cpp | 676 +++++++++++++++-------------- parser/RiddleParser.h | 31 +- parser/RiddleParser.interp | 4 +- parser/RiddleParser.tokens | 148 +++---- parser/RiddleParserBaseListener.h | 3 + parser/RiddleParserBaseVisitor.h | 4 + parser/RiddleParserListener.h | 3 + parser/RiddleParserVisitor.h | 2 + src/Tools/Managers/StmtManager.ixx | 21 +- src/Types/Statements.ixx | 17 +- src/Visitors/StmtVisitor.cpp | 33 +- src/Visitors/StmtVisitor.h | 17 +- 18 files changed, 771 insertions(+), 636 deletions(-) diff --git a/RiddleLexer.g4 b/RiddleLexer.g4 index 7b0b6b4..e1344cb 100644 --- a/RiddleLexer.g4 +++ b/RiddleLexer.g4 @@ -19,6 +19,7 @@ True:'true'; False:'false'; Static:'static'; Const:'const'; +Null:'null'; //可见字符 //基本运算符 LeftBracket: '('; diff --git a/RiddleParser.g4 b/RiddleParser.g4 index c860737..fee3074 100644 --- a/RiddleParser.g4 +++ b/RiddleParser.g4 @@ -147,6 +147,7 @@ expression | string #stringExpr | number #numberExpr | boolean #booleanExpr + | Null #nullExpr ; id: Identifier; diff --git a/parser/RiddleLexer.cpp b/parser/RiddleLexer.cpp index 0dd5e06..29afebb 100644 --- a/parser/RiddleLexer.cpp +++ b/parser/RiddleLexer.cpp @@ -59,7 +59,7 @@ void riddlelexerLexerInitialize() { std::vector{ "Var", "Val", "For", "While", "If", "Else", "Func", "Return", "Import", "Package", "Class", "Public", "Protected", "Private", "Override", - "True", "False", "Static", "Const", "LeftBracket", "RightBracket", + "True", "False", "Static", "Const", "Null", "LeftBracket", "RightBracket", "LeftSquare", "RightSquare", "LeftCurly", "RightCurly", "Colon", "Semi", "Comma", "Equal", "Assign", "Greater", "Less", "LeftLeft", "RightRight", "RightRightRight", "Add", "Sub", "Star", "Div", "Mod", "Not", "And", @@ -78,14 +78,15 @@ void riddlelexerLexerInitialize() { "", "'var'", "'val'", "'for'", "'while'", "'if'", "'else'", "'fun'", "'return'", "'import'", "'package'", "'class'", "'public'", "'protected'", "'Private'", "'override'", "'true'", "'false'", "'static'", "'const'", - "'('", "')'", "'['", "']'", "'{'", "'}'", "':'", "';'", "','", "'=='", - "'='", "'>'", "'<'", "'<<'", "'>>'", "'>>>'", "'+'", "'-'", "'*'", - "'/'", "'%'", "'!'", "'&'", "'|'", "'^'", "'.'", "'\"'", "'''", "'\\n'" + "'null'", "'('", "')'", "'['", "']'", "'{'", "'}'", "':'", "';'", + "','", "'=='", "'='", "'>'", "'<'", "'<<'", "'>>'", "'>>>'", "'+'", + "'-'", "'*'", "'/'", "'%'", "'!'", "'&'", "'|'", "'^'", "'.'", "'\"'", + "'''", "'\\n'" }, std::vector{ "", "Var", "Val", "For", "While", "If", "Else", "Func", "Return", "Import", "Package", "Class", "Public", "Protected", "Private", "Override", - "True", "False", "Static", "Const", "LeftBracket", "RightBracket", + "True", "False", "Static", "Const", "Null", "LeftBracket", "RightBracket", "LeftSquare", "RightSquare", "LeftCurly", "RightCurly", "Colon", "Semi", "Comma", "Equal", "Assign", "Greater", "Less", "LeftLeft", "RightRight", "RightRightRight", "Add", "Sub", "Star", "Div", "Mod", "Not", "And", @@ -96,7 +97,7 @@ void riddlelexerLexerInitialize() { } ); static const int32_t serializedATNSegment[] = { - 4,0,63,416,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,0,64,423,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14, 7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21, 7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28, @@ -105,135 +106,137 @@ void riddlelexerLexerInitialize() { 7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49, 7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56, 7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63, - 7,63,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3, - 1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1, - 7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9, - 1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,11,1,11, - 1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13, - 1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,15, - 1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17, - 1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,20,1,20,1,21, - 1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,25,1,25,1,26,1,26,1,27,1,27,1,28, - 1,28,1,28,1,29,1,29,1,30,1,30,1,31,1,31,1,32,1,32,1,32,1,33,1,33,1,33, - 1,34,1,34,1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37,1,38,1,38,1,39,1,39, - 1,40,1,40,1,41,1,41,1,42,1,42,1,43,1,43,1,44,1,44,1,45,1,45,1,46,1,46, - 1,47,1,47,1,48,1,48,5,48,311,8,48,10,48,12,48,314,9,48,1,49,1,49,1,49, - 1,49,1,49,5,49,321,8,49,10,49,12,49,324,9,49,1,50,1,50,1,50,5,50,329, - 8,50,10,50,12,50,332,9,50,3,50,334,8,50,1,51,1,51,1,51,5,51,339,8,51, - 10,51,12,51,342,9,51,1,52,1,52,1,52,1,52,1,52,5,52,349,8,52,10,52,12, - 52,352,9,52,1,53,1,53,1,53,1,53,1,54,4,54,359,8,54,11,54,12,54,360,1, - 55,1,55,1,56,1,56,1,57,1,57,1,58,1,58,1,59,1,59,1,59,5,59,374,8,59,10, - 59,12,59,377,9,59,1,59,1,59,1,60,1,60,3,60,383,8,60,1,61,1,61,1,61,1, - 61,5,61,389,8,61,10,61,12,61,392,9,61,1,61,1,61,1,62,1,62,1,62,1,62,5, - 62,400,8,62,10,62,12,62,403,9,62,1,62,1,62,1,62,1,62,1,62,1,63,4,63,411, - 8,63,11,63,12,63,412,1,63,1,63,1,401,0,64,1,1,3,2,5,3,7,4,9,5,11,6,13, - 7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37, - 19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30, - 61,31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83, - 42,85,43,87,44,89,45,91,46,93,47,95,48,97,49,99,50,101,51,103,52,105, - 53,107,54,109,55,111,56,113,57,115,58,117,59,119,60,121,0,123,61,125, - 62,127,63,1,0,13,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122, - 2,0,49,57,65,70,1,0,49,57,1,0,49,55,2,0,48,57,65,70,1,0,48,55,1,0,48, - 49,1,0,48,57,4,0,10,10,13,13,34,34,92,92,5,0,34,34,47,47,65,90,92,92, - 97,122,2,0,10,10,13,13,3,0,9,10,13,13,32,32,426,0,1,1,0,0,0,0,3,1,0,0, - 0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15, - 1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0, - 0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0, - 0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47, - 1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0, - 0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0, - 0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79, - 1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0, - 0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0, - 0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0, - 0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1,0,0,0, - 0,123,1,0,0,0,0,125,1,0,0,0,0,127,1,0,0,0,1,129,1,0,0,0,3,133,1,0,0,0, - 5,137,1,0,0,0,7,141,1,0,0,0,9,147,1,0,0,0,11,150,1,0,0,0,13,155,1,0,0, - 0,15,159,1,0,0,0,17,166,1,0,0,0,19,173,1,0,0,0,21,181,1,0,0,0,23,187, - 1,0,0,0,25,194,1,0,0,0,27,204,1,0,0,0,29,212,1,0,0,0,31,221,1,0,0,0,33, - 226,1,0,0,0,35,232,1,0,0,0,37,239,1,0,0,0,39,245,1,0,0,0,41,247,1,0,0, - 0,43,249,1,0,0,0,45,251,1,0,0,0,47,253,1,0,0,0,49,255,1,0,0,0,51,257, - 1,0,0,0,53,259,1,0,0,0,55,261,1,0,0,0,57,263,1,0,0,0,59,266,1,0,0,0,61, - 268,1,0,0,0,63,270,1,0,0,0,65,272,1,0,0,0,67,275,1,0,0,0,69,278,1,0,0, - 0,71,282,1,0,0,0,73,284,1,0,0,0,75,286,1,0,0,0,77,288,1,0,0,0,79,290, - 1,0,0,0,81,292,1,0,0,0,83,294,1,0,0,0,85,296,1,0,0,0,87,298,1,0,0,0,89, - 300,1,0,0,0,91,302,1,0,0,0,93,304,1,0,0,0,95,306,1,0,0,0,97,308,1,0,0, - 0,99,315,1,0,0,0,101,333,1,0,0,0,103,335,1,0,0,0,105,343,1,0,0,0,107, - 353,1,0,0,0,109,358,1,0,0,0,111,362,1,0,0,0,113,364,1,0,0,0,115,366,1, - 0,0,0,117,368,1,0,0,0,119,370,1,0,0,0,121,380,1,0,0,0,123,384,1,0,0,0, - 125,395,1,0,0,0,127,410,1,0,0,0,129,130,5,118,0,0,130,131,5,97,0,0,131, - 132,5,114,0,0,132,2,1,0,0,0,133,134,5,118,0,0,134,135,5,97,0,0,135,136, - 5,108,0,0,136,4,1,0,0,0,137,138,5,102,0,0,138,139,5,111,0,0,139,140,5, - 114,0,0,140,6,1,0,0,0,141,142,5,119,0,0,142,143,5,104,0,0,143,144,5,105, - 0,0,144,145,5,108,0,0,145,146,5,101,0,0,146,8,1,0,0,0,147,148,5,105,0, - 0,148,149,5,102,0,0,149,10,1,0,0,0,150,151,5,101,0,0,151,152,5,108,0, - 0,152,153,5,115,0,0,153,154,5,101,0,0,154,12,1,0,0,0,155,156,5,102,0, - 0,156,157,5,117,0,0,157,158,5,110,0,0,158,14,1,0,0,0,159,160,5,114,0, - 0,160,161,5,101,0,0,161,162,5,116,0,0,162,163,5,117,0,0,163,164,5,114, - 0,0,164,165,5,110,0,0,165,16,1,0,0,0,166,167,5,105,0,0,167,168,5,109, - 0,0,168,169,5,112,0,0,169,170,5,111,0,0,170,171,5,114,0,0,171,172,5,116, - 0,0,172,18,1,0,0,0,173,174,5,112,0,0,174,175,5,97,0,0,175,176,5,99,0, - 0,176,177,5,107,0,0,177,178,5,97,0,0,178,179,5,103,0,0,179,180,5,101, - 0,0,180,20,1,0,0,0,181,182,5,99,0,0,182,183,5,108,0,0,183,184,5,97,0, - 0,184,185,5,115,0,0,185,186,5,115,0,0,186,22,1,0,0,0,187,188,5,112,0, - 0,188,189,5,117,0,0,189,190,5,98,0,0,190,191,5,108,0,0,191,192,5,105, - 0,0,192,193,5,99,0,0,193,24,1,0,0,0,194,195,5,112,0,0,195,196,5,114,0, - 0,196,197,5,111,0,0,197,198,5,116,0,0,198,199,5,101,0,0,199,200,5,99, - 0,0,200,201,5,116,0,0,201,202,5,101,0,0,202,203,5,100,0,0,203,26,1,0, - 0,0,204,205,5,80,0,0,205,206,5,114,0,0,206,207,5,105,0,0,207,208,5,118, - 0,0,208,209,5,97,0,0,209,210,5,116,0,0,210,211,5,101,0,0,211,28,1,0,0, - 0,212,213,5,111,0,0,213,214,5,118,0,0,214,215,5,101,0,0,215,216,5,114, - 0,0,216,217,5,114,0,0,217,218,5,105,0,0,218,219,5,100,0,0,219,220,5,101, - 0,0,220,30,1,0,0,0,221,222,5,116,0,0,222,223,5,114,0,0,223,224,5,117, - 0,0,224,225,5,101,0,0,225,32,1,0,0,0,226,227,5,102,0,0,227,228,5,97,0, - 0,228,229,5,108,0,0,229,230,5,115,0,0,230,231,5,101,0,0,231,34,1,0,0, - 0,232,233,5,115,0,0,233,234,5,116,0,0,234,235,5,97,0,0,235,236,5,116, - 0,0,236,237,5,105,0,0,237,238,5,99,0,0,238,36,1,0,0,0,239,240,5,99,0, - 0,240,241,5,111,0,0,241,242,5,110,0,0,242,243,5,115,0,0,243,244,5,116, - 0,0,244,38,1,0,0,0,245,246,5,40,0,0,246,40,1,0,0,0,247,248,5,41,0,0,248, - 42,1,0,0,0,249,250,5,91,0,0,250,44,1,0,0,0,251,252,5,93,0,0,252,46,1, - 0,0,0,253,254,5,123,0,0,254,48,1,0,0,0,255,256,5,125,0,0,256,50,1,0,0, - 0,257,258,5,58,0,0,258,52,1,0,0,0,259,260,5,59,0,0,260,54,1,0,0,0,261, - 262,5,44,0,0,262,56,1,0,0,0,263,264,5,61,0,0,264,265,5,61,0,0,265,58, - 1,0,0,0,266,267,5,61,0,0,267,60,1,0,0,0,268,269,5,62,0,0,269,62,1,0,0, - 0,270,271,5,60,0,0,271,64,1,0,0,0,272,273,5,60,0,0,273,274,5,60,0,0,274, - 66,1,0,0,0,275,276,5,62,0,0,276,277,5,62,0,0,277,68,1,0,0,0,278,279,5, - 62,0,0,279,280,5,62,0,0,280,281,5,62,0,0,281,70,1,0,0,0,282,283,5,43, - 0,0,283,72,1,0,0,0,284,285,5,45,0,0,285,74,1,0,0,0,286,287,5,42,0,0,287, - 76,1,0,0,0,288,289,5,47,0,0,289,78,1,0,0,0,290,291,5,37,0,0,291,80,1, - 0,0,0,292,293,5,33,0,0,293,82,1,0,0,0,294,295,5,38,0,0,295,84,1,0,0,0, - 296,297,5,124,0,0,297,86,1,0,0,0,298,299,5,94,0,0,299,88,1,0,0,0,300, - 301,5,46,0,0,301,90,1,0,0,0,302,303,5,34,0,0,303,92,1,0,0,0,304,305,5, - 39,0,0,305,94,1,0,0,0,306,307,5,10,0,0,307,96,1,0,0,0,308,312,7,0,0,0, - 309,311,7,1,0,0,310,309,1,0,0,0,311,314,1,0,0,0,312,310,1,0,0,0,312,313, - 1,0,0,0,313,98,1,0,0,0,314,312,1,0,0,0,315,316,5,48,0,0,316,317,5,120, - 0,0,317,318,1,0,0,0,318,322,7,2,0,0,319,321,3,111,55,0,320,319,1,0,0, - 0,321,324,1,0,0,0,322,320,1,0,0,0,322,323,1,0,0,0,323,100,1,0,0,0,324, - 322,1,0,0,0,325,334,5,48,0,0,326,330,7,3,0,0,327,329,3,117,58,0,328,327, - 1,0,0,0,329,332,1,0,0,0,330,328,1,0,0,0,330,331,1,0,0,0,331,334,1,0,0, - 0,332,330,1,0,0,0,333,325,1,0,0,0,333,326,1,0,0,0,334,102,1,0,0,0,335, - 336,5,48,0,0,336,340,7,4,0,0,337,339,3,113,56,0,338,337,1,0,0,0,339,342, - 1,0,0,0,340,338,1,0,0,0,340,341,1,0,0,0,341,104,1,0,0,0,342,340,1,0,0, - 0,343,344,5,48,0,0,344,345,5,98,0,0,345,346,1,0,0,0,346,350,5,49,0,0, - 347,349,3,115,57,0,348,347,1,0,0,0,349,352,1,0,0,0,350,348,1,0,0,0,350, - 351,1,0,0,0,351,106,1,0,0,0,352,350,1,0,0,0,353,354,3,101,50,0,354,355, - 3,89,44,0,355,356,3,109,54,0,356,108,1,0,0,0,357,359,3,117,58,0,358,357, - 1,0,0,0,359,360,1,0,0,0,360,358,1,0,0,0,360,361,1,0,0,0,361,110,1,0,0, - 0,362,363,7,5,0,0,363,112,1,0,0,0,364,365,7,6,0,0,365,114,1,0,0,0,366, - 367,7,7,0,0,367,116,1,0,0,0,368,369,7,8,0,0,369,118,1,0,0,0,370,375,5, - 34,0,0,371,374,3,121,60,0,372,374,8,9,0,0,373,371,1,0,0,0,373,372,1,0, - 0,0,374,377,1,0,0,0,375,373,1,0,0,0,375,376,1,0,0,0,376,378,1,0,0,0,377, - 375,1,0,0,0,378,379,5,34,0,0,379,120,1,0,0,0,380,382,5,92,0,0,381,383, - 7,10,0,0,382,381,1,0,0,0,383,122,1,0,0,0,384,385,5,47,0,0,385,386,5,47, - 0,0,386,390,1,0,0,0,387,389,8,11,0,0,388,387,1,0,0,0,389,392,1,0,0,0, - 390,388,1,0,0,0,390,391,1,0,0,0,391,393,1,0,0,0,392,390,1,0,0,0,393,394, - 6,61,0,0,394,124,1,0,0,0,395,396,5,47,0,0,396,397,5,42,0,0,397,401,1, - 0,0,0,398,400,9,0,0,0,399,398,1,0,0,0,400,403,1,0,0,0,401,402,1,0,0,0, - 401,399,1,0,0,0,402,404,1,0,0,0,403,401,1,0,0,0,404,405,5,42,0,0,405, - 406,5,47,0,0,406,407,1,0,0,0,407,408,6,62,0,0,408,126,1,0,0,0,409,411, - 7,12,0,0,410,409,1,0,0,0,411,412,1,0,0,0,412,410,1,0,0,0,412,413,1,0, - 0,0,413,414,1,0,0,0,414,415,6,63,0,0,415,128,1,0,0,0,14,0,312,322,330, - 333,340,350,360,373,375,382,390,401,412,1,6,0,0 + 7,63,2,64,7,64,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1, + 3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7, + 1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1, + 9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11, + 1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13, + 1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,14, + 1,14,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17, + 1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19, + 1,19,1,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,25,1,25, + 1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,29,1,30,1,30,1,31,1,31,1,32, + 1,32,1,33,1,33,1,33,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,37, + 1,37,1,38,1,38,1,39,1,39,1,40,1,40,1,41,1,41,1,42,1,42,1,43,1,43,1,44, + 1,44,1,45,1,45,1,46,1,46,1,47,1,47,1,48,1,48,1,49,1,49,5,49,318,8,49, + 10,49,12,49,321,9,49,1,50,1,50,1,50,1,50,1,50,5,50,328,8,50,10,50,12, + 50,331,9,50,1,51,1,51,1,51,5,51,336,8,51,10,51,12,51,339,9,51,3,51,341, + 8,51,1,52,1,52,1,52,5,52,346,8,52,10,52,12,52,349,9,52,1,53,1,53,1,53, + 1,53,1,53,5,53,356,8,53,10,53,12,53,359,9,53,1,54,1,54,1,54,1,54,1,55, + 4,55,366,8,55,11,55,12,55,367,1,56,1,56,1,57,1,57,1,58,1,58,1,59,1,59, + 1,60,1,60,1,60,5,60,381,8,60,10,60,12,60,384,9,60,1,60,1,60,1,61,1,61, + 3,61,390,8,61,1,62,1,62,1,62,1,62,5,62,396,8,62,10,62,12,62,399,9,62, + 1,62,1,62,1,63,1,63,1,63,1,63,5,63,407,8,63,10,63,12,63,410,9,63,1,63, + 1,63,1,63,1,63,1,63,1,64,4,64,418,8,64,11,64,12,64,419,1,64,1,64,1,408, + 0,65,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13, + 27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49, + 25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36, + 73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,44,89,45,91,46,93,47,95, + 48,97,49,99,50,101,51,103,52,105,53,107,54,109,55,111,56,113,57,115,58, + 117,59,119,60,121,61,123,0,125,62,127,63,129,64,1,0,13,3,0,65,90,95,95, + 97,122,4,0,48,57,65,90,95,95,97,122,2,0,49,57,65,70,1,0,49,57,1,0,49, + 55,2,0,48,57,65,70,1,0,48,55,1,0,48,49,1,0,48,57,4,0,10,10,13,13,34,34, + 92,92,5,0,34,34,47,47,65,90,92,92,97,122,2,0,10,10,13,13,3,0,9,10,13, + 13,32,32,433,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0, + 0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0, + 0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31, + 1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0, + 0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0, + 0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63, + 1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0, + 0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0, + 0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95, + 1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1, + 0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1, + 0,0,0,0,117,1,0,0,0,0,119,1,0,0,0,0,121,1,0,0,0,0,125,1,0,0,0,0,127,1, + 0,0,0,0,129,1,0,0,0,1,131,1,0,0,0,3,135,1,0,0,0,5,139,1,0,0,0,7,143,1, + 0,0,0,9,149,1,0,0,0,11,152,1,0,0,0,13,157,1,0,0,0,15,161,1,0,0,0,17,168, + 1,0,0,0,19,175,1,0,0,0,21,183,1,0,0,0,23,189,1,0,0,0,25,196,1,0,0,0,27, + 206,1,0,0,0,29,214,1,0,0,0,31,223,1,0,0,0,33,228,1,0,0,0,35,234,1,0,0, + 0,37,241,1,0,0,0,39,247,1,0,0,0,41,252,1,0,0,0,43,254,1,0,0,0,45,256, + 1,0,0,0,47,258,1,0,0,0,49,260,1,0,0,0,51,262,1,0,0,0,53,264,1,0,0,0,55, + 266,1,0,0,0,57,268,1,0,0,0,59,270,1,0,0,0,61,273,1,0,0,0,63,275,1,0,0, + 0,65,277,1,0,0,0,67,279,1,0,0,0,69,282,1,0,0,0,71,285,1,0,0,0,73,289, + 1,0,0,0,75,291,1,0,0,0,77,293,1,0,0,0,79,295,1,0,0,0,81,297,1,0,0,0,83, + 299,1,0,0,0,85,301,1,0,0,0,87,303,1,0,0,0,89,305,1,0,0,0,91,307,1,0,0, + 0,93,309,1,0,0,0,95,311,1,0,0,0,97,313,1,0,0,0,99,315,1,0,0,0,101,322, + 1,0,0,0,103,340,1,0,0,0,105,342,1,0,0,0,107,350,1,0,0,0,109,360,1,0,0, + 0,111,365,1,0,0,0,113,369,1,0,0,0,115,371,1,0,0,0,117,373,1,0,0,0,119, + 375,1,0,0,0,121,377,1,0,0,0,123,387,1,0,0,0,125,391,1,0,0,0,127,402,1, + 0,0,0,129,417,1,0,0,0,131,132,5,118,0,0,132,133,5,97,0,0,133,134,5,114, + 0,0,134,2,1,0,0,0,135,136,5,118,0,0,136,137,5,97,0,0,137,138,5,108,0, + 0,138,4,1,0,0,0,139,140,5,102,0,0,140,141,5,111,0,0,141,142,5,114,0,0, + 142,6,1,0,0,0,143,144,5,119,0,0,144,145,5,104,0,0,145,146,5,105,0,0,146, + 147,5,108,0,0,147,148,5,101,0,0,148,8,1,0,0,0,149,150,5,105,0,0,150,151, + 5,102,0,0,151,10,1,0,0,0,152,153,5,101,0,0,153,154,5,108,0,0,154,155, + 5,115,0,0,155,156,5,101,0,0,156,12,1,0,0,0,157,158,5,102,0,0,158,159, + 5,117,0,0,159,160,5,110,0,0,160,14,1,0,0,0,161,162,5,114,0,0,162,163, + 5,101,0,0,163,164,5,116,0,0,164,165,5,117,0,0,165,166,5,114,0,0,166,167, + 5,110,0,0,167,16,1,0,0,0,168,169,5,105,0,0,169,170,5,109,0,0,170,171, + 5,112,0,0,171,172,5,111,0,0,172,173,5,114,0,0,173,174,5,116,0,0,174,18, + 1,0,0,0,175,176,5,112,0,0,176,177,5,97,0,0,177,178,5,99,0,0,178,179,5, + 107,0,0,179,180,5,97,0,0,180,181,5,103,0,0,181,182,5,101,0,0,182,20,1, + 0,0,0,183,184,5,99,0,0,184,185,5,108,0,0,185,186,5,97,0,0,186,187,5,115, + 0,0,187,188,5,115,0,0,188,22,1,0,0,0,189,190,5,112,0,0,190,191,5,117, + 0,0,191,192,5,98,0,0,192,193,5,108,0,0,193,194,5,105,0,0,194,195,5,99, + 0,0,195,24,1,0,0,0,196,197,5,112,0,0,197,198,5,114,0,0,198,199,5,111, + 0,0,199,200,5,116,0,0,200,201,5,101,0,0,201,202,5,99,0,0,202,203,5,116, + 0,0,203,204,5,101,0,0,204,205,5,100,0,0,205,26,1,0,0,0,206,207,5,80,0, + 0,207,208,5,114,0,0,208,209,5,105,0,0,209,210,5,118,0,0,210,211,5,97, + 0,0,211,212,5,116,0,0,212,213,5,101,0,0,213,28,1,0,0,0,214,215,5,111, + 0,0,215,216,5,118,0,0,216,217,5,101,0,0,217,218,5,114,0,0,218,219,5,114, + 0,0,219,220,5,105,0,0,220,221,5,100,0,0,221,222,5,101,0,0,222,30,1,0, + 0,0,223,224,5,116,0,0,224,225,5,114,0,0,225,226,5,117,0,0,226,227,5,101, + 0,0,227,32,1,0,0,0,228,229,5,102,0,0,229,230,5,97,0,0,230,231,5,108,0, + 0,231,232,5,115,0,0,232,233,5,101,0,0,233,34,1,0,0,0,234,235,5,115,0, + 0,235,236,5,116,0,0,236,237,5,97,0,0,237,238,5,116,0,0,238,239,5,105, + 0,0,239,240,5,99,0,0,240,36,1,0,0,0,241,242,5,99,0,0,242,243,5,111,0, + 0,243,244,5,110,0,0,244,245,5,115,0,0,245,246,5,116,0,0,246,38,1,0,0, + 0,247,248,5,110,0,0,248,249,5,117,0,0,249,250,5,108,0,0,250,251,5,108, + 0,0,251,40,1,0,0,0,252,253,5,40,0,0,253,42,1,0,0,0,254,255,5,41,0,0,255, + 44,1,0,0,0,256,257,5,91,0,0,257,46,1,0,0,0,258,259,5,93,0,0,259,48,1, + 0,0,0,260,261,5,123,0,0,261,50,1,0,0,0,262,263,5,125,0,0,263,52,1,0,0, + 0,264,265,5,58,0,0,265,54,1,0,0,0,266,267,5,59,0,0,267,56,1,0,0,0,268, + 269,5,44,0,0,269,58,1,0,0,0,270,271,5,61,0,0,271,272,5,61,0,0,272,60, + 1,0,0,0,273,274,5,61,0,0,274,62,1,0,0,0,275,276,5,62,0,0,276,64,1,0,0, + 0,277,278,5,60,0,0,278,66,1,0,0,0,279,280,5,60,0,0,280,281,5,60,0,0,281, + 68,1,0,0,0,282,283,5,62,0,0,283,284,5,62,0,0,284,70,1,0,0,0,285,286,5, + 62,0,0,286,287,5,62,0,0,287,288,5,62,0,0,288,72,1,0,0,0,289,290,5,43, + 0,0,290,74,1,0,0,0,291,292,5,45,0,0,292,76,1,0,0,0,293,294,5,42,0,0,294, + 78,1,0,0,0,295,296,5,47,0,0,296,80,1,0,0,0,297,298,5,37,0,0,298,82,1, + 0,0,0,299,300,5,33,0,0,300,84,1,0,0,0,301,302,5,38,0,0,302,86,1,0,0,0, + 303,304,5,124,0,0,304,88,1,0,0,0,305,306,5,94,0,0,306,90,1,0,0,0,307, + 308,5,46,0,0,308,92,1,0,0,0,309,310,5,34,0,0,310,94,1,0,0,0,311,312,5, + 39,0,0,312,96,1,0,0,0,313,314,5,10,0,0,314,98,1,0,0,0,315,319,7,0,0,0, + 316,318,7,1,0,0,317,316,1,0,0,0,318,321,1,0,0,0,319,317,1,0,0,0,319,320, + 1,0,0,0,320,100,1,0,0,0,321,319,1,0,0,0,322,323,5,48,0,0,323,324,5,120, + 0,0,324,325,1,0,0,0,325,329,7,2,0,0,326,328,3,113,56,0,327,326,1,0,0, + 0,328,331,1,0,0,0,329,327,1,0,0,0,329,330,1,0,0,0,330,102,1,0,0,0,331, + 329,1,0,0,0,332,341,5,48,0,0,333,337,7,3,0,0,334,336,3,119,59,0,335,334, + 1,0,0,0,336,339,1,0,0,0,337,335,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0, + 0,339,337,1,0,0,0,340,332,1,0,0,0,340,333,1,0,0,0,341,104,1,0,0,0,342, + 343,5,48,0,0,343,347,7,4,0,0,344,346,3,115,57,0,345,344,1,0,0,0,346,349, + 1,0,0,0,347,345,1,0,0,0,347,348,1,0,0,0,348,106,1,0,0,0,349,347,1,0,0, + 0,350,351,5,48,0,0,351,352,5,98,0,0,352,353,1,0,0,0,353,357,5,49,0,0, + 354,356,3,117,58,0,355,354,1,0,0,0,356,359,1,0,0,0,357,355,1,0,0,0,357, + 358,1,0,0,0,358,108,1,0,0,0,359,357,1,0,0,0,360,361,3,103,51,0,361,362, + 3,91,45,0,362,363,3,111,55,0,363,110,1,0,0,0,364,366,3,119,59,0,365,364, + 1,0,0,0,366,367,1,0,0,0,367,365,1,0,0,0,367,368,1,0,0,0,368,112,1,0,0, + 0,369,370,7,5,0,0,370,114,1,0,0,0,371,372,7,6,0,0,372,116,1,0,0,0,373, + 374,7,7,0,0,374,118,1,0,0,0,375,376,7,8,0,0,376,120,1,0,0,0,377,382,5, + 34,0,0,378,381,3,123,61,0,379,381,8,9,0,0,380,378,1,0,0,0,380,379,1,0, + 0,0,381,384,1,0,0,0,382,380,1,0,0,0,382,383,1,0,0,0,383,385,1,0,0,0,384, + 382,1,0,0,0,385,386,5,34,0,0,386,122,1,0,0,0,387,389,5,92,0,0,388,390, + 7,10,0,0,389,388,1,0,0,0,390,124,1,0,0,0,391,392,5,47,0,0,392,393,5,47, + 0,0,393,397,1,0,0,0,394,396,8,11,0,0,395,394,1,0,0,0,396,399,1,0,0,0, + 397,395,1,0,0,0,397,398,1,0,0,0,398,400,1,0,0,0,399,397,1,0,0,0,400,401, + 6,62,0,0,401,126,1,0,0,0,402,403,5,47,0,0,403,404,5,42,0,0,404,408,1, + 0,0,0,405,407,9,0,0,0,406,405,1,0,0,0,407,410,1,0,0,0,408,409,1,0,0,0, + 408,406,1,0,0,0,409,411,1,0,0,0,410,408,1,0,0,0,411,412,5,42,0,0,412, + 413,5,47,0,0,413,414,1,0,0,0,414,415,6,63,0,0,415,128,1,0,0,0,416,418, + 7,12,0,0,417,416,1,0,0,0,418,419,1,0,0,0,419,417,1,0,0,0,419,420,1,0, + 0,0,420,421,1,0,0,0,421,422,6,64,0,0,422,130,1,0,0,0,14,0,319,329,337, + 340,347,357,367,380,382,389,397,408,419,1,6,0,0 }; staticData->serializedATN = antlr4::atn::SerializedATNView(serializedATNSegment, sizeof(serializedATNSegment) / sizeof(serializedATNSegment[0])); diff --git a/parser/RiddleLexer.h b/parser/RiddleLexer.h index b8e3e0f..5b24295 100644 --- a/parser/RiddleLexer.h +++ b/parser/RiddleLexer.h @@ -14,16 +14,16 @@ class RiddleLexer : public antlr4::Lexer { enum { Var = 1, Val = 2, For = 3, While = 4, If = 5, Else = 6, Func = 7, Return = 8, Import = 9, Package = 10, Class = 11, Public = 12, Protected = 13, Private = 14, - Override = 15, True = 16, False = 17, Static = 18, Const = 19, LeftBracket = 20, - RightBracket = 21, LeftSquare = 22, RightSquare = 23, LeftCurly = 24, - RightCurly = 25, Colon = 26, Semi = 27, Comma = 28, Equal = 29, Assign = 30, - Greater = 31, Less = 32, LeftLeft = 33, RightRight = 34, RightRightRight = 35, - Add = 36, Sub = 37, Star = 38, Div = 39, Mod = 40, Not = 41, And = 42, - Or = 43, Xor = 44, Dot = 45, DoubleQuotes = 46, Quotes = 47, Endl = 48, - Identifier = 49, Hexadecimal = 50, Decimal = 51, Octal = 52, Binary = 53, - Float = 54, IntegerSequence = 55, HEX_DIGIT = 56, OCTAL_DIGIT = 57, - BINARY_DIGIT = 58, DIGIT = 59, STRING = 60, LINE_COMMENT = 61, BLOCK_COMMENT = 62, - WHITESPACE = 63 + Override = 15, True = 16, False = 17, Static = 18, Const = 19, Null = 20, + LeftBracket = 21, RightBracket = 22, LeftSquare = 23, RightSquare = 24, + LeftCurly = 25, RightCurly = 26, Colon = 27, Semi = 28, Comma = 29, + Equal = 30, Assign = 31, Greater = 32, Less = 33, LeftLeft = 34, RightRight = 35, + RightRightRight = 36, Add = 37, Sub = 38, Star = 39, Div = 40, Mod = 41, + Not = 42, And = 43, Or = 44, Xor = 45, Dot = 46, DoubleQuotes = 47, + Quotes = 48, Endl = 49, Identifier = 50, Hexadecimal = 51, Decimal = 52, + Octal = 53, Binary = 54, Float = 55, IntegerSequence = 56, HEX_DIGIT = 57, + OCTAL_DIGIT = 58, BINARY_DIGIT = 59, DIGIT = 60, STRING = 61, LINE_COMMENT = 62, + BLOCK_COMMENT = 63, WHITESPACE = 64 }; explicit RiddleLexer(antlr4::CharStream *input); diff --git a/parser/RiddleLexer.interp b/parser/RiddleLexer.interp index 95d0e3e..b38bf83 100644 --- a/parser/RiddleLexer.interp +++ b/parser/RiddleLexer.interp @@ -19,6 +19,7 @@ null 'false' 'static' 'const' +'null' '(' ')' '[' @@ -85,6 +86,7 @@ True False Static Const +Null LeftBracket RightBracket LeftSquare @@ -150,6 +152,7 @@ True False Static Const +Null LeftBracket RightBracket LeftSquare @@ -204,4 +207,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 63, 416, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 5, 48, 311, 8, 48, 10, 48, 12, 48, 314, 9, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 5, 49, 321, 8, 49, 10, 49, 12, 49, 324, 9, 49, 1, 50, 1, 50, 1, 50, 5, 50, 329, 8, 50, 10, 50, 12, 50, 332, 9, 50, 3, 50, 334, 8, 50, 1, 51, 1, 51, 1, 51, 5, 51, 339, 8, 51, 10, 51, 12, 51, 342, 9, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 349, 8, 52, 10, 52, 12, 52, 352, 9, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 4, 54, 359, 8, 54, 11, 54, 12, 54, 360, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 5, 59, 374, 8, 59, 10, 59, 12, 59, 377, 9, 59, 1, 59, 1, 59, 1, 60, 1, 60, 3, 60, 383, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 5, 61, 389, 8, 61, 10, 61, 12, 61, 392, 9, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 5, 62, 400, 8, 62, 10, 62, 12, 62, 403, 9, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 4, 63, 411, 8, 63, 11, 63, 12, 63, 412, 1, 63, 1, 63, 1, 401, 0, 64, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 0, 123, 61, 125, 62, 127, 63, 1, 0, 13, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 49, 57, 65, 70, 1, 0, 49, 57, 1, 0, 49, 55, 2, 0, 48, 57, 65, 70, 1, 0, 48, 55, 1, 0, 48, 49, 1, 0, 48, 57, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 5, 0, 34, 34, 47, 47, 65, 90, 92, 92, 97, 122, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 1, 129, 1, 0, 0, 0, 3, 133, 1, 0, 0, 0, 5, 137, 1, 0, 0, 0, 7, 141, 1, 0, 0, 0, 9, 147, 1, 0, 0, 0, 11, 150, 1, 0, 0, 0, 13, 155, 1, 0, 0, 0, 15, 159, 1, 0, 0, 0, 17, 166, 1, 0, 0, 0, 19, 173, 1, 0, 0, 0, 21, 181, 1, 0, 0, 0, 23, 187, 1, 0, 0, 0, 25, 194, 1, 0, 0, 0, 27, 204, 1, 0, 0, 0, 29, 212, 1, 0, 0, 0, 31, 221, 1, 0, 0, 0, 33, 226, 1, 0, 0, 0, 35, 232, 1, 0, 0, 0, 37, 239, 1, 0, 0, 0, 39, 245, 1, 0, 0, 0, 41, 247, 1, 0, 0, 0, 43, 249, 1, 0, 0, 0, 45, 251, 1, 0, 0, 0, 47, 253, 1, 0, 0, 0, 49, 255, 1, 0, 0, 0, 51, 257, 1, 0, 0, 0, 53, 259, 1, 0, 0, 0, 55, 261, 1, 0, 0, 0, 57, 263, 1, 0, 0, 0, 59, 266, 1, 0, 0, 0, 61, 268, 1, 0, 0, 0, 63, 270, 1, 0, 0, 0, 65, 272, 1, 0, 0, 0, 67, 275, 1, 0, 0, 0, 69, 278, 1, 0, 0, 0, 71, 282, 1, 0, 0, 0, 73, 284, 1, 0, 0, 0, 75, 286, 1, 0, 0, 0, 77, 288, 1, 0, 0, 0, 79, 290, 1, 0, 0, 0, 81, 292, 1, 0, 0, 0, 83, 294, 1, 0, 0, 0, 85, 296, 1, 0, 0, 0, 87, 298, 1, 0, 0, 0, 89, 300, 1, 0, 0, 0, 91, 302, 1, 0, 0, 0, 93, 304, 1, 0, 0, 0, 95, 306, 1, 0, 0, 0, 97, 308, 1, 0, 0, 0, 99, 315, 1, 0, 0, 0, 101, 333, 1, 0, 0, 0, 103, 335, 1, 0, 0, 0, 105, 343, 1, 0, 0, 0, 107, 353, 1, 0, 0, 0, 109, 358, 1, 0, 0, 0, 111, 362, 1, 0, 0, 0, 113, 364, 1, 0, 0, 0, 115, 366, 1, 0, 0, 0, 117, 368, 1, 0, 0, 0, 119, 370, 1, 0, 0, 0, 121, 380, 1, 0, 0, 0, 123, 384, 1, 0, 0, 0, 125, 395, 1, 0, 0, 0, 127, 410, 1, 0, 0, 0, 129, 130, 5, 118, 0, 0, 130, 131, 5, 97, 0, 0, 131, 132, 5, 114, 0, 0, 132, 2, 1, 0, 0, 0, 133, 134, 5, 118, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 108, 0, 0, 136, 4, 1, 0, 0, 0, 137, 138, 5, 102, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 114, 0, 0, 140, 6, 1, 0, 0, 0, 141, 142, 5, 119, 0, 0, 142, 143, 5, 104, 0, 0, 143, 144, 5, 105, 0, 0, 144, 145, 5, 108, 0, 0, 145, 146, 5, 101, 0, 0, 146, 8, 1, 0, 0, 0, 147, 148, 5, 105, 0, 0, 148, 149, 5, 102, 0, 0, 149, 10, 1, 0, 0, 0, 150, 151, 5, 101, 0, 0, 151, 152, 5, 108, 0, 0, 152, 153, 5, 115, 0, 0, 153, 154, 5, 101, 0, 0, 154, 12, 1, 0, 0, 0, 155, 156, 5, 102, 0, 0, 156, 157, 5, 117, 0, 0, 157, 158, 5, 110, 0, 0, 158, 14, 1, 0, 0, 0, 159, 160, 5, 114, 0, 0, 160, 161, 5, 101, 0, 0, 161, 162, 5, 116, 0, 0, 162, 163, 5, 117, 0, 0, 163, 164, 5, 114, 0, 0, 164, 165, 5, 110, 0, 0, 165, 16, 1, 0, 0, 0, 166, 167, 5, 105, 0, 0, 167, 168, 5, 109, 0, 0, 168, 169, 5, 112, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 114, 0, 0, 171, 172, 5, 116, 0, 0, 172, 18, 1, 0, 0, 0, 173, 174, 5, 112, 0, 0, 174, 175, 5, 97, 0, 0, 175, 176, 5, 99, 0, 0, 176, 177, 5, 107, 0, 0, 177, 178, 5, 97, 0, 0, 178, 179, 5, 103, 0, 0, 179, 180, 5, 101, 0, 0, 180, 20, 1, 0, 0, 0, 181, 182, 5, 99, 0, 0, 182, 183, 5, 108, 0, 0, 183, 184, 5, 97, 0, 0, 184, 185, 5, 115, 0, 0, 185, 186, 5, 115, 0, 0, 186, 22, 1, 0, 0, 0, 187, 188, 5, 112, 0, 0, 188, 189, 5, 117, 0, 0, 189, 190, 5, 98, 0, 0, 190, 191, 5, 108, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 99, 0, 0, 193, 24, 1, 0, 0, 0, 194, 195, 5, 112, 0, 0, 195, 196, 5, 114, 0, 0, 196, 197, 5, 111, 0, 0, 197, 198, 5, 116, 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 99, 0, 0, 200, 201, 5, 116, 0, 0, 201, 202, 5, 101, 0, 0, 202, 203, 5, 100, 0, 0, 203, 26, 1, 0, 0, 0, 204, 205, 5, 80, 0, 0, 205, 206, 5, 114, 0, 0, 206, 207, 5, 105, 0, 0, 207, 208, 5, 118, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 116, 0, 0, 210, 211, 5, 101, 0, 0, 211, 28, 1, 0, 0, 0, 212, 213, 5, 111, 0, 0, 213, 214, 5, 118, 0, 0, 214, 215, 5, 101, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 114, 0, 0, 217, 218, 5, 105, 0, 0, 218, 219, 5, 100, 0, 0, 219, 220, 5, 101, 0, 0, 220, 30, 1, 0, 0, 0, 221, 222, 5, 116, 0, 0, 222, 223, 5, 114, 0, 0, 223, 224, 5, 117, 0, 0, 224, 225, 5, 101, 0, 0, 225, 32, 1, 0, 0, 0, 226, 227, 5, 102, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 108, 0, 0, 229, 230, 5, 115, 0, 0, 230, 231, 5, 101, 0, 0, 231, 34, 1, 0, 0, 0, 232, 233, 5, 115, 0, 0, 233, 234, 5, 116, 0, 0, 234, 235, 5, 97, 0, 0, 235, 236, 5, 116, 0, 0, 236, 237, 5, 105, 0, 0, 237, 238, 5, 99, 0, 0, 238, 36, 1, 0, 0, 0, 239, 240, 5, 99, 0, 0, 240, 241, 5, 111, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 115, 0, 0, 243, 244, 5, 116, 0, 0, 244, 38, 1, 0, 0, 0, 245, 246, 5, 40, 0, 0, 246, 40, 1, 0, 0, 0, 247, 248, 5, 41, 0, 0, 248, 42, 1, 0, 0, 0, 249, 250, 5, 91, 0, 0, 250, 44, 1, 0, 0, 0, 251, 252, 5, 93, 0, 0, 252, 46, 1, 0, 0, 0, 253, 254, 5, 123, 0, 0, 254, 48, 1, 0, 0, 0, 255, 256, 5, 125, 0, 0, 256, 50, 1, 0, 0, 0, 257, 258, 5, 58, 0, 0, 258, 52, 1, 0, 0, 0, 259, 260, 5, 59, 0, 0, 260, 54, 1, 0, 0, 0, 261, 262, 5, 44, 0, 0, 262, 56, 1, 0, 0, 0, 263, 264, 5, 61, 0, 0, 264, 265, 5, 61, 0, 0, 265, 58, 1, 0, 0, 0, 266, 267, 5, 61, 0, 0, 267, 60, 1, 0, 0, 0, 268, 269, 5, 62, 0, 0, 269, 62, 1, 0, 0, 0, 270, 271, 5, 60, 0, 0, 271, 64, 1, 0, 0, 0, 272, 273, 5, 60, 0, 0, 273, 274, 5, 60, 0, 0, 274, 66, 1, 0, 0, 0, 275, 276, 5, 62, 0, 0, 276, 277, 5, 62, 0, 0, 277, 68, 1, 0, 0, 0, 278, 279, 5, 62, 0, 0, 279, 280, 5, 62, 0, 0, 280, 281, 5, 62, 0, 0, 281, 70, 1, 0, 0, 0, 282, 283, 5, 43, 0, 0, 283, 72, 1, 0, 0, 0, 284, 285, 5, 45, 0, 0, 285, 74, 1, 0, 0, 0, 286, 287, 5, 42, 0, 0, 287, 76, 1, 0, 0, 0, 288, 289, 5, 47, 0, 0, 289, 78, 1, 0, 0, 0, 290, 291, 5, 37, 0, 0, 291, 80, 1, 0, 0, 0, 292, 293, 5, 33, 0, 0, 293, 82, 1, 0, 0, 0, 294, 295, 5, 38, 0, 0, 295, 84, 1, 0, 0, 0, 296, 297, 5, 124, 0, 0, 297, 86, 1, 0, 0, 0, 298, 299, 5, 94, 0, 0, 299, 88, 1, 0, 0, 0, 300, 301, 5, 46, 0, 0, 301, 90, 1, 0, 0, 0, 302, 303, 5, 34, 0, 0, 303, 92, 1, 0, 0, 0, 304, 305, 5, 39, 0, 0, 305, 94, 1, 0, 0, 0, 306, 307, 5, 10, 0, 0, 307, 96, 1, 0, 0, 0, 308, 312, 7, 0, 0, 0, 309, 311, 7, 1, 0, 0, 310, 309, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 98, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 315, 316, 5, 48, 0, 0, 316, 317, 5, 120, 0, 0, 317, 318, 1, 0, 0, 0, 318, 322, 7, 2, 0, 0, 319, 321, 3, 111, 55, 0, 320, 319, 1, 0, 0, 0, 321, 324, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 322, 323, 1, 0, 0, 0, 323, 100, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 325, 334, 5, 48, 0, 0, 326, 330, 7, 3, 0, 0, 327, 329, 3, 117, 58, 0, 328, 327, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 334, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 325, 1, 0, 0, 0, 333, 326, 1, 0, 0, 0, 334, 102, 1, 0, 0, 0, 335, 336, 5, 48, 0, 0, 336, 340, 7, 4, 0, 0, 337, 339, 3, 113, 56, 0, 338, 337, 1, 0, 0, 0, 339, 342, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 104, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 343, 344, 5, 48, 0, 0, 344, 345, 5, 98, 0, 0, 345, 346, 1, 0, 0, 0, 346, 350, 5, 49, 0, 0, 347, 349, 3, 115, 57, 0, 348, 347, 1, 0, 0, 0, 349, 352, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 106, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 3, 101, 50, 0, 354, 355, 3, 89, 44, 0, 355, 356, 3, 109, 54, 0, 356, 108, 1, 0, 0, 0, 357, 359, 3, 117, 58, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 110, 1, 0, 0, 0, 362, 363, 7, 5, 0, 0, 363, 112, 1, 0, 0, 0, 364, 365, 7, 6, 0, 0, 365, 114, 1, 0, 0, 0, 366, 367, 7, 7, 0, 0, 367, 116, 1, 0, 0, 0, 368, 369, 7, 8, 0, 0, 369, 118, 1, 0, 0, 0, 370, 375, 5, 34, 0, 0, 371, 374, 3, 121, 60, 0, 372, 374, 8, 9, 0, 0, 373, 371, 1, 0, 0, 0, 373, 372, 1, 0, 0, 0, 374, 377, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 378, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 378, 379, 5, 34, 0, 0, 379, 120, 1, 0, 0, 0, 380, 382, 5, 92, 0, 0, 381, 383, 7, 10, 0, 0, 382, 381, 1, 0, 0, 0, 383, 122, 1, 0, 0, 0, 384, 385, 5, 47, 0, 0, 385, 386, 5, 47, 0, 0, 386, 390, 1, 0, 0, 0, 387, 389, 8, 11, 0, 0, 388, 387, 1, 0, 0, 0, 389, 392, 1, 0, 0, 0, 390, 388, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 394, 6, 61, 0, 0, 394, 124, 1, 0, 0, 0, 395, 396, 5, 47, 0, 0, 396, 397, 5, 42, 0, 0, 397, 401, 1, 0, 0, 0, 398, 400, 9, 0, 0, 0, 399, 398, 1, 0, 0, 0, 400, 403, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 404, 405, 5, 42, 0, 0, 405, 406, 5, 47, 0, 0, 406, 407, 1, 0, 0, 0, 407, 408, 6, 62, 0, 0, 408, 126, 1, 0, 0, 0, 409, 411, 7, 12, 0, 0, 410, 409, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 415, 6, 63, 0, 0, 415, 128, 1, 0, 0, 0, 14, 0, 312, 322, 330, 333, 340, 350, 360, 373, 375, 382, 390, 401, 412, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 64, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 5, 49, 318, 8, 49, 10, 49, 12, 49, 321, 9, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 328, 8, 50, 10, 50, 12, 50, 331, 9, 50, 1, 51, 1, 51, 1, 51, 5, 51, 336, 8, 51, 10, 51, 12, 51, 339, 9, 51, 3, 51, 341, 8, 51, 1, 52, 1, 52, 1, 52, 5, 52, 346, 8, 52, 10, 52, 12, 52, 349, 9, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 356, 8, 53, 10, 53, 12, 53, 359, 9, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 4, 55, 366, 8, 55, 11, 55, 12, 55, 367, 1, 56, 1, 56, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 5, 60, 381, 8, 60, 10, 60, 12, 60, 384, 9, 60, 1, 60, 1, 60, 1, 61, 1, 61, 3, 61, 390, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 5, 62, 396, 8, 62, 10, 62, 12, 62, 399, 9, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 5, 63, 407, 8, 63, 10, 63, 12, 63, 410, 9, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 4, 64, 418, 8, 64, 11, 64, 12, 64, 419, 1, 64, 1, 64, 1, 408, 0, 65, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 0, 125, 62, 127, 63, 129, 64, 1, 0, 13, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 49, 57, 65, 70, 1, 0, 49, 57, 1, 0, 49, 55, 2, 0, 48, 57, 65, 70, 1, 0, 48, 55, 1, 0, 48, 49, 1, 0, 48, 57, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 5, 0, 34, 34, 47, 47, 65, 90, 92, 92, 97, 122, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 433, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 1, 131, 1, 0, 0, 0, 3, 135, 1, 0, 0, 0, 5, 139, 1, 0, 0, 0, 7, 143, 1, 0, 0, 0, 9, 149, 1, 0, 0, 0, 11, 152, 1, 0, 0, 0, 13, 157, 1, 0, 0, 0, 15, 161, 1, 0, 0, 0, 17, 168, 1, 0, 0, 0, 19, 175, 1, 0, 0, 0, 21, 183, 1, 0, 0, 0, 23, 189, 1, 0, 0, 0, 25, 196, 1, 0, 0, 0, 27, 206, 1, 0, 0, 0, 29, 214, 1, 0, 0, 0, 31, 223, 1, 0, 0, 0, 33, 228, 1, 0, 0, 0, 35, 234, 1, 0, 0, 0, 37, 241, 1, 0, 0, 0, 39, 247, 1, 0, 0, 0, 41, 252, 1, 0, 0, 0, 43, 254, 1, 0, 0, 0, 45, 256, 1, 0, 0, 0, 47, 258, 1, 0, 0, 0, 49, 260, 1, 0, 0, 0, 51, 262, 1, 0, 0, 0, 53, 264, 1, 0, 0, 0, 55, 266, 1, 0, 0, 0, 57, 268, 1, 0, 0, 0, 59, 270, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 275, 1, 0, 0, 0, 65, 277, 1, 0, 0, 0, 67, 279, 1, 0, 0, 0, 69, 282, 1, 0, 0, 0, 71, 285, 1, 0, 0, 0, 73, 289, 1, 0, 0, 0, 75, 291, 1, 0, 0, 0, 77, 293, 1, 0, 0, 0, 79, 295, 1, 0, 0, 0, 81, 297, 1, 0, 0, 0, 83, 299, 1, 0, 0, 0, 85, 301, 1, 0, 0, 0, 87, 303, 1, 0, 0, 0, 89, 305, 1, 0, 0, 0, 91, 307, 1, 0, 0, 0, 93, 309, 1, 0, 0, 0, 95, 311, 1, 0, 0, 0, 97, 313, 1, 0, 0, 0, 99, 315, 1, 0, 0, 0, 101, 322, 1, 0, 0, 0, 103, 340, 1, 0, 0, 0, 105, 342, 1, 0, 0, 0, 107, 350, 1, 0, 0, 0, 109, 360, 1, 0, 0, 0, 111, 365, 1, 0, 0, 0, 113, 369, 1, 0, 0, 0, 115, 371, 1, 0, 0, 0, 117, 373, 1, 0, 0, 0, 119, 375, 1, 0, 0, 0, 121, 377, 1, 0, 0, 0, 123, 387, 1, 0, 0, 0, 125, 391, 1, 0, 0, 0, 127, 402, 1, 0, 0, 0, 129, 417, 1, 0, 0, 0, 131, 132, 5, 118, 0, 0, 132, 133, 5, 97, 0, 0, 133, 134, 5, 114, 0, 0, 134, 2, 1, 0, 0, 0, 135, 136, 5, 118, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 108, 0, 0, 138, 4, 1, 0, 0, 0, 139, 140, 5, 102, 0, 0, 140, 141, 5, 111, 0, 0, 141, 142, 5, 114, 0, 0, 142, 6, 1, 0, 0, 0, 143, 144, 5, 119, 0, 0, 144, 145, 5, 104, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 108, 0, 0, 147, 148, 5, 101, 0, 0, 148, 8, 1, 0, 0, 0, 149, 150, 5, 105, 0, 0, 150, 151, 5, 102, 0, 0, 151, 10, 1, 0, 0, 0, 152, 153, 5, 101, 0, 0, 153, 154, 5, 108, 0, 0, 154, 155, 5, 115, 0, 0, 155, 156, 5, 101, 0, 0, 156, 12, 1, 0, 0, 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 117, 0, 0, 159, 160, 5, 110, 0, 0, 160, 14, 1, 0, 0, 0, 161, 162, 5, 114, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 116, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 114, 0, 0, 166, 167, 5, 110, 0, 0, 167, 16, 1, 0, 0, 0, 168, 169, 5, 105, 0, 0, 169, 170, 5, 109, 0, 0, 170, 171, 5, 112, 0, 0, 171, 172, 5, 111, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 116, 0, 0, 174, 18, 1, 0, 0, 0, 175, 176, 5, 112, 0, 0, 176, 177, 5, 97, 0, 0, 177, 178, 5, 99, 0, 0, 178, 179, 5, 107, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 103, 0, 0, 181, 182, 5, 101, 0, 0, 182, 20, 1, 0, 0, 0, 183, 184, 5, 99, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 97, 0, 0, 186, 187, 5, 115, 0, 0, 187, 188, 5, 115, 0, 0, 188, 22, 1, 0, 0, 0, 189, 190, 5, 112, 0, 0, 190, 191, 5, 117, 0, 0, 191, 192, 5, 98, 0, 0, 192, 193, 5, 108, 0, 0, 193, 194, 5, 105, 0, 0, 194, 195, 5, 99, 0, 0, 195, 24, 1, 0, 0, 0, 196, 197, 5, 112, 0, 0, 197, 198, 5, 114, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 101, 0, 0, 201, 202, 5, 99, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 100, 0, 0, 205, 26, 1, 0, 0, 0, 206, 207, 5, 80, 0, 0, 207, 208, 5, 114, 0, 0, 208, 209, 5, 105, 0, 0, 209, 210, 5, 118, 0, 0, 210, 211, 5, 97, 0, 0, 211, 212, 5, 116, 0, 0, 212, 213, 5, 101, 0, 0, 213, 28, 1, 0, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 118, 0, 0, 216, 217, 5, 101, 0, 0, 217, 218, 5, 114, 0, 0, 218, 219, 5, 114, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 100, 0, 0, 221, 222, 5, 101, 0, 0, 222, 30, 1, 0, 0, 0, 223, 224, 5, 116, 0, 0, 224, 225, 5, 114, 0, 0, 225, 226, 5, 117, 0, 0, 226, 227, 5, 101, 0, 0, 227, 32, 1, 0, 0, 0, 228, 229, 5, 102, 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 108, 0, 0, 231, 232, 5, 115, 0, 0, 232, 233, 5, 101, 0, 0, 233, 34, 1, 0, 0, 0, 234, 235, 5, 115, 0, 0, 235, 236, 5, 116, 0, 0, 236, 237, 5, 97, 0, 0, 237, 238, 5, 116, 0, 0, 238, 239, 5, 105, 0, 0, 239, 240, 5, 99, 0, 0, 240, 36, 1, 0, 0, 0, 241, 242, 5, 99, 0, 0, 242, 243, 5, 111, 0, 0, 243, 244, 5, 110, 0, 0, 244, 245, 5, 115, 0, 0, 245, 246, 5, 116, 0, 0, 246, 38, 1, 0, 0, 0, 247, 248, 5, 110, 0, 0, 248, 249, 5, 117, 0, 0, 249, 250, 5, 108, 0, 0, 250, 251, 5, 108, 0, 0, 251, 40, 1, 0, 0, 0, 252, 253, 5, 40, 0, 0, 253, 42, 1, 0, 0, 0, 254, 255, 5, 41, 0, 0, 255, 44, 1, 0, 0, 0, 256, 257, 5, 91, 0, 0, 257, 46, 1, 0, 0, 0, 258, 259, 5, 93, 0, 0, 259, 48, 1, 0, 0, 0, 260, 261, 5, 123, 0, 0, 261, 50, 1, 0, 0, 0, 262, 263, 5, 125, 0, 0, 263, 52, 1, 0, 0, 0, 264, 265, 5, 58, 0, 0, 265, 54, 1, 0, 0, 0, 266, 267, 5, 59, 0, 0, 267, 56, 1, 0, 0, 0, 268, 269, 5, 44, 0, 0, 269, 58, 1, 0, 0, 0, 270, 271, 5, 61, 0, 0, 271, 272, 5, 61, 0, 0, 272, 60, 1, 0, 0, 0, 273, 274, 5, 61, 0, 0, 274, 62, 1, 0, 0, 0, 275, 276, 5, 62, 0, 0, 276, 64, 1, 0, 0, 0, 277, 278, 5, 60, 0, 0, 278, 66, 1, 0, 0, 0, 279, 280, 5, 60, 0, 0, 280, 281, 5, 60, 0, 0, 281, 68, 1, 0, 0, 0, 282, 283, 5, 62, 0, 0, 283, 284, 5, 62, 0, 0, 284, 70, 1, 0, 0, 0, 285, 286, 5, 62, 0, 0, 286, 287, 5, 62, 0, 0, 287, 288, 5, 62, 0, 0, 288, 72, 1, 0, 0, 0, 289, 290, 5, 43, 0, 0, 290, 74, 1, 0, 0, 0, 291, 292, 5, 45, 0, 0, 292, 76, 1, 0, 0, 0, 293, 294, 5, 42, 0, 0, 294, 78, 1, 0, 0, 0, 295, 296, 5, 47, 0, 0, 296, 80, 1, 0, 0, 0, 297, 298, 5, 37, 0, 0, 298, 82, 1, 0, 0, 0, 299, 300, 5, 33, 0, 0, 300, 84, 1, 0, 0, 0, 301, 302, 5, 38, 0, 0, 302, 86, 1, 0, 0, 0, 303, 304, 5, 124, 0, 0, 304, 88, 1, 0, 0, 0, 305, 306, 5, 94, 0, 0, 306, 90, 1, 0, 0, 0, 307, 308, 5, 46, 0, 0, 308, 92, 1, 0, 0, 0, 309, 310, 5, 34, 0, 0, 310, 94, 1, 0, 0, 0, 311, 312, 5, 39, 0, 0, 312, 96, 1, 0, 0, 0, 313, 314, 5, 10, 0, 0, 314, 98, 1, 0, 0, 0, 315, 319, 7, 0, 0, 0, 316, 318, 7, 1, 0, 0, 317, 316, 1, 0, 0, 0, 318, 321, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 100, 1, 0, 0, 0, 321, 319, 1, 0, 0, 0, 322, 323, 5, 48, 0, 0, 323, 324, 5, 120, 0, 0, 324, 325, 1, 0, 0, 0, 325, 329, 7, 2, 0, 0, 326, 328, 3, 113, 56, 0, 327, 326, 1, 0, 0, 0, 328, 331, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 102, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 332, 341, 5, 48, 0, 0, 333, 337, 7, 3, 0, 0, 334, 336, 3, 119, 59, 0, 335, 334, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 341, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 340, 332, 1, 0, 0, 0, 340, 333, 1, 0, 0, 0, 341, 104, 1, 0, 0, 0, 342, 343, 5, 48, 0, 0, 343, 347, 7, 4, 0, 0, 344, 346, 3, 115, 57, 0, 345, 344, 1, 0, 0, 0, 346, 349, 1, 0, 0, 0, 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 106, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 350, 351, 5, 48, 0, 0, 351, 352, 5, 98, 0, 0, 352, 353, 1, 0, 0, 0, 353, 357, 5, 49, 0, 0, 354, 356, 3, 117, 58, 0, 355, 354, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 108, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 360, 361, 3, 103, 51, 0, 361, 362, 3, 91, 45, 0, 362, 363, 3, 111, 55, 0, 363, 110, 1, 0, 0, 0, 364, 366, 3, 119, 59, 0, 365, 364, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 112, 1, 0, 0, 0, 369, 370, 7, 5, 0, 0, 370, 114, 1, 0, 0, 0, 371, 372, 7, 6, 0, 0, 372, 116, 1, 0, 0, 0, 373, 374, 7, 7, 0, 0, 374, 118, 1, 0, 0, 0, 375, 376, 7, 8, 0, 0, 376, 120, 1, 0, 0, 0, 377, 382, 5, 34, 0, 0, 378, 381, 3, 123, 61, 0, 379, 381, 8, 9, 0, 0, 380, 378, 1, 0, 0, 0, 380, 379, 1, 0, 0, 0, 381, 384, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 385, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 385, 386, 5, 34, 0, 0, 386, 122, 1, 0, 0, 0, 387, 389, 5, 92, 0, 0, 388, 390, 7, 10, 0, 0, 389, 388, 1, 0, 0, 0, 390, 124, 1, 0, 0, 0, 391, 392, 5, 47, 0, 0, 392, 393, 5, 47, 0, 0, 393, 397, 1, 0, 0, 0, 394, 396, 8, 11, 0, 0, 395, 394, 1, 0, 0, 0, 396, 399, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 400, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 400, 401, 6, 62, 0, 0, 401, 126, 1, 0, 0, 0, 402, 403, 5, 47, 0, 0, 403, 404, 5, 42, 0, 0, 404, 408, 1, 0, 0, 0, 405, 407, 9, 0, 0, 0, 406, 405, 1, 0, 0, 0, 407, 410, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 409, 411, 1, 0, 0, 0, 410, 408, 1, 0, 0, 0, 411, 412, 5, 42, 0, 0, 412, 413, 5, 47, 0, 0, 413, 414, 1, 0, 0, 0, 414, 415, 6, 63, 0, 0, 415, 128, 1, 0, 0, 0, 416, 418, 7, 12, 0, 0, 417, 416, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 417, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 422, 6, 64, 0, 0, 422, 130, 1, 0, 0, 0, 14, 0, 319, 329, 337, 340, 347, 357, 367, 380, 382, 389, 397, 408, 419, 1, 6, 0, 0] \ No newline at end of file diff --git a/parser/RiddleLexer.tokens b/parser/RiddleLexer.tokens index 880003f..6482b53 100644 --- a/parser/RiddleLexer.tokens +++ b/parser/RiddleLexer.tokens @@ -17,50 +17,51 @@ True=16 False=17 Static=18 Const=19 -LeftBracket=20 -RightBracket=21 -LeftSquare=22 -RightSquare=23 -LeftCurly=24 -RightCurly=25 -Colon=26 -Semi=27 -Comma=28 -Equal=29 -Assign=30 -Greater=31 -Less=32 -LeftLeft=33 -RightRight=34 -RightRightRight=35 -Add=36 -Sub=37 -Star=38 -Div=39 -Mod=40 -Not=41 -And=42 -Or=43 -Xor=44 -Dot=45 -DoubleQuotes=46 -Quotes=47 -Endl=48 -Identifier=49 -Hexadecimal=50 -Decimal=51 -Octal=52 -Binary=53 -Float=54 -IntegerSequence=55 -HEX_DIGIT=56 -OCTAL_DIGIT=57 -BINARY_DIGIT=58 -DIGIT=59 -STRING=60 -LINE_COMMENT=61 -BLOCK_COMMENT=62 -WHITESPACE=63 +Null=20 +LeftBracket=21 +RightBracket=22 +LeftSquare=23 +RightSquare=24 +LeftCurly=25 +RightCurly=26 +Colon=27 +Semi=28 +Comma=29 +Equal=30 +Assign=31 +Greater=32 +Less=33 +LeftLeft=34 +RightRight=35 +RightRightRight=36 +Add=37 +Sub=38 +Star=39 +Div=40 +Mod=41 +Not=42 +And=43 +Or=44 +Xor=45 +Dot=46 +DoubleQuotes=47 +Quotes=48 +Endl=49 +Identifier=50 +Hexadecimal=51 +Decimal=52 +Octal=53 +Binary=54 +Float=55 +IntegerSequence=56 +HEX_DIGIT=57 +OCTAL_DIGIT=58 +BINARY_DIGIT=59 +DIGIT=60 +STRING=61 +LINE_COMMENT=62 +BLOCK_COMMENT=63 +WHITESPACE=64 'var'=1 'val'=2 'for'=3 @@ -80,32 +81,33 @@ WHITESPACE=63 'false'=17 'static'=18 'const'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -':'=26 -';'=27 -','=28 -'=='=29 -'='=30 -'>'=31 -'<'=32 -'<<'=33 -'>>'=34 -'>>>'=35 -'+'=36 -'-'=37 -'*'=38 -'/'=39 -'%'=40 -'!'=41 -'&'=42 -'|'=43 -'^'=44 -'.'=45 -'"'=46 -'\''=47 -'\n'=48 +'null'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +':'=27 +';'=28 +','=29 +'=='=30 +'='=31 +'>'=32 +'<'=33 +'<<'=34 +'>>'=35 +'>>>'=36 +'+'=37 +'-'=38 +'*'=39 +'/'=40 +'%'=41 +'!'=42 +'&'=43 +'|'=44 +'^'=45 +'.'=46 +'"'=47 +'\''=48 +'\n'=49 diff --git a/parser/RiddleParser.cpp b/parser/RiddleParser.cpp index a8e7526..bcd64f5 100644 --- a/parser/RiddleParser.cpp +++ b/parser/RiddleParser.cpp @@ -64,14 +64,15 @@ void riddleparserParserInitialize() { "", "'var'", "'val'", "'for'", "'while'", "'if'", "'else'", "'fun'", "'return'", "'import'", "'package'", "'class'", "'public'", "'protected'", "'Private'", "'override'", "'true'", "'false'", "'static'", "'const'", - "'('", "')'", "'['", "']'", "'{'", "'}'", "':'", "';'", "','", "'=='", - "'='", "'>'", "'<'", "'<<'", "'>>'", "'>>>'", "'+'", "'-'", "'*'", - "'/'", "'%'", "'!'", "'&'", "'|'", "'^'", "'.'", "'\"'", "'''", "'\\n'" + "'null'", "'('", "')'", "'['", "']'", "'{'", "'}'", "':'", "';'", + "','", "'=='", "'='", "'>'", "'<'", "'<<'", "'>>'", "'>>>'", "'+'", + "'-'", "'*'", "'/'", "'%'", "'!'", "'&'", "'|'", "'^'", "'.'", "'\"'", + "'''", "'\\n'" }, std::vector{ "", "Var", "Val", "For", "While", "If", "Else", "Func", "Return", "Import", "Package", "Class", "Public", "Protected", "Private", "Override", - "True", "False", "Static", "Const", "LeftBracket", "RightBracket", + "True", "False", "Static", "Const", "Null", "LeftBracket", "RightBracket", "LeftSquare", "RightSquare", "LeftCurly", "RightCurly", "Colon", "Semi", "Comma", "Equal", "Assign", "Greater", "Less", "LeftLeft", "RightRight", "RightRightRight", "Add", "Sub", "Star", "Div", "Mod", "Not", "And", @@ -82,7 +83,7 @@ void riddleparserParserInitialize() { } ); static const int32_t serializedATNSegment[] = { - 4,1,63,471,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2, + 4,1,64,472,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2, 7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7, 14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7, 21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,1,0,5, @@ -106,144 +107,145 @@ void riddleparserParserInitialize() { 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, - 1,18,1,18,1,18,1,18,1,18,3,18,341,8,18,1,18,1,18,1,18,1,18,1,18,1,18, + 1,18,1,18,1,18,1,18,1,18,1,18,3,18,342,8,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18, - 5,18,405,8,18,10,18,12,18,408,9,18,1,19,1,19,1,20,1,20,3,20,414,8,20, - 1,21,1,21,1,21,1,21,3,21,420,8,21,1,22,1,22,1,23,1,23,1,23,1,24,1,24, - 1,24,1,24,1,24,1,24,1,24,1,24,3,24,435,8,24,1,25,1,25,3,25,439,8,25,1, - 26,1,26,1,26,5,26,444,8,26,10,26,12,26,447,9,26,1,26,3,26,450,8,26,1, - 27,1,27,1,27,1,27,1,27,1,27,1,27,3,27,459,8,27,1,27,1,27,1,27,1,27,1, - 27,5,27,466,8,27,10,27,12,27,469,9,27,1,27,0,3,32,36,54,28,0,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,54, - 0,0,529,0,63,1,0,0,0,2,74,1,0,0,0,4,94,1,0,0,0,6,96,1,0,0,0,8,99,1,0, - 0,0,10,117,1,0,0,0,12,128,1,0,0,0,14,143,1,0,0,0,16,145,1,0,0,0,18,162, - 1,0,0,0,20,165,1,0,0,0,22,181,1,0,0,0,24,203,1,0,0,0,26,205,1,0,0,0,28, - 209,1,0,0,0,30,218,1,0,0,0,32,228,1,0,0,0,34,238,1,0,0,0,36,340,1,0,0, - 0,38,409,1,0,0,0,40,413,1,0,0,0,42,419,1,0,0,0,44,421,1,0,0,0,46,423, - 1,0,0,0,48,434,1,0,0,0,50,438,1,0,0,0,52,449,1,0,0,0,54,458,1,0,0,0,56, - 58,3,2,1,0,57,56,1,0,0,0,58,61,1,0,0,0,59,57,1,0,0,0,59,60,1,0,0,0,60, - 64,1,0,0,0,61,59,1,0,0,0,62,64,5,0,0,1,63,59,1,0,0,0,63,62,1,0,0,0,64, - 1,1,0,0,0,65,67,3,4,2,0,66,68,5,27,0,0,67,66,1,0,0,0,67,68,1,0,0,0,68, - 70,1,0,0,0,69,71,5,48,0,0,70,69,1,0,0,0,70,71,1,0,0,0,71,75,1,0,0,0,72, - 75,5,27,0,0,73,75,5,48,0,0,74,65,1,0,0,0,74,72,1,0,0,0,74,73,1,0,0,0, - 75,3,1,0,0,0,76,95,3,6,3,0,77,95,3,8,4,0,78,95,3,28,14,0,79,95,3,16,8, - 0,80,95,3,10,5,0,81,95,3,20,10,0,82,95,3,22,11,0,83,95,3,24,12,0,84,95, - 3,26,13,0,85,95,3,36,18,0,86,90,5,24,0,0,87,89,3,2,1,0,88,87,1,0,0,0, - 89,92,1,0,0,0,90,88,1,0,0,0,90,91,1,0,0,0,91,93,1,0,0,0,92,90,1,0,0,0, - 93,95,5,25,0,0,94,76,1,0,0,0,94,77,1,0,0,0,94,78,1,0,0,0,94,79,1,0,0, - 0,94,80,1,0,0,0,94,81,1,0,0,0,94,82,1,0,0,0,94,83,1,0,0,0,94,84,1,0,0, - 0,94,85,1,0,0,0,94,86,1,0,0,0,95,5,1,0,0,0,96,97,5,10,0,0,97,98,3,38, - 19,0,98,7,1,0,0,0,99,100,5,9,0,0,100,101,3,38,19,0,101,9,1,0,0,0,102, - 103,5,1,0,0,103,104,5,49,0,0,104,105,5,26,0,0,105,118,3,54,27,0,106,107, - 5,1,0,0,107,108,5,49,0,0,108,109,5,30,0,0,109,118,3,36,18,0,110,111,5, - 1,0,0,111,112,5,49,0,0,112,113,5,26,0,0,113,114,3,54,27,0,114,115,5,30, - 0,0,115,116,3,36,18,0,116,118,1,0,0,0,117,102,1,0,0,0,117,106,1,0,0,0, - 117,110,1,0,0,0,118,11,1,0,0,0,119,120,3,36,18,0,120,121,5,28,0,0,121, - 123,1,0,0,0,122,119,1,0,0,0,123,126,1,0,0,0,124,122,1,0,0,0,124,125,1, - 0,0,0,125,127,1,0,0,0,126,124,1,0,0,0,127,129,3,36,18,0,128,124,1,0,0, - 0,128,129,1,0,0,0,129,13,1,0,0,0,130,131,5,49,0,0,131,132,5,26,0,0,132, - 133,3,54,27,0,133,134,5,28,0,0,134,136,1,0,0,0,135,130,1,0,0,0,136,139, - 1,0,0,0,137,135,1,0,0,0,137,138,1,0,0,0,138,140,1,0,0,0,139,137,1,0,0, - 0,140,141,5,49,0,0,141,142,5,26,0,0,142,144,3,54,27,0,143,137,1,0,0,0, - 143,144,1,0,0,0,144,15,1,0,0,0,145,146,5,7,0,0,146,147,5,49,0,0,147,148, - 5,20,0,0,148,149,3,14,7,0,149,153,5,21,0,0,150,151,5,37,0,0,151,152,5, - 31,0,0,152,154,3,54,27,0,153,150,1,0,0,0,153,154,1,0,0,0,154,155,1,0, - 0,0,155,156,5,24,0,0,156,157,3,18,9,0,157,158,5,25,0,0,158,17,1,0,0,0, - 159,161,3,2,1,0,160,159,1,0,0,0,161,164,1,0,0,0,162,160,1,0,0,0,162,163, - 1,0,0,0,163,19,1,0,0,0,164,162,1,0,0,0,165,166,5,3,0,0,166,168,5,20,0, - 0,167,169,3,10,5,0,168,167,1,0,0,0,168,169,1,0,0,0,169,170,1,0,0,0,170, - 172,5,27,0,0,171,173,3,36,18,0,172,171,1,0,0,0,172,173,1,0,0,0,173,174, - 1,0,0,0,174,176,5,27,0,0,175,177,3,4,2,0,176,175,1,0,0,0,176,177,1,0, - 0,0,177,178,1,0,0,0,178,179,5,21,0,0,179,180,3,2,1,0,180,21,1,0,0,0,181, - 182,5,4,0,0,182,183,5,20,0,0,183,184,3,36,18,0,184,185,5,21,0,0,185,186, - 3,2,1,0,186,23,1,0,0,0,187,188,5,5,0,0,188,189,5,20,0,0,189,190,3,36, - 18,0,190,191,5,21,0,0,191,192,3,2,1,0,192,193,6,12,-1,0,193,204,1,0,0, - 0,194,195,5,5,0,0,195,196,5,20,0,0,196,197,3,36,18,0,197,198,5,21,0,0, - 198,199,3,2,1,0,199,200,5,6,0,0,200,201,3,2,1,0,201,202,6,12,-1,0,202, - 204,1,0,0,0,203,187,1,0,0,0,203,194,1,0,0,0,204,25,1,0,0,0,205,207,5, - 8,0,0,206,208,3,2,1,0,207,206,1,0,0,0,207,208,1,0,0,0,208,27,1,0,0,0, - 209,210,5,11,0,0,210,211,3,38,19,0,211,212,5,24,0,0,212,213,3,30,15,0, - 213,214,5,25,0,0,214,29,1,0,0,0,215,217,3,2,1,0,216,215,1,0,0,0,217,220, - 1,0,0,0,218,216,1,0,0,0,218,219,1,0,0,0,219,31,1,0,0,0,220,218,1,0,0, - 0,221,222,6,16,-1,0,222,223,5,49,0,0,223,224,5,20,0,0,224,225,3,12,6, - 0,225,226,5,21,0,0,226,229,1,0,0,0,227,229,5,49,0,0,228,221,1,0,0,0,228, - 227,1,0,0,0,229,235,1,0,0,0,230,231,10,1,0,0,231,232,5,45,0,0,232,234, - 3,32,16,2,233,230,1,0,0,0,234,237,1,0,0,0,235,233,1,0,0,0,235,236,1,0, - 0,0,236,33,1,0,0,0,237,235,1,0,0,0,238,239,3,32,16,0,239,35,1,0,0,0,240, - 241,6,18,-1,0,241,242,5,32,0,0,242,243,3,54,27,0,243,244,5,31,0,0,244, - 245,5,20,0,0,245,246,3,34,17,0,246,247,5,21,0,0,247,341,1,0,0,0,248,249, - 5,20,0,0,249,250,3,36,18,0,250,251,5,21,0,0,251,341,1,0,0,0,252,253,5, - 41,0,0,253,341,3,36,18,43,254,255,5,36,0,0,255,341,3,36,18,42,256,257, - 5,37,0,0,257,341,3,36,18,41,258,259,5,36,0,0,259,260,5,36,0,0,260,341, - 3,34,17,0,261,262,3,34,17,0,262,263,5,36,0,0,263,264,5,36,0,0,264,341, - 1,0,0,0,265,266,5,37,0,0,266,267,5,37,0,0,267,341,3,34,17,0,268,269,3, - 34,17,0,269,270,5,37,0,0,270,271,5,37,0,0,271,341,1,0,0,0,272,341,3,32, - 16,0,273,274,3,34,17,0,274,275,5,30,0,0,275,276,3,36,18,16,276,341,1, - 0,0,0,277,278,3,34,17,0,278,279,5,36,0,0,279,280,5,30,0,0,280,281,3,36, - 18,15,281,341,1,0,0,0,282,283,3,34,17,0,283,284,5,37,0,0,284,285,5,30, - 0,0,285,286,3,36,18,14,286,341,1,0,0,0,287,288,3,34,17,0,288,289,5,38, - 0,0,289,290,5,30,0,0,290,291,3,36,18,13,291,341,1,0,0,0,292,293,3,34, - 17,0,293,294,5,39,0,0,294,295,5,30,0,0,295,296,3,36,18,12,296,341,1,0, - 0,0,297,298,3,34,17,0,298,299,5,40,0,0,299,300,5,30,0,0,300,301,3,36, - 18,11,301,341,1,0,0,0,302,303,3,34,17,0,303,304,5,36,0,0,304,305,5,30, - 0,0,305,306,3,36,18,10,306,341,1,0,0,0,307,308,3,34,17,0,308,309,5,42, - 0,0,309,310,5,30,0,0,310,311,3,36,18,9,311,341,1,0,0,0,312,313,3,34,17, - 0,313,314,5,43,0,0,314,315,5,30,0,0,315,316,3,36,18,8,316,341,1,0,0,0, - 317,318,3,34,17,0,318,319,5,44,0,0,319,320,5,30,0,0,320,321,3,36,18,7, - 321,341,1,0,0,0,322,323,3,34,17,0,323,324,5,33,0,0,324,325,5,30,0,0,325, - 326,3,36,18,6,326,341,1,0,0,0,327,328,3,34,17,0,328,329,5,34,0,0,329, - 330,5,30,0,0,330,331,3,36,18,5,331,341,1,0,0,0,332,333,3,34,17,0,333, - 334,5,35,0,0,334,335,5,30,0,0,335,336,3,36,18,4,336,341,1,0,0,0,337,341, - 3,44,22,0,338,341,3,40,20,0,339,341,3,42,21,0,340,240,1,0,0,0,340,248, - 1,0,0,0,340,252,1,0,0,0,340,254,1,0,0,0,340,256,1,0,0,0,340,258,1,0,0, - 0,340,261,1,0,0,0,340,265,1,0,0,0,340,268,1,0,0,0,340,272,1,0,0,0,340, - 273,1,0,0,0,340,277,1,0,0,0,340,282,1,0,0,0,340,287,1,0,0,0,340,292,1, - 0,0,0,340,297,1,0,0,0,340,302,1,0,0,0,340,307,1,0,0,0,340,312,1,0,0,0, - 340,317,1,0,0,0,340,322,1,0,0,0,340,327,1,0,0,0,340,332,1,0,0,0,340,337, - 1,0,0,0,340,338,1,0,0,0,340,339,1,0,0,0,341,406,1,0,0,0,342,343,10,35, - 0,0,343,344,5,38,0,0,344,405,3,36,18,36,345,346,10,34,0,0,346,347,5,39, - 0,0,347,405,3,36,18,35,348,349,10,33,0,0,349,350,5,40,0,0,350,405,3,36, - 18,34,351,352,10,32,0,0,352,353,5,36,0,0,353,405,3,36,18,33,354,355,10, - 31,0,0,355,356,5,37,0,0,356,405,3,36,18,32,357,358,10,30,0,0,358,359, - 5,33,0,0,359,405,3,36,18,31,360,361,10,29,0,0,361,362,5,34,0,0,362,405, - 3,36,18,30,363,364,10,28,0,0,364,365,5,35,0,0,365,405,3,36,18,29,366, - 367,10,27,0,0,367,368,5,31,0,0,368,405,3,36,18,28,369,370,10,26,0,0,370, - 371,5,32,0,0,371,405,3,36,18,27,372,373,10,25,0,0,373,374,5,31,0,0,374, - 375,5,30,0,0,375,405,3,36,18,26,376,377,10,24,0,0,377,378,5,32,0,0,378, - 379,5,30,0,0,379,405,3,36,18,25,380,381,10,23,0,0,381,382,5,29,0,0,382, - 405,3,36,18,24,383,384,10,22,0,0,384,385,5,41,0,0,385,386,5,30,0,0,386, - 405,3,36,18,23,387,388,10,21,0,0,388,389,5,42,0,0,389,405,3,36,18,22, - 390,391,10,20,0,0,391,392,5,44,0,0,392,405,3,36,18,21,393,394,10,19,0, - 0,394,395,5,43,0,0,395,405,3,36,18,20,396,397,10,18,0,0,397,398,5,42, - 0,0,398,399,5,42,0,0,399,405,3,36,18,19,400,401,10,17,0,0,401,402,5,43, - 0,0,402,403,5,43,0,0,403,405,3,36,18,18,404,342,1,0,0,0,404,345,1,0,0, - 0,404,348,1,0,0,0,404,351,1,0,0,0,404,354,1,0,0,0,404,357,1,0,0,0,404, - 360,1,0,0,0,404,363,1,0,0,0,404,366,1,0,0,0,404,369,1,0,0,0,404,372,1, - 0,0,0,404,376,1,0,0,0,404,380,1,0,0,0,404,383,1,0,0,0,404,387,1,0,0,0, - 404,390,1,0,0,0,404,393,1,0,0,0,404,396,1,0,0,0,404,400,1,0,0,0,405,408, - 1,0,0,0,406,404,1,0,0,0,406,407,1,0,0,0,407,37,1,0,0,0,408,406,1,0,0, - 0,409,410,5,49,0,0,410,39,1,0,0,0,411,414,3,48,24,0,412,414,3,46,23,0, - 413,411,1,0,0,0,413,412,1,0,0,0,414,41,1,0,0,0,415,416,5,16,0,0,416,420, - 6,21,-1,0,417,418,5,17,0,0,418,420,6,21,-1,0,419,415,1,0,0,0,419,417, - 1,0,0,0,420,43,1,0,0,0,421,422,5,60,0,0,422,45,1,0,0,0,423,424,5,54,0, - 0,424,425,6,23,-1,0,425,47,1,0,0,0,426,427,5,51,0,0,427,435,6,24,-1,0, - 428,429,5,50,0,0,429,435,6,24,-1,0,430,431,5,53,0,0,431,435,6,24,-1,0, - 432,433,5,52,0,0,433,435,6,24,-1,0,434,426,1,0,0,0,434,428,1,0,0,0,434, - 430,1,0,0,0,434,432,1,0,0,0,435,49,1,0,0,0,436,439,3,36,18,0,437,439, - 3,54,27,0,438,436,1,0,0,0,438,437,1,0,0,0,439,51,1,0,0,0,440,441,3,50, - 25,0,441,442,5,28,0,0,442,444,1,0,0,0,443,440,1,0,0,0,444,447,1,0,0,0, - 445,443,1,0,0,0,445,446,1,0,0,0,446,448,1,0,0,0,447,445,1,0,0,0,448,450, - 3,50,25,0,449,445,1,0,0,0,449,450,1,0,0,0,450,53,1,0,0,0,451,452,6,27, - -1,0,452,459,3,38,19,0,453,454,3,38,19,0,454,455,5,32,0,0,455,456,3,52, - 26,0,456,457,5,31,0,0,457,459,1,0,0,0,458,451,1,0,0,0,458,453,1,0,0,0, - 459,467,1,0,0,0,460,461,10,1,0,0,461,462,5,22,0,0,462,463,3,36,18,0,463, - 464,5,23,0,0,464,466,1,0,0,0,465,460,1,0,0,0,466,469,1,0,0,0,467,465, - 1,0,0,0,467,468,1,0,0,0,468,55,1,0,0,0,469,467,1,0,0,0,33,59,63,67,70, - 74,90,94,117,124,128,137,143,153,162,168,172,176,203,207,218,228,235, - 340,404,406,413,419,434,438,445,449,458,467 + 1,18,5,18,406,8,18,10,18,12,18,409,9,18,1,19,1,19,1,20,1,20,3,20,415, + 8,20,1,21,1,21,1,21,1,21,3,21,421,8,21,1,22,1,22,1,23,1,23,1,23,1,24, + 1,24,1,24,1,24,1,24,1,24,1,24,1,24,3,24,436,8,24,1,25,1,25,3,25,440,8, + 25,1,26,1,26,1,26,5,26,445,8,26,10,26,12,26,448,9,26,1,26,3,26,451,8, + 26,1,27,1,27,1,27,1,27,1,27,1,27,1,27,3,27,460,8,27,1,27,1,27,1,27,1, + 27,1,27,5,27,467,8,27,10,27,12,27,470,9,27,1,27,0,3,32,36,54,28,0,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, + 54,0,0,531,0,63,1,0,0,0,2,74,1,0,0,0,4,94,1,0,0,0,6,96,1,0,0,0,8,99,1, + 0,0,0,10,117,1,0,0,0,12,128,1,0,0,0,14,143,1,0,0,0,16,145,1,0,0,0,18, + 162,1,0,0,0,20,165,1,0,0,0,22,181,1,0,0,0,24,203,1,0,0,0,26,205,1,0,0, + 0,28,209,1,0,0,0,30,218,1,0,0,0,32,228,1,0,0,0,34,238,1,0,0,0,36,341, + 1,0,0,0,38,410,1,0,0,0,40,414,1,0,0,0,42,420,1,0,0,0,44,422,1,0,0,0,46, + 424,1,0,0,0,48,435,1,0,0,0,50,439,1,0,0,0,52,450,1,0,0,0,54,459,1,0,0, + 0,56,58,3,2,1,0,57,56,1,0,0,0,58,61,1,0,0,0,59,57,1,0,0,0,59,60,1,0,0, + 0,60,64,1,0,0,0,61,59,1,0,0,0,62,64,5,0,0,1,63,59,1,0,0,0,63,62,1,0,0, + 0,64,1,1,0,0,0,65,67,3,4,2,0,66,68,5,28,0,0,67,66,1,0,0,0,67,68,1,0,0, + 0,68,70,1,0,0,0,69,71,5,49,0,0,70,69,1,0,0,0,70,71,1,0,0,0,71,75,1,0, + 0,0,72,75,5,28,0,0,73,75,5,49,0,0,74,65,1,0,0,0,74,72,1,0,0,0,74,73,1, + 0,0,0,75,3,1,0,0,0,76,95,3,6,3,0,77,95,3,8,4,0,78,95,3,28,14,0,79,95, + 3,16,8,0,80,95,3,10,5,0,81,95,3,20,10,0,82,95,3,22,11,0,83,95,3,24,12, + 0,84,95,3,26,13,0,85,95,3,36,18,0,86,90,5,25,0,0,87,89,3,2,1,0,88,87, + 1,0,0,0,89,92,1,0,0,0,90,88,1,0,0,0,90,91,1,0,0,0,91,93,1,0,0,0,92,90, + 1,0,0,0,93,95,5,26,0,0,94,76,1,0,0,0,94,77,1,0,0,0,94,78,1,0,0,0,94,79, + 1,0,0,0,94,80,1,0,0,0,94,81,1,0,0,0,94,82,1,0,0,0,94,83,1,0,0,0,94,84, + 1,0,0,0,94,85,1,0,0,0,94,86,1,0,0,0,95,5,1,0,0,0,96,97,5,10,0,0,97,98, + 3,38,19,0,98,7,1,0,0,0,99,100,5,9,0,0,100,101,3,38,19,0,101,9,1,0,0,0, + 102,103,5,1,0,0,103,104,5,50,0,0,104,105,5,27,0,0,105,118,3,54,27,0,106, + 107,5,1,0,0,107,108,5,50,0,0,108,109,5,31,0,0,109,118,3,36,18,0,110,111, + 5,1,0,0,111,112,5,50,0,0,112,113,5,27,0,0,113,114,3,54,27,0,114,115,5, + 31,0,0,115,116,3,36,18,0,116,118,1,0,0,0,117,102,1,0,0,0,117,106,1,0, + 0,0,117,110,1,0,0,0,118,11,1,0,0,0,119,120,3,36,18,0,120,121,5,29,0,0, + 121,123,1,0,0,0,122,119,1,0,0,0,123,126,1,0,0,0,124,122,1,0,0,0,124,125, + 1,0,0,0,125,127,1,0,0,0,126,124,1,0,0,0,127,129,3,36,18,0,128,124,1,0, + 0,0,128,129,1,0,0,0,129,13,1,0,0,0,130,131,5,50,0,0,131,132,5,27,0,0, + 132,133,3,54,27,0,133,134,5,29,0,0,134,136,1,0,0,0,135,130,1,0,0,0,136, + 139,1,0,0,0,137,135,1,0,0,0,137,138,1,0,0,0,138,140,1,0,0,0,139,137,1, + 0,0,0,140,141,5,50,0,0,141,142,5,27,0,0,142,144,3,54,27,0,143,137,1,0, + 0,0,143,144,1,0,0,0,144,15,1,0,0,0,145,146,5,7,0,0,146,147,5,50,0,0,147, + 148,5,21,0,0,148,149,3,14,7,0,149,153,5,22,0,0,150,151,5,38,0,0,151,152, + 5,32,0,0,152,154,3,54,27,0,153,150,1,0,0,0,153,154,1,0,0,0,154,155,1, + 0,0,0,155,156,5,25,0,0,156,157,3,18,9,0,157,158,5,26,0,0,158,17,1,0,0, + 0,159,161,3,2,1,0,160,159,1,0,0,0,161,164,1,0,0,0,162,160,1,0,0,0,162, + 163,1,0,0,0,163,19,1,0,0,0,164,162,1,0,0,0,165,166,5,3,0,0,166,168,5, + 21,0,0,167,169,3,10,5,0,168,167,1,0,0,0,168,169,1,0,0,0,169,170,1,0,0, + 0,170,172,5,28,0,0,171,173,3,36,18,0,172,171,1,0,0,0,172,173,1,0,0,0, + 173,174,1,0,0,0,174,176,5,28,0,0,175,177,3,4,2,0,176,175,1,0,0,0,176, + 177,1,0,0,0,177,178,1,0,0,0,178,179,5,22,0,0,179,180,3,2,1,0,180,21,1, + 0,0,0,181,182,5,4,0,0,182,183,5,21,0,0,183,184,3,36,18,0,184,185,5,22, + 0,0,185,186,3,2,1,0,186,23,1,0,0,0,187,188,5,5,0,0,188,189,5,21,0,0,189, + 190,3,36,18,0,190,191,5,22,0,0,191,192,3,2,1,0,192,193,6,12,-1,0,193, + 204,1,0,0,0,194,195,5,5,0,0,195,196,5,21,0,0,196,197,3,36,18,0,197,198, + 5,22,0,0,198,199,3,2,1,0,199,200,5,6,0,0,200,201,3,2,1,0,201,202,6,12, + -1,0,202,204,1,0,0,0,203,187,1,0,0,0,203,194,1,0,0,0,204,25,1,0,0,0,205, + 207,5,8,0,0,206,208,3,2,1,0,207,206,1,0,0,0,207,208,1,0,0,0,208,27,1, + 0,0,0,209,210,5,11,0,0,210,211,3,38,19,0,211,212,5,25,0,0,212,213,3,30, + 15,0,213,214,5,26,0,0,214,29,1,0,0,0,215,217,3,2,1,0,216,215,1,0,0,0, + 217,220,1,0,0,0,218,216,1,0,0,0,218,219,1,0,0,0,219,31,1,0,0,0,220,218, + 1,0,0,0,221,222,6,16,-1,0,222,223,5,50,0,0,223,224,5,21,0,0,224,225,3, + 12,6,0,225,226,5,22,0,0,226,229,1,0,0,0,227,229,5,50,0,0,228,221,1,0, + 0,0,228,227,1,0,0,0,229,235,1,0,0,0,230,231,10,1,0,0,231,232,5,46,0,0, + 232,234,3,32,16,2,233,230,1,0,0,0,234,237,1,0,0,0,235,233,1,0,0,0,235, + 236,1,0,0,0,236,33,1,0,0,0,237,235,1,0,0,0,238,239,3,32,16,0,239,35,1, + 0,0,0,240,241,6,18,-1,0,241,242,5,33,0,0,242,243,3,54,27,0,243,244,5, + 32,0,0,244,245,5,21,0,0,245,246,3,34,17,0,246,247,5,22,0,0,247,342,1, + 0,0,0,248,249,5,21,0,0,249,250,3,36,18,0,250,251,5,22,0,0,251,342,1,0, + 0,0,252,253,5,42,0,0,253,342,3,36,18,44,254,255,5,37,0,0,255,342,3,36, + 18,43,256,257,5,38,0,0,257,342,3,36,18,42,258,259,5,37,0,0,259,260,5, + 37,0,0,260,342,3,34,17,0,261,262,3,34,17,0,262,263,5,37,0,0,263,264,5, + 37,0,0,264,342,1,0,0,0,265,266,5,38,0,0,266,267,5,38,0,0,267,342,3,34, + 17,0,268,269,3,34,17,0,269,270,5,38,0,0,270,271,5,38,0,0,271,342,1,0, + 0,0,272,342,3,32,16,0,273,274,3,34,17,0,274,275,5,31,0,0,275,276,3,36, + 18,17,276,342,1,0,0,0,277,278,3,34,17,0,278,279,5,37,0,0,279,280,5,31, + 0,0,280,281,3,36,18,16,281,342,1,0,0,0,282,283,3,34,17,0,283,284,5,38, + 0,0,284,285,5,31,0,0,285,286,3,36,18,15,286,342,1,0,0,0,287,288,3,34, + 17,0,288,289,5,39,0,0,289,290,5,31,0,0,290,291,3,36,18,14,291,342,1,0, + 0,0,292,293,3,34,17,0,293,294,5,40,0,0,294,295,5,31,0,0,295,296,3,36, + 18,13,296,342,1,0,0,0,297,298,3,34,17,0,298,299,5,41,0,0,299,300,5,31, + 0,0,300,301,3,36,18,12,301,342,1,0,0,0,302,303,3,34,17,0,303,304,5,37, + 0,0,304,305,5,31,0,0,305,306,3,36,18,11,306,342,1,0,0,0,307,308,3,34, + 17,0,308,309,5,43,0,0,309,310,5,31,0,0,310,311,3,36,18,10,311,342,1,0, + 0,0,312,313,3,34,17,0,313,314,5,44,0,0,314,315,5,31,0,0,315,316,3,36, + 18,9,316,342,1,0,0,0,317,318,3,34,17,0,318,319,5,45,0,0,319,320,5,31, + 0,0,320,321,3,36,18,8,321,342,1,0,0,0,322,323,3,34,17,0,323,324,5,34, + 0,0,324,325,5,31,0,0,325,326,3,36,18,7,326,342,1,0,0,0,327,328,3,34,17, + 0,328,329,5,35,0,0,329,330,5,31,0,0,330,331,3,36,18,6,331,342,1,0,0,0, + 332,333,3,34,17,0,333,334,5,36,0,0,334,335,5,31,0,0,335,336,3,36,18,5, + 336,342,1,0,0,0,337,342,3,44,22,0,338,342,3,40,20,0,339,342,3,42,21,0, + 340,342,5,20,0,0,341,240,1,0,0,0,341,248,1,0,0,0,341,252,1,0,0,0,341, + 254,1,0,0,0,341,256,1,0,0,0,341,258,1,0,0,0,341,261,1,0,0,0,341,265,1, + 0,0,0,341,268,1,0,0,0,341,272,1,0,0,0,341,273,1,0,0,0,341,277,1,0,0,0, + 341,282,1,0,0,0,341,287,1,0,0,0,341,292,1,0,0,0,341,297,1,0,0,0,341,302, + 1,0,0,0,341,307,1,0,0,0,341,312,1,0,0,0,341,317,1,0,0,0,341,322,1,0,0, + 0,341,327,1,0,0,0,341,332,1,0,0,0,341,337,1,0,0,0,341,338,1,0,0,0,341, + 339,1,0,0,0,341,340,1,0,0,0,342,407,1,0,0,0,343,344,10,36,0,0,344,345, + 5,39,0,0,345,406,3,36,18,37,346,347,10,35,0,0,347,348,5,40,0,0,348,406, + 3,36,18,36,349,350,10,34,0,0,350,351,5,41,0,0,351,406,3,36,18,35,352, + 353,10,33,0,0,353,354,5,37,0,0,354,406,3,36,18,34,355,356,10,32,0,0,356, + 357,5,38,0,0,357,406,3,36,18,33,358,359,10,31,0,0,359,360,5,34,0,0,360, + 406,3,36,18,32,361,362,10,30,0,0,362,363,5,35,0,0,363,406,3,36,18,31, + 364,365,10,29,0,0,365,366,5,36,0,0,366,406,3,36,18,30,367,368,10,28,0, + 0,368,369,5,32,0,0,369,406,3,36,18,29,370,371,10,27,0,0,371,372,5,33, + 0,0,372,406,3,36,18,28,373,374,10,26,0,0,374,375,5,32,0,0,375,376,5,31, + 0,0,376,406,3,36,18,27,377,378,10,25,0,0,378,379,5,33,0,0,379,380,5,31, + 0,0,380,406,3,36,18,26,381,382,10,24,0,0,382,383,5,30,0,0,383,406,3,36, + 18,25,384,385,10,23,0,0,385,386,5,42,0,0,386,387,5,31,0,0,387,406,3,36, + 18,24,388,389,10,22,0,0,389,390,5,43,0,0,390,406,3,36,18,23,391,392,10, + 21,0,0,392,393,5,45,0,0,393,406,3,36,18,22,394,395,10,20,0,0,395,396, + 5,44,0,0,396,406,3,36,18,21,397,398,10,19,0,0,398,399,5,43,0,0,399,400, + 5,43,0,0,400,406,3,36,18,20,401,402,10,18,0,0,402,403,5,44,0,0,403,404, + 5,44,0,0,404,406,3,36,18,19,405,343,1,0,0,0,405,346,1,0,0,0,405,349,1, + 0,0,0,405,352,1,0,0,0,405,355,1,0,0,0,405,358,1,0,0,0,405,361,1,0,0,0, + 405,364,1,0,0,0,405,367,1,0,0,0,405,370,1,0,0,0,405,373,1,0,0,0,405,377, + 1,0,0,0,405,381,1,0,0,0,405,384,1,0,0,0,405,388,1,0,0,0,405,391,1,0,0, + 0,405,394,1,0,0,0,405,397,1,0,0,0,405,401,1,0,0,0,406,409,1,0,0,0,407, + 405,1,0,0,0,407,408,1,0,0,0,408,37,1,0,0,0,409,407,1,0,0,0,410,411,5, + 50,0,0,411,39,1,0,0,0,412,415,3,48,24,0,413,415,3,46,23,0,414,412,1,0, + 0,0,414,413,1,0,0,0,415,41,1,0,0,0,416,417,5,16,0,0,417,421,6,21,-1,0, + 418,419,5,17,0,0,419,421,6,21,-1,0,420,416,1,0,0,0,420,418,1,0,0,0,421, + 43,1,0,0,0,422,423,5,61,0,0,423,45,1,0,0,0,424,425,5,55,0,0,425,426,6, + 23,-1,0,426,47,1,0,0,0,427,428,5,52,0,0,428,436,6,24,-1,0,429,430,5,51, + 0,0,430,436,6,24,-1,0,431,432,5,54,0,0,432,436,6,24,-1,0,433,434,5,53, + 0,0,434,436,6,24,-1,0,435,427,1,0,0,0,435,429,1,0,0,0,435,431,1,0,0,0, + 435,433,1,0,0,0,436,49,1,0,0,0,437,440,3,36,18,0,438,440,3,54,27,0,439, + 437,1,0,0,0,439,438,1,0,0,0,440,51,1,0,0,0,441,442,3,50,25,0,442,443, + 5,29,0,0,443,445,1,0,0,0,444,441,1,0,0,0,445,448,1,0,0,0,446,444,1,0, + 0,0,446,447,1,0,0,0,447,449,1,0,0,0,448,446,1,0,0,0,449,451,3,50,25,0, + 450,446,1,0,0,0,450,451,1,0,0,0,451,53,1,0,0,0,452,453,6,27,-1,0,453, + 460,3,38,19,0,454,455,3,38,19,0,455,456,5,33,0,0,456,457,3,52,26,0,457, + 458,5,32,0,0,458,460,1,0,0,0,459,452,1,0,0,0,459,454,1,0,0,0,460,468, + 1,0,0,0,461,462,10,1,0,0,462,463,5,23,0,0,463,464,3,36,18,0,464,465,5, + 24,0,0,465,467,1,0,0,0,466,461,1,0,0,0,467,470,1,0,0,0,468,466,1,0,0, + 0,468,469,1,0,0,0,469,55,1,0,0,0,470,468,1,0,0,0,33,59,63,67,70,74,90, + 94,117,124,128,137,143,153,162,168,172,176,203,207,218,228,235,341,405, + 407,414,420,435,439,446,450,459,468 }; staticData->serializedATN = antlr4::atn::SerializedATNView(serializedATNSegment, sizeof(serializedATNSegment) / sizeof(serializedATNSegment[0])); @@ -357,7 +359,7 @@ RiddleParser::ProgramContext* RiddleParser::program() { _errHandler->sync(this); _la = _input->LA(1); while ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188671236277997498) != 0)) { + ((1ULL << _la) & 2377342472556842938) != 0)) { setState(56); statement_ed(); setState(61); @@ -457,6 +459,7 @@ RiddleParser::Statement_edContext* RiddleParser::statement_ed() { case RiddleParser::Class: case RiddleParser::True: case RiddleParser::False: + case RiddleParser::Null: case RiddleParser::LeftBracket: case RiddleParser::LeftCurly: case RiddleParser::Less: @@ -698,6 +701,7 @@ RiddleParser::StatementContext* RiddleParser::statement() { case RiddleParser::True: case RiddleParser::False: + case RiddleParser::Null: case RiddleParser::LeftBracket: case RiddleParser::Less: case RiddleParser::Add: @@ -724,7 +728,7 @@ RiddleParser::StatementContext* RiddleParser::statement() { _errHandler->sync(this); _la = _input->LA(1); while ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188671236277997498) != 0)) { + ((1ULL << _la) & 2377342472556842938) != 0)) { setState(87); statement_ed(); setState(92); @@ -1078,7 +1082,7 @@ RiddleParser::ArgsExprContext* RiddleParser::argsExpr() { _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188389761150287872) != 0)) { + ((1ULL << _la) & 2376779522301427712) != 0)) { setState(124); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 8, _ctx); @@ -1412,7 +1416,7 @@ RiddleParser::FuncBodyContext* RiddleParser::funcBody() { _errHandler->sync(this); _la = _input->LA(1); while ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188671236277997498) != 0)) { + ((1ULL << _la) & 2377342472556842938) != 0)) { setState(159); statement_ed(); setState(164); @@ -1530,7 +1534,7 @@ RiddleParser::ForStatementContext* RiddleParser::forStatement() { _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188389761150287872) != 0)) { + ((1ULL << _la) & 2376779522301427712) != 0)) { setState(171); antlrcpp::downCast(_localctx)->termCond = expression(0); } @@ -1541,7 +1545,7 @@ RiddleParser::ForStatementContext* RiddleParser::forStatement() { _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188389761167069114) != 0)) { + ((1ULL << _la) & 2376779522334986170) != 0)) { setState(175); antlrcpp::downCast(_localctx)->selfVar = statement(); } @@ -1989,7 +1993,7 @@ RiddleParser::ClassBodyContext* RiddleParser::classBody() { _errHandler->sync(this); _la = _input->LA(1); while ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188671236277997498) != 0)) { + ((1ULL << _la) & 2377342472556842938) != 0)) { setState(215); statement_ed(); setState(220); @@ -2354,6 +2358,31 @@ std::any RiddleParser::AndAssignExprContext::accept(tree::ParseTreeVisitor *visi else return visitor->visitChildren(this); } +//----------------- NullExprContext ------------------------------------------------------------------ + +tree::TerminalNode* RiddleParser::NullExprContext::Null() { + return getToken(RiddleParser::Null, 0); +} + +RiddleParser::NullExprContext::NullExprContext(ExpressionContext *ctx) { copyFrom(ctx); } + +void RiddleParser::NullExprContext::enterRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->enterNullExpr(this); +} +void RiddleParser::NullExprContext::exitRule(tree::ParseTreeListener *listener) { + auto parserListener = dynamic_cast(listener); + if (parserListener != nullptr) + parserListener->exitNullExpr(this); +} + +std::any RiddleParser::NullExprContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNullExpr(this); + else + return visitor->visitChildren(this); +} //----------------- ModExprContext ------------------------------------------------------------------ tree::TerminalNode* RiddleParser::ModExprContext::Mod() { @@ -3794,7 +3823,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { try { size_t alt; enterOuterAlt(_localctx, 1); - setState(340); + setState(341); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 22, _ctx)) { case 1: { @@ -3837,7 +3866,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(252); match(RiddleParser::Not); setState(253); - antlrcpp::downCast(_localctx)->expr = expression(43); + antlrcpp::downCast(_localctx)->expr = expression(44); break; } @@ -3848,7 +3877,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(254); match(RiddleParser::Add); setState(255); - antlrcpp::downCast(_localctx)->expr = expression(42); + antlrcpp::downCast(_localctx)->expr = expression(43); break; } @@ -3859,7 +3888,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(256); match(RiddleParser::Sub); setState(257); - antlrcpp::downCast(_localctx)->expr = expression(41); + antlrcpp::downCast(_localctx)->expr = expression(42); break; } @@ -3933,7 +3962,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(274); match(RiddleParser::Assign); setState(275); - antlrcpp::downCast(_localctx)->right = expression(16); + antlrcpp::downCast(_localctx)->right = expression(17); break; } @@ -3948,7 +3977,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(279); match(RiddleParser::Assign); setState(280); - antlrcpp::downCast(_localctx)->right = expression(15); + antlrcpp::downCast(_localctx)->right = expression(16); break; } @@ -3963,7 +3992,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(284); match(RiddleParser::Assign); setState(285); - antlrcpp::downCast(_localctx)->right = expression(14); + antlrcpp::downCast(_localctx)->right = expression(15); break; } @@ -3978,7 +4007,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(289); match(RiddleParser::Assign); setState(290); - antlrcpp::downCast(_localctx)->right = expression(13); + antlrcpp::downCast(_localctx)->right = expression(14); break; } @@ -3993,7 +4022,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(294); match(RiddleParser::Assign); setState(295); - antlrcpp::downCast(_localctx)->right = expression(12); + antlrcpp::downCast(_localctx)->right = expression(13); break; } @@ -4008,7 +4037,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(299); match(RiddleParser::Assign); setState(300); - antlrcpp::downCast(_localctx)->right = expression(11); + antlrcpp::downCast(_localctx)->right = expression(12); break; } @@ -4023,7 +4052,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(304); match(RiddleParser::Assign); setState(305); - antlrcpp::downCast(_localctx)->right = expression(10); + antlrcpp::downCast(_localctx)->right = expression(11); break; } @@ -4038,7 +4067,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(309); match(RiddleParser::Assign); setState(310); - antlrcpp::downCast(_localctx)->right = expression(9); + antlrcpp::downCast(_localctx)->right = expression(10); break; } @@ -4053,7 +4082,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(314); match(RiddleParser::Assign); setState(315); - antlrcpp::downCast(_localctx)->right = expression(8); + antlrcpp::downCast(_localctx)->right = expression(9); break; } @@ -4068,7 +4097,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(319); match(RiddleParser::Assign); setState(320); - antlrcpp::downCast(_localctx)->right = expression(7); + antlrcpp::downCast(_localctx)->right = expression(8); break; } @@ -4083,7 +4112,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(324); match(RiddleParser::Assign); setState(325); - antlrcpp::downCast(_localctx)->right = expression(6); + antlrcpp::downCast(_localctx)->right = expression(7); break; } @@ -4098,7 +4127,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(329); match(RiddleParser::Assign); setState(330); - antlrcpp::downCast(_localctx)->right = expression(5); + antlrcpp::downCast(_localctx)->right = expression(6); break; } @@ -4113,7 +4142,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { setState(334); match(RiddleParser::Assign); setState(335); - antlrcpp::downCast(_localctx)->right = expression(4); + antlrcpp::downCast(_localctx)->right = expression(5); break; } @@ -4144,11 +4173,20 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { break; } + case 27: { + _localctx = _tracker.createInstance(_localctx); + _ctx = _localctx; + previousContext = _localctx; + setState(340); + match(RiddleParser::Null); + break; + } + default: break; } _ctx->stop = _input->LT(-1); - setState(406); + setState(407); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 24, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { @@ -4156,7 +4194,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { if (!_parseListeners.empty()) triggerExitRuleEvent(); previousContext = _localctx; - setState(404); + setState(405); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 23, _ctx)) { case 1: { @@ -4164,13 +4202,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(342); - - if (!(precpred(_ctx, 35))) throw FailedPredicateException(this, "precpred(_ctx, 35)"); setState(343); - match(RiddleParser::Star); + + if (!(precpred(_ctx, 36))) throw FailedPredicateException(this, "precpred(_ctx, 36)"); setState(344); - antlrcpp::downCast(_localctx)->right = expression(36); + match(RiddleParser::Star); + setState(345); + antlrcpp::downCast(_localctx)->right = expression(37); break; } @@ -4179,13 +4217,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(345); - - if (!(precpred(_ctx, 34))) throw FailedPredicateException(this, "precpred(_ctx, 34)"); setState(346); - match(RiddleParser::Div); + + if (!(precpred(_ctx, 35))) throw FailedPredicateException(this, "precpred(_ctx, 35)"); setState(347); - antlrcpp::downCast(_localctx)->right = expression(35); + match(RiddleParser::Div); + setState(348); + antlrcpp::downCast(_localctx)->right = expression(36); break; } @@ -4194,13 +4232,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(348); - - if (!(precpred(_ctx, 33))) throw FailedPredicateException(this, "precpred(_ctx, 33)"); setState(349); - match(RiddleParser::Mod); + + if (!(precpred(_ctx, 34))) throw FailedPredicateException(this, "precpred(_ctx, 34)"); setState(350); - antlrcpp::downCast(_localctx)->right = expression(34); + match(RiddleParser::Mod); + setState(351); + antlrcpp::downCast(_localctx)->right = expression(35); break; } @@ -4209,13 +4247,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(351); - - if (!(precpred(_ctx, 32))) throw FailedPredicateException(this, "precpred(_ctx, 32)"); setState(352); - match(RiddleParser::Add); + + if (!(precpred(_ctx, 33))) throw FailedPredicateException(this, "precpred(_ctx, 33)"); setState(353); - antlrcpp::downCast(_localctx)->right = expression(33); + match(RiddleParser::Add); + setState(354); + antlrcpp::downCast(_localctx)->right = expression(34); break; } @@ -4224,13 +4262,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(354); - - if (!(precpred(_ctx, 31))) throw FailedPredicateException(this, "precpred(_ctx, 31)"); setState(355); - match(RiddleParser::Sub); + + if (!(precpred(_ctx, 32))) throw FailedPredicateException(this, "precpred(_ctx, 32)"); setState(356); - antlrcpp::downCast(_localctx)->right = expression(32); + match(RiddleParser::Sub); + setState(357); + antlrcpp::downCast(_localctx)->right = expression(33); break; } @@ -4239,13 +4277,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(357); - - if (!(precpred(_ctx, 30))) throw FailedPredicateException(this, "precpred(_ctx, 30)"); setState(358); - match(RiddleParser::LeftLeft); + + if (!(precpred(_ctx, 31))) throw FailedPredicateException(this, "precpred(_ctx, 31)"); setState(359); - antlrcpp::downCast(_localctx)->right = expression(31); + match(RiddleParser::LeftLeft); + setState(360); + antlrcpp::downCast(_localctx)->right = expression(32); break; } @@ -4254,13 +4292,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(360); - - if (!(precpred(_ctx, 29))) throw FailedPredicateException(this, "precpred(_ctx, 29)"); setState(361); - match(RiddleParser::RightRight); + + if (!(precpred(_ctx, 30))) throw FailedPredicateException(this, "precpred(_ctx, 30)"); setState(362); - antlrcpp::downCast(_localctx)->right = expression(30); + match(RiddleParser::RightRight); + setState(363); + antlrcpp::downCast(_localctx)->right = expression(31); break; } @@ -4269,13 +4307,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(363); - - if (!(precpred(_ctx, 28))) throw FailedPredicateException(this, "precpred(_ctx, 28)"); setState(364); - match(RiddleParser::RightRightRight); + + if (!(precpred(_ctx, 29))) throw FailedPredicateException(this, "precpred(_ctx, 29)"); setState(365); - antlrcpp::downCast(_localctx)->right = expression(29); + match(RiddleParser::RightRightRight); + setState(366); + antlrcpp::downCast(_localctx)->right = expression(30); break; } @@ -4284,13 +4322,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(366); - - if (!(precpred(_ctx, 27))) throw FailedPredicateException(this, "precpred(_ctx, 27)"); setState(367); - match(RiddleParser::Greater); + + if (!(precpred(_ctx, 28))) throw FailedPredicateException(this, "precpred(_ctx, 28)"); setState(368); - antlrcpp::downCast(_localctx)->right = expression(28); + match(RiddleParser::Greater); + setState(369); + antlrcpp::downCast(_localctx)->right = expression(29); break; } @@ -4299,13 +4337,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(369); - - if (!(precpred(_ctx, 26))) throw FailedPredicateException(this, "precpred(_ctx, 26)"); setState(370); - match(RiddleParser::Less); + + if (!(precpred(_ctx, 27))) throw FailedPredicateException(this, "precpred(_ctx, 27)"); setState(371); - antlrcpp::downCast(_localctx)->right = expression(27); + match(RiddleParser::Less); + setState(372); + antlrcpp::downCast(_localctx)->right = expression(28); break; } @@ -4314,15 +4352,15 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(372); - - if (!(precpred(_ctx, 25))) throw FailedPredicateException(this, "precpred(_ctx, 25)"); setState(373); - match(RiddleParser::Greater); + + if (!(precpred(_ctx, 26))) throw FailedPredicateException(this, "precpred(_ctx, 26)"); setState(374); - match(RiddleParser::Assign); + match(RiddleParser::Greater); setState(375); - antlrcpp::downCast(_localctx)->right = expression(26); + match(RiddleParser::Assign); + setState(376); + antlrcpp::downCast(_localctx)->right = expression(27); break; } @@ -4331,15 +4369,15 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(376); - - if (!(precpred(_ctx, 24))) throw FailedPredicateException(this, "precpred(_ctx, 24)"); setState(377); - match(RiddleParser::Less); + + if (!(precpred(_ctx, 25))) throw FailedPredicateException(this, "precpred(_ctx, 25)"); setState(378); - match(RiddleParser::Assign); + match(RiddleParser::Less); setState(379); - antlrcpp::downCast(_localctx)->right = expression(25); + match(RiddleParser::Assign); + setState(380); + antlrcpp::downCast(_localctx)->right = expression(26); break; } @@ -4348,13 +4386,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(380); - - if (!(precpred(_ctx, 23))) throw FailedPredicateException(this, "precpred(_ctx, 23)"); setState(381); - match(RiddleParser::Equal); + + if (!(precpred(_ctx, 24))) throw FailedPredicateException(this, "precpred(_ctx, 24)"); setState(382); - antlrcpp::downCast(_localctx)->right = expression(24); + match(RiddleParser::Equal); + setState(383); + antlrcpp::downCast(_localctx)->right = expression(25); break; } @@ -4363,15 +4401,15 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(383); - - if (!(precpred(_ctx, 22))) throw FailedPredicateException(this, "precpred(_ctx, 22)"); setState(384); - match(RiddleParser::Not); + + if (!(precpred(_ctx, 23))) throw FailedPredicateException(this, "precpred(_ctx, 23)"); setState(385); - match(RiddleParser::Assign); + match(RiddleParser::Not); setState(386); - antlrcpp::downCast(_localctx)->right = expression(23); + match(RiddleParser::Assign); + setState(387); + antlrcpp::downCast(_localctx)->right = expression(24); break; } @@ -4380,13 +4418,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(387); - - if (!(precpred(_ctx, 21))) throw FailedPredicateException(this, "precpred(_ctx, 21)"); setState(388); - match(RiddleParser::And); + + if (!(precpred(_ctx, 22))) throw FailedPredicateException(this, "precpred(_ctx, 22)"); setState(389); - antlrcpp::downCast(_localctx)->right = expression(22); + match(RiddleParser::And); + setState(390); + antlrcpp::downCast(_localctx)->right = expression(23); break; } @@ -4395,13 +4433,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(390); - - if (!(precpred(_ctx, 20))) throw FailedPredicateException(this, "precpred(_ctx, 20)"); setState(391); - match(RiddleParser::Xor); + + if (!(precpred(_ctx, 21))) throw FailedPredicateException(this, "precpred(_ctx, 21)"); setState(392); - antlrcpp::downCast(_localctx)->right = expression(21); + match(RiddleParser::Xor); + setState(393); + antlrcpp::downCast(_localctx)->right = expression(22); break; } @@ -4410,13 +4448,13 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(393); - - if (!(precpred(_ctx, 19))) throw FailedPredicateException(this, "precpred(_ctx, 19)"); setState(394); - match(RiddleParser::Or); + + if (!(precpred(_ctx, 20))) throw FailedPredicateException(this, "precpred(_ctx, 20)"); setState(395); - antlrcpp::downCast(_localctx)->right = expression(20); + match(RiddleParser::Or); + setState(396); + antlrcpp::downCast(_localctx)->right = expression(21); break; } @@ -4425,15 +4463,15 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(396); - - if (!(precpred(_ctx, 18))) throw FailedPredicateException(this, "precpred(_ctx, 18)"); setState(397); - match(RiddleParser::And); + + if (!(precpred(_ctx, 19))) throw FailedPredicateException(this, "precpred(_ctx, 19)"); setState(398); match(RiddleParser::And); setState(399); - antlrcpp::downCast(_localctx)->right = expression(19); + match(RiddleParser::And); + setState(400); + antlrcpp::downCast(_localctx)->right = expression(20); break; } @@ -4442,15 +4480,15 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { _localctx = newContext; newContext->left = previousContext; pushNewRecursionContext(newContext, startState, RuleExpression); - setState(400); - - if (!(precpred(_ctx, 17))) throw FailedPredicateException(this, "precpred(_ctx, 17)"); setState(401); - match(RiddleParser::Or); + + if (!(precpred(_ctx, 18))) throw FailedPredicateException(this, "precpred(_ctx, 18)"); setState(402); match(RiddleParser::Or); setState(403); - antlrcpp::downCast(_localctx)->right = expression(18); + match(RiddleParser::Or); + setState(404); + antlrcpp::downCast(_localctx)->right = expression(19); break; } @@ -4458,7 +4496,7 @@ RiddleParser::ExpressionContext* RiddleParser::expression(int precedence) { break; } } - setState(408); + setState(409); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 24, _ctx); } @@ -4519,7 +4557,7 @@ RiddleParser::IdContext* RiddleParser::id() { }); try { enterOuterAlt(_localctx, 1); - setState(409); + setState(410); match(RiddleParser::Identifier); } @@ -4583,7 +4621,7 @@ RiddleParser::NumberContext* RiddleParser::number() { exitRule(); }); try { - setState(413); + setState(414); _errHandler->sync(this); switch (_input->LA(1)) { case RiddleParser::Hexadecimal: @@ -4591,14 +4629,14 @@ RiddleParser::NumberContext* RiddleParser::number() { case RiddleParser::Octal: case RiddleParser::Binary: { enterOuterAlt(_localctx, 1); - setState(411); + setState(412); integer(); break; } case RiddleParser::Float: { enterOuterAlt(_localctx, 2); - setState(412); + setState(413); float_(); break; } @@ -4668,12 +4706,12 @@ RiddleParser::BooleanContext* RiddleParser::boolean() { exitRule(); }); try { - setState(419); + setState(420); _errHandler->sync(this); switch (_input->LA(1)) { case RiddleParser::True: { enterOuterAlt(_localctx, 1); - setState(415); + setState(416); match(RiddleParser::True); antlrcpp::downCast(_localctx)->value = true; break; @@ -4681,7 +4719,7 @@ RiddleParser::BooleanContext* RiddleParser::boolean() { case RiddleParser::False: { enterOuterAlt(_localctx, 2); - setState(417); + setState(418); match(RiddleParser::False); antlrcpp::downCast(_localctx)->value = false; break; @@ -4749,7 +4787,7 @@ RiddleParser::StringContext* RiddleParser::string() { }); try { enterOuterAlt(_localctx, 1); - setState(421); + setState(422); match(RiddleParser::STRING); } @@ -4810,7 +4848,7 @@ RiddleParser::FloatContext* RiddleParser::float_() { }); try { enterOuterAlt(_localctx, 1); - setState(423); + setState(424); antlrcpp::downCast(_localctx)->floatToken = match(RiddleParser::Float); antlrcpp::downCast(_localctx)->value = stod((antlrcpp::downCast(_localctx)->floatToken != nullptr ? antlrcpp::downCast(_localctx)->floatToken->getText() : "")); @@ -4885,12 +4923,12 @@ RiddleParser::IntegerContext* RiddleParser::integer() { exitRule(); }); try { - setState(434); + setState(435); _errHandler->sync(this); switch (_input->LA(1)) { case RiddleParser::Decimal: { enterOuterAlt(_localctx, 1); - setState(426); + setState(427); antlrcpp::downCast(_localctx)->decimalToken = match(RiddleParser::Decimal); antlrcpp::downCast(_localctx)->value = stoi((antlrcpp::downCast(_localctx)->decimalToken != nullptr ? antlrcpp::downCast(_localctx)->decimalToken->getText() : "")); @@ -4900,7 +4938,7 @@ RiddleParser::IntegerContext* RiddleParser::integer() { case RiddleParser::Hexadecimal: { enterOuterAlt(_localctx, 2); - setState(428); + setState(429); antlrcpp::downCast(_localctx)->hexadecimalToken = match(RiddleParser::Hexadecimal); antlrcpp::downCast(_localctx)->value = stoi((antlrcpp::downCast(_localctx)->hexadecimalToken != nullptr ? antlrcpp::downCast(_localctx)->hexadecimalToken->getText() : "").substr(2),nullptr,16); @@ -4910,7 +4948,7 @@ RiddleParser::IntegerContext* RiddleParser::integer() { case RiddleParser::Binary: { enterOuterAlt(_localctx, 3); - setState(430); + setState(431); antlrcpp::downCast(_localctx)->binaryToken = match(RiddleParser::Binary); antlrcpp::downCast(_localctx)->value = stoi((antlrcpp::downCast(_localctx)->binaryToken != nullptr ? antlrcpp::downCast(_localctx)->binaryToken->getText() : "").substr(2),nullptr,2); @@ -4920,7 +4958,7 @@ RiddleParser::IntegerContext* RiddleParser::integer() { case RiddleParser::Octal: { enterOuterAlt(_localctx, 4); - setState(432); + setState(433); antlrcpp::downCast(_localctx)->octalToken = match(RiddleParser::Octal); antlrcpp::downCast(_localctx)->value = stoi((antlrcpp::downCast(_localctx)->octalToken != nullptr ? antlrcpp::downCast(_localctx)->octalToken->getText() : "").substr(1),nullptr,8); @@ -4993,19 +5031,19 @@ RiddleParser::TemplateArgContext* RiddleParser::templateArg() { exitRule(); }); try { - setState(438); + setState(439); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 28, _ctx)) { case 1: { enterOuterAlt(_localctx, 1); - setState(436); + setState(437); expression(0); break; } case 2: { enterOuterAlt(_localctx, 2); - setState(437); + setState(438); typeName(0); break; } @@ -5086,27 +5124,27 @@ RiddleParser::TemplateArgsContext* RiddleParser::templateArgs() { try { size_t alt; enterOuterAlt(_localctx, 1); - setState(449); + setState(450); _errHandler->sync(this); _la = _input->LA(1); if ((((_la & ~ 0x3fULL) == 0) && - ((1ULL << _la) & 1188389761150287872) != 0)) { - setState(445); + ((1ULL << _la) & 2376779522301427712) != 0)) { + setState(446); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 29, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { if (alt == 1) { - setState(440); - templateArg(); setState(441); + templateArg(); + setState(442); match(RiddleParser::Comma); } - setState(447); + setState(448); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 29, _ctx); } - setState(448); + setState(449); templateArg(); } @@ -5209,23 +5247,23 @@ RiddleParser::TypeNameContext* RiddleParser::typeName(int precedence) { try { size_t alt; enterOuterAlt(_localctx, 1); - setState(458); + setState(459); _errHandler->sync(this); switch (getInterpreter()->adaptivePredict(_input, 31, _ctx)) { case 1: { - setState(452); + setState(453); antlrcpp::downCast(_localctx)->name = id(); break; } case 2: { - setState(453); - antlrcpp::downCast(_localctx)->name = id(); setState(454); - match(RiddleParser::Less); + antlrcpp::downCast(_localctx)->name = id(); setState(455); - antlrcpp::downCast(_localctx)->args = templateArgs(); + match(RiddleParser::Less); setState(456); + antlrcpp::downCast(_localctx)->args = templateArgs(); + setState(457); match(RiddleParser::Greater); break; } @@ -5234,7 +5272,7 @@ RiddleParser::TypeNameContext* RiddleParser::typeName(int precedence) { break; } _ctx->stop = _input->LT(-1); - setState(467); + setState(468); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 32, _ctx); while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) { @@ -5245,17 +5283,17 @@ RiddleParser::TypeNameContext* RiddleParser::typeName(int precedence) { _localctx = _tracker.createInstance(parentContext, parentState); _localctx->baseType = previousContext; pushNewRecursionContext(_localctx, startState, RuleTypeName); - setState(460); + setState(461); if (!(precpred(_ctx, 1))) throw FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(461); - match(RiddleParser::LeftSquare); setState(462); - antlrcpp::downCast(_localctx)->size = expression(0); + match(RiddleParser::LeftSquare); setState(463); + antlrcpp::downCast(_localctx)->size = expression(0); + setState(464); match(RiddleParser::RightSquare); } - setState(469); + setState(470); _errHandler->sync(this); alt = getInterpreter()->adaptivePredict(_input, 32, _ctx); } @@ -5292,25 +5330,25 @@ bool RiddleParser::exprPtrSempred(ExprPtrContext *_localctx, size_t predicateInd bool RiddleParser::expressionSempred(ExpressionContext *_localctx, size_t predicateIndex) { switch (predicateIndex) { - case 1: return precpred(_ctx, 35); - case 2: return precpred(_ctx, 34); - case 3: return precpred(_ctx, 33); - case 4: return precpred(_ctx, 32); - case 5: return precpred(_ctx, 31); - case 6: return precpred(_ctx, 30); - case 7: return precpred(_ctx, 29); - case 8: return precpred(_ctx, 28); - case 9: return precpred(_ctx, 27); - case 10: return precpred(_ctx, 26); - case 11: return precpred(_ctx, 25); - case 12: return precpred(_ctx, 24); - case 13: return precpred(_ctx, 23); - case 14: return precpred(_ctx, 22); - case 15: return precpred(_ctx, 21); - case 16: return precpred(_ctx, 20); - case 17: return precpred(_ctx, 19); - case 18: return precpred(_ctx, 18); - case 19: return precpred(_ctx, 17); + case 1: return precpred(_ctx, 36); + case 2: return precpred(_ctx, 35); + case 3: return precpred(_ctx, 34); + case 4: return precpred(_ctx, 33); + case 5: return precpred(_ctx, 32); + case 6: return precpred(_ctx, 31); + case 7: return precpred(_ctx, 30); + case 8: return precpred(_ctx, 29); + case 9: return precpred(_ctx, 28); + case 10: return precpred(_ctx, 27); + case 11: return precpred(_ctx, 26); + case 12: return precpred(_ctx, 25); + case 13: return precpred(_ctx, 24); + case 14: return precpred(_ctx, 23); + case 15: return precpred(_ctx, 22); + case 16: return precpred(_ctx, 21); + case 17: return precpred(_ctx, 20); + case 18: return precpred(_ctx, 19); + case 19: return precpred(_ctx, 18); default: break; diff --git a/parser/RiddleParser.h b/parser/RiddleParser.h index 528cc12..3a85225 100644 --- a/parser/RiddleParser.h +++ b/parser/RiddleParser.h @@ -14,16 +14,16 @@ class RiddleParser : public antlr4::Parser { enum { Var = 1, Val = 2, For = 3, While = 4, If = 5, Else = 6, Func = 7, Return = 8, Import = 9, Package = 10, Class = 11, Public = 12, Protected = 13, Private = 14, - Override = 15, True = 16, False = 17, Static = 18, Const = 19, LeftBracket = 20, - RightBracket = 21, LeftSquare = 22, RightSquare = 23, LeftCurly = 24, - RightCurly = 25, Colon = 26, Semi = 27, Comma = 28, Equal = 29, Assign = 30, - Greater = 31, Less = 32, LeftLeft = 33, RightRight = 34, RightRightRight = 35, - Add = 36, Sub = 37, Star = 38, Div = 39, Mod = 40, Not = 41, And = 42, - Or = 43, Xor = 44, Dot = 45, DoubleQuotes = 46, Quotes = 47, Endl = 48, - Identifier = 49, Hexadecimal = 50, Decimal = 51, Octal = 52, Binary = 53, - Float = 54, IntegerSequence = 55, HEX_DIGIT = 56, OCTAL_DIGIT = 57, - BINARY_DIGIT = 58, DIGIT = 59, STRING = 60, LINE_COMMENT = 61, BLOCK_COMMENT = 62, - WHITESPACE = 63 + Override = 15, True = 16, False = 17, Static = 18, Const = 19, Null = 20, + LeftBracket = 21, RightBracket = 22, LeftSquare = 23, RightSquare = 24, + LeftCurly = 25, RightCurly = 26, Colon = 27, Semi = 28, Comma = 29, + Equal = 30, Assign = 31, Greater = 32, Less = 33, LeftLeft = 34, RightRight = 35, + RightRightRight = 36, Add = 37, Sub = 38, Star = 39, Div = 40, Mod = 41, + Not = 42, And = 43, Or = 44, Xor = 45, Dot = 46, DoubleQuotes = 47, + Quotes = 48, Endl = 49, Identifier = 50, Hexadecimal = 51, Decimal = 52, + Octal = 53, Binary = 54, Float = 55, IntegerSequence = 56, HEX_DIGIT = 57, + OCTAL_DIGIT = 58, BINARY_DIGIT = 59, DIGIT = 60, STRING = 61, LINE_COMMENT = 62, + BLOCK_COMMENT = 63, WHITESPACE = 64 }; enum { @@ -529,6 +529,17 @@ class RiddleParser : public antlr4::Parser { virtual std::any accept(antlr4::tree::ParseTreeVisitor *visitor) override; }; + class NullExprContext : public ExpressionContext { + public: + NullExprContext(ExpressionContext *ctx); + + antlr4::tree::TerminalNode *Null(); + virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override; + virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override; + + virtual std::any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + }; + class ModExprContext : public ExpressionContext { public: ModExprContext(ExpressionContext *ctx); diff --git a/parser/RiddleParser.interp b/parser/RiddleParser.interp index b629475..15e2224 100644 --- a/parser/RiddleParser.interp +++ b/parser/RiddleParser.interp @@ -19,6 +19,7 @@ null 'false' 'static' 'const' +'null' '(' ')' '[' @@ -85,6 +86,7 @@ True False Static Const +Null LeftBracket RightBracket LeftSquare @@ -162,4 +164,4 @@ typeName atn: -[4, 1, 63, 471, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 1, 0, 5, 0, 58, 8, 0, 10, 0, 12, 0, 61, 9, 0, 1, 0, 3, 0, 64, 8, 0, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 1, 3, 1, 71, 8, 1, 1, 1, 1, 1, 3, 1, 75, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 89, 8, 2, 10, 2, 12, 2, 92, 9, 2, 1, 2, 3, 2, 95, 8, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 118, 8, 5, 1, 6, 1, 6, 1, 6, 5, 6, 123, 8, 6, 10, 6, 12, 6, 126, 9, 6, 1, 6, 3, 6, 129, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 136, 8, 7, 10, 7, 12, 7, 139, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 144, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 161, 8, 9, 10, 9, 12, 9, 164, 9, 9, 1, 10, 1, 10, 1, 10, 3, 10, 169, 8, 10, 1, 10, 1, 10, 3, 10, 173, 8, 10, 1, 10, 1, 10, 3, 10, 177, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 204, 8, 12, 1, 13, 1, 13, 3, 13, 208, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 5, 15, 217, 8, 15, 10, 15, 12, 15, 220, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 229, 8, 16, 1, 16, 1, 16, 1, 16, 5, 16, 234, 8, 16, 10, 16, 12, 16, 237, 9, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 341, 8, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 405, 8, 18, 10, 18, 12, 18, 408, 9, 18, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 414, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, 420, 8, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 435, 8, 24, 1, 25, 1, 25, 3, 25, 439, 8, 25, 1, 26, 1, 26, 1, 26, 5, 26, 444, 8, 26, 10, 26, 12, 26, 447, 9, 26, 1, 26, 3, 26, 450, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 459, 8, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 466, 8, 27, 10, 27, 12, 27, 469, 9, 27, 1, 27, 0, 3, 32, 36, 54, 28, 0, 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, 54, 0, 0, 529, 0, 63, 1, 0, 0, 0, 2, 74, 1, 0, 0, 0, 4, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 8, 99, 1, 0, 0, 0, 10, 117, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 145, 1, 0, 0, 0, 18, 162, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 181, 1, 0, 0, 0, 24, 203, 1, 0, 0, 0, 26, 205, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 218, 1, 0, 0, 0, 32, 228, 1, 0, 0, 0, 34, 238, 1, 0, 0, 0, 36, 340, 1, 0, 0, 0, 38, 409, 1, 0, 0, 0, 40, 413, 1, 0, 0, 0, 42, 419, 1, 0, 0, 0, 44, 421, 1, 0, 0, 0, 46, 423, 1, 0, 0, 0, 48, 434, 1, 0, 0, 0, 50, 438, 1, 0, 0, 0, 52, 449, 1, 0, 0, 0, 54, 458, 1, 0, 0, 0, 56, 58, 3, 2, 1, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 64, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 64, 5, 0, 0, 1, 63, 59, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 1, 1, 0, 0, 0, 65, 67, 3, 4, 2, 0, 66, 68, 5, 27, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 5, 48, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 75, 1, 0, 0, 0, 72, 75, 5, 27, 0, 0, 73, 75, 5, 48, 0, 0, 74, 65, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 3, 1, 0, 0, 0, 76, 95, 3, 6, 3, 0, 77, 95, 3, 8, 4, 0, 78, 95, 3, 28, 14, 0, 79, 95, 3, 16, 8, 0, 80, 95, 3, 10, 5, 0, 81, 95, 3, 20, 10, 0, 82, 95, 3, 22, 11, 0, 83, 95, 3, 24, 12, 0, 84, 95, 3, 26, 13, 0, 85, 95, 3, 36, 18, 0, 86, 90, 5, 24, 0, 0, 87, 89, 3, 2, 1, 0, 88, 87, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 93, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 95, 5, 25, 0, 0, 94, 76, 1, 0, 0, 0, 94, 77, 1, 0, 0, 0, 94, 78, 1, 0, 0, 0, 94, 79, 1, 0, 0, 0, 94, 80, 1, 0, 0, 0, 94, 81, 1, 0, 0, 0, 94, 82, 1, 0, 0, 0, 94, 83, 1, 0, 0, 0, 94, 84, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 86, 1, 0, 0, 0, 95, 5, 1, 0, 0, 0, 96, 97, 5, 10, 0, 0, 97, 98, 3, 38, 19, 0, 98, 7, 1, 0, 0, 0, 99, 100, 5, 9, 0, 0, 100, 101, 3, 38, 19, 0, 101, 9, 1, 0, 0, 0, 102, 103, 5, 1, 0, 0, 103, 104, 5, 49, 0, 0, 104, 105, 5, 26, 0, 0, 105, 118, 3, 54, 27, 0, 106, 107, 5, 1, 0, 0, 107, 108, 5, 49, 0, 0, 108, 109, 5, 30, 0, 0, 109, 118, 3, 36, 18, 0, 110, 111, 5, 1, 0, 0, 111, 112, 5, 49, 0, 0, 112, 113, 5, 26, 0, 0, 113, 114, 3, 54, 27, 0, 114, 115, 5, 30, 0, 0, 115, 116, 3, 36, 18, 0, 116, 118, 1, 0, 0, 0, 117, 102, 1, 0, 0, 0, 117, 106, 1, 0, 0, 0, 117, 110, 1, 0, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 3, 36, 18, 0, 120, 121, 5, 28, 0, 0, 121, 123, 1, 0, 0, 0, 122, 119, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 129, 3, 36, 18, 0, 128, 124, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 13, 1, 0, 0, 0, 130, 131, 5, 49, 0, 0, 131, 132, 5, 26, 0, 0, 132, 133, 3, 54, 27, 0, 133, 134, 5, 28, 0, 0, 134, 136, 1, 0, 0, 0, 135, 130, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 140, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 140, 141, 5, 49, 0, 0, 141, 142, 5, 26, 0, 0, 142, 144, 3, 54, 27, 0, 143, 137, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 15, 1, 0, 0, 0, 145, 146, 5, 7, 0, 0, 146, 147, 5, 49, 0, 0, 147, 148, 5, 20, 0, 0, 148, 149, 3, 14, 7, 0, 149, 153, 5, 21, 0, 0, 150, 151, 5, 37, 0, 0, 151, 152, 5, 31, 0, 0, 152, 154, 3, 54, 27, 0, 153, 150, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 5, 24, 0, 0, 156, 157, 3, 18, 9, 0, 157, 158, 5, 25, 0, 0, 158, 17, 1, 0, 0, 0, 159, 161, 3, 2, 1, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 19, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 3, 0, 0, 166, 168, 5, 20, 0, 0, 167, 169, 3, 10, 5, 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 5, 27, 0, 0, 171, 173, 3, 36, 18, 0, 172, 171, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 5, 27, 0, 0, 175, 177, 3, 4, 2, 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 5, 21, 0, 0, 179, 180, 3, 2, 1, 0, 180, 21, 1, 0, 0, 0, 181, 182, 5, 4, 0, 0, 182, 183, 5, 20, 0, 0, 183, 184, 3, 36, 18, 0, 184, 185, 5, 21, 0, 0, 185, 186, 3, 2, 1, 0, 186, 23, 1, 0, 0, 0, 187, 188, 5, 5, 0, 0, 188, 189, 5, 20, 0, 0, 189, 190, 3, 36, 18, 0, 190, 191, 5, 21, 0, 0, 191, 192, 3, 2, 1, 0, 192, 193, 6, 12, -1, 0, 193, 204, 1, 0, 0, 0, 194, 195, 5, 5, 0, 0, 195, 196, 5, 20, 0, 0, 196, 197, 3, 36, 18, 0, 197, 198, 5, 21, 0, 0, 198, 199, 3, 2, 1, 0, 199, 200, 5, 6, 0, 0, 200, 201, 3, 2, 1, 0, 201, 202, 6, 12, -1, 0, 202, 204, 1, 0, 0, 0, 203, 187, 1, 0, 0, 0, 203, 194, 1, 0, 0, 0, 204, 25, 1, 0, 0, 0, 205, 207, 5, 8, 0, 0, 206, 208, 3, 2, 1, 0, 207, 206, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 27, 1, 0, 0, 0, 209, 210, 5, 11, 0, 0, 210, 211, 3, 38, 19, 0, 211, 212, 5, 24, 0, 0, 212, 213, 3, 30, 15, 0, 213, 214, 5, 25, 0, 0, 214, 29, 1, 0, 0, 0, 215, 217, 3, 2, 1, 0, 216, 215, 1, 0, 0, 0, 217, 220, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 31, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 221, 222, 6, 16, -1, 0, 222, 223, 5, 49, 0, 0, 223, 224, 5, 20, 0, 0, 224, 225, 3, 12, 6, 0, 225, 226, 5, 21, 0, 0, 226, 229, 1, 0, 0, 0, 227, 229, 5, 49, 0, 0, 228, 221, 1, 0, 0, 0, 228, 227, 1, 0, 0, 0, 229, 235, 1, 0, 0, 0, 230, 231, 10, 1, 0, 0, 231, 232, 5, 45, 0, 0, 232, 234, 3, 32, 16, 2, 233, 230, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 33, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 238, 239, 3, 32, 16, 0, 239, 35, 1, 0, 0, 0, 240, 241, 6, 18, -1, 0, 241, 242, 5, 32, 0, 0, 242, 243, 3, 54, 27, 0, 243, 244, 5, 31, 0, 0, 244, 245, 5, 20, 0, 0, 245, 246, 3, 34, 17, 0, 246, 247, 5, 21, 0, 0, 247, 341, 1, 0, 0, 0, 248, 249, 5, 20, 0, 0, 249, 250, 3, 36, 18, 0, 250, 251, 5, 21, 0, 0, 251, 341, 1, 0, 0, 0, 252, 253, 5, 41, 0, 0, 253, 341, 3, 36, 18, 43, 254, 255, 5, 36, 0, 0, 255, 341, 3, 36, 18, 42, 256, 257, 5, 37, 0, 0, 257, 341, 3, 36, 18, 41, 258, 259, 5, 36, 0, 0, 259, 260, 5, 36, 0, 0, 260, 341, 3, 34, 17, 0, 261, 262, 3, 34, 17, 0, 262, 263, 5, 36, 0, 0, 263, 264, 5, 36, 0, 0, 264, 341, 1, 0, 0, 0, 265, 266, 5, 37, 0, 0, 266, 267, 5, 37, 0, 0, 267, 341, 3, 34, 17, 0, 268, 269, 3, 34, 17, 0, 269, 270, 5, 37, 0, 0, 270, 271, 5, 37, 0, 0, 271, 341, 1, 0, 0, 0, 272, 341, 3, 32, 16, 0, 273, 274, 3, 34, 17, 0, 274, 275, 5, 30, 0, 0, 275, 276, 3, 36, 18, 16, 276, 341, 1, 0, 0, 0, 277, 278, 3, 34, 17, 0, 278, 279, 5, 36, 0, 0, 279, 280, 5, 30, 0, 0, 280, 281, 3, 36, 18, 15, 281, 341, 1, 0, 0, 0, 282, 283, 3, 34, 17, 0, 283, 284, 5, 37, 0, 0, 284, 285, 5, 30, 0, 0, 285, 286, 3, 36, 18, 14, 286, 341, 1, 0, 0, 0, 287, 288, 3, 34, 17, 0, 288, 289, 5, 38, 0, 0, 289, 290, 5, 30, 0, 0, 290, 291, 3, 36, 18, 13, 291, 341, 1, 0, 0, 0, 292, 293, 3, 34, 17, 0, 293, 294, 5, 39, 0, 0, 294, 295, 5, 30, 0, 0, 295, 296, 3, 36, 18, 12, 296, 341, 1, 0, 0, 0, 297, 298, 3, 34, 17, 0, 298, 299, 5, 40, 0, 0, 299, 300, 5, 30, 0, 0, 300, 301, 3, 36, 18, 11, 301, 341, 1, 0, 0, 0, 302, 303, 3, 34, 17, 0, 303, 304, 5, 36, 0, 0, 304, 305, 5, 30, 0, 0, 305, 306, 3, 36, 18, 10, 306, 341, 1, 0, 0, 0, 307, 308, 3, 34, 17, 0, 308, 309, 5, 42, 0, 0, 309, 310, 5, 30, 0, 0, 310, 311, 3, 36, 18, 9, 311, 341, 1, 0, 0, 0, 312, 313, 3, 34, 17, 0, 313, 314, 5, 43, 0, 0, 314, 315, 5, 30, 0, 0, 315, 316, 3, 36, 18, 8, 316, 341, 1, 0, 0, 0, 317, 318, 3, 34, 17, 0, 318, 319, 5, 44, 0, 0, 319, 320, 5, 30, 0, 0, 320, 321, 3, 36, 18, 7, 321, 341, 1, 0, 0, 0, 322, 323, 3, 34, 17, 0, 323, 324, 5, 33, 0, 0, 324, 325, 5, 30, 0, 0, 325, 326, 3, 36, 18, 6, 326, 341, 1, 0, 0, 0, 327, 328, 3, 34, 17, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5, 30, 0, 0, 330, 331, 3, 36, 18, 5, 331, 341, 1, 0, 0, 0, 332, 333, 3, 34, 17, 0, 333, 334, 5, 35, 0, 0, 334, 335, 5, 30, 0, 0, 335, 336, 3, 36, 18, 4, 336, 341, 1, 0, 0, 0, 337, 341, 3, 44, 22, 0, 338, 341, 3, 40, 20, 0, 339, 341, 3, 42, 21, 0, 340, 240, 1, 0, 0, 0, 340, 248, 1, 0, 0, 0, 340, 252, 1, 0, 0, 0, 340, 254, 1, 0, 0, 0, 340, 256, 1, 0, 0, 0, 340, 258, 1, 0, 0, 0, 340, 261, 1, 0, 0, 0, 340, 265, 1, 0, 0, 0, 340, 268, 1, 0, 0, 0, 340, 272, 1, 0, 0, 0, 340, 273, 1, 0, 0, 0, 340, 277, 1, 0, 0, 0, 340, 282, 1, 0, 0, 0, 340, 287, 1, 0, 0, 0, 340, 292, 1, 0, 0, 0, 340, 297, 1, 0, 0, 0, 340, 302, 1, 0, 0, 0, 340, 307, 1, 0, 0, 0, 340, 312, 1, 0, 0, 0, 340, 317, 1, 0, 0, 0, 340, 322, 1, 0, 0, 0, 340, 327, 1, 0, 0, 0, 340, 332, 1, 0, 0, 0, 340, 337, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 340, 339, 1, 0, 0, 0, 341, 406, 1, 0, 0, 0, 342, 343, 10, 35, 0, 0, 343, 344, 5, 38, 0, 0, 344, 405, 3, 36, 18, 36, 345, 346, 10, 34, 0, 0, 346, 347, 5, 39, 0, 0, 347, 405, 3, 36, 18, 35, 348, 349, 10, 33, 0, 0, 349, 350, 5, 40, 0, 0, 350, 405, 3, 36, 18, 34, 351, 352, 10, 32, 0, 0, 352, 353, 5, 36, 0, 0, 353, 405, 3, 36, 18, 33, 354, 355, 10, 31, 0, 0, 355, 356, 5, 37, 0, 0, 356, 405, 3, 36, 18, 32, 357, 358, 10, 30, 0, 0, 358, 359, 5, 33, 0, 0, 359, 405, 3, 36, 18, 31, 360, 361, 10, 29, 0, 0, 361, 362, 5, 34, 0, 0, 362, 405, 3, 36, 18, 30, 363, 364, 10, 28, 0, 0, 364, 365, 5, 35, 0, 0, 365, 405, 3, 36, 18, 29, 366, 367, 10, 27, 0, 0, 367, 368, 5, 31, 0, 0, 368, 405, 3, 36, 18, 28, 369, 370, 10, 26, 0, 0, 370, 371, 5, 32, 0, 0, 371, 405, 3, 36, 18, 27, 372, 373, 10, 25, 0, 0, 373, 374, 5, 31, 0, 0, 374, 375, 5, 30, 0, 0, 375, 405, 3, 36, 18, 26, 376, 377, 10, 24, 0, 0, 377, 378, 5, 32, 0, 0, 378, 379, 5, 30, 0, 0, 379, 405, 3, 36, 18, 25, 380, 381, 10, 23, 0, 0, 381, 382, 5, 29, 0, 0, 382, 405, 3, 36, 18, 24, 383, 384, 10, 22, 0, 0, 384, 385, 5, 41, 0, 0, 385, 386, 5, 30, 0, 0, 386, 405, 3, 36, 18, 23, 387, 388, 10, 21, 0, 0, 388, 389, 5, 42, 0, 0, 389, 405, 3, 36, 18, 22, 390, 391, 10, 20, 0, 0, 391, 392, 5, 44, 0, 0, 392, 405, 3, 36, 18, 21, 393, 394, 10, 19, 0, 0, 394, 395, 5, 43, 0, 0, 395, 405, 3, 36, 18, 20, 396, 397, 10, 18, 0, 0, 397, 398, 5, 42, 0, 0, 398, 399, 5, 42, 0, 0, 399, 405, 3, 36, 18, 19, 400, 401, 10, 17, 0, 0, 401, 402, 5, 43, 0, 0, 402, 403, 5, 43, 0, 0, 403, 405, 3, 36, 18, 18, 404, 342, 1, 0, 0, 0, 404, 345, 1, 0, 0, 0, 404, 348, 1, 0, 0, 0, 404, 351, 1, 0, 0, 0, 404, 354, 1, 0, 0, 0, 404, 357, 1, 0, 0, 0, 404, 360, 1, 0, 0, 0, 404, 363, 1, 0, 0, 0, 404, 366, 1, 0, 0, 0, 404, 369, 1, 0, 0, 0, 404, 372, 1, 0, 0, 0, 404, 376, 1, 0, 0, 0, 404, 380, 1, 0, 0, 0, 404, 383, 1, 0, 0, 0, 404, 387, 1, 0, 0, 0, 404, 390, 1, 0, 0, 0, 404, 393, 1, 0, 0, 0, 404, 396, 1, 0, 0, 0, 404, 400, 1, 0, 0, 0, 405, 408, 1, 0, 0, 0, 406, 404, 1, 0, 0, 0, 406, 407, 1, 0, 0, 0, 407, 37, 1, 0, 0, 0, 408, 406, 1, 0, 0, 0, 409, 410, 5, 49, 0, 0, 410, 39, 1, 0, 0, 0, 411, 414, 3, 48, 24, 0, 412, 414, 3, 46, 23, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0, 0, 0, 414, 41, 1, 0, 0, 0, 415, 416, 5, 16, 0, 0, 416, 420, 6, 21, -1, 0, 417, 418, 5, 17, 0, 0, 418, 420, 6, 21, -1, 0, 419, 415, 1, 0, 0, 0, 419, 417, 1, 0, 0, 0, 420, 43, 1, 0, 0, 0, 421, 422, 5, 60, 0, 0, 422, 45, 1, 0, 0, 0, 423, 424, 5, 54, 0, 0, 424, 425, 6, 23, -1, 0, 425, 47, 1, 0, 0, 0, 426, 427, 5, 51, 0, 0, 427, 435, 6, 24, -1, 0, 428, 429, 5, 50, 0, 0, 429, 435, 6, 24, -1, 0, 430, 431, 5, 53, 0, 0, 431, 435, 6, 24, -1, 0, 432, 433, 5, 52, 0, 0, 433, 435, 6, 24, -1, 0, 434, 426, 1, 0, 0, 0, 434, 428, 1, 0, 0, 0, 434, 430, 1, 0, 0, 0, 434, 432, 1, 0, 0, 0, 435, 49, 1, 0, 0, 0, 436, 439, 3, 36, 18, 0, 437, 439, 3, 54, 27, 0, 438, 436, 1, 0, 0, 0, 438, 437, 1, 0, 0, 0, 439, 51, 1, 0, 0, 0, 440, 441, 3, 50, 25, 0, 441, 442, 5, 28, 0, 0, 442, 444, 1, 0, 0, 0, 443, 440, 1, 0, 0, 0, 444, 447, 1, 0, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 448, 1, 0, 0, 0, 447, 445, 1, 0, 0, 0, 448, 450, 3, 50, 25, 0, 449, 445, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 53, 1, 0, 0, 0, 451, 452, 6, 27, -1, 0, 452, 459, 3, 38, 19, 0, 453, 454, 3, 38, 19, 0, 454, 455, 5, 32, 0, 0, 455, 456, 3, 52, 26, 0, 456, 457, 5, 31, 0, 0, 457, 459, 1, 0, 0, 0, 458, 451, 1, 0, 0, 0, 458, 453, 1, 0, 0, 0, 459, 467, 1, 0, 0, 0, 460, 461, 10, 1, 0, 0, 461, 462, 5, 22, 0, 0, 462, 463, 3, 36, 18, 0, 463, 464, 5, 23, 0, 0, 464, 466, 1, 0, 0, 0, 465, 460, 1, 0, 0, 0, 466, 469, 1, 0, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 55, 1, 0, 0, 0, 469, 467, 1, 0, 0, 0, 33, 59, 63, 67, 70, 74, 90, 94, 117, 124, 128, 137, 143, 153, 162, 168, 172, 176, 203, 207, 218, 228, 235, 340, 404, 406, 413, 419, 434, 438, 445, 449, 458, 467] \ No newline at end of file +[4, 1, 64, 472, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 1, 0, 5, 0, 58, 8, 0, 10, 0, 12, 0, 61, 9, 0, 1, 0, 3, 0, 64, 8, 0, 1, 1, 1, 1, 3, 1, 68, 8, 1, 1, 1, 3, 1, 71, 8, 1, 1, 1, 1, 1, 3, 1, 75, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 89, 8, 2, 10, 2, 12, 2, 92, 9, 2, 1, 2, 3, 2, 95, 8, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 118, 8, 5, 1, 6, 1, 6, 1, 6, 5, 6, 123, 8, 6, 10, 6, 12, 6, 126, 9, 6, 1, 6, 3, 6, 129, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 136, 8, 7, 10, 7, 12, 7, 139, 9, 7, 1, 7, 1, 7, 1, 7, 3, 7, 144, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 5, 9, 161, 8, 9, 10, 9, 12, 9, 164, 9, 9, 1, 10, 1, 10, 1, 10, 3, 10, 169, 8, 10, 1, 10, 1, 10, 3, 10, 173, 8, 10, 1, 10, 1, 10, 3, 10, 177, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 204, 8, 12, 1, 13, 1, 13, 3, 13, 208, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 5, 15, 217, 8, 15, 10, 15, 12, 15, 220, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 229, 8, 16, 1, 16, 1, 16, 1, 16, 5, 16, 234, 8, 16, 10, 16, 12, 16, 237, 9, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 342, 8, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 406, 8, 18, 10, 18, 12, 18, 409, 9, 18, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 415, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, 421, 8, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 436, 8, 24, 1, 25, 1, 25, 3, 25, 440, 8, 25, 1, 26, 1, 26, 1, 26, 5, 26, 445, 8, 26, 10, 26, 12, 26, 448, 9, 26, 1, 26, 3, 26, 451, 8, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 460, 8, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 467, 8, 27, 10, 27, 12, 27, 470, 9, 27, 1, 27, 0, 3, 32, 36, 54, 28, 0, 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, 54, 0, 0, 531, 0, 63, 1, 0, 0, 0, 2, 74, 1, 0, 0, 0, 4, 94, 1, 0, 0, 0, 6, 96, 1, 0, 0, 0, 8, 99, 1, 0, 0, 0, 10, 117, 1, 0, 0, 0, 12, 128, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 145, 1, 0, 0, 0, 18, 162, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 181, 1, 0, 0, 0, 24, 203, 1, 0, 0, 0, 26, 205, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 218, 1, 0, 0, 0, 32, 228, 1, 0, 0, 0, 34, 238, 1, 0, 0, 0, 36, 341, 1, 0, 0, 0, 38, 410, 1, 0, 0, 0, 40, 414, 1, 0, 0, 0, 42, 420, 1, 0, 0, 0, 44, 422, 1, 0, 0, 0, 46, 424, 1, 0, 0, 0, 48, 435, 1, 0, 0, 0, 50, 439, 1, 0, 0, 0, 52, 450, 1, 0, 0, 0, 54, 459, 1, 0, 0, 0, 56, 58, 3, 2, 1, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 64, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 64, 5, 0, 0, 1, 63, 59, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 1, 1, 0, 0, 0, 65, 67, 3, 4, 2, 0, 66, 68, 5, 28, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 5, 49, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 75, 1, 0, 0, 0, 72, 75, 5, 28, 0, 0, 73, 75, 5, 49, 0, 0, 74, 65, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 73, 1, 0, 0, 0, 75, 3, 1, 0, 0, 0, 76, 95, 3, 6, 3, 0, 77, 95, 3, 8, 4, 0, 78, 95, 3, 28, 14, 0, 79, 95, 3, 16, 8, 0, 80, 95, 3, 10, 5, 0, 81, 95, 3, 20, 10, 0, 82, 95, 3, 22, 11, 0, 83, 95, 3, 24, 12, 0, 84, 95, 3, 26, 13, 0, 85, 95, 3, 36, 18, 0, 86, 90, 5, 25, 0, 0, 87, 89, 3, 2, 1, 0, 88, 87, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 93, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 95, 5, 26, 0, 0, 94, 76, 1, 0, 0, 0, 94, 77, 1, 0, 0, 0, 94, 78, 1, 0, 0, 0, 94, 79, 1, 0, 0, 0, 94, 80, 1, 0, 0, 0, 94, 81, 1, 0, 0, 0, 94, 82, 1, 0, 0, 0, 94, 83, 1, 0, 0, 0, 94, 84, 1, 0, 0, 0, 94, 85, 1, 0, 0, 0, 94, 86, 1, 0, 0, 0, 95, 5, 1, 0, 0, 0, 96, 97, 5, 10, 0, 0, 97, 98, 3, 38, 19, 0, 98, 7, 1, 0, 0, 0, 99, 100, 5, 9, 0, 0, 100, 101, 3, 38, 19, 0, 101, 9, 1, 0, 0, 0, 102, 103, 5, 1, 0, 0, 103, 104, 5, 50, 0, 0, 104, 105, 5, 27, 0, 0, 105, 118, 3, 54, 27, 0, 106, 107, 5, 1, 0, 0, 107, 108, 5, 50, 0, 0, 108, 109, 5, 31, 0, 0, 109, 118, 3, 36, 18, 0, 110, 111, 5, 1, 0, 0, 111, 112, 5, 50, 0, 0, 112, 113, 5, 27, 0, 0, 113, 114, 3, 54, 27, 0, 114, 115, 5, 31, 0, 0, 115, 116, 3, 36, 18, 0, 116, 118, 1, 0, 0, 0, 117, 102, 1, 0, 0, 0, 117, 106, 1, 0, 0, 0, 117, 110, 1, 0, 0, 0, 118, 11, 1, 0, 0, 0, 119, 120, 3, 36, 18, 0, 120, 121, 5, 29, 0, 0, 121, 123, 1, 0, 0, 0, 122, 119, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 129, 3, 36, 18, 0, 128, 124, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 13, 1, 0, 0, 0, 130, 131, 5, 50, 0, 0, 131, 132, 5, 27, 0, 0, 132, 133, 3, 54, 27, 0, 133, 134, 5, 29, 0, 0, 134, 136, 1, 0, 0, 0, 135, 130, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 140, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 140, 141, 5, 50, 0, 0, 141, 142, 5, 27, 0, 0, 142, 144, 3, 54, 27, 0, 143, 137, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 15, 1, 0, 0, 0, 145, 146, 5, 7, 0, 0, 146, 147, 5, 50, 0, 0, 147, 148, 5, 21, 0, 0, 148, 149, 3, 14, 7, 0, 149, 153, 5, 22, 0, 0, 150, 151, 5, 38, 0, 0, 151, 152, 5, 32, 0, 0, 152, 154, 3, 54, 27, 0, 153, 150, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 5, 25, 0, 0, 156, 157, 3, 18, 9, 0, 157, 158, 5, 26, 0, 0, 158, 17, 1, 0, 0, 0, 159, 161, 3, 2, 1, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 19, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 5, 3, 0, 0, 166, 168, 5, 21, 0, 0, 167, 169, 3, 10, 5, 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 5, 28, 0, 0, 171, 173, 3, 36, 18, 0, 172, 171, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 5, 28, 0, 0, 175, 177, 3, 4, 2, 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 5, 22, 0, 0, 179, 180, 3, 2, 1, 0, 180, 21, 1, 0, 0, 0, 181, 182, 5, 4, 0, 0, 182, 183, 5, 21, 0, 0, 183, 184, 3, 36, 18, 0, 184, 185, 5, 22, 0, 0, 185, 186, 3, 2, 1, 0, 186, 23, 1, 0, 0, 0, 187, 188, 5, 5, 0, 0, 188, 189, 5, 21, 0, 0, 189, 190, 3, 36, 18, 0, 190, 191, 5, 22, 0, 0, 191, 192, 3, 2, 1, 0, 192, 193, 6, 12, -1, 0, 193, 204, 1, 0, 0, 0, 194, 195, 5, 5, 0, 0, 195, 196, 5, 21, 0, 0, 196, 197, 3, 36, 18, 0, 197, 198, 5, 22, 0, 0, 198, 199, 3, 2, 1, 0, 199, 200, 5, 6, 0, 0, 200, 201, 3, 2, 1, 0, 201, 202, 6, 12, -1, 0, 202, 204, 1, 0, 0, 0, 203, 187, 1, 0, 0, 0, 203, 194, 1, 0, 0, 0, 204, 25, 1, 0, 0, 0, 205, 207, 5, 8, 0, 0, 206, 208, 3, 2, 1, 0, 207, 206, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 27, 1, 0, 0, 0, 209, 210, 5, 11, 0, 0, 210, 211, 3, 38, 19, 0, 211, 212, 5, 25, 0, 0, 212, 213, 3, 30, 15, 0, 213, 214, 5, 26, 0, 0, 214, 29, 1, 0, 0, 0, 215, 217, 3, 2, 1, 0, 216, 215, 1, 0, 0, 0, 217, 220, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 31, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 221, 222, 6, 16, -1, 0, 222, 223, 5, 50, 0, 0, 223, 224, 5, 21, 0, 0, 224, 225, 3, 12, 6, 0, 225, 226, 5, 22, 0, 0, 226, 229, 1, 0, 0, 0, 227, 229, 5, 50, 0, 0, 228, 221, 1, 0, 0, 0, 228, 227, 1, 0, 0, 0, 229, 235, 1, 0, 0, 0, 230, 231, 10, 1, 0, 0, 231, 232, 5, 46, 0, 0, 232, 234, 3, 32, 16, 2, 233, 230, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 33, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 238, 239, 3, 32, 16, 0, 239, 35, 1, 0, 0, 0, 240, 241, 6, 18, -1, 0, 241, 242, 5, 33, 0, 0, 242, 243, 3, 54, 27, 0, 243, 244, 5, 32, 0, 0, 244, 245, 5, 21, 0, 0, 245, 246, 3, 34, 17, 0, 246, 247, 5, 22, 0, 0, 247, 342, 1, 0, 0, 0, 248, 249, 5, 21, 0, 0, 249, 250, 3, 36, 18, 0, 250, 251, 5, 22, 0, 0, 251, 342, 1, 0, 0, 0, 252, 253, 5, 42, 0, 0, 253, 342, 3, 36, 18, 44, 254, 255, 5, 37, 0, 0, 255, 342, 3, 36, 18, 43, 256, 257, 5, 38, 0, 0, 257, 342, 3, 36, 18, 42, 258, 259, 5, 37, 0, 0, 259, 260, 5, 37, 0, 0, 260, 342, 3, 34, 17, 0, 261, 262, 3, 34, 17, 0, 262, 263, 5, 37, 0, 0, 263, 264, 5, 37, 0, 0, 264, 342, 1, 0, 0, 0, 265, 266, 5, 38, 0, 0, 266, 267, 5, 38, 0, 0, 267, 342, 3, 34, 17, 0, 268, 269, 3, 34, 17, 0, 269, 270, 5, 38, 0, 0, 270, 271, 5, 38, 0, 0, 271, 342, 1, 0, 0, 0, 272, 342, 3, 32, 16, 0, 273, 274, 3, 34, 17, 0, 274, 275, 5, 31, 0, 0, 275, 276, 3, 36, 18, 17, 276, 342, 1, 0, 0, 0, 277, 278, 3, 34, 17, 0, 278, 279, 5, 37, 0, 0, 279, 280, 5, 31, 0, 0, 280, 281, 3, 36, 18, 16, 281, 342, 1, 0, 0, 0, 282, 283, 3, 34, 17, 0, 283, 284, 5, 38, 0, 0, 284, 285, 5, 31, 0, 0, 285, 286, 3, 36, 18, 15, 286, 342, 1, 0, 0, 0, 287, 288, 3, 34, 17, 0, 288, 289, 5, 39, 0, 0, 289, 290, 5, 31, 0, 0, 290, 291, 3, 36, 18, 14, 291, 342, 1, 0, 0, 0, 292, 293, 3, 34, 17, 0, 293, 294, 5, 40, 0, 0, 294, 295, 5, 31, 0, 0, 295, 296, 3, 36, 18, 13, 296, 342, 1, 0, 0, 0, 297, 298, 3, 34, 17, 0, 298, 299, 5, 41, 0, 0, 299, 300, 5, 31, 0, 0, 300, 301, 3, 36, 18, 12, 301, 342, 1, 0, 0, 0, 302, 303, 3, 34, 17, 0, 303, 304, 5, 37, 0, 0, 304, 305, 5, 31, 0, 0, 305, 306, 3, 36, 18, 11, 306, 342, 1, 0, 0, 0, 307, 308, 3, 34, 17, 0, 308, 309, 5, 43, 0, 0, 309, 310, 5, 31, 0, 0, 310, 311, 3, 36, 18, 10, 311, 342, 1, 0, 0, 0, 312, 313, 3, 34, 17, 0, 313, 314, 5, 44, 0, 0, 314, 315, 5, 31, 0, 0, 315, 316, 3, 36, 18, 9, 316, 342, 1, 0, 0, 0, 317, 318, 3, 34, 17, 0, 318, 319, 5, 45, 0, 0, 319, 320, 5, 31, 0, 0, 320, 321, 3, 36, 18, 8, 321, 342, 1, 0, 0, 0, 322, 323, 3, 34, 17, 0, 323, 324, 5, 34, 0, 0, 324, 325, 5, 31, 0, 0, 325, 326, 3, 36, 18, 7, 326, 342, 1, 0, 0, 0, 327, 328, 3, 34, 17, 0, 328, 329, 5, 35, 0, 0, 329, 330, 5, 31, 0, 0, 330, 331, 3, 36, 18, 6, 331, 342, 1, 0, 0, 0, 332, 333, 3, 34, 17, 0, 333, 334, 5, 36, 0, 0, 334, 335, 5, 31, 0, 0, 335, 336, 3, 36, 18, 5, 336, 342, 1, 0, 0, 0, 337, 342, 3, 44, 22, 0, 338, 342, 3, 40, 20, 0, 339, 342, 3, 42, 21, 0, 340, 342, 5, 20, 0, 0, 341, 240, 1, 0, 0, 0, 341, 248, 1, 0, 0, 0, 341, 252, 1, 0, 0, 0, 341, 254, 1, 0, 0, 0, 341, 256, 1, 0, 0, 0, 341, 258, 1, 0, 0, 0, 341, 261, 1, 0, 0, 0, 341, 265, 1, 0, 0, 0, 341, 268, 1, 0, 0, 0, 341, 272, 1, 0, 0, 0, 341, 273, 1, 0, 0, 0, 341, 277, 1, 0, 0, 0, 341, 282, 1, 0, 0, 0, 341, 287, 1, 0, 0, 0, 341, 292, 1, 0, 0, 0, 341, 297, 1, 0, 0, 0, 341, 302, 1, 0, 0, 0, 341, 307, 1, 0, 0, 0, 341, 312, 1, 0, 0, 0, 341, 317, 1, 0, 0, 0, 341, 322, 1, 0, 0, 0, 341, 327, 1, 0, 0, 0, 341, 332, 1, 0, 0, 0, 341, 337, 1, 0, 0, 0, 341, 338, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 341, 340, 1, 0, 0, 0, 342, 407, 1, 0, 0, 0, 343, 344, 10, 36, 0, 0, 344, 345, 5, 39, 0, 0, 345, 406, 3, 36, 18, 37, 346, 347, 10, 35, 0, 0, 347, 348, 5, 40, 0, 0, 348, 406, 3, 36, 18, 36, 349, 350, 10, 34, 0, 0, 350, 351, 5, 41, 0, 0, 351, 406, 3, 36, 18, 35, 352, 353, 10, 33, 0, 0, 353, 354, 5, 37, 0, 0, 354, 406, 3, 36, 18, 34, 355, 356, 10, 32, 0, 0, 356, 357, 5, 38, 0, 0, 357, 406, 3, 36, 18, 33, 358, 359, 10, 31, 0, 0, 359, 360, 5, 34, 0, 0, 360, 406, 3, 36, 18, 32, 361, 362, 10, 30, 0, 0, 362, 363, 5, 35, 0, 0, 363, 406, 3, 36, 18, 31, 364, 365, 10, 29, 0, 0, 365, 366, 5, 36, 0, 0, 366, 406, 3, 36, 18, 30, 367, 368, 10, 28, 0, 0, 368, 369, 5, 32, 0, 0, 369, 406, 3, 36, 18, 29, 370, 371, 10, 27, 0, 0, 371, 372, 5, 33, 0, 0, 372, 406, 3, 36, 18, 28, 373, 374, 10, 26, 0, 0, 374, 375, 5, 32, 0, 0, 375, 376, 5, 31, 0, 0, 376, 406, 3, 36, 18, 27, 377, 378, 10, 25, 0, 0, 378, 379, 5, 33, 0, 0, 379, 380, 5, 31, 0, 0, 380, 406, 3, 36, 18, 26, 381, 382, 10, 24, 0, 0, 382, 383, 5, 30, 0, 0, 383, 406, 3, 36, 18, 25, 384, 385, 10, 23, 0, 0, 385, 386, 5, 42, 0, 0, 386, 387, 5, 31, 0, 0, 387, 406, 3, 36, 18, 24, 388, 389, 10, 22, 0, 0, 389, 390, 5, 43, 0, 0, 390, 406, 3, 36, 18, 23, 391, 392, 10, 21, 0, 0, 392, 393, 5, 45, 0, 0, 393, 406, 3, 36, 18, 22, 394, 395, 10, 20, 0, 0, 395, 396, 5, 44, 0, 0, 396, 406, 3, 36, 18, 21, 397, 398, 10, 19, 0, 0, 398, 399, 5, 43, 0, 0, 399, 400, 5, 43, 0, 0, 400, 406, 3, 36, 18, 20, 401, 402, 10, 18, 0, 0, 402, 403, 5, 44, 0, 0, 403, 404, 5, 44, 0, 0, 404, 406, 3, 36, 18, 19, 405, 343, 1, 0, 0, 0, 405, 346, 1, 0, 0, 0, 405, 349, 1, 0, 0, 0, 405, 352, 1, 0, 0, 0, 405, 355, 1, 0, 0, 0, 405, 358, 1, 0, 0, 0, 405, 361, 1, 0, 0, 0, 405, 364, 1, 0, 0, 0, 405, 367, 1, 0, 0, 0, 405, 370, 1, 0, 0, 0, 405, 373, 1, 0, 0, 0, 405, 377, 1, 0, 0, 0, 405, 381, 1, 0, 0, 0, 405, 384, 1, 0, 0, 0, 405, 388, 1, 0, 0, 0, 405, 391, 1, 0, 0, 0, 405, 394, 1, 0, 0, 0, 405, 397, 1, 0, 0, 0, 405, 401, 1, 0, 0, 0, 406, 409, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 37, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 410, 411, 5, 50, 0, 0, 411, 39, 1, 0, 0, 0, 412, 415, 3, 48, 24, 0, 413, 415, 3, 46, 23, 0, 414, 412, 1, 0, 0, 0, 414, 413, 1, 0, 0, 0, 415, 41, 1, 0, 0, 0, 416, 417, 5, 16, 0, 0, 417, 421, 6, 21, -1, 0, 418, 419, 5, 17, 0, 0, 419, 421, 6, 21, -1, 0, 420, 416, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 421, 43, 1, 0, 0, 0, 422, 423, 5, 61, 0, 0, 423, 45, 1, 0, 0, 0, 424, 425, 5, 55, 0, 0, 425, 426, 6, 23, -1, 0, 426, 47, 1, 0, 0, 0, 427, 428, 5, 52, 0, 0, 428, 436, 6, 24, -1, 0, 429, 430, 5, 51, 0, 0, 430, 436, 6, 24, -1, 0, 431, 432, 5, 54, 0, 0, 432, 436, 6, 24, -1, 0, 433, 434, 5, 53, 0, 0, 434, 436, 6, 24, -1, 0, 435, 427, 1, 0, 0, 0, 435, 429, 1, 0, 0, 0, 435, 431, 1, 0, 0, 0, 435, 433, 1, 0, 0, 0, 436, 49, 1, 0, 0, 0, 437, 440, 3, 36, 18, 0, 438, 440, 3, 54, 27, 0, 439, 437, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 51, 1, 0, 0, 0, 441, 442, 3, 50, 25, 0, 442, 443, 5, 29, 0, 0, 443, 445, 1, 0, 0, 0, 444, 441, 1, 0, 0, 0, 445, 448, 1, 0, 0, 0, 446, 444, 1, 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 449, 1, 0, 0, 0, 448, 446, 1, 0, 0, 0, 449, 451, 3, 50, 25, 0, 450, 446, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 53, 1, 0, 0, 0, 452, 453, 6, 27, -1, 0, 453, 460, 3, 38, 19, 0, 454, 455, 3, 38, 19, 0, 455, 456, 5, 33, 0, 0, 456, 457, 3, 52, 26, 0, 457, 458, 5, 32, 0, 0, 458, 460, 1, 0, 0, 0, 459, 452, 1, 0, 0, 0, 459, 454, 1, 0, 0, 0, 460, 468, 1, 0, 0, 0, 461, 462, 10, 1, 0, 0, 462, 463, 5, 23, 0, 0, 463, 464, 3, 36, 18, 0, 464, 465, 5, 24, 0, 0, 465, 467, 1, 0, 0, 0, 466, 461, 1, 0, 0, 0, 467, 470, 1, 0, 0, 0, 468, 466, 1, 0, 0, 0, 468, 469, 1, 0, 0, 0, 469, 55, 1, 0, 0, 0, 470, 468, 1, 0, 0, 0, 33, 59, 63, 67, 70, 74, 90, 94, 117, 124, 128, 137, 143, 153, 162, 168, 172, 176, 203, 207, 218, 228, 235, 341, 405, 407, 414, 420, 435, 439, 446, 450, 459, 468] \ No newline at end of file diff --git a/parser/RiddleParser.tokens b/parser/RiddleParser.tokens index 880003f..6482b53 100644 --- a/parser/RiddleParser.tokens +++ b/parser/RiddleParser.tokens @@ -17,50 +17,51 @@ True=16 False=17 Static=18 Const=19 -LeftBracket=20 -RightBracket=21 -LeftSquare=22 -RightSquare=23 -LeftCurly=24 -RightCurly=25 -Colon=26 -Semi=27 -Comma=28 -Equal=29 -Assign=30 -Greater=31 -Less=32 -LeftLeft=33 -RightRight=34 -RightRightRight=35 -Add=36 -Sub=37 -Star=38 -Div=39 -Mod=40 -Not=41 -And=42 -Or=43 -Xor=44 -Dot=45 -DoubleQuotes=46 -Quotes=47 -Endl=48 -Identifier=49 -Hexadecimal=50 -Decimal=51 -Octal=52 -Binary=53 -Float=54 -IntegerSequence=55 -HEX_DIGIT=56 -OCTAL_DIGIT=57 -BINARY_DIGIT=58 -DIGIT=59 -STRING=60 -LINE_COMMENT=61 -BLOCK_COMMENT=62 -WHITESPACE=63 +Null=20 +LeftBracket=21 +RightBracket=22 +LeftSquare=23 +RightSquare=24 +LeftCurly=25 +RightCurly=26 +Colon=27 +Semi=28 +Comma=29 +Equal=30 +Assign=31 +Greater=32 +Less=33 +LeftLeft=34 +RightRight=35 +RightRightRight=36 +Add=37 +Sub=38 +Star=39 +Div=40 +Mod=41 +Not=42 +And=43 +Or=44 +Xor=45 +Dot=46 +DoubleQuotes=47 +Quotes=48 +Endl=49 +Identifier=50 +Hexadecimal=51 +Decimal=52 +Octal=53 +Binary=54 +Float=55 +IntegerSequence=56 +HEX_DIGIT=57 +OCTAL_DIGIT=58 +BINARY_DIGIT=59 +DIGIT=60 +STRING=61 +LINE_COMMENT=62 +BLOCK_COMMENT=63 +WHITESPACE=64 'var'=1 'val'=2 'for'=3 @@ -80,32 +81,33 @@ WHITESPACE=63 'false'=17 'static'=18 'const'=19 -'('=20 -')'=21 -'['=22 -']'=23 -'{'=24 -'}'=25 -':'=26 -';'=27 -','=28 -'=='=29 -'='=30 -'>'=31 -'<'=32 -'<<'=33 -'>>'=34 -'>>>'=35 -'+'=36 -'-'=37 -'*'=38 -'/'=39 -'%'=40 -'!'=41 -'&'=42 -'|'=43 -'^'=44 -'.'=45 -'"'=46 -'\''=47 -'\n'=48 +'null'=20 +'('=21 +')'=22 +'['=23 +']'=24 +'{'=25 +'}'=26 +':'=27 +';'=28 +','=29 +'=='=30 +'='=31 +'>'=32 +'<'=33 +'<<'=34 +'>>'=35 +'>>>'=36 +'+'=37 +'-'=38 +'*'=39 +'/'=40 +'%'=41 +'!'=42 +'&'=43 +'|'=44 +'^'=45 +'.'=46 +'"'=47 +'\''=48 +'\n'=49 diff --git a/parser/RiddleParserBaseListener.h b/parser/RiddleParserBaseListener.h index e511b30..094fae4 100644 --- a/parser/RiddleParserBaseListener.h +++ b/parser/RiddleParserBaseListener.h @@ -82,6 +82,9 @@ class RiddleParserBaseListener : public RiddleParserListener { virtual void enterAndAssignExpr(RiddleParser::AndAssignExprContext * /*ctx*/) override { } virtual void exitAndAssignExpr(RiddleParser::AndAssignExprContext * /*ctx*/) override { } + virtual void enterNullExpr(RiddleParser::NullExprContext * /*ctx*/) override { } + virtual void exitNullExpr(RiddleParser::NullExprContext * /*ctx*/) override { } + virtual void enterModExpr(RiddleParser::ModExprContext * /*ctx*/) override { } virtual void exitModExpr(RiddleParser::ModExprContext * /*ctx*/) override { } diff --git a/parser/RiddleParserBaseVisitor.h b/parser/RiddleParserBaseVisitor.h index 6a09b87..33f2d32 100644 --- a/parser/RiddleParserBaseVisitor.h +++ b/parser/RiddleParserBaseVisitor.h @@ -103,6 +103,10 @@ class RiddleParserBaseVisitor : public RiddleParserVisitor { return visitChildren(ctx); } + virtual std::any visitNullExpr(RiddleParser::NullExprContext *ctx) override { + return visitChildren(ctx); + } + virtual std::any visitModExpr(RiddleParser::ModExprContext *ctx) override { return visitChildren(ctx); } diff --git a/parser/RiddleParserListener.h b/parser/RiddleParserListener.h index 89f673b..0a3d08e 100644 --- a/parser/RiddleParserListener.h +++ b/parser/RiddleParserListener.h @@ -80,6 +80,9 @@ class RiddleParserListener : public antlr4::tree::ParseTreeListener { virtual void enterAndAssignExpr(RiddleParser::AndAssignExprContext *ctx) = 0; virtual void exitAndAssignExpr(RiddleParser::AndAssignExprContext *ctx) = 0; + virtual void enterNullExpr(RiddleParser::NullExprContext *ctx) = 0; + virtual void exitNullExpr(RiddleParser::NullExprContext *ctx) = 0; + virtual void enterModExpr(RiddleParser::ModExprContext *ctx) = 0; virtual void exitModExpr(RiddleParser::ModExprContext *ctx) = 0; diff --git a/parser/RiddleParserVisitor.h b/parser/RiddleParserVisitor.h index 4bec081..3224674 100644 --- a/parser/RiddleParserVisitor.h +++ b/parser/RiddleParserVisitor.h @@ -63,6 +63,8 @@ class RiddleParserVisitor : public antlr4::tree::AbstractParseTreeVisitor { virtual std::any visitAndAssignExpr(RiddleParser::AndAssignExprContext *context) = 0; + virtual std::any visitNullExpr(RiddleParser::NullExprContext *context) = 0; + virtual std::any visitModExpr(RiddleParser::ModExprContext *context) = 0; virtual std::any visitCastExpr(RiddleParser::CastExprContext *context) = 0; diff --git a/src/Tools/Managers/StmtManager.ixx b/src/Tools/Managers/StmtManager.ixx index 00c999f..788f9f2 100644 --- a/src/Tools/Managers/StmtManager.ixx +++ b/src/Tools/Managers/StmtManager.ixx @@ -1,4 +1,5 @@ module; +#include #include export module Managers.StmtManager; @@ -14,30 +15,40 @@ export namespace Riddle { delete stmt; } } - BaseStmt *getConstant(const int value) { + IntegerStmt *getConstant(const int value) { const auto ptr = new IntegerStmt(value); stmts.push_back(ptr); return ptr; } - BaseStmt *getConstant(const double value) { + DoubleStmt *getConstant(const double value) { const auto ptr = new DoubleStmt(value); stmts.push_back(ptr); return ptr; } - BaseStmt *getConstant(const float value) { + FloatStmt *getConstant(const float value) { const auto ptr = new FloatStmt(value); stmts.push_back(ptr); return ptr; } - BaseStmt *getConstant(const bool value) { + BoolStmt *getConstant(const bool value) { const auto ptr = new BoolStmt(value); stmts.push_back(ptr); return ptr; } - BaseStmt *getNull() { + StringStmt *getConstant(const std::string value) { + const auto ptr = new StringStmt(value); + stmts.push_back(ptr); + return ptr; + } + NullStmt *getNull() { const auto ptr = new NullStmt(); stmts.push_back(ptr); return ptr; } + VarDefineStmt *getVarDefine(const std::string &name, const std::string &type, BaseStmt *value) { + const auto ptr = new VarDefineStmt(name, type, value); + stmts.push_back(ptr); + return ptr; + } }; }// namespace Riddle \ No newline at end of file diff --git a/src/Types/Statements.ixx b/src/Types/Statements.ixx index 1d0c524..7b750ea 100644 --- a/src/Types/Statements.ixx +++ b/src/Types/Statements.ixx @@ -23,9 +23,10 @@ export namespace Riddle { IntegerStmtID,// int 类型 FloatStmtID, // float 类型 - DoubleStmtID, - BoolStmtID, - NullStmtID, + DoubleStmtID, // double 类型 + BoolStmtID, // bool 类型 + StringStmtID, // string 类型 + NullStmtID, // Null NoneStmtID,// 没有任何效果的语句 }; @@ -109,6 +110,16 @@ export namespace Riddle { [[nodiscard]] inline bool getValue() const { return value; } }; + /// @brief 存储 string 数据类型 + class StringStmt final : public ConstantStmt { + protected: + std::string value; + + public: + explicit StringStmt(const std::string &value): ConstantStmt(StmtTypeID::StringStmtID), value(value) {} + [[nodiscard]] inline std::string getValue() const { return value; } + }; + // todo 实现多个变量定义 /// @brief 用于存储变量定义 diff --git a/src/Visitors/StmtVisitor.cpp b/src/Visitors/StmtVisitor.cpp index 8c1d927..6f54b0f 100644 --- a/src/Visitors/StmtVisitor.cpp +++ b/src/Visitors/StmtVisitor.cpp @@ -1,19 +1,48 @@ #include "StmtVisitor.h" +#include + import Types.Statements; +import Managers.StmtManager; namespace Riddle { + std::any StmtVisitor::visitProgram(RiddleParser::ProgramContext *ctx) { + std::vector stmts; + for(auto i: ctx->children) { + stmts.push_back(std::any_cast(visit(i))); + } + return stmts; + } std::any StmtVisitor::visitStatement_ed(RiddleParser::Statement_edContext *ctx) { return visit(ctx->children[0]); } std::any StmtVisitor::visitInteger(RiddleParser::IntegerContext *ctx) { - auto result = IntegerStmt(ctx->value); + BaseStmt *result = stmt_manager.getConstant(ctx->value); + return result; + } + std::any StmtVisitor::visitFloat(RiddleParser::FloatContext *ctx) { + BaseStmt *result = stmt_manager.getConstant(ctx->value); + return result; + } + std::any StmtVisitor::visitBoolean(RiddleParser::BooleanContext *ctx) { + BaseStmt *result = stmt_manager.getConstant(ctx->value); + return result; + } + std::any StmtVisitor::visitNullExpr(RiddleParser::NullExprContext *context) { + BaseStmt *result = stmt_manager.getNull(); return result; } + std::any StmtVisitor::visitVarDefineStatement(RiddleParser::VarDefineStatementContext *ctx) { const std::string name = ctx->name->getText(); - return {}; + std::string type; + if(ctx->type != nullptr) { + type = ctx->type->getText(); + } + const auto value = std::any_cast(visit(ctx->value)); + return stmt_manager.getVarDefine(name, type, value); } + }// namespace Riddle \ No newline at end of file diff --git a/src/Visitors/StmtVisitor.h b/src/Visitors/StmtVisitor.h index ff3b27c..e79b265 100644 --- a/src/Visitors/StmtVisitor.h +++ b/src/Visitors/StmtVisitor.h @@ -1,16 +1,25 @@ -#ifndef STATVISITOR_H -#define STATVISITOR_H + #ifndef STMTVISITOR_H +#define STMTVISITOR_H #include +import Managers.StmtManager; + namespace Riddle { + /// 所有函数的返回值都为BaseStmt + class StmtVisitor final : RiddleParserBaseVisitor { + StmtManager stmt_manager{}; - class StmtVisitor final : RiddleParserBaseVisitor{ + public: + std::any visitProgram(RiddleParser::ProgramContext *ctx) override; std::any visitStatement_ed(RiddleParser::Statement_edContext *ctx) override; std::any visitInteger(RiddleParser::IntegerContext *ctx) override; + std::any visitFloat(RiddleParser::FloatContext *ctx) override; + std::any visitBoolean(RiddleParser::BooleanContext *ctx) override; + std::any visitNullExpr(RiddleParser::NullExprContext *context) override; std::any visitVarDefineStatement(RiddleParser::VarDefineStatementContext *ctx) override; }; }// namespace Riddle -#endif//STATVISITOR_H +#endif//STMTVISITOR_H