brett-compiler 1.0.21 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/Brett.interp +152 -0
- package/dist/generated/Brett.tokens +108 -0
- package/dist/generated/BrettLexer.interp +188 -0
- package/dist/generated/BrettLexer.js +232 -1
- package/dist/generated/BrettLexer.tokens +108 -0
- package/dist/generated/BrettListener.js +369 -1
- package/dist/generated/BrettParser.js +3990 -1
- package/dist/generated/BrettVisitor.js +250 -1
- package/package.json +7 -3
|
@@ -1 +1,3990 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("antlr4"),r=require("./BrettListener.js"),o=require("./BrettVisitor.js"),nt=[4,1,57,342,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,1,0,5,0,56,8,0,10,0,12,0,59,9,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,76,8,1,1,2,1,2,5,2,80,8,2,10,2,12,2,83,9,2,1,2,1,2,1,3,1,3,1,3,1,3,3,3,91,8,3,1,3,1,3,3,3,95,8,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,107,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,116,8,4,1,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,136,8,7,1,7,3,7,139,8,7,1,7,1,7,3,7,143,8,7,1,7,1,7,1,7,1,8,1,8,1,8,4,8,151,8,8,11,8,12,8,152,1,8,3,8,156,8,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,11,1,11,3,11,171,8,11,1,11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,1,14,1,14,1,14,1,15,1,15,1,15,1,15,3,15,188,8,15,1,15,1,15,1,15,3,15,193,8,15,1,15,1,15,1,16,1,16,1,16,5,16,200,8,16,10,16,12,16,203,9,16,1,17,1,17,1,17,3,17,208,8,17,1,18,1,18,1,18,1,18,1,18,5,18,215,8,18,10,18,12,18,218,9,18,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,3,20,229,8,20,1,20,1,20,1,20,1,20,3,20,235,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,3,21,246,8,21,1,21,1,21,1,21,3,21,251,8,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,5,21,275,8,21,10,21,12,21,278,9,21,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,293,8,22,1,22,1,22,1,22,3,22,298,8,22,1,23,1,23,1,23,1,23,5,23,304,8,23,10,23,12,23,307,9,23,3,23,309,8,23,1,23,1,23,1,24,1,24,1,24,1,24,5,24,317,8,24,10,24,12,24,320,9,24,3,24,322,8,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,3,25,332,8,25,1,26,1,26,1,26,5,26,337,8,26,10,26,12,26,340,9,26,1,26,0,2,36,42,27,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,0,6,3,0,2,5,25,25,54,54,1,0,6,7,1,0,40,41,1,0,38,39,1,0,34,37,1,0,32,33,373,0,57,1,0,0,0,2,75,1,0,0,0,4,77,1,0,0,0,6,106,1,0,0,0,8,108,1,0,0,0,10,117,1,0,0,0,12,123,1,0,0,0,14,131,1,0,0,0,16,147,1,0,0,0,18,159,1,0,0,0,20,164,1,0,0,0,22,168,1,0,0,0,24,174,1,0,0,0,26,177,1,0,0,0,28,180,1,0,0,0,30,183,1,0,0,0,32,196,1,0,0,0,34,204,1,0,0,0,36,209,1,0,0,0,38,219,1,0,0,0,40,221,1,0,0,0,42,250,1,0,0,0,44,297,1,0,0,0,46,299,1,0,0,0,48,312,1,0,0,0,50,331,1,0,0,0,52,333,1,0,0,0,54,56,3,2,1,0,55,54,1,0,0,0,56,59,1,0,0,0,57,55,1,0,0,0,57,58,1,0,0,0,58,60,1,0,0,0,59,57,1,0,0,0,60,61,5,0,0,1,61,1,1,0,0,0,62,76,3,6,3,0,63,76,3,30,15,0,64,76,3,8,4,0,65,76,3,10,5,0,66,76,3,14,7,0,67,76,3,16,8,0,68,76,3,22,11,0,69,76,3,28,14,0,70,76,3,4,2,0,71,76,3,24,12,0,72,76,3,26,13,0,73,76,3,12,6,0,74,76,3,40,20,0,75,62,1,0,0,0,75,63,1,0,0,0,75,64,1,0,0,0,75,65,1,0,0,0,75,66,1,0,0,0,75,67,1,0,0,0,75,68,1,0,0,0,75,69,1,0,0,0,75,70,1,0,0,0,75,71,1,0,0,0,75,72,1,0,0,0,75,73,1,0,0,0,75,74,1,0,0,0,76,3,1,0,0,0,77,81,5,49,0,0,78,80,3,2,1,0,79,78,1,0,0,0,80,83,1,0,0,0,81,79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,5,50,0,0,85,5,1,0,0,0,86,87,5,11,0,0,87,90,5,54,0,0,88,89,5,44,0,0,89,91,3,36,18,0,90,88,1,0,0,0,90,91,1,0,0,0,91,94,1,0,0,0,92,93,5,42,0,0,93,95,3,42,21,0,94,92,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,107,5,43,0,0,97,98,5,12,0,0,98,99,5,54,0,0,99,100,5,44,0,0,100,101,3,36,18,0,101,102,1,0,0,0,102,103,5,42,0,0,103,104,3,42,21,0,104,105,5,43,0,0,105,107,1,0,0,0,106,86,1,0,0,0,106,97,1,0,0,0,107,7,1,0,0,0,108,109,5,14,0,0,109,110,5,47,0,0,110,111,3,42,21,0,111,112,5,48,0,0,112,115,3,4,2,0,113,114,5,15,0,0,114,116,3,4,2,0,115,113,1,0,0,0,115,116,1,0,0,0,116,9,1,0,0,0,117,118,5,16,0,0,118,119,5,47,0,0,119,120,3,42,21,0,120,121,5,48,0,0,121,122,3,4,2,0,122,11,1,0,0,0,123,124,5,18,0,0,124,125,3,4,2,0,125,126,5,16,0,0,126,127,5,47,0,0,127,128,3,42,21,0,128,129,5,48,0,0,129,130,5,43,0,0,130,13,1,0,0,0,131,132,5,17,0,0,132,135,5,47,0,0,133,136,3,6,3,0,134,136,3,28,14,0,135,133,1,0,0,0,135,134,1,0,0,0,135,136,1,0,0,0,136,138,1,0,0,0,137,139,3,42,21,0,138,137,1,0,0,0,138,139,1,0,0,0,139,140,1,0,0,0,140,142,5,43,0,0,141,143,3,42,21,0,142,141,1,0,0,0,142,143,1,0,0,0,143,144,1,0,0,0,144,145,5,48,0,0,145,146,3,4,2,0,146,15,1,0,0,0,147,148,5,26,0,0,148,150,5,49,0,0,149,151,3,18,9,0,150,149,1,0,0,0,151,152,1,0,0,0,152,150,1,0,0,0,152,153,1,0,0,0,153,155,1,0,0,0,154,156,3,20,10,0,155,154,1,0,0,0,155,156,1,0,0,0,156,157,1,0,0,0,157,158,5,50,0,0,158,17,1,0,0,0,159,160,5,27,0,0,160,161,3,42,21,0,161,162,5,53,0,0,162,163,3,4,2,0,163,19,1,0,0,0,164,165,5,28,0,0,165,166,5,53,0,0,166,167,3,4,2,0,167,21,1,0,0,0,168,170,5,29,0,0,169,171,3,42,21,0,170,169,1,0,0,0,170,171,1,0,0,0,171,172,1,0,0,0,172,173,5,43,0,0,173,23,1,0,0,0,174,175,5,22,0,0,175,176,5,43,0,0,176,25,1,0,0,0,177,178,5,23,0,0,178,179,5,43,0,0,179,27,1,0,0,0,180,181,3,42,21,0,181,182,5,43,0,0,182,29,1,0,0,0,183,184,5,13,0,0,184,185,5,54,0,0,185,187,5,47,0,0,186,188,3,32,16,0,187,186,1,0,0,0,187,188,1,0,0,0,188,189,1,0,0,0,189,192,5,48,0,0,190,191,5,44,0,0,191,193,3,36,18,0,192,190,1,0,0,0,192,193,1,0,0,0,193,194,1,0,0,0,194,195,3,4,2,0,195,31,1,0,0,0,196,201,3,34,17,0,197,198,5,45,0,0,198,200,3,34,17,0,199,197,1,0,0,0,200,203,1,0,0,0,201,199,1,0,0,0,201,202,1,0,0,0,202,33,1,0,0,0,203,201,1,0,0,0,204,207,5,54,0,0,205,206,5,44,0,0,206,208,3,36,18,0,207,205,1,0,0,0,207,208,1,0,0,0,208,35,1,0,0,0,209,210,6,18,-1,0,210,211,3,38,19,0,211,216,1,0,0,0,212,213,10,1,0,0,213,215,5,1,0,0,214,212,1,0,0,0,215,218,1,0,0,0,216,214,1,0,0,0,216,217,1,0,0,0,217,37,1,0,0,0,218,216,1,0,0,0,219,220,7,0,0,0,220,39,1,0,0,0,221,222,5,19,0,0,222,223,3,4,2,0,223,224,5,20,0,0,224,225,5,47,0,0,225,228,5,54,0,0,226,227,5,44,0,0,227,229,3,36,18,0,228,226,1,0,0,0,228,229,1,0,0,0,229,230,1,0,0,0,230,231,5,48,0,0,231,234,3,4,2,0,232,233,5,21,0,0,233,235,3,4,2,0,234,232,1,0,0,0,234,235,1,0,0,0,235,41,1,0,0,0,236,237,6,21,-1,0,237,251,3,44,22,0,238,239,5,54,0,0,239,240,5,42,0,0,240,251,3,42,21,6,241,242,5,24,0,0,242,243,5,54,0,0,243,245,5,47,0,0,244,246,3,52,26,0,245,244,1,0,0,0,245,246,1,0,0,0,246,247,1,0,0,0,247,251,5,48,0,0,248,249,7,1,0,0,249,251,3,42,21,1,250,236,1,0,0,0,250,238,1,0,0,0,250,241,1,0,0,0,250,248,1,0,0,0,251,276,1,0,0,0,252,253,10,10,0,0,253,254,7,2,0,0,254,275,3,42,21,11,255,256,10,9,0,0,256,257,7,3,0,0,257,275,3,42,21,10,258,259,10,8,0,0,259,260,7,4,0,0,260,275,3,42,21,9,261,262,10,7,0,0,262,263,7,5,0,0,263,275,3,42,21,8,264,265,10,5,0,0,265,266,5,51,0,0,266,267,3,42,21,0,267,268,5,52,0,0,268,275,1,0,0,0,269,270,10,4,0,0,270,271,5,46,0,0,271,275,5,54,0,0,272,273,10,2,0,0,273,275,7,1,0,0,274,252,1,0,0,0,274,255,1,0,0,0,274,258,1,0,0,0,274,261,1,0,0,0,274,264,1,0,0,0,274,269,1,0,0,0,274,272,1,0,0,0,275,278,1,0,0,0,276,274,1,0,0,0,276,277,1,0,0,0,277,43,1,0,0,0,278,276,1,0,0,0,279,298,5,30,0,0,280,298,5,31,0,0,281,298,5,8,0,0,282,298,5,9,0,0,283,298,5,10,0,0,284,298,5,54,0,0,285,286,5,47,0,0,286,287,3,42,21,0,287,288,5,48,0,0,288,298,1,0,0,0,289,290,5,54,0,0,290,292,5,47,0,0,291,293,3,52,26,0,292,291,1,0,0,0,292,293,1,0,0,0,293,294,1,0,0,0,294,298,5,48,0,0,295,298,3,46,23,0,296,298,3,48,24,0,297,279,1,0,0,0,297,280,1,0,0,0,297,281,1,0,0,0,297,282,1,0,0,0,297,283,1,0,0,0,297,284,1,0,0,0,297,285,1,0,0,0,297,289,1,0,0,0,297,295,1,0,0,0,297,296,1,0,0,0,298,45,1,0,0,0,299,308,5,51,0,0,300,305,3,42,21,0,301,302,5,45,0,0,302,304,3,42,21,0,303,301,1,0,0,0,304,307,1,0,0,0,305,303,1,0,0,0,305,306,1,0,0,0,306,309,1,0,0,0,307,305,1,0,0,0,308,300,1,0,0,0,308,309,1,0,0,0,309,310,1,0,0,0,310,311,5,52,0,0,311,47,1,0,0,0,312,321,5,49,0,0,313,318,3,50,25,0,314,315,5,45,0,0,315,317,3,50,25,0,316,314,1,0,0,0,317,320,1,0,0,0,318,316,1,0,0,0,318,319,1,0,0,0,319,322,1,0,0,0,320,318,1,0,0,0,321,313,1,0,0,0,321,322,1,0,0,0,322,323,1,0,0,0,323,324,5,50,0,0,324,49,1,0,0,0,325,326,5,54,0,0,326,327,5,44,0,0,327,332,3,42,21,0,328,329,5,31,0,0,329,330,5,44,0,0,330,332,3,42,21,0,331,325,1,0,0,0,331,328,1,0,0,0,332,51,1,0,0,0,333,338,3,42,21,0,334,335,5,45,0,0,335,337,3,42,21,0,336,334,1,0,0,0,337,340,1,0,0,0,338,336,1,0,0,0,338,339,1,0,0,0,339,53,1,0,0,0,340,338,1,0,0,0,32,57,75,81,90,94,106,115,135,138,142,152,155,170,187,192,201,207,216,228,234,245,250,274,276,292,297,305,308,318,321,331,338],K=new n.atn.ATNDeserializer().deserialize(nt),ht=K.decisionToState.map((a,t)=>new n.dfa.DFA(a,t)),at=new n.atn.PredictionContextCache;class e extends n.Parser{static grammarFileName="Brett.g4";static literalNames=[null,"'[]'","'string'","'number'","'bool'","'any'","'++'","'--'","'true'","'false'","'nil'","'let'","'const'","'def'","'if'","'else'","'while'","'for'","'do'","'try'","'catch'","'finally'","'break'","'continue'","'new'","'void'","'switch'","'case'","'default'","'return'",null,null,"'=='","'!='","'<='","'>='","'<'","'>'","'+'","'-'","'*'","'/'","'='","';'","':'","','","'.'","'('","')'","'{'","'}'","'['","']'","'=>'"];static symbolicNames=[null,null,null,null,null,null,null,null,null,null,null,"LET","CONST","DEF","IF","ELSE","WHILE","FOR","DO","TRY","CATCH","FINALLY","BREAK","CONTINUE","NEW","VOID","SWITCH","CASE","DEFAULT","RETURN","NUMBER","STRING","EQ","NEQ","LE","GE","LT","GT","PLUS","MINUS","STAR","SLASH","ASSIGN","SEMI","COLON","COMMA","DOT","LPAREN","RPAREN","LBRACE","RBRACE","LBRACK","RBRACK","ARROW","IDENTIFIER","WS","LINE_COMMENT","BLOCK_COMMENT"];static ruleNames=["program","statement","block","variableDeclaration","ifStatement","whileStatement","doWhileStatement","forStatement","switchStatement","switchCase","defaultCase","returnStatement","breakStatement","continueStatement","expressionStatement","functionDeclaration","parameterList","parameter","type","baseType","tryCatchStatement","expression","primary","arrayLiteral","objectLiteral","property","argList"];constructor(t){super(t),this._interp=new n.atn.ParserATNSimulator(this,K,ht,at),this.ruleNames=e.ruleNames,this.literalNames=e.literalNames,this.symbolicNames=e.symbolicNames}sempred(t,s,i){switch(s){case 18:return this.type_sempred(t,i);case 21:return this.expression_sempred(t,i);default:throw"No predicate with index:"+s}}type_sempred(t,s){if(s===0)return this.precpred(this._ctx,1);throw"No predicate with index:"+s}expression_sempred(t,s){switch(s){case 1:return this.precpred(this._ctx,10);case 2:return this.precpred(this._ctx,9);case 3:return this.precpred(this._ctx,8);case 4:return this.precpred(this._ctx,7);case 5:return this.precpred(this._ctx,5);case 6:return this.precpred(this._ctx,4);case 7:return this.precpred(this._ctx,2);default:throw"No predicate with index:"+s}}program(){let t=new j(this,this._ctx,this.state);this.enterRule(t,0,e.RULE_program);var s=0;try{for(this.enterOuterAlt(t,1),this.state=57,this._errHandler.sync(this),s=this._input.LA(1);(s&-32)===0&&(1<<s&3855581120)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0;)this.state=54,this.statement(),this.state=59,this._errHandler.sync(this),s=this._input.LA(1);this.state=60,this.match(e.EOF)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}statement(){let t=new L(this,this._ctx,this.state);this.enterRule(t,2,e.RULE_statement);try{this.state=75,this._errHandler.sync(this);var s=this._interp.adaptivePredict(this._input,1,this._ctx);switch(s){case 1:this.enterOuterAlt(t,1),this.state=62,this.variableDeclaration();break;case 2:this.enterOuterAlt(t,2),this.state=63,this.functionDeclaration();break;case 3:this.enterOuterAlt(t,3),this.state=64,this.ifStatement();break;case 4:this.enterOuterAlt(t,4),this.state=65,this.whileStatement();break;case 5:this.enterOuterAlt(t,5),this.state=66,this.forStatement();break;case 6:this.enterOuterAlt(t,6),this.state=67,this.switchStatement();break;case 7:this.enterOuterAlt(t,7),this.state=68,this.returnStatement();break;case 8:this.enterOuterAlt(t,8),this.state=69,this.expressionStatement();break;case 9:this.enterOuterAlt(t,9),this.state=70,this.block();break;case 10:this.enterOuterAlt(t,10),this.state=71,this.breakStatement();break;case 11:this.enterOuterAlt(t,11),this.state=72,this.continueStatement();break;case 12:this.enterOuterAlt(t,12),this.state=73,this.doWhileStatement();break;case 13:this.enterOuterAlt(t,13),this.state=74,this.tryCatchStatement();break}}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}block(){let t=new u(this,this._ctx,this.state);this.enterRule(t,4,e.RULE_block);var s=0;try{for(this.enterOuterAlt(t,1),this.state=77,this.match(e.LBRACE),this.state=81,this._errHandler.sync(this),s=this._input.LA(1);(s&-32)===0&&(1<<s&3855581120)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0;)this.state=78,this.statement(),this.state=83,this._errHandler.sync(this),s=this._input.LA(1);this.state=84,this.match(e.RBRACE)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}variableDeclaration(){let t=new I(this,this._ctx,this.state);this.enterRule(t,6,e.RULE_variableDeclaration);var s=0;try{switch(this.state=106,this._errHandler.sync(this),this._input.LA(1)){case 11:this.enterOuterAlt(t,1),this.state=86,this.match(e.LET),this.state=87,this.match(e.IDENTIFIER),this.state=90,this._errHandler.sync(this),s=this._input.LA(1),s===44&&(this.state=88,this.match(e.COLON),this.state=89,this.type(0)),this.state=94,this._errHandler.sync(this),s=this._input.LA(1),s===42&&(this.state=92,this.match(e.ASSIGN),this.state=93,this.expression(0)),this.state=96,this.match(e.SEMI);break;case 12:this.enterOuterAlt(t,2),this.state=97,this.match(e.CONST),this.state=98,this.match(e.IDENTIFIER),this.state=99,this.match(e.COLON),this.state=100,this.type(0),this.state=102,this.match(e.ASSIGN),this.state=103,this.expression(0),this.state=104,this.match(e.SEMI);break;default:throw new n.error.NoViableAltException(this)}}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}ifStatement(){let t=new O(this,this._ctx,this.state);this.enterRule(t,8,e.RULE_ifStatement);var s=0;try{this.enterOuterAlt(t,1),this.state=108,this.match(e.IF),this.state=109,this.match(e.LPAREN),this.state=110,this.expression(0),this.state=111,this.match(e.RPAREN),this.state=112,this.block(),this.state=115,this._errHandler.sync(this),s=this._input.LA(1),s===15&&(this.state=113,this.match(e.ELSE),this.state=114,this.block())}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}whileStatement(){let t=new S(this,this._ctx,this.state);this.enterRule(t,10,e.RULE_whileStatement);try{this.enterOuterAlt(t,1),this.state=117,this.match(e.WHILE),this.state=118,this.match(e.LPAREN),this.state=119,this.expression(0),this.state=120,this.match(e.RPAREN),this.state=121,this.block()}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}doWhileStatement(){let t=new g(this,this._ctx,this.state);this.enterRule(t,12,e.RULE_doWhileStatement);try{this.enterOuterAlt(t,1),this.state=123,this.match(e.DO),this.state=124,this.block(),this.state=125,this.match(e.WHILE),this.state=126,this.match(e.LPAREN),this.state=127,this.expression(0),this.state=128,this.match(e.RPAREN),this.state=129,this.match(e.SEMI)}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}forStatement(){let t=new H(this,this._ctx,this.state);this.enterRule(t,14,e.RULE_forStatement);var s=0;try{this.enterOuterAlt(t,1),this.state=131,this.match(e.FOR),this.state=132,this.match(e.LPAREN),this.state=135,this._errHandler.sync(this);var i=this._interp.adaptivePredict(this._input,7,this._ctx);i===1?(this.state=133,this.variableDeclaration()):i===2&&(this.state=134,this.expressionStatement()),this.state=138,this._errHandler.sync(this),s=this._input.LA(1),((s&-32)===0&&(1<<s&3238004672)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0)&&(this.state=137,this.expression(0)),this.state=140,this.match(e.SEMI),this.state=142,this._errHandler.sync(this),s=this._input.LA(1),((s&-32)===0&&(1<<s&3238004672)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0)&&(this.state=141,this.expression(0)),this.state=144,this.match(e.RPAREN),this.state=145,this.block()}catch(h){if(h instanceof n.error.RecognitionException)t.exception=h,this._errHandler.reportError(this,h),this._errHandler.recover(this,h);else throw h}finally{this.exitRule()}return t}switchStatement(){let t=new b(this,this._ctx,this.state);this.enterRule(t,16,e.RULE_switchStatement);var s=0;try{this.enterOuterAlt(t,1),this.state=147,this.match(e.SWITCH),this.state=148,this.match(e.LBRACE),this.state=150,this._errHandler.sync(this),s=this._input.LA(1);do this.state=149,this.switchCase(),this.state=152,this._errHandler.sync(this),s=this._input.LA(1);while(s===27);this.state=155,this._errHandler.sync(this),s=this._input.LA(1),s===28&&(this.state=154,this.defaultCase()),this.state=157,this.match(e.RBRACE)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}switchCase(){let t=new y(this,this._ctx,this.state);this.enterRule(t,18,e.RULE_switchCase);try{this.enterOuterAlt(t,1),this.state=159,this.match(e.CASE),this.state=160,this.expression(0),this.state=161,this.match(e.ARROW),this.state=162,this.block()}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}defaultCase(){let t=new U(this,this._ctx,this.state);this.enterRule(t,20,e.RULE_defaultCase);try{this.enterOuterAlt(t,1),this.state=164,this.match(e.DEFAULT),this.state=165,this.match(e.ARROW),this.state=166,this.block()}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}returnStatement(){let t=new F(this,this._ctx,this.state);this.enterRule(t,22,e.RULE_returnStatement);var s=0;try{this.enterOuterAlt(t,1),this.state=168,this.match(e.RETURN),this.state=170,this._errHandler.sync(this),s=this._input.LA(1),((s&-32)===0&&(1<<s&3238004672)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0)&&(this.state=169,this.expression(0)),this.state=172,this.match(e.SEMI)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}breakStatement(){let t=new D(this,this._ctx,this.state);this.enterRule(t,24,e.RULE_breakStatement);try{this.enterOuterAlt(t,1),this.state=174,this.match(e.BREAK),this.state=175,this.match(e.SEMI)}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}continueStatement(){let t=new k(this,this._ctx,this.state);this.enterRule(t,26,e.RULE_continueStatement);try{this.enterOuterAlt(t,1),this.state=177,this.match(e.CONTINUE),this.state=178,this.match(e.SEMI)}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}expressionStatement(){let t=new N(this,this._ctx,this.state);this.enterRule(t,28,e.RULE_expressionStatement);try{this.enterOuterAlt(t,1),this.state=180,this.expression(0),this.state=181,this.match(e.SEMI)}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}functionDeclaration(){let t=new M(this,this._ctx,this.state);this.enterRule(t,30,e.RULE_functionDeclaration);var s=0;try{this.enterOuterAlt(t,1),this.state=183,this.match(e.DEF),this.state=184,this.match(e.IDENTIFIER),this.state=185,this.match(e.LPAREN),this.state=187,this._errHandler.sync(this),s=this._input.LA(1),s===54&&(this.state=186,this.parameterList()),this.state=189,this.match(e.RPAREN),this.state=192,this._errHandler.sync(this),s=this._input.LA(1),s===44&&(this.state=190,this.match(e.COLON),this.state=191,this.type(0)),this.state=194,this.block()}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}parameterList(){let t=new B(this,this._ctx,this.state);this.enterRule(t,32,e.RULE_parameterList);var s=0;try{for(this.enterOuterAlt(t,1),this.state=196,this.parameter(),this.state=201,this._errHandler.sync(this),s=this._input.LA(1);s===45;)this.state=197,this.match(e.COMMA),this.state=198,this.parameter(),this.state=203,this._errHandler.sync(this),s=this._input.LA(1)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}parameter(){let t=new A(this,this._ctx,this.state);this.enterRule(t,34,e.RULE_parameter);var s=0;try{this.enterOuterAlt(t,1),this.state=204,this.match(e.IDENTIFIER),this.state=207,this._errHandler.sync(this),s=this._input.LA(1),s===44&&(this.state=205,this.match(e.COLON),this.state=206,this.type(0))}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}type(t){t===void 0&&(t=0);const s=this._ctx,i=this.state;let h=new x(this,this._ctx,i),d=h;const p=36;this.enterRecursionRule(h,36,e.RULE_type,t);try{this.enterOuterAlt(h,1),h=new z(this,h),this._ctx=h,d=h,this.state=210,this.baseType(),this._ctx.stop=this._input.LT(-1),this.state=216,this._errHandler.sync(this);for(var l=this._interp.adaptivePredict(this._input,17,this._ctx);l!=2&&l!=n.atn.ATN.INVALID_ALT_NUMBER;){if(l===1){if(this._parseListeners!==null&&this.triggerExitRuleEvent(),d=h,h=new Y(this,new x(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_type),this.state=212,!this.precpred(this._ctx,1))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 1)");this.state=213,this.match(e.T__0)}this.state=218,this._errHandler.sync(this),l=this._interp.adaptivePredict(this._input,17,this._ctx)}}catch(f){if(f instanceof n.error.RecognitionException)h.exception=f,this._errHandler.reportError(this,f),this._errHandler.recover(this,f);else throw f}finally{this.unrollRecursionContexts(s)}return h}baseType(){let t=new V(this,this._ctx,this.state);this.enterRule(t,38,e.RULE_baseType);var s=0;try{this.enterOuterAlt(t,1),this.state=219,s=this._input.LA(1),(s&-32)===0&&(1<<s&33554492)!==0||s===54?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}tryCatchStatement(){let t=new W(this,this._ctx,this.state);this.enterRule(t,40,e.RULE_tryCatchStatement);var s=0;try{this.enterOuterAlt(t,1),this.state=221,this.match(e.TRY),this.state=222,this.block(),this.state=223,this.match(e.CATCH),this.state=224,this.match(e.LPAREN),this.state=225,this.match(e.IDENTIFIER),this.state=228,this._errHandler.sync(this),s=this._input.LA(1),s===44&&(this.state=226,this.match(e.COLON),this.state=227,this.type(0)),this.state=230,this.match(e.RPAREN),this.state=231,this.block(),this.state=234,this._errHandler.sync(this),s=this._input.LA(1),s===21&&(this.state=232,this.match(e.FINALLY),this.state=233,this.block())}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}expression(t){t===void 0&&(t=0);const s=this._ctx,i=this.state;let h=new c(this,this._ctx,i),d=h;const p=42;this.enterRecursionRule(h,42,e.RULE_expression,t);var l=0;try{this.enterOuterAlt(h,1),this.state=250,this._errHandler.sync(this);var f=this._interp.adaptivePredict(this._input,21,this._ctx);switch(f){case 1:h=new q(this,h),this._ctx=h,d=h,this.state=237,this.primary();break;case 2:h=new v(this,h),this._ctx=h,d=h,this.state=238,this.match(e.IDENTIFIER),this.state=239,this.match(e.ASSIGN),this.state=240,this.expression(6);break;case 3:h=new J(this,h),this._ctx=h,d=h,this.state=241,this.match(e.NEW),this.state=242,this.match(e.IDENTIFIER),this.state=243,this.match(e.LPAREN),this.state=245,this._errHandler.sync(this),l=this._input.LA(1),((l&-32)===0&&(1<<l&3238004672)!==0||(l-47&-32)===0&&(1<<l-47&149)!==0)&&(this.state=244,this.argList()),this.state=247,this.match(e.RPAREN);break;case 4:h=new X(this,h),this._ctx=h,d=h,this.state=248,l=this._input.LA(1),l===6||l===7?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=249,this.expression(1);break}this._ctx.stop=this._input.LT(-1),this.state=276,this._errHandler.sync(this);for(var T=this._interp.adaptivePredict(this._input,23,this._ctx);T!=2&&T!=n.atn.ATN.INVALID_ALT_NUMBER;){if(T===1){this._parseListeners!==null&&this.triggerExitRuleEvent(),d=h,this.state=274,this._errHandler.sync(this);var f=this._interp.adaptivePredict(this._input,22,this._ctx);switch(f){case 1:if(h=new m(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=252,!this.precpred(this._ctx,10))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 10)");this.state=253,h.op=this._input.LT(1),l=this._input.LA(1),l===40||l===41?(this._errHandler.reportMatch(this),this.consume()):h.op=this._errHandler.recoverInline(this),this.state=254,this.expression(11);break;case 2:if(h=new m(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=255,!this.precpred(this._ctx,9))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 9)");this.state=256,h.op=this._input.LT(1),l=this._input.LA(1),l===38||l===39?(this._errHandler.reportMatch(this),this.consume()):h.op=this._errHandler.recoverInline(this),this.state=257,this.expression(10);break;case 3:if(h=new m(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=258,!this.precpred(this._ctx,8))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 8)");this.state=259,h.op=this._input.LT(1),l=this._input.LA(1),(l-34&-32)===0&&(1<<l-34&15)!==0?(this._errHandler.reportMatch(this),this.consume()):h.op=this._errHandler.recoverInline(this),this.state=260,this.expression(9);break;case 4:if(h=new m(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=261,!this.precpred(this._ctx,7))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 7)");this.state=262,h.op=this._input.LT(1),l=this._input.LA(1),l===32||l===33?(this._errHandler.reportMatch(this),this.consume()):h.op=this._errHandler.recoverInline(this),this.state=263,this.expression(8);break;case 5:if(h=new Z(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=264,!this.precpred(this._ctx,5))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 5)");this.state=265,this.match(e.LBRACK),this.state=266,this.expression(0),this.state=267,this.match(e.RBRACK);break;case 6:if(h=new Q(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=269,!this.precpred(this._ctx,4))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 4)");this.state=270,this.match(e.DOT),this.state=271,this.match(e.IDENTIFIER);break;case 7:if(h=new $(this,new c(this,s,i)),this.pushNewRecursionContext(h,p,e.RULE_expression),this.state=272,!this.precpred(this._ctx,2))throw new n.error.FailedPredicateException(this,"this.precpred(this._ctx, 2)");this.state=273,l=this._input.LA(1),l===6||l===7?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this);break}}this.state=278,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,23,this._ctx)}}catch(C){if(C instanceof n.error.RecognitionException)h.exception=C,this._errHandler.reportError(this,C),this._errHandler.recover(this,C);else throw C}finally{this.unrollRecursionContexts(s)}return h}primary(){let t=new R(this,this._ctx,this.state);this.enterRule(t,44,e.RULE_primary);var s=0;try{this.state=297,this._errHandler.sync(this);var i=this._interp.adaptivePredict(this._input,25,this._ctx);switch(i){case 1:t=new E(this,t),this.enterOuterAlt(t,1),this.state=279,this.match(e.NUMBER);break;case 2:t=new E(this,t),this.enterOuterAlt(t,2),this.state=280,this.match(e.STRING);break;case 3:t=new E(this,t),this.enterOuterAlt(t,3),this.state=281,this.match(e.T__7);break;case 4:t=new E(this,t),this.enterOuterAlt(t,4),this.state=282,this.match(e.T__8);break;case 5:t=new E(this,t),this.enterOuterAlt(t,5),this.state=283,this.match(e.T__9);break;case 6:t=new rt(this,t),this.enterOuterAlt(t,6),this.state=284,this.match(e.IDENTIFIER);break;case 7:t=new tt(this,t),this.enterOuterAlt(t,7),this.state=285,this.match(e.LPAREN),this.state=286,this.expression(0),this.state=287,this.match(e.RPAREN);break;case 8:t=new it(this,t),this.enterOuterAlt(t,8),this.state=289,this.match(e.IDENTIFIER),this.state=290,this.match(e.LPAREN),this.state=292,this._errHandler.sync(this),s=this._input.LA(1),((s&-32)===0&&(1<<s&3238004672)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0)&&(this.state=291,this.argList()),this.state=294,this.match(e.RPAREN);break;case 9:t=new st(this,t),this.enterOuterAlt(t,9),this.state=295,this.arrayLiteral();break;case 10:t=new et(this,t),this.enterOuterAlt(t,10),this.state=296,this.objectLiteral();break}}catch(h){if(h instanceof n.error.RecognitionException)t.exception=h,this._errHandler.reportError(this,h),this._errHandler.recover(this,h);else throw h}finally{this.exitRule()}return t}arrayLiteral(){let t=new G(this,this._ctx,this.state);this.enterRule(t,46,e.RULE_arrayLiteral);var s=0;try{if(this.enterOuterAlt(t,1),this.state=299,this.match(e.LBRACK),this.state=308,this._errHandler.sync(this),s=this._input.LA(1),(s&-32)===0&&(1<<s&3238004672)!==0||(s-47&-32)===0&&(1<<s-47&149)!==0)for(this.state=300,this.expression(0),this.state=305,this._errHandler.sync(this),s=this._input.LA(1);s===45;)this.state=301,this.match(e.COMMA),this.state=302,this.expression(0),this.state=307,this._errHandler.sync(this),s=this._input.LA(1);this.state=310,this.match(e.RBRACK)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}objectLiteral(){let t=new P(this,this._ctx,this.state);this.enterRule(t,48,e.RULE_objectLiteral);var s=0;try{if(this.enterOuterAlt(t,1),this.state=312,this.match(e.LBRACE),this.state=321,this._errHandler.sync(this),s=this._input.LA(1),s===31||s===54)for(this.state=313,this.property(),this.state=318,this._errHandler.sync(this),s=this._input.LA(1);s===45;)this.state=314,this.match(e.COMMA),this.state=315,this.property(),this.state=320,this._errHandler.sync(this),s=this._input.LA(1);this.state=323,this.match(e.RBRACE)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}property(){let t=new _(this,this._ctx,this.state);this.enterRule(t,50,e.RULE_property);try{switch(this.state=331,this._errHandler.sync(this),this._input.LA(1)){case 54:this.enterOuterAlt(t,1),this.state=325,this.match(e.IDENTIFIER),this.state=326,this.match(e.COLON),this.state=327,this.expression(0);break;case 31:this.enterOuterAlt(t,2),this.state=328,this.match(e.STRING),this.state=329,this.match(e.COLON),this.state=330,this.expression(0);break;default:throw new n.error.NoViableAltException(this)}}catch(s){if(s instanceof n.error.RecognitionException)t.exception=s,this._errHandler.reportError(this,s),this._errHandler.recover(this,s);else throw s}finally{this.exitRule()}return t}argList(){let t=new w(this,this._ctx,this.state);this.enterRule(t,52,e.RULE_argList);var s=0;try{for(this.enterOuterAlt(t,1),this.state=333,this.expression(0),this.state=338,this._errHandler.sync(this),s=this._input.LA(1);s===45;)this.state=334,this.match(e.COMMA),this.state=335,this.expression(0),this.state=340,this._errHandler.sync(this),s=this._input.LA(1)}catch(i){if(i instanceof n.error.RecognitionException)t.exception=i,this._errHandler.reportError(this,i),this._errHandler.recover(this,i);else throw i}finally{this.exitRule()}return t}}e.EOF=n.Token.EOF;e.T__0=1;e.T__1=2;e.T__2=3;e.T__3=4;e.T__4=5;e.T__5=6;e.T__6=7;e.T__7=8;e.T__8=9;e.T__9=10;e.LET=11;e.CONST=12;e.DEF=13;e.IF=14;e.ELSE=15;e.WHILE=16;e.FOR=17;e.DO=18;e.TRY=19;e.CATCH=20;e.FINALLY=21;e.BREAK=22;e.CONTINUE=23;e.NEW=24;e.VOID=25;e.SWITCH=26;e.CASE=27;e.DEFAULT=28;e.RETURN=29;e.NUMBER=30;e.STRING=31;e.EQ=32;e.NEQ=33;e.LE=34;e.GE=35;e.LT=36;e.GT=37;e.PLUS=38;e.MINUS=39;e.STAR=40;e.SLASH=41;e.ASSIGN=42;e.SEMI=43;e.COLON=44;e.COMMA=45;e.DOT=46;e.LPAREN=47;e.RPAREN=48;e.LBRACE=49;e.RBRACE=50;e.LBRACK=51;e.RBRACK=52;e.ARROW=53;e.IDENTIFIER=54;e.WS=55;e.LINE_COMMENT=56;e.BLOCK_COMMENT=57;e.RULE_program=0;e.RULE_statement=1;e.RULE_block=2;e.RULE_variableDeclaration=3;e.RULE_ifStatement=4;e.RULE_whileStatement=5;e.RULE_doWhileStatement=6;e.RULE_forStatement=7;e.RULE_switchStatement=8;e.RULE_switchCase=9;e.RULE_defaultCase=10;e.RULE_returnStatement=11;e.RULE_breakStatement=12;e.RULE_continueStatement=13;e.RULE_expressionStatement=14;e.RULE_functionDeclaration=15;e.RULE_parameterList=16;e.RULE_parameter=17;e.RULE_type=18;e.RULE_baseType=19;e.RULE_tryCatchStatement=20;e.RULE_expression=21;e.RULE_primary=22;e.RULE_arrayLiteral=23;e.RULE_objectLiteral=24;e.RULE_property=25;e.RULE_argList=26;class j extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_program}EOF(){return this.getToken(e.EOF,0)}statement=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(L):this.getTypedRuleContext(L,t)};enterRule(t){t instanceof r.BrettListener&&t.enterProgram(this)}exitRule(t){t instanceof r.BrettListener&&t.exitProgram(this)}accept(t){return t instanceof o.BrettVisitor?t.visitProgram(this):t.visitChildren(this)}}class L extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_statement}variableDeclaration(){return this.getTypedRuleContext(I,0)}functionDeclaration(){return this.getTypedRuleContext(M,0)}ifStatement(){return this.getTypedRuleContext(O,0)}whileStatement(){return this.getTypedRuleContext(S,0)}forStatement(){return this.getTypedRuleContext(H,0)}switchStatement(){return this.getTypedRuleContext(b,0)}returnStatement(){return this.getTypedRuleContext(F,0)}expressionStatement(){return this.getTypedRuleContext(N,0)}block(){return this.getTypedRuleContext(u,0)}breakStatement(){return this.getTypedRuleContext(D,0)}continueStatement(){return this.getTypedRuleContext(k,0)}doWhileStatement(){return this.getTypedRuleContext(g,0)}tryCatchStatement(){return this.getTypedRuleContext(W,0)}enterRule(t){t instanceof r.BrettListener&&t.enterStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitStatement(this):t.visitChildren(this)}}class u extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_block}LBRACE(){return this.getToken(e.LBRACE,0)}RBRACE(){return this.getToken(e.RBRACE,0)}statement=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(L):this.getTypedRuleContext(L,t)};enterRule(t){t instanceof r.BrettListener&&t.enterBlock(this)}exitRule(t){t instanceof r.BrettListener&&t.exitBlock(this)}accept(t){return t instanceof o.BrettVisitor?t.visitBlock(this):t.visitChildren(this)}}class I extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_variableDeclaration}LET(){return this.getToken(e.LET,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}SEMI(){return this.getToken(e.SEMI,0)}COLON(){return this.getToken(e.COLON,0)}type(){return this.getTypedRuleContext(x,0)}ASSIGN(){return this.getToken(e.ASSIGN,0)}expression(){return this.getTypedRuleContext(c,0)}CONST(){return this.getToken(e.CONST,0)}enterRule(t){t instanceof r.BrettListener&&t.enterVariableDeclaration(this)}exitRule(t){t instanceof r.BrettListener&&t.exitVariableDeclaration(this)}accept(t){return t instanceof o.BrettVisitor?t.visitVariableDeclaration(this):t.visitChildren(this)}}class O extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_ifStatement}IF(){return this.getToken(e.IF,0)}LPAREN(){return this.getToken(e.LPAREN,0)}expression(){return this.getTypedRuleContext(c,0)}RPAREN(){return this.getToken(e.RPAREN,0)}block=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(u):this.getTypedRuleContext(u,t)};ELSE(){return this.getToken(e.ELSE,0)}enterRule(t){t instanceof r.BrettListener&&t.enterIfStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitIfStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitIfStatement(this):t.visitChildren(this)}}class S extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_whileStatement}WHILE(){return this.getToken(e.WHILE,0)}LPAREN(){return this.getToken(e.LPAREN,0)}expression(){return this.getTypedRuleContext(c,0)}RPAREN(){return this.getToken(e.RPAREN,0)}block(){return this.getTypedRuleContext(u,0)}enterRule(t){t instanceof r.BrettListener&&t.enterWhileStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitWhileStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitWhileStatement(this):t.visitChildren(this)}}class g extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_doWhileStatement}DO(){return this.getToken(e.DO,0)}block(){return this.getTypedRuleContext(u,0)}WHILE(){return this.getToken(e.WHILE,0)}LPAREN(){return this.getToken(e.LPAREN,0)}expression(){return this.getTypedRuleContext(c,0)}RPAREN(){return this.getToken(e.RPAREN,0)}SEMI(){return this.getToken(e.SEMI,0)}enterRule(t){t instanceof r.BrettListener&&t.enterDoWhileStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitDoWhileStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitDoWhileStatement(this):t.visitChildren(this)}}class H extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_forStatement}FOR(){return this.getToken(e.FOR,0)}LPAREN(){return this.getToken(e.LPAREN,0)}SEMI(){return this.getToken(e.SEMI,0)}RPAREN(){return this.getToken(e.RPAREN,0)}block(){return this.getTypedRuleContext(u,0)}variableDeclaration(){return this.getTypedRuleContext(I,0)}expressionStatement(){return this.getTypedRuleContext(N,0)}expression=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(c):this.getTypedRuleContext(c,t)};enterRule(t){t instanceof r.BrettListener&&t.enterForStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitForStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitForStatement(this):t.visitChildren(this)}}class b extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_switchStatement}SWITCH(){return this.getToken(e.SWITCH,0)}LBRACE(){return this.getToken(e.LBRACE,0)}RBRACE(){return this.getToken(e.RBRACE,0)}switchCase=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(y):this.getTypedRuleContext(y,t)};defaultCase(){return this.getTypedRuleContext(U,0)}enterRule(t){t instanceof r.BrettListener&&t.enterSwitchStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitSwitchStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitSwitchStatement(this):t.visitChildren(this)}}class y extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_switchCase}CASE(){return this.getToken(e.CASE,0)}expression(){return this.getTypedRuleContext(c,0)}ARROW(){return this.getToken(e.ARROW,0)}block(){return this.getTypedRuleContext(u,0)}enterRule(t){t instanceof r.BrettListener&&t.enterSwitchCase(this)}exitRule(t){t instanceof r.BrettListener&&t.exitSwitchCase(this)}accept(t){return t instanceof o.BrettVisitor?t.visitSwitchCase(this):t.visitChildren(this)}}class U extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_defaultCase}DEFAULT(){return this.getToken(e.DEFAULT,0)}ARROW(){return this.getToken(e.ARROW,0)}block(){return this.getTypedRuleContext(u,0)}enterRule(t){t instanceof r.BrettListener&&t.enterDefaultCase(this)}exitRule(t){t instanceof r.BrettListener&&t.exitDefaultCase(this)}accept(t){return t instanceof o.BrettVisitor?t.visitDefaultCase(this):t.visitChildren(this)}}class F extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_returnStatement}RETURN(){return this.getToken(e.RETURN,0)}SEMI(){return this.getToken(e.SEMI,0)}expression(){return this.getTypedRuleContext(c,0)}enterRule(t){t instanceof r.BrettListener&&t.enterReturnStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitReturnStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitReturnStatement(this):t.visitChildren(this)}}class D extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_breakStatement}BREAK(){return this.getToken(e.BREAK,0)}SEMI(){return this.getToken(e.SEMI,0)}enterRule(t){t instanceof r.BrettListener&&t.enterBreakStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitBreakStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitBreakStatement(this):t.visitChildren(this)}}class k extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_continueStatement}CONTINUE(){return this.getToken(e.CONTINUE,0)}SEMI(){return this.getToken(e.SEMI,0)}enterRule(t){t instanceof r.BrettListener&&t.enterContinueStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitContinueStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitContinueStatement(this):t.visitChildren(this)}}class N extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_expressionStatement}expression(){return this.getTypedRuleContext(c,0)}SEMI(){return this.getToken(e.SEMI,0)}enterRule(t){t instanceof r.BrettListener&&t.enterExpressionStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitExpressionStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitExpressionStatement(this):t.visitChildren(this)}}class M extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_functionDeclaration}DEF(){return this.getToken(e.DEF,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}LPAREN(){return this.getToken(e.LPAREN,0)}RPAREN(){return this.getToken(e.RPAREN,0)}block(){return this.getTypedRuleContext(u,0)}parameterList(){return this.getTypedRuleContext(B,0)}COLON(){return this.getToken(e.COLON,0)}type(){return this.getTypedRuleContext(x,0)}enterRule(t){t instanceof r.BrettListener&&t.enterFunctionDeclaration(this)}exitRule(t){t instanceof r.BrettListener&&t.exitFunctionDeclaration(this)}accept(t){return t instanceof o.BrettVisitor?t.visitFunctionDeclaration(this):t.visitChildren(this)}}class B extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_parameterList}parameter=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(A):this.getTypedRuleContext(A,t)};COMMA=function(t){return t===void 0&&(t=null),t===null?this.getTokens(e.COMMA):this.getToken(e.COMMA,t)};enterRule(t){t instanceof r.BrettListener&&t.enterParameterList(this)}exitRule(t){t instanceof r.BrettListener&&t.exitParameterList(this)}accept(t){return t instanceof o.BrettVisitor?t.visitParameterList(this):t.visitChildren(this)}}class A extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_parameter}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}COLON(){return this.getToken(e.COLON,0)}type(){return this.getTypedRuleContext(x,0)}enterRule(t){t instanceof r.BrettListener&&t.enterParameter(this)}exitRule(t){t instanceof r.BrettListener&&t.exitParameter(this)}accept(t){return t instanceof o.BrettVisitor?t.visitParameter(this):t.visitChildren(this)}}class x extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_type}copyFrom(t){super.copyFrom(t)}}class Y extends x{constructor(t,s){super(t),super.copyFrom(s)}type(){return this.getTypedRuleContext(x,0)}enterRule(t){t instanceof r.BrettListener&&t.enterArrayType(this)}exitRule(t){t instanceof r.BrettListener&&t.exitArrayType(this)}accept(t){return t instanceof o.BrettVisitor?t.visitArrayType(this):t.visitChildren(this)}}e.ArrayTypeContext=Y;class z extends x{constructor(t,s){super(t),super.copyFrom(s)}baseType(){return this.getTypedRuleContext(V,0)}enterRule(t){t instanceof r.BrettListener&&t.enterSimpleType(this)}exitRule(t){t instanceof r.BrettListener&&t.exitSimpleType(this)}accept(t){return t instanceof o.BrettVisitor?t.visitSimpleType(this):t.visitChildren(this)}}e.SimpleTypeContext=z;class V extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_baseType}VOID(){return this.getToken(e.VOID,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}enterRule(t){t instanceof r.BrettListener&&t.enterBaseType(this)}exitRule(t){t instanceof r.BrettListener&&t.exitBaseType(this)}accept(t){return t instanceof o.BrettVisitor?t.visitBaseType(this):t.visitChildren(this)}}class W extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_tryCatchStatement}TRY(){return this.getToken(e.TRY,0)}block=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(u):this.getTypedRuleContext(u,t)};CATCH(){return this.getToken(e.CATCH,0)}LPAREN(){return this.getToken(e.LPAREN,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}RPAREN(){return this.getToken(e.RPAREN,0)}COLON(){return this.getToken(e.COLON,0)}type(){return this.getTypedRuleContext(x,0)}FINALLY(){return this.getToken(e.FINALLY,0)}enterRule(t){t instanceof r.BrettListener&&t.enterTryCatchStatement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitTryCatchStatement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitTryCatchStatement(this):t.visitChildren(this)}}class c extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_expression}copyFrom(t){super.copyFrom(t)}}class Q extends c{constructor(t,s){super(t),super.copyFrom(s)}expression(){return this.getTypedRuleContext(c,0)}DOT(){return this.getToken(e.DOT,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}enterRule(t){t instanceof r.BrettListener&&t.enterMemberExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitMemberExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitMemberExpression(this):t.visitChildren(this)}}e.MemberExpressionContext=Q;class q extends c{constructor(t,s){super(t),super.copyFrom(s)}primary(){return this.getTypedRuleContext(R,0)}enterRule(t){t instanceof r.BrettListener&&t.enterPrimaryExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitPrimaryExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitPrimaryExpression(this):t.visitChildren(this)}}e.PrimaryExpressionContext=q;class v extends c{constructor(t,s){super(t),super.copyFrom(s)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}ASSIGN(){return this.getToken(e.ASSIGN,0)}expression(){return this.getTypedRuleContext(c,0)}enterRule(t){t instanceof r.BrettListener&&t.enterAssignmentExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitAssignmentExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitAssignmentExpression(this):t.visitChildren(this)}}e.AssignmentExpressionContext=v;class m extends c{constructor(t,s){super(t),this.op=null,super.copyFrom(s)}expression=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(c):this.getTypedRuleContext(c,t)};STAR(){return this.getToken(e.STAR,0)}SLASH(){return this.getToken(e.SLASH,0)}PLUS(){return this.getToken(e.PLUS,0)}MINUS(){return this.getToken(e.MINUS,0)}LT(){return this.getToken(e.LT,0)}LE(){return this.getToken(e.LE,0)}GT(){return this.getToken(e.GT,0)}GE(){return this.getToken(e.GE,0)}EQ(){return this.getToken(e.EQ,0)}NEQ(){return this.getToken(e.NEQ,0)}enterRule(t){t instanceof r.BrettListener&&t.enterBinaryExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitBinaryExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitBinaryExpression(this):t.visitChildren(this)}}e.BinaryExpressionContext=m;class J extends c{constructor(t,s){super(t),super.copyFrom(s)}NEW(){return this.getToken(e.NEW,0)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}LPAREN(){return this.getToken(e.LPAREN,0)}RPAREN(){return this.getToken(e.RPAREN,0)}argList(){return this.getTypedRuleContext(w,0)}enterRule(t){t instanceof r.BrettListener&&t.enterNewExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitNewExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitNewExpression(this):t.visitChildren(this)}}e.NewExpressionContext=J;class X extends c{constructor(t,s){super(t),super.copyFrom(s)}expression(){return this.getTypedRuleContext(c,0)}enterRule(t){t instanceof r.BrettListener&&t.enterPreIncrementDecrement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitPreIncrementDecrement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitPreIncrementDecrement(this):t.visitChildren(this)}}e.PreIncrementDecrementContext=X;class Z extends c{constructor(t,s){super(t),super.copyFrom(s)}expression=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(c):this.getTypedRuleContext(c,t)};LBRACK(){return this.getToken(e.LBRACK,0)}RBRACK(){return this.getToken(e.RBRACK,0)}enterRule(t){t instanceof r.BrettListener&&t.enterIndexExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitIndexExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitIndexExpression(this):t.visitChildren(this)}}e.IndexExpressionContext=Z;class $ extends c{constructor(t,s){super(t),super.copyFrom(s)}expression(){return this.getTypedRuleContext(c,0)}enterRule(t){t instanceof r.BrettListener&&t.enterPostIncrementDecrement(this)}exitRule(t){t instanceof r.BrettListener&&t.exitPostIncrementDecrement(this)}accept(t){return t instanceof o.BrettVisitor?t.visitPostIncrementDecrement(this):t.visitChildren(this)}}e.PostIncrementDecrementContext=$;class R extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_primary}copyFrom(t){super.copyFrom(t)}}class tt extends R{constructor(t,s){super(t),super.copyFrom(s)}LPAREN(){return this.getToken(e.LPAREN,0)}expression(){return this.getTypedRuleContext(c,0)}RPAREN(){return this.getToken(e.RPAREN,0)}enterRule(t){t instanceof r.BrettListener&&t.enterParenthesizedExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitParenthesizedExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitParenthesizedExpression(this):t.visitChildren(this)}}e.ParenthesizedExpressionContext=tt;class et extends R{constructor(t,s){super(t),super.copyFrom(s)}objectLiteral(){return this.getTypedRuleContext(P,0)}enterRule(t){t instanceof r.BrettListener&&t.enterObjectLiteralExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitObjectLiteralExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitObjectLiteralExpression(this):t.visitChildren(this)}}e.ObjectLiteralExpressionContext=et;class E extends R{constructor(t,s){super(t),super.copyFrom(s)}NUMBER(){return this.getToken(e.NUMBER,0)}STRING(){return this.getToken(e.STRING,0)}enterRule(t){t instanceof r.BrettListener&&t.enterLiteralExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitLiteralExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitLiteralExpression(this):t.visitChildren(this)}}e.LiteralExpressionContext=E;class st extends R{constructor(t,s){super(t),super.copyFrom(s)}arrayLiteral(){return this.getTypedRuleContext(G,0)}enterRule(t){t instanceof r.BrettListener&&t.enterArrayLiteralExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitArrayLiteralExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitArrayLiteralExpression(this):t.visitChildren(this)}}e.ArrayLiteralExpressionContext=st;class it extends R{constructor(t,s){super(t),super.copyFrom(s)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}LPAREN(){return this.getToken(e.LPAREN,0)}RPAREN(){return this.getToken(e.RPAREN,0)}argList(){return this.getTypedRuleContext(w,0)}enterRule(t){t instanceof r.BrettListener&&t.enterFunctionCallExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitFunctionCallExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitFunctionCallExpression(this):t.visitChildren(this)}}e.FunctionCallExpressionContext=it;class rt extends R{constructor(t,s){super(t),super.copyFrom(s)}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}enterRule(t){t instanceof r.BrettListener&&t.enterIdentifierExpression(this)}exitRule(t){t instanceof r.BrettListener&&t.exitIdentifierExpression(this)}accept(t){return t instanceof o.BrettVisitor?t.visitIdentifierExpression(this):t.visitChildren(this)}}e.IdentifierExpressionContext=rt;class G extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_arrayLiteral}LBRACK(){return this.getToken(e.LBRACK,0)}RBRACK(){return this.getToken(e.RBRACK,0)}expression=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(c):this.getTypedRuleContext(c,t)};COMMA=function(t){return t===void 0&&(t=null),t===null?this.getTokens(e.COMMA):this.getToken(e.COMMA,t)};enterRule(t){t instanceof r.BrettListener&&t.enterArrayLiteral(this)}exitRule(t){t instanceof r.BrettListener&&t.exitArrayLiteral(this)}accept(t){return t instanceof o.BrettVisitor?t.visitArrayLiteral(this):t.visitChildren(this)}}class P extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_objectLiteral}LBRACE(){return this.getToken(e.LBRACE,0)}RBRACE(){return this.getToken(e.RBRACE,0)}property=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(_):this.getTypedRuleContext(_,t)};COMMA=function(t){return t===void 0&&(t=null),t===null?this.getTokens(e.COMMA):this.getToken(e.COMMA,t)};enterRule(t){t instanceof r.BrettListener&&t.enterObjectLiteral(this)}exitRule(t){t instanceof r.BrettListener&&t.exitObjectLiteral(this)}accept(t){return t instanceof o.BrettVisitor?t.visitObjectLiteral(this):t.visitChildren(this)}}class _ extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_property}IDENTIFIER(){return this.getToken(e.IDENTIFIER,0)}COLON(){return this.getToken(e.COLON,0)}expression(){return this.getTypedRuleContext(c,0)}STRING(){return this.getToken(e.STRING,0)}enterRule(t){t instanceof r.BrettListener&&t.enterProperty(this)}exitRule(t){t instanceof r.BrettListener&&t.exitProperty(this)}accept(t){return t instanceof o.BrettVisitor?t.visitProperty(this):t.visitChildren(this)}}class w extends n.ParserRuleContext{constructor(t,s,i){s===void 0&&(s=null),i==null&&(i=-1),super(s,i),this.parser=t,this.ruleIndex=e.RULE_argList}expression=function(t){return t===void 0&&(t=null),t===null?this.getTypedRuleContexts(c):this.getTypedRuleContext(c,t)};COMMA=function(t){return t===void 0&&(t=null),t===null?this.getTokens(e.COMMA):this.getToken(e.COMMA,t)};enterRule(t){t instanceof r.BrettListener&&t.enterArgList(this)}exitRule(t){t instanceof r.BrettListener&&t.exitArgList(this)}accept(t){return t instanceof o.BrettVisitor?t.visitArgList(this):t.visitChildren(this)}}e.ProgramContext=j;e.StatementContext=L;e.BlockContext=u;e.VariableDeclarationContext=I;e.IfStatementContext=O;e.WhileStatementContext=S;e.DoWhileStatementContext=g;e.ForStatementContext=H;e.SwitchStatementContext=b;e.SwitchCaseContext=y;e.DefaultCaseContext=U;e.ReturnStatementContext=F;e.BreakStatementContext=D;e.ContinueStatementContext=k;e.ExpressionStatementContext=N;e.FunctionDeclarationContext=M;e.ParameterListContext=B;e.ParameterContext=A;e.TypeContext=x;e.BaseTypeContext=V;e.TryCatchStatementContext=W;e.ExpressionContext=c;e.PrimaryContext=R;e.ArrayLiteralContext=G;e.ObjectLiteralContext=P;e.PropertyContext=_;e.ArgListContext=w;exports.BrettParser=e;
|
|
1
|
+
// Generated from /builds/kdg-ti/programmeren-3/projecten-25-26/brett.deswert/Compiler/src/g4/Brett.g4 by ANTLR 4.13.2
|
|
2
|
+
// jshint ignore: start
|
|
3
|
+
import antlr4 from 'antlr4';
|
|
4
|
+
import BrettListener from './BrettListener.js';
|
|
5
|
+
import BrettVisitor from './BrettVisitor.js';
|
|
6
|
+
|
|
7
|
+
const serializedATN = [4,1,57,342,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,
|
|
8
|
+
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,
|
|
9
|
+
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,
|
|
10
|
+
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,1,0,
|
|
11
|
+
5,0,56,8,0,10,0,12,0,59,9,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
12
|
+
1,1,1,1,1,1,1,1,3,1,76,8,1,1,2,1,2,5,2,80,8,2,10,2,12,2,83,9,2,1,2,1,2,1,
|
|
13
|
+
3,1,3,1,3,1,3,3,3,91,8,3,1,3,1,3,3,3,95,8,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,
|
|
14
|
+
1,3,1,3,1,3,3,3,107,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,116,8,4,1,5,1,5,
|
|
15
|
+
1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,136,
|
|
16
|
+
8,7,1,7,3,7,139,8,7,1,7,1,7,3,7,143,8,7,1,7,1,7,1,7,1,8,1,8,1,8,4,8,151,
|
|
17
|
+
8,8,11,8,12,8,152,1,8,3,8,156,8,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,
|
|
18
|
+
1,10,1,10,1,11,1,11,3,11,171,8,11,1,11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,
|
|
19
|
+
1,14,1,14,1,14,1,15,1,15,1,15,1,15,3,15,188,8,15,1,15,1,15,1,15,3,15,193,
|
|
20
|
+
8,15,1,15,1,15,1,16,1,16,1,16,5,16,200,8,16,10,16,12,16,203,9,16,1,17,1,
|
|
21
|
+
17,1,17,3,17,208,8,17,1,18,1,18,1,18,1,18,1,18,5,18,215,8,18,10,18,12,18,
|
|
22
|
+
218,9,18,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,3,20,229,8,20,1,20,
|
|
23
|
+
1,20,1,20,1,20,3,20,235,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,
|
|
24
|
+
3,21,246,8,21,1,21,1,21,1,21,3,21,251,8,21,1,21,1,21,1,21,1,21,1,21,1,21,
|
|
25
|
+
1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,
|
|
26
|
+
21,1,21,5,21,275,8,21,10,21,12,21,278,9,21,1,22,1,22,1,22,1,22,1,22,1,22,
|
|
27
|
+
1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,293,8,22,1,22,1,22,1,22,3,22,298,
|
|
28
|
+
8,22,1,23,1,23,1,23,1,23,5,23,304,8,23,10,23,12,23,307,9,23,3,23,309,8,23,
|
|
29
|
+
1,23,1,23,1,24,1,24,1,24,1,24,5,24,317,8,24,10,24,12,24,320,9,24,3,24,322,
|
|
30
|
+
8,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,3,25,332,8,25,1,26,1,26,1,26,
|
|
31
|
+
5,26,337,8,26,10,26,12,26,340,9,26,1,26,0,2,36,42,27,0,2,4,6,8,10,12,14,
|
|
32
|
+
16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,0,6,3,0,2,5,25,
|
|
33
|
+
25,54,54,1,0,6,7,1,0,40,41,1,0,38,39,1,0,34,37,1,0,32,33,373,0,57,1,0,0,
|
|
34
|
+
0,2,75,1,0,0,0,4,77,1,0,0,0,6,106,1,0,0,0,8,108,1,0,0,0,10,117,1,0,0,0,12,
|
|
35
|
+
123,1,0,0,0,14,131,1,0,0,0,16,147,1,0,0,0,18,159,1,0,0,0,20,164,1,0,0,0,
|
|
36
|
+
22,168,1,0,0,0,24,174,1,0,0,0,26,177,1,0,0,0,28,180,1,0,0,0,30,183,1,0,0,
|
|
37
|
+
0,32,196,1,0,0,0,34,204,1,0,0,0,36,209,1,0,0,0,38,219,1,0,0,0,40,221,1,0,
|
|
38
|
+
0,0,42,250,1,0,0,0,44,297,1,0,0,0,46,299,1,0,0,0,48,312,1,0,0,0,50,331,1,
|
|
39
|
+
0,0,0,52,333,1,0,0,0,54,56,3,2,1,0,55,54,1,0,0,0,56,59,1,0,0,0,57,55,1,0,
|
|
40
|
+
0,0,57,58,1,0,0,0,58,60,1,0,0,0,59,57,1,0,0,0,60,61,5,0,0,1,61,1,1,0,0,0,
|
|
41
|
+
62,76,3,6,3,0,63,76,3,30,15,0,64,76,3,8,4,0,65,76,3,10,5,0,66,76,3,14,7,
|
|
42
|
+
0,67,76,3,16,8,0,68,76,3,22,11,0,69,76,3,28,14,0,70,76,3,4,2,0,71,76,3,24,
|
|
43
|
+
12,0,72,76,3,26,13,0,73,76,3,12,6,0,74,76,3,40,20,0,75,62,1,0,0,0,75,63,
|
|
44
|
+
1,0,0,0,75,64,1,0,0,0,75,65,1,0,0,0,75,66,1,0,0,0,75,67,1,0,0,0,75,68,1,
|
|
45
|
+
0,0,0,75,69,1,0,0,0,75,70,1,0,0,0,75,71,1,0,0,0,75,72,1,0,0,0,75,73,1,0,
|
|
46
|
+
0,0,75,74,1,0,0,0,76,3,1,0,0,0,77,81,5,49,0,0,78,80,3,2,1,0,79,78,1,0,0,
|
|
47
|
+
0,80,83,1,0,0,0,81,79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,
|
|
48
|
+
84,85,5,50,0,0,85,5,1,0,0,0,86,87,5,11,0,0,87,90,5,54,0,0,88,89,5,44,0,0,
|
|
49
|
+
89,91,3,36,18,0,90,88,1,0,0,0,90,91,1,0,0,0,91,94,1,0,0,0,92,93,5,42,0,0,
|
|
50
|
+
93,95,3,42,21,0,94,92,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,107,5,43,0,
|
|
51
|
+
0,97,98,5,12,0,0,98,99,5,54,0,0,99,100,5,44,0,0,100,101,3,36,18,0,101,102,
|
|
52
|
+
1,0,0,0,102,103,5,42,0,0,103,104,3,42,21,0,104,105,5,43,0,0,105,107,1,0,
|
|
53
|
+
0,0,106,86,1,0,0,0,106,97,1,0,0,0,107,7,1,0,0,0,108,109,5,14,0,0,109,110,
|
|
54
|
+
5,47,0,0,110,111,3,42,21,0,111,112,5,48,0,0,112,115,3,4,2,0,113,114,5,15,
|
|
55
|
+
0,0,114,116,3,4,2,0,115,113,1,0,0,0,115,116,1,0,0,0,116,9,1,0,0,0,117,118,
|
|
56
|
+
5,16,0,0,118,119,5,47,0,0,119,120,3,42,21,0,120,121,5,48,0,0,121,122,3,4,
|
|
57
|
+
2,0,122,11,1,0,0,0,123,124,5,18,0,0,124,125,3,4,2,0,125,126,5,16,0,0,126,
|
|
58
|
+
127,5,47,0,0,127,128,3,42,21,0,128,129,5,48,0,0,129,130,5,43,0,0,130,13,
|
|
59
|
+
1,0,0,0,131,132,5,17,0,0,132,135,5,47,0,0,133,136,3,6,3,0,134,136,3,28,14,
|
|
60
|
+
0,135,133,1,0,0,0,135,134,1,0,0,0,135,136,1,0,0,0,136,138,1,0,0,0,137,139,
|
|
61
|
+
3,42,21,0,138,137,1,0,0,0,138,139,1,0,0,0,139,140,1,0,0,0,140,142,5,43,0,
|
|
62
|
+
0,141,143,3,42,21,0,142,141,1,0,0,0,142,143,1,0,0,0,143,144,1,0,0,0,144,
|
|
63
|
+
145,5,48,0,0,145,146,3,4,2,0,146,15,1,0,0,0,147,148,5,26,0,0,148,150,5,49,
|
|
64
|
+
0,0,149,151,3,18,9,0,150,149,1,0,0,0,151,152,1,0,0,0,152,150,1,0,0,0,152,
|
|
65
|
+
153,1,0,0,0,153,155,1,0,0,0,154,156,3,20,10,0,155,154,1,0,0,0,155,156,1,
|
|
66
|
+
0,0,0,156,157,1,0,0,0,157,158,5,50,0,0,158,17,1,0,0,0,159,160,5,27,0,0,160,
|
|
67
|
+
161,3,42,21,0,161,162,5,53,0,0,162,163,3,4,2,0,163,19,1,0,0,0,164,165,5,
|
|
68
|
+
28,0,0,165,166,5,53,0,0,166,167,3,4,2,0,167,21,1,0,0,0,168,170,5,29,0,0,
|
|
69
|
+
169,171,3,42,21,0,170,169,1,0,0,0,170,171,1,0,0,0,171,172,1,0,0,0,172,173,
|
|
70
|
+
5,43,0,0,173,23,1,0,0,0,174,175,5,22,0,0,175,176,5,43,0,0,176,25,1,0,0,0,
|
|
71
|
+
177,178,5,23,0,0,178,179,5,43,0,0,179,27,1,0,0,0,180,181,3,42,21,0,181,182,
|
|
72
|
+
5,43,0,0,182,29,1,0,0,0,183,184,5,13,0,0,184,185,5,54,0,0,185,187,5,47,0,
|
|
73
|
+
0,186,188,3,32,16,0,187,186,1,0,0,0,187,188,1,0,0,0,188,189,1,0,0,0,189,
|
|
74
|
+
192,5,48,0,0,190,191,5,44,0,0,191,193,3,36,18,0,192,190,1,0,0,0,192,193,
|
|
75
|
+
1,0,0,0,193,194,1,0,0,0,194,195,3,4,2,0,195,31,1,0,0,0,196,201,3,34,17,0,
|
|
76
|
+
197,198,5,45,0,0,198,200,3,34,17,0,199,197,1,0,0,0,200,203,1,0,0,0,201,199,
|
|
77
|
+
1,0,0,0,201,202,1,0,0,0,202,33,1,0,0,0,203,201,1,0,0,0,204,207,5,54,0,0,
|
|
78
|
+
205,206,5,44,0,0,206,208,3,36,18,0,207,205,1,0,0,0,207,208,1,0,0,0,208,35,
|
|
79
|
+
1,0,0,0,209,210,6,18,-1,0,210,211,3,38,19,0,211,216,1,0,0,0,212,213,10,1,
|
|
80
|
+
0,0,213,215,5,1,0,0,214,212,1,0,0,0,215,218,1,0,0,0,216,214,1,0,0,0,216,
|
|
81
|
+
217,1,0,0,0,217,37,1,0,0,0,218,216,1,0,0,0,219,220,7,0,0,0,220,39,1,0,0,
|
|
82
|
+
0,221,222,5,19,0,0,222,223,3,4,2,0,223,224,5,20,0,0,224,225,5,47,0,0,225,
|
|
83
|
+
228,5,54,0,0,226,227,5,44,0,0,227,229,3,36,18,0,228,226,1,0,0,0,228,229,
|
|
84
|
+
1,0,0,0,229,230,1,0,0,0,230,231,5,48,0,0,231,234,3,4,2,0,232,233,5,21,0,
|
|
85
|
+
0,233,235,3,4,2,0,234,232,1,0,0,0,234,235,1,0,0,0,235,41,1,0,0,0,236,237,
|
|
86
|
+
6,21,-1,0,237,251,3,44,22,0,238,239,5,54,0,0,239,240,5,42,0,0,240,251,3,
|
|
87
|
+
42,21,6,241,242,5,24,0,0,242,243,5,54,0,0,243,245,5,47,0,0,244,246,3,52,
|
|
88
|
+
26,0,245,244,1,0,0,0,245,246,1,0,0,0,246,247,1,0,0,0,247,251,5,48,0,0,248,
|
|
89
|
+
249,7,1,0,0,249,251,3,42,21,1,250,236,1,0,0,0,250,238,1,0,0,0,250,241,1,
|
|
90
|
+
0,0,0,250,248,1,0,0,0,251,276,1,0,0,0,252,253,10,10,0,0,253,254,7,2,0,0,
|
|
91
|
+
254,275,3,42,21,11,255,256,10,9,0,0,256,257,7,3,0,0,257,275,3,42,21,10,258,
|
|
92
|
+
259,10,8,0,0,259,260,7,4,0,0,260,275,3,42,21,9,261,262,10,7,0,0,262,263,
|
|
93
|
+
7,5,0,0,263,275,3,42,21,8,264,265,10,5,0,0,265,266,5,51,0,0,266,267,3,42,
|
|
94
|
+
21,0,267,268,5,52,0,0,268,275,1,0,0,0,269,270,10,4,0,0,270,271,5,46,0,0,
|
|
95
|
+
271,275,5,54,0,0,272,273,10,2,0,0,273,275,7,1,0,0,274,252,1,0,0,0,274,255,
|
|
96
|
+
1,0,0,0,274,258,1,0,0,0,274,261,1,0,0,0,274,264,1,0,0,0,274,269,1,0,0,0,
|
|
97
|
+
274,272,1,0,0,0,275,278,1,0,0,0,276,274,1,0,0,0,276,277,1,0,0,0,277,43,1,
|
|
98
|
+
0,0,0,278,276,1,0,0,0,279,298,5,30,0,0,280,298,5,31,0,0,281,298,5,8,0,0,
|
|
99
|
+
282,298,5,9,0,0,283,298,5,10,0,0,284,298,5,54,0,0,285,286,5,47,0,0,286,287,
|
|
100
|
+
3,42,21,0,287,288,5,48,0,0,288,298,1,0,0,0,289,290,5,54,0,0,290,292,5,47,
|
|
101
|
+
0,0,291,293,3,52,26,0,292,291,1,0,0,0,292,293,1,0,0,0,293,294,1,0,0,0,294,
|
|
102
|
+
298,5,48,0,0,295,298,3,46,23,0,296,298,3,48,24,0,297,279,1,0,0,0,297,280,
|
|
103
|
+
1,0,0,0,297,281,1,0,0,0,297,282,1,0,0,0,297,283,1,0,0,0,297,284,1,0,0,0,
|
|
104
|
+
297,285,1,0,0,0,297,289,1,0,0,0,297,295,1,0,0,0,297,296,1,0,0,0,298,45,1,
|
|
105
|
+
0,0,0,299,308,5,51,0,0,300,305,3,42,21,0,301,302,5,45,0,0,302,304,3,42,21,
|
|
106
|
+
0,303,301,1,0,0,0,304,307,1,0,0,0,305,303,1,0,0,0,305,306,1,0,0,0,306,309,
|
|
107
|
+
1,0,0,0,307,305,1,0,0,0,308,300,1,0,0,0,308,309,1,0,0,0,309,310,1,0,0,0,
|
|
108
|
+
310,311,5,52,0,0,311,47,1,0,0,0,312,321,5,49,0,0,313,318,3,50,25,0,314,315,
|
|
109
|
+
5,45,0,0,315,317,3,50,25,0,316,314,1,0,0,0,317,320,1,0,0,0,318,316,1,0,0,
|
|
110
|
+
0,318,319,1,0,0,0,319,322,1,0,0,0,320,318,1,0,0,0,321,313,1,0,0,0,321,322,
|
|
111
|
+
1,0,0,0,322,323,1,0,0,0,323,324,5,50,0,0,324,49,1,0,0,0,325,326,5,54,0,0,
|
|
112
|
+
326,327,5,44,0,0,327,332,3,42,21,0,328,329,5,31,0,0,329,330,5,44,0,0,330,
|
|
113
|
+
332,3,42,21,0,331,325,1,0,0,0,331,328,1,0,0,0,332,51,1,0,0,0,333,338,3,42,
|
|
114
|
+
21,0,334,335,5,45,0,0,335,337,3,42,21,0,336,334,1,0,0,0,337,340,1,0,0,0,
|
|
115
|
+
338,336,1,0,0,0,338,339,1,0,0,0,339,53,1,0,0,0,340,338,1,0,0,0,32,57,75,
|
|
116
|
+
81,90,94,106,115,135,138,142,152,155,170,187,192,201,207,216,228,234,245,
|
|
117
|
+
250,274,276,292,297,305,308,318,321,331,338];
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
const atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
|
|
121
|
+
|
|
122
|
+
const decisionsToDFA = atn.decisionToState.map( (ds, index) => new antlr4.dfa.DFA(ds, index) );
|
|
123
|
+
|
|
124
|
+
const sharedContextCache = new antlr4.atn.PredictionContextCache();
|
|
125
|
+
|
|
126
|
+
export default class BrettParser extends antlr4.Parser {
|
|
127
|
+
|
|
128
|
+
static grammarFileName = "Brett.g4";
|
|
129
|
+
static literalNames = [ null, "'[]'", "'string'", "'number'", "'bool'",
|
|
130
|
+
"'any'", "'++'", "'--'", "'true'", "'false'",
|
|
131
|
+
"'nil'", "'let'", "'const'", "'def'", "'if'",
|
|
132
|
+
"'else'", "'while'", "'for'", "'do'", "'try'",
|
|
133
|
+
"'catch'", "'finally'", "'break'", "'continue'",
|
|
134
|
+
"'new'", "'void'", "'switch'", "'case'", "'default'",
|
|
135
|
+
"'return'", null, null, "'=='", "'!='", "'<='",
|
|
136
|
+
"'>='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'",
|
|
137
|
+
"'='", "';'", "':'", "','", "'.'", "'('", "')'",
|
|
138
|
+
"'{'", "'}'", "'['", "']'", "'=>'" ];
|
|
139
|
+
static symbolicNames = [ null, null, null, null, null, null, null, null,
|
|
140
|
+
null, null, null, "LET", "CONST", "DEF", "IF",
|
|
141
|
+
"ELSE", "WHILE", "FOR", "DO", "TRY", "CATCH",
|
|
142
|
+
"FINALLY", "BREAK", "CONTINUE", "NEW", "VOID",
|
|
143
|
+
"SWITCH", "CASE", "DEFAULT", "RETURN", "NUMBER",
|
|
144
|
+
"STRING", "EQ", "NEQ", "LE", "GE", "LT", "GT",
|
|
145
|
+
"PLUS", "MINUS", "STAR", "SLASH", "ASSIGN",
|
|
146
|
+
"SEMI", "COLON", "COMMA", "DOT", "LPAREN",
|
|
147
|
+
"RPAREN", "LBRACE", "RBRACE", "LBRACK", "RBRACK",
|
|
148
|
+
"ARROW", "IDENTIFIER", "WS", "LINE_COMMENT",
|
|
149
|
+
"BLOCK_COMMENT" ];
|
|
150
|
+
static ruleNames = [ "program", "statement", "block", "variableDeclaration",
|
|
151
|
+
"ifStatement", "whileStatement", "doWhileStatement",
|
|
152
|
+
"forStatement", "switchStatement", "switchCase",
|
|
153
|
+
"defaultCase", "returnStatement", "breakStatement",
|
|
154
|
+
"continueStatement", "expressionStatement", "functionDeclaration",
|
|
155
|
+
"parameterList", "parameter", "type", "baseType",
|
|
156
|
+
"tryCatchStatement", "expression", "primary", "arrayLiteral",
|
|
157
|
+
"objectLiteral", "property", "argList" ];
|
|
158
|
+
|
|
159
|
+
constructor(input) {
|
|
160
|
+
super(input);
|
|
161
|
+
this._interp = new antlr4.atn.ParserATNSimulator(this, atn, decisionsToDFA, sharedContextCache);
|
|
162
|
+
this.ruleNames = BrettParser.ruleNames;
|
|
163
|
+
this.literalNames = BrettParser.literalNames;
|
|
164
|
+
this.symbolicNames = BrettParser.symbolicNames;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
sempred(localctx, ruleIndex, predIndex) {
|
|
168
|
+
switch(ruleIndex) {
|
|
169
|
+
case 18:
|
|
170
|
+
return this.type_sempred(localctx, predIndex);
|
|
171
|
+
case 21:
|
|
172
|
+
return this.expression_sempred(localctx, predIndex);
|
|
173
|
+
default:
|
|
174
|
+
throw "No predicate with index:" + ruleIndex;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
type_sempred(localctx, predIndex) {
|
|
179
|
+
switch(predIndex) {
|
|
180
|
+
case 0:
|
|
181
|
+
return this.precpred(this._ctx, 1);
|
|
182
|
+
default:
|
|
183
|
+
throw "No predicate with index:" + predIndex;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
expression_sempred(localctx, predIndex) {
|
|
188
|
+
switch(predIndex) {
|
|
189
|
+
case 1:
|
|
190
|
+
return this.precpred(this._ctx, 10);
|
|
191
|
+
case 2:
|
|
192
|
+
return this.precpred(this._ctx, 9);
|
|
193
|
+
case 3:
|
|
194
|
+
return this.precpred(this._ctx, 8);
|
|
195
|
+
case 4:
|
|
196
|
+
return this.precpred(this._ctx, 7);
|
|
197
|
+
case 5:
|
|
198
|
+
return this.precpred(this._ctx, 5);
|
|
199
|
+
case 6:
|
|
200
|
+
return this.precpred(this._ctx, 4);
|
|
201
|
+
case 7:
|
|
202
|
+
return this.precpred(this._ctx, 2);
|
|
203
|
+
default:
|
|
204
|
+
throw "No predicate with index:" + predIndex;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
program() {
|
|
212
|
+
let localctx = new ProgramContext(this, this._ctx, this.state);
|
|
213
|
+
this.enterRule(localctx, 0, BrettParser.RULE_program);
|
|
214
|
+
var _la = 0;
|
|
215
|
+
try {
|
|
216
|
+
this.enterOuterAlt(localctx, 1);
|
|
217
|
+
this.state = 57;
|
|
218
|
+
this._errHandler.sync(this);
|
|
219
|
+
_la = this._input.LA(1);
|
|
220
|
+
while((((_la) & ~0x1f) === 0 && ((1 << _la) & 3855581120) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
221
|
+
this.state = 54;
|
|
222
|
+
this.statement();
|
|
223
|
+
this.state = 59;
|
|
224
|
+
this._errHandler.sync(this);
|
|
225
|
+
_la = this._input.LA(1);
|
|
226
|
+
}
|
|
227
|
+
this.state = 60;
|
|
228
|
+
this.match(BrettParser.EOF);
|
|
229
|
+
} catch (re) {
|
|
230
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
231
|
+
localctx.exception = re;
|
|
232
|
+
this._errHandler.reportError(this, re);
|
|
233
|
+
this._errHandler.recover(this, re);
|
|
234
|
+
} else {
|
|
235
|
+
throw re;
|
|
236
|
+
}
|
|
237
|
+
} finally {
|
|
238
|
+
this.exitRule();
|
|
239
|
+
}
|
|
240
|
+
return localctx;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
statement() {
|
|
246
|
+
let localctx = new StatementContext(this, this._ctx, this.state);
|
|
247
|
+
this.enterRule(localctx, 2, BrettParser.RULE_statement);
|
|
248
|
+
try {
|
|
249
|
+
this.state = 75;
|
|
250
|
+
this._errHandler.sync(this);
|
|
251
|
+
var la_ = this._interp.adaptivePredict(this._input,1,this._ctx);
|
|
252
|
+
switch(la_) {
|
|
253
|
+
case 1:
|
|
254
|
+
this.enterOuterAlt(localctx, 1);
|
|
255
|
+
this.state = 62;
|
|
256
|
+
this.variableDeclaration();
|
|
257
|
+
break;
|
|
258
|
+
|
|
259
|
+
case 2:
|
|
260
|
+
this.enterOuterAlt(localctx, 2);
|
|
261
|
+
this.state = 63;
|
|
262
|
+
this.functionDeclaration();
|
|
263
|
+
break;
|
|
264
|
+
|
|
265
|
+
case 3:
|
|
266
|
+
this.enterOuterAlt(localctx, 3);
|
|
267
|
+
this.state = 64;
|
|
268
|
+
this.ifStatement();
|
|
269
|
+
break;
|
|
270
|
+
|
|
271
|
+
case 4:
|
|
272
|
+
this.enterOuterAlt(localctx, 4);
|
|
273
|
+
this.state = 65;
|
|
274
|
+
this.whileStatement();
|
|
275
|
+
break;
|
|
276
|
+
|
|
277
|
+
case 5:
|
|
278
|
+
this.enterOuterAlt(localctx, 5);
|
|
279
|
+
this.state = 66;
|
|
280
|
+
this.forStatement();
|
|
281
|
+
break;
|
|
282
|
+
|
|
283
|
+
case 6:
|
|
284
|
+
this.enterOuterAlt(localctx, 6);
|
|
285
|
+
this.state = 67;
|
|
286
|
+
this.switchStatement();
|
|
287
|
+
break;
|
|
288
|
+
|
|
289
|
+
case 7:
|
|
290
|
+
this.enterOuterAlt(localctx, 7);
|
|
291
|
+
this.state = 68;
|
|
292
|
+
this.returnStatement();
|
|
293
|
+
break;
|
|
294
|
+
|
|
295
|
+
case 8:
|
|
296
|
+
this.enterOuterAlt(localctx, 8);
|
|
297
|
+
this.state = 69;
|
|
298
|
+
this.expressionStatement();
|
|
299
|
+
break;
|
|
300
|
+
|
|
301
|
+
case 9:
|
|
302
|
+
this.enterOuterAlt(localctx, 9);
|
|
303
|
+
this.state = 70;
|
|
304
|
+
this.block();
|
|
305
|
+
break;
|
|
306
|
+
|
|
307
|
+
case 10:
|
|
308
|
+
this.enterOuterAlt(localctx, 10);
|
|
309
|
+
this.state = 71;
|
|
310
|
+
this.breakStatement();
|
|
311
|
+
break;
|
|
312
|
+
|
|
313
|
+
case 11:
|
|
314
|
+
this.enterOuterAlt(localctx, 11);
|
|
315
|
+
this.state = 72;
|
|
316
|
+
this.continueStatement();
|
|
317
|
+
break;
|
|
318
|
+
|
|
319
|
+
case 12:
|
|
320
|
+
this.enterOuterAlt(localctx, 12);
|
|
321
|
+
this.state = 73;
|
|
322
|
+
this.doWhileStatement();
|
|
323
|
+
break;
|
|
324
|
+
|
|
325
|
+
case 13:
|
|
326
|
+
this.enterOuterAlt(localctx, 13);
|
|
327
|
+
this.state = 74;
|
|
328
|
+
this.tryCatchStatement();
|
|
329
|
+
break;
|
|
330
|
+
|
|
331
|
+
}
|
|
332
|
+
} catch (re) {
|
|
333
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
334
|
+
localctx.exception = re;
|
|
335
|
+
this._errHandler.reportError(this, re);
|
|
336
|
+
this._errHandler.recover(this, re);
|
|
337
|
+
} else {
|
|
338
|
+
throw re;
|
|
339
|
+
}
|
|
340
|
+
} finally {
|
|
341
|
+
this.exitRule();
|
|
342
|
+
}
|
|
343
|
+
return localctx;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
block() {
|
|
349
|
+
let localctx = new BlockContext(this, this._ctx, this.state);
|
|
350
|
+
this.enterRule(localctx, 4, BrettParser.RULE_block);
|
|
351
|
+
var _la = 0;
|
|
352
|
+
try {
|
|
353
|
+
this.enterOuterAlt(localctx, 1);
|
|
354
|
+
this.state = 77;
|
|
355
|
+
this.match(BrettParser.LBRACE);
|
|
356
|
+
this.state = 81;
|
|
357
|
+
this._errHandler.sync(this);
|
|
358
|
+
_la = this._input.LA(1);
|
|
359
|
+
while((((_la) & ~0x1f) === 0 && ((1 << _la) & 3855581120) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
360
|
+
this.state = 78;
|
|
361
|
+
this.statement();
|
|
362
|
+
this.state = 83;
|
|
363
|
+
this._errHandler.sync(this);
|
|
364
|
+
_la = this._input.LA(1);
|
|
365
|
+
}
|
|
366
|
+
this.state = 84;
|
|
367
|
+
this.match(BrettParser.RBRACE);
|
|
368
|
+
} catch (re) {
|
|
369
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
370
|
+
localctx.exception = re;
|
|
371
|
+
this._errHandler.reportError(this, re);
|
|
372
|
+
this._errHandler.recover(this, re);
|
|
373
|
+
} else {
|
|
374
|
+
throw re;
|
|
375
|
+
}
|
|
376
|
+
} finally {
|
|
377
|
+
this.exitRule();
|
|
378
|
+
}
|
|
379
|
+
return localctx;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
variableDeclaration() {
|
|
385
|
+
let localctx = new VariableDeclarationContext(this, this._ctx, this.state);
|
|
386
|
+
this.enterRule(localctx, 6, BrettParser.RULE_variableDeclaration);
|
|
387
|
+
var _la = 0;
|
|
388
|
+
try {
|
|
389
|
+
this.state = 106;
|
|
390
|
+
this._errHandler.sync(this);
|
|
391
|
+
switch(this._input.LA(1)) {
|
|
392
|
+
case 11:
|
|
393
|
+
this.enterOuterAlt(localctx, 1);
|
|
394
|
+
this.state = 86;
|
|
395
|
+
this.match(BrettParser.LET);
|
|
396
|
+
this.state = 87;
|
|
397
|
+
this.match(BrettParser.IDENTIFIER);
|
|
398
|
+
this.state = 90;
|
|
399
|
+
this._errHandler.sync(this);
|
|
400
|
+
_la = this._input.LA(1);
|
|
401
|
+
if(_la===44) {
|
|
402
|
+
this.state = 88;
|
|
403
|
+
this.match(BrettParser.COLON);
|
|
404
|
+
this.state = 89;
|
|
405
|
+
this.type(0);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
this.state = 94;
|
|
409
|
+
this._errHandler.sync(this);
|
|
410
|
+
_la = this._input.LA(1);
|
|
411
|
+
if(_la===42) {
|
|
412
|
+
this.state = 92;
|
|
413
|
+
this.match(BrettParser.ASSIGN);
|
|
414
|
+
this.state = 93;
|
|
415
|
+
this.expression(0);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
this.state = 96;
|
|
419
|
+
this.match(BrettParser.SEMI);
|
|
420
|
+
break;
|
|
421
|
+
case 12:
|
|
422
|
+
this.enterOuterAlt(localctx, 2);
|
|
423
|
+
this.state = 97;
|
|
424
|
+
this.match(BrettParser.CONST);
|
|
425
|
+
this.state = 98;
|
|
426
|
+
this.match(BrettParser.IDENTIFIER);
|
|
427
|
+
|
|
428
|
+
this.state = 99;
|
|
429
|
+
this.match(BrettParser.COLON);
|
|
430
|
+
this.state = 100;
|
|
431
|
+
this.type(0);
|
|
432
|
+
this.state = 102;
|
|
433
|
+
this.match(BrettParser.ASSIGN);
|
|
434
|
+
this.state = 103;
|
|
435
|
+
this.expression(0);
|
|
436
|
+
this.state = 104;
|
|
437
|
+
this.match(BrettParser.SEMI);
|
|
438
|
+
break;
|
|
439
|
+
default:
|
|
440
|
+
throw new antlr4.error.NoViableAltException(this);
|
|
441
|
+
}
|
|
442
|
+
} catch (re) {
|
|
443
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
444
|
+
localctx.exception = re;
|
|
445
|
+
this._errHandler.reportError(this, re);
|
|
446
|
+
this._errHandler.recover(this, re);
|
|
447
|
+
} else {
|
|
448
|
+
throw re;
|
|
449
|
+
}
|
|
450
|
+
} finally {
|
|
451
|
+
this.exitRule();
|
|
452
|
+
}
|
|
453
|
+
return localctx;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
ifStatement() {
|
|
459
|
+
let localctx = new IfStatementContext(this, this._ctx, this.state);
|
|
460
|
+
this.enterRule(localctx, 8, BrettParser.RULE_ifStatement);
|
|
461
|
+
var _la = 0;
|
|
462
|
+
try {
|
|
463
|
+
this.enterOuterAlt(localctx, 1);
|
|
464
|
+
this.state = 108;
|
|
465
|
+
this.match(BrettParser.IF);
|
|
466
|
+
this.state = 109;
|
|
467
|
+
this.match(BrettParser.LPAREN);
|
|
468
|
+
this.state = 110;
|
|
469
|
+
this.expression(0);
|
|
470
|
+
this.state = 111;
|
|
471
|
+
this.match(BrettParser.RPAREN);
|
|
472
|
+
this.state = 112;
|
|
473
|
+
this.block();
|
|
474
|
+
this.state = 115;
|
|
475
|
+
this._errHandler.sync(this);
|
|
476
|
+
_la = this._input.LA(1);
|
|
477
|
+
if(_la===15) {
|
|
478
|
+
this.state = 113;
|
|
479
|
+
this.match(BrettParser.ELSE);
|
|
480
|
+
this.state = 114;
|
|
481
|
+
this.block();
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
} catch (re) {
|
|
485
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
486
|
+
localctx.exception = re;
|
|
487
|
+
this._errHandler.reportError(this, re);
|
|
488
|
+
this._errHandler.recover(this, re);
|
|
489
|
+
} else {
|
|
490
|
+
throw re;
|
|
491
|
+
}
|
|
492
|
+
} finally {
|
|
493
|
+
this.exitRule();
|
|
494
|
+
}
|
|
495
|
+
return localctx;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
whileStatement() {
|
|
501
|
+
let localctx = new WhileStatementContext(this, this._ctx, this.state);
|
|
502
|
+
this.enterRule(localctx, 10, BrettParser.RULE_whileStatement);
|
|
503
|
+
try {
|
|
504
|
+
this.enterOuterAlt(localctx, 1);
|
|
505
|
+
this.state = 117;
|
|
506
|
+
this.match(BrettParser.WHILE);
|
|
507
|
+
this.state = 118;
|
|
508
|
+
this.match(BrettParser.LPAREN);
|
|
509
|
+
this.state = 119;
|
|
510
|
+
this.expression(0);
|
|
511
|
+
this.state = 120;
|
|
512
|
+
this.match(BrettParser.RPAREN);
|
|
513
|
+
this.state = 121;
|
|
514
|
+
this.block();
|
|
515
|
+
} catch (re) {
|
|
516
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
517
|
+
localctx.exception = re;
|
|
518
|
+
this._errHandler.reportError(this, re);
|
|
519
|
+
this._errHandler.recover(this, re);
|
|
520
|
+
} else {
|
|
521
|
+
throw re;
|
|
522
|
+
}
|
|
523
|
+
} finally {
|
|
524
|
+
this.exitRule();
|
|
525
|
+
}
|
|
526
|
+
return localctx;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
doWhileStatement() {
|
|
532
|
+
let localctx = new DoWhileStatementContext(this, this._ctx, this.state);
|
|
533
|
+
this.enterRule(localctx, 12, BrettParser.RULE_doWhileStatement);
|
|
534
|
+
try {
|
|
535
|
+
this.enterOuterAlt(localctx, 1);
|
|
536
|
+
this.state = 123;
|
|
537
|
+
this.match(BrettParser.DO);
|
|
538
|
+
this.state = 124;
|
|
539
|
+
this.block();
|
|
540
|
+
this.state = 125;
|
|
541
|
+
this.match(BrettParser.WHILE);
|
|
542
|
+
this.state = 126;
|
|
543
|
+
this.match(BrettParser.LPAREN);
|
|
544
|
+
this.state = 127;
|
|
545
|
+
this.expression(0);
|
|
546
|
+
this.state = 128;
|
|
547
|
+
this.match(BrettParser.RPAREN);
|
|
548
|
+
this.state = 129;
|
|
549
|
+
this.match(BrettParser.SEMI);
|
|
550
|
+
} catch (re) {
|
|
551
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
552
|
+
localctx.exception = re;
|
|
553
|
+
this._errHandler.reportError(this, re);
|
|
554
|
+
this._errHandler.recover(this, re);
|
|
555
|
+
} else {
|
|
556
|
+
throw re;
|
|
557
|
+
}
|
|
558
|
+
} finally {
|
|
559
|
+
this.exitRule();
|
|
560
|
+
}
|
|
561
|
+
return localctx;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
forStatement() {
|
|
567
|
+
let localctx = new ForStatementContext(this, this._ctx, this.state);
|
|
568
|
+
this.enterRule(localctx, 14, BrettParser.RULE_forStatement);
|
|
569
|
+
var _la = 0;
|
|
570
|
+
try {
|
|
571
|
+
this.enterOuterAlt(localctx, 1);
|
|
572
|
+
this.state = 131;
|
|
573
|
+
this.match(BrettParser.FOR);
|
|
574
|
+
this.state = 132;
|
|
575
|
+
this.match(BrettParser.LPAREN);
|
|
576
|
+
this.state = 135;
|
|
577
|
+
this._errHandler.sync(this);
|
|
578
|
+
var la_ = this._interp.adaptivePredict(this._input,7,this._ctx);
|
|
579
|
+
if(la_===1) {
|
|
580
|
+
this.state = 133;
|
|
581
|
+
this.variableDeclaration();
|
|
582
|
+
|
|
583
|
+
} else if(la_===2) {
|
|
584
|
+
this.state = 134;
|
|
585
|
+
this.expressionStatement();
|
|
586
|
+
|
|
587
|
+
}
|
|
588
|
+
this.state = 138;
|
|
589
|
+
this._errHandler.sync(this);
|
|
590
|
+
_la = this._input.LA(1);
|
|
591
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
592
|
+
this.state = 137;
|
|
593
|
+
this.expression(0);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
this.state = 140;
|
|
597
|
+
this.match(BrettParser.SEMI);
|
|
598
|
+
this.state = 142;
|
|
599
|
+
this._errHandler.sync(this);
|
|
600
|
+
_la = this._input.LA(1);
|
|
601
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
602
|
+
this.state = 141;
|
|
603
|
+
this.expression(0);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
this.state = 144;
|
|
607
|
+
this.match(BrettParser.RPAREN);
|
|
608
|
+
this.state = 145;
|
|
609
|
+
this.block();
|
|
610
|
+
} catch (re) {
|
|
611
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
612
|
+
localctx.exception = re;
|
|
613
|
+
this._errHandler.reportError(this, re);
|
|
614
|
+
this._errHandler.recover(this, re);
|
|
615
|
+
} else {
|
|
616
|
+
throw re;
|
|
617
|
+
}
|
|
618
|
+
} finally {
|
|
619
|
+
this.exitRule();
|
|
620
|
+
}
|
|
621
|
+
return localctx;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
switchStatement() {
|
|
627
|
+
let localctx = new SwitchStatementContext(this, this._ctx, this.state);
|
|
628
|
+
this.enterRule(localctx, 16, BrettParser.RULE_switchStatement);
|
|
629
|
+
var _la = 0;
|
|
630
|
+
try {
|
|
631
|
+
this.enterOuterAlt(localctx, 1);
|
|
632
|
+
this.state = 147;
|
|
633
|
+
this.match(BrettParser.SWITCH);
|
|
634
|
+
this.state = 148;
|
|
635
|
+
this.match(BrettParser.LBRACE);
|
|
636
|
+
this.state = 150;
|
|
637
|
+
this._errHandler.sync(this);
|
|
638
|
+
_la = this._input.LA(1);
|
|
639
|
+
do {
|
|
640
|
+
this.state = 149;
|
|
641
|
+
this.switchCase();
|
|
642
|
+
this.state = 152;
|
|
643
|
+
this._errHandler.sync(this);
|
|
644
|
+
_la = this._input.LA(1);
|
|
645
|
+
} while(_la===27);
|
|
646
|
+
this.state = 155;
|
|
647
|
+
this._errHandler.sync(this);
|
|
648
|
+
_la = this._input.LA(1);
|
|
649
|
+
if(_la===28) {
|
|
650
|
+
this.state = 154;
|
|
651
|
+
this.defaultCase();
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
this.state = 157;
|
|
655
|
+
this.match(BrettParser.RBRACE);
|
|
656
|
+
} catch (re) {
|
|
657
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
658
|
+
localctx.exception = re;
|
|
659
|
+
this._errHandler.reportError(this, re);
|
|
660
|
+
this._errHandler.recover(this, re);
|
|
661
|
+
} else {
|
|
662
|
+
throw re;
|
|
663
|
+
}
|
|
664
|
+
} finally {
|
|
665
|
+
this.exitRule();
|
|
666
|
+
}
|
|
667
|
+
return localctx;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
switchCase() {
|
|
673
|
+
let localctx = new SwitchCaseContext(this, this._ctx, this.state);
|
|
674
|
+
this.enterRule(localctx, 18, BrettParser.RULE_switchCase);
|
|
675
|
+
try {
|
|
676
|
+
this.enterOuterAlt(localctx, 1);
|
|
677
|
+
this.state = 159;
|
|
678
|
+
this.match(BrettParser.CASE);
|
|
679
|
+
this.state = 160;
|
|
680
|
+
this.expression(0);
|
|
681
|
+
this.state = 161;
|
|
682
|
+
this.match(BrettParser.ARROW);
|
|
683
|
+
this.state = 162;
|
|
684
|
+
this.block();
|
|
685
|
+
} catch (re) {
|
|
686
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
687
|
+
localctx.exception = re;
|
|
688
|
+
this._errHandler.reportError(this, re);
|
|
689
|
+
this._errHandler.recover(this, re);
|
|
690
|
+
} else {
|
|
691
|
+
throw re;
|
|
692
|
+
}
|
|
693
|
+
} finally {
|
|
694
|
+
this.exitRule();
|
|
695
|
+
}
|
|
696
|
+
return localctx;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
defaultCase() {
|
|
702
|
+
let localctx = new DefaultCaseContext(this, this._ctx, this.state);
|
|
703
|
+
this.enterRule(localctx, 20, BrettParser.RULE_defaultCase);
|
|
704
|
+
try {
|
|
705
|
+
this.enterOuterAlt(localctx, 1);
|
|
706
|
+
this.state = 164;
|
|
707
|
+
this.match(BrettParser.DEFAULT);
|
|
708
|
+
this.state = 165;
|
|
709
|
+
this.match(BrettParser.ARROW);
|
|
710
|
+
this.state = 166;
|
|
711
|
+
this.block();
|
|
712
|
+
} catch (re) {
|
|
713
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
714
|
+
localctx.exception = re;
|
|
715
|
+
this._errHandler.reportError(this, re);
|
|
716
|
+
this._errHandler.recover(this, re);
|
|
717
|
+
} else {
|
|
718
|
+
throw re;
|
|
719
|
+
}
|
|
720
|
+
} finally {
|
|
721
|
+
this.exitRule();
|
|
722
|
+
}
|
|
723
|
+
return localctx;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
returnStatement() {
|
|
729
|
+
let localctx = new ReturnStatementContext(this, this._ctx, this.state);
|
|
730
|
+
this.enterRule(localctx, 22, BrettParser.RULE_returnStatement);
|
|
731
|
+
var _la = 0;
|
|
732
|
+
try {
|
|
733
|
+
this.enterOuterAlt(localctx, 1);
|
|
734
|
+
this.state = 168;
|
|
735
|
+
this.match(BrettParser.RETURN);
|
|
736
|
+
this.state = 170;
|
|
737
|
+
this._errHandler.sync(this);
|
|
738
|
+
_la = this._input.LA(1);
|
|
739
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
740
|
+
this.state = 169;
|
|
741
|
+
this.expression(0);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
this.state = 172;
|
|
745
|
+
this.match(BrettParser.SEMI);
|
|
746
|
+
} catch (re) {
|
|
747
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
748
|
+
localctx.exception = re;
|
|
749
|
+
this._errHandler.reportError(this, re);
|
|
750
|
+
this._errHandler.recover(this, re);
|
|
751
|
+
} else {
|
|
752
|
+
throw re;
|
|
753
|
+
}
|
|
754
|
+
} finally {
|
|
755
|
+
this.exitRule();
|
|
756
|
+
}
|
|
757
|
+
return localctx;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
breakStatement() {
|
|
763
|
+
let localctx = new BreakStatementContext(this, this._ctx, this.state);
|
|
764
|
+
this.enterRule(localctx, 24, BrettParser.RULE_breakStatement);
|
|
765
|
+
try {
|
|
766
|
+
this.enterOuterAlt(localctx, 1);
|
|
767
|
+
this.state = 174;
|
|
768
|
+
this.match(BrettParser.BREAK);
|
|
769
|
+
this.state = 175;
|
|
770
|
+
this.match(BrettParser.SEMI);
|
|
771
|
+
} catch (re) {
|
|
772
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
773
|
+
localctx.exception = re;
|
|
774
|
+
this._errHandler.reportError(this, re);
|
|
775
|
+
this._errHandler.recover(this, re);
|
|
776
|
+
} else {
|
|
777
|
+
throw re;
|
|
778
|
+
}
|
|
779
|
+
} finally {
|
|
780
|
+
this.exitRule();
|
|
781
|
+
}
|
|
782
|
+
return localctx;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
continueStatement() {
|
|
788
|
+
let localctx = new ContinueStatementContext(this, this._ctx, this.state);
|
|
789
|
+
this.enterRule(localctx, 26, BrettParser.RULE_continueStatement);
|
|
790
|
+
try {
|
|
791
|
+
this.enterOuterAlt(localctx, 1);
|
|
792
|
+
this.state = 177;
|
|
793
|
+
this.match(BrettParser.CONTINUE);
|
|
794
|
+
this.state = 178;
|
|
795
|
+
this.match(BrettParser.SEMI);
|
|
796
|
+
} catch (re) {
|
|
797
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
798
|
+
localctx.exception = re;
|
|
799
|
+
this._errHandler.reportError(this, re);
|
|
800
|
+
this._errHandler.recover(this, re);
|
|
801
|
+
} else {
|
|
802
|
+
throw re;
|
|
803
|
+
}
|
|
804
|
+
} finally {
|
|
805
|
+
this.exitRule();
|
|
806
|
+
}
|
|
807
|
+
return localctx;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
expressionStatement() {
|
|
813
|
+
let localctx = new ExpressionStatementContext(this, this._ctx, this.state);
|
|
814
|
+
this.enterRule(localctx, 28, BrettParser.RULE_expressionStatement);
|
|
815
|
+
try {
|
|
816
|
+
this.enterOuterAlt(localctx, 1);
|
|
817
|
+
this.state = 180;
|
|
818
|
+
this.expression(0);
|
|
819
|
+
this.state = 181;
|
|
820
|
+
this.match(BrettParser.SEMI);
|
|
821
|
+
} catch (re) {
|
|
822
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
823
|
+
localctx.exception = re;
|
|
824
|
+
this._errHandler.reportError(this, re);
|
|
825
|
+
this._errHandler.recover(this, re);
|
|
826
|
+
} else {
|
|
827
|
+
throw re;
|
|
828
|
+
}
|
|
829
|
+
} finally {
|
|
830
|
+
this.exitRule();
|
|
831
|
+
}
|
|
832
|
+
return localctx;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
functionDeclaration() {
|
|
838
|
+
let localctx = new FunctionDeclarationContext(this, this._ctx, this.state);
|
|
839
|
+
this.enterRule(localctx, 30, BrettParser.RULE_functionDeclaration);
|
|
840
|
+
var _la = 0;
|
|
841
|
+
try {
|
|
842
|
+
this.enterOuterAlt(localctx, 1);
|
|
843
|
+
this.state = 183;
|
|
844
|
+
this.match(BrettParser.DEF);
|
|
845
|
+
this.state = 184;
|
|
846
|
+
this.match(BrettParser.IDENTIFIER);
|
|
847
|
+
this.state = 185;
|
|
848
|
+
this.match(BrettParser.LPAREN);
|
|
849
|
+
this.state = 187;
|
|
850
|
+
this._errHandler.sync(this);
|
|
851
|
+
_la = this._input.LA(1);
|
|
852
|
+
if(_la===54) {
|
|
853
|
+
this.state = 186;
|
|
854
|
+
this.parameterList();
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
this.state = 189;
|
|
858
|
+
this.match(BrettParser.RPAREN);
|
|
859
|
+
this.state = 192;
|
|
860
|
+
this._errHandler.sync(this);
|
|
861
|
+
_la = this._input.LA(1);
|
|
862
|
+
if(_la===44) {
|
|
863
|
+
this.state = 190;
|
|
864
|
+
this.match(BrettParser.COLON);
|
|
865
|
+
this.state = 191;
|
|
866
|
+
this.type(0);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
this.state = 194;
|
|
870
|
+
this.block();
|
|
871
|
+
} catch (re) {
|
|
872
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
873
|
+
localctx.exception = re;
|
|
874
|
+
this._errHandler.reportError(this, re);
|
|
875
|
+
this._errHandler.recover(this, re);
|
|
876
|
+
} else {
|
|
877
|
+
throw re;
|
|
878
|
+
}
|
|
879
|
+
} finally {
|
|
880
|
+
this.exitRule();
|
|
881
|
+
}
|
|
882
|
+
return localctx;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
parameterList() {
|
|
888
|
+
let localctx = new ParameterListContext(this, this._ctx, this.state);
|
|
889
|
+
this.enterRule(localctx, 32, BrettParser.RULE_parameterList);
|
|
890
|
+
var _la = 0;
|
|
891
|
+
try {
|
|
892
|
+
this.enterOuterAlt(localctx, 1);
|
|
893
|
+
this.state = 196;
|
|
894
|
+
this.parameter();
|
|
895
|
+
this.state = 201;
|
|
896
|
+
this._errHandler.sync(this);
|
|
897
|
+
_la = this._input.LA(1);
|
|
898
|
+
while(_la===45) {
|
|
899
|
+
this.state = 197;
|
|
900
|
+
this.match(BrettParser.COMMA);
|
|
901
|
+
this.state = 198;
|
|
902
|
+
this.parameter();
|
|
903
|
+
this.state = 203;
|
|
904
|
+
this._errHandler.sync(this);
|
|
905
|
+
_la = this._input.LA(1);
|
|
906
|
+
}
|
|
907
|
+
} catch (re) {
|
|
908
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
909
|
+
localctx.exception = re;
|
|
910
|
+
this._errHandler.reportError(this, re);
|
|
911
|
+
this._errHandler.recover(this, re);
|
|
912
|
+
} else {
|
|
913
|
+
throw re;
|
|
914
|
+
}
|
|
915
|
+
} finally {
|
|
916
|
+
this.exitRule();
|
|
917
|
+
}
|
|
918
|
+
return localctx;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
parameter() {
|
|
924
|
+
let localctx = new ParameterContext(this, this._ctx, this.state);
|
|
925
|
+
this.enterRule(localctx, 34, BrettParser.RULE_parameter);
|
|
926
|
+
var _la = 0;
|
|
927
|
+
try {
|
|
928
|
+
this.enterOuterAlt(localctx, 1);
|
|
929
|
+
this.state = 204;
|
|
930
|
+
this.match(BrettParser.IDENTIFIER);
|
|
931
|
+
this.state = 207;
|
|
932
|
+
this._errHandler.sync(this);
|
|
933
|
+
_la = this._input.LA(1);
|
|
934
|
+
if(_la===44) {
|
|
935
|
+
this.state = 205;
|
|
936
|
+
this.match(BrettParser.COLON);
|
|
937
|
+
this.state = 206;
|
|
938
|
+
this.type(0);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
} catch (re) {
|
|
942
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
943
|
+
localctx.exception = re;
|
|
944
|
+
this._errHandler.reportError(this, re);
|
|
945
|
+
this._errHandler.recover(this, re);
|
|
946
|
+
} else {
|
|
947
|
+
throw re;
|
|
948
|
+
}
|
|
949
|
+
} finally {
|
|
950
|
+
this.exitRule();
|
|
951
|
+
}
|
|
952
|
+
return localctx;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
type(_p) {
|
|
957
|
+
if(_p===undefined) {
|
|
958
|
+
_p = 0;
|
|
959
|
+
}
|
|
960
|
+
const _parentctx = this._ctx;
|
|
961
|
+
const _parentState = this.state;
|
|
962
|
+
let localctx = new TypeContext(this, this._ctx, _parentState);
|
|
963
|
+
let _prevctx = localctx;
|
|
964
|
+
const _startState = 36;
|
|
965
|
+
this.enterRecursionRule(localctx, 36, BrettParser.RULE_type, _p);
|
|
966
|
+
try {
|
|
967
|
+
this.enterOuterAlt(localctx, 1);
|
|
968
|
+
localctx = new SimpleTypeContext(this, localctx);
|
|
969
|
+
this._ctx = localctx;
|
|
970
|
+
_prevctx = localctx;
|
|
971
|
+
|
|
972
|
+
this.state = 210;
|
|
973
|
+
this.baseType();
|
|
974
|
+
this._ctx.stop = this._input.LT(-1);
|
|
975
|
+
this.state = 216;
|
|
976
|
+
this._errHandler.sync(this);
|
|
977
|
+
var _alt = this._interp.adaptivePredict(this._input,17,this._ctx)
|
|
978
|
+
while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
|
|
979
|
+
if(_alt===1) {
|
|
980
|
+
if(this._parseListeners!==null) {
|
|
981
|
+
this.triggerExitRuleEvent();
|
|
982
|
+
}
|
|
983
|
+
_prevctx = localctx;
|
|
984
|
+
localctx = new ArrayTypeContext(this, new TypeContext(this, _parentctx, _parentState));
|
|
985
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_type);
|
|
986
|
+
this.state = 212;
|
|
987
|
+
if (!( this.precpred(this._ctx, 1))) {
|
|
988
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 1)");
|
|
989
|
+
}
|
|
990
|
+
this.state = 213;
|
|
991
|
+
this.match(BrettParser.T__0);
|
|
992
|
+
}
|
|
993
|
+
this.state = 218;
|
|
994
|
+
this._errHandler.sync(this);
|
|
995
|
+
_alt = this._interp.adaptivePredict(this._input,17,this._ctx);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
} catch( error) {
|
|
999
|
+
if(error instanceof antlr4.error.RecognitionException) {
|
|
1000
|
+
localctx.exception = error;
|
|
1001
|
+
this._errHandler.reportError(this, error);
|
|
1002
|
+
this._errHandler.recover(this, error);
|
|
1003
|
+
} else {
|
|
1004
|
+
throw error;
|
|
1005
|
+
}
|
|
1006
|
+
} finally {
|
|
1007
|
+
this.unrollRecursionContexts(_parentctx)
|
|
1008
|
+
}
|
|
1009
|
+
return localctx;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
baseType() {
|
|
1015
|
+
let localctx = new BaseTypeContext(this, this._ctx, this.state);
|
|
1016
|
+
this.enterRule(localctx, 38, BrettParser.RULE_baseType);
|
|
1017
|
+
var _la = 0;
|
|
1018
|
+
try {
|
|
1019
|
+
this.enterOuterAlt(localctx, 1);
|
|
1020
|
+
this.state = 219;
|
|
1021
|
+
_la = this._input.LA(1);
|
|
1022
|
+
if(!((((_la) & ~0x1f) === 0 && ((1 << _la) & 33554492) !== 0) || _la===54)) {
|
|
1023
|
+
this._errHandler.recoverInline(this);
|
|
1024
|
+
}
|
|
1025
|
+
else {
|
|
1026
|
+
this._errHandler.reportMatch(this);
|
|
1027
|
+
this.consume();
|
|
1028
|
+
}
|
|
1029
|
+
} catch (re) {
|
|
1030
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1031
|
+
localctx.exception = re;
|
|
1032
|
+
this._errHandler.reportError(this, re);
|
|
1033
|
+
this._errHandler.recover(this, re);
|
|
1034
|
+
} else {
|
|
1035
|
+
throw re;
|
|
1036
|
+
}
|
|
1037
|
+
} finally {
|
|
1038
|
+
this.exitRule();
|
|
1039
|
+
}
|
|
1040
|
+
return localctx;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
tryCatchStatement() {
|
|
1046
|
+
let localctx = new TryCatchStatementContext(this, this._ctx, this.state);
|
|
1047
|
+
this.enterRule(localctx, 40, BrettParser.RULE_tryCatchStatement);
|
|
1048
|
+
var _la = 0;
|
|
1049
|
+
try {
|
|
1050
|
+
this.enterOuterAlt(localctx, 1);
|
|
1051
|
+
this.state = 221;
|
|
1052
|
+
this.match(BrettParser.TRY);
|
|
1053
|
+
this.state = 222;
|
|
1054
|
+
this.block();
|
|
1055
|
+
this.state = 223;
|
|
1056
|
+
this.match(BrettParser.CATCH);
|
|
1057
|
+
this.state = 224;
|
|
1058
|
+
this.match(BrettParser.LPAREN);
|
|
1059
|
+
this.state = 225;
|
|
1060
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1061
|
+
this.state = 228;
|
|
1062
|
+
this._errHandler.sync(this);
|
|
1063
|
+
_la = this._input.LA(1);
|
|
1064
|
+
if(_la===44) {
|
|
1065
|
+
this.state = 226;
|
|
1066
|
+
this.match(BrettParser.COLON);
|
|
1067
|
+
this.state = 227;
|
|
1068
|
+
this.type(0);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
this.state = 230;
|
|
1072
|
+
this.match(BrettParser.RPAREN);
|
|
1073
|
+
this.state = 231;
|
|
1074
|
+
this.block();
|
|
1075
|
+
this.state = 234;
|
|
1076
|
+
this._errHandler.sync(this);
|
|
1077
|
+
_la = this._input.LA(1);
|
|
1078
|
+
if(_la===21) {
|
|
1079
|
+
this.state = 232;
|
|
1080
|
+
this.match(BrettParser.FINALLY);
|
|
1081
|
+
this.state = 233;
|
|
1082
|
+
this.block();
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
} catch (re) {
|
|
1086
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1087
|
+
localctx.exception = re;
|
|
1088
|
+
this._errHandler.reportError(this, re);
|
|
1089
|
+
this._errHandler.recover(this, re);
|
|
1090
|
+
} else {
|
|
1091
|
+
throw re;
|
|
1092
|
+
}
|
|
1093
|
+
} finally {
|
|
1094
|
+
this.exitRule();
|
|
1095
|
+
}
|
|
1096
|
+
return localctx;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
expression(_p) {
|
|
1101
|
+
if(_p===undefined) {
|
|
1102
|
+
_p = 0;
|
|
1103
|
+
}
|
|
1104
|
+
const _parentctx = this._ctx;
|
|
1105
|
+
const _parentState = this.state;
|
|
1106
|
+
let localctx = new ExpressionContext(this, this._ctx, _parentState);
|
|
1107
|
+
let _prevctx = localctx;
|
|
1108
|
+
const _startState = 42;
|
|
1109
|
+
this.enterRecursionRule(localctx, 42, BrettParser.RULE_expression, _p);
|
|
1110
|
+
var _la = 0;
|
|
1111
|
+
try {
|
|
1112
|
+
this.enterOuterAlt(localctx, 1);
|
|
1113
|
+
this.state = 250;
|
|
1114
|
+
this._errHandler.sync(this);
|
|
1115
|
+
var la_ = this._interp.adaptivePredict(this._input,21,this._ctx);
|
|
1116
|
+
switch(la_) {
|
|
1117
|
+
case 1:
|
|
1118
|
+
localctx = new PrimaryExpressionContext(this, localctx);
|
|
1119
|
+
this._ctx = localctx;
|
|
1120
|
+
_prevctx = localctx;
|
|
1121
|
+
|
|
1122
|
+
this.state = 237;
|
|
1123
|
+
this.primary();
|
|
1124
|
+
break;
|
|
1125
|
+
|
|
1126
|
+
case 2:
|
|
1127
|
+
localctx = new AssignmentExpressionContext(this, localctx);
|
|
1128
|
+
this._ctx = localctx;
|
|
1129
|
+
_prevctx = localctx;
|
|
1130
|
+
this.state = 238;
|
|
1131
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1132
|
+
this.state = 239;
|
|
1133
|
+
this.match(BrettParser.ASSIGN);
|
|
1134
|
+
this.state = 240;
|
|
1135
|
+
this.expression(6);
|
|
1136
|
+
break;
|
|
1137
|
+
|
|
1138
|
+
case 3:
|
|
1139
|
+
localctx = new NewExpressionContext(this, localctx);
|
|
1140
|
+
this._ctx = localctx;
|
|
1141
|
+
_prevctx = localctx;
|
|
1142
|
+
this.state = 241;
|
|
1143
|
+
this.match(BrettParser.NEW);
|
|
1144
|
+
this.state = 242;
|
|
1145
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1146
|
+
this.state = 243;
|
|
1147
|
+
this.match(BrettParser.LPAREN);
|
|
1148
|
+
this.state = 245;
|
|
1149
|
+
this._errHandler.sync(this);
|
|
1150
|
+
_la = this._input.LA(1);
|
|
1151
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
1152
|
+
this.state = 244;
|
|
1153
|
+
this.argList();
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
this.state = 247;
|
|
1157
|
+
this.match(BrettParser.RPAREN);
|
|
1158
|
+
break;
|
|
1159
|
+
|
|
1160
|
+
case 4:
|
|
1161
|
+
localctx = new PreIncrementDecrementContext(this, localctx);
|
|
1162
|
+
this._ctx = localctx;
|
|
1163
|
+
_prevctx = localctx;
|
|
1164
|
+
this.state = 248;
|
|
1165
|
+
_la = this._input.LA(1);
|
|
1166
|
+
if(!(_la===6 || _la===7)) {
|
|
1167
|
+
this._errHandler.recoverInline(this);
|
|
1168
|
+
}
|
|
1169
|
+
else {
|
|
1170
|
+
this._errHandler.reportMatch(this);
|
|
1171
|
+
this.consume();
|
|
1172
|
+
}
|
|
1173
|
+
this.state = 249;
|
|
1174
|
+
this.expression(1);
|
|
1175
|
+
break;
|
|
1176
|
+
|
|
1177
|
+
}
|
|
1178
|
+
this._ctx.stop = this._input.LT(-1);
|
|
1179
|
+
this.state = 276;
|
|
1180
|
+
this._errHandler.sync(this);
|
|
1181
|
+
var _alt = this._interp.adaptivePredict(this._input,23,this._ctx)
|
|
1182
|
+
while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
|
|
1183
|
+
if(_alt===1) {
|
|
1184
|
+
if(this._parseListeners!==null) {
|
|
1185
|
+
this.triggerExitRuleEvent();
|
|
1186
|
+
}
|
|
1187
|
+
_prevctx = localctx;
|
|
1188
|
+
this.state = 274;
|
|
1189
|
+
this._errHandler.sync(this);
|
|
1190
|
+
var la_ = this._interp.adaptivePredict(this._input,22,this._ctx);
|
|
1191
|
+
switch(la_) {
|
|
1192
|
+
case 1:
|
|
1193
|
+
localctx = new BinaryExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1194
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1195
|
+
this.state = 252;
|
|
1196
|
+
if (!( this.precpred(this._ctx, 10))) {
|
|
1197
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 10)");
|
|
1198
|
+
}
|
|
1199
|
+
this.state = 253;
|
|
1200
|
+
localctx.op = this._input.LT(1);
|
|
1201
|
+
_la = this._input.LA(1);
|
|
1202
|
+
if(!(_la===40 || _la===41)) {
|
|
1203
|
+
localctx.op = this._errHandler.recoverInline(this);
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
this._errHandler.reportMatch(this);
|
|
1207
|
+
this.consume();
|
|
1208
|
+
}
|
|
1209
|
+
this.state = 254;
|
|
1210
|
+
this.expression(11);
|
|
1211
|
+
break;
|
|
1212
|
+
|
|
1213
|
+
case 2:
|
|
1214
|
+
localctx = new BinaryExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1215
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1216
|
+
this.state = 255;
|
|
1217
|
+
if (!( this.precpred(this._ctx, 9))) {
|
|
1218
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 9)");
|
|
1219
|
+
}
|
|
1220
|
+
this.state = 256;
|
|
1221
|
+
localctx.op = this._input.LT(1);
|
|
1222
|
+
_la = this._input.LA(1);
|
|
1223
|
+
if(!(_la===38 || _la===39)) {
|
|
1224
|
+
localctx.op = this._errHandler.recoverInline(this);
|
|
1225
|
+
}
|
|
1226
|
+
else {
|
|
1227
|
+
this._errHandler.reportMatch(this);
|
|
1228
|
+
this.consume();
|
|
1229
|
+
}
|
|
1230
|
+
this.state = 257;
|
|
1231
|
+
this.expression(10);
|
|
1232
|
+
break;
|
|
1233
|
+
|
|
1234
|
+
case 3:
|
|
1235
|
+
localctx = new BinaryExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1236
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1237
|
+
this.state = 258;
|
|
1238
|
+
if (!( this.precpred(this._ctx, 8))) {
|
|
1239
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 8)");
|
|
1240
|
+
}
|
|
1241
|
+
this.state = 259;
|
|
1242
|
+
localctx.op = this._input.LT(1);
|
|
1243
|
+
_la = this._input.LA(1);
|
|
1244
|
+
if(!(((((_la - 34)) & ~0x1f) === 0 && ((1 << (_la - 34)) & 15) !== 0))) {
|
|
1245
|
+
localctx.op = this._errHandler.recoverInline(this);
|
|
1246
|
+
}
|
|
1247
|
+
else {
|
|
1248
|
+
this._errHandler.reportMatch(this);
|
|
1249
|
+
this.consume();
|
|
1250
|
+
}
|
|
1251
|
+
this.state = 260;
|
|
1252
|
+
this.expression(9);
|
|
1253
|
+
break;
|
|
1254
|
+
|
|
1255
|
+
case 4:
|
|
1256
|
+
localctx = new BinaryExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1257
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1258
|
+
this.state = 261;
|
|
1259
|
+
if (!( this.precpred(this._ctx, 7))) {
|
|
1260
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 7)");
|
|
1261
|
+
}
|
|
1262
|
+
this.state = 262;
|
|
1263
|
+
localctx.op = this._input.LT(1);
|
|
1264
|
+
_la = this._input.LA(1);
|
|
1265
|
+
if(!(_la===32 || _la===33)) {
|
|
1266
|
+
localctx.op = this._errHandler.recoverInline(this);
|
|
1267
|
+
}
|
|
1268
|
+
else {
|
|
1269
|
+
this._errHandler.reportMatch(this);
|
|
1270
|
+
this.consume();
|
|
1271
|
+
}
|
|
1272
|
+
this.state = 263;
|
|
1273
|
+
this.expression(8);
|
|
1274
|
+
break;
|
|
1275
|
+
|
|
1276
|
+
case 5:
|
|
1277
|
+
localctx = new IndexExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1278
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1279
|
+
this.state = 264;
|
|
1280
|
+
if (!( this.precpred(this._ctx, 5))) {
|
|
1281
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 5)");
|
|
1282
|
+
}
|
|
1283
|
+
this.state = 265;
|
|
1284
|
+
this.match(BrettParser.LBRACK);
|
|
1285
|
+
this.state = 266;
|
|
1286
|
+
this.expression(0);
|
|
1287
|
+
this.state = 267;
|
|
1288
|
+
this.match(BrettParser.RBRACK);
|
|
1289
|
+
break;
|
|
1290
|
+
|
|
1291
|
+
case 6:
|
|
1292
|
+
localctx = new MemberExpressionContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1293
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1294
|
+
this.state = 269;
|
|
1295
|
+
if (!( this.precpred(this._ctx, 4))) {
|
|
1296
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 4)");
|
|
1297
|
+
}
|
|
1298
|
+
this.state = 270;
|
|
1299
|
+
this.match(BrettParser.DOT);
|
|
1300
|
+
this.state = 271;
|
|
1301
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1302
|
+
break;
|
|
1303
|
+
|
|
1304
|
+
case 7:
|
|
1305
|
+
localctx = new PostIncrementDecrementContext(this, new ExpressionContext(this, _parentctx, _parentState));
|
|
1306
|
+
this.pushNewRecursionContext(localctx, _startState, BrettParser.RULE_expression);
|
|
1307
|
+
this.state = 272;
|
|
1308
|
+
if (!( this.precpred(this._ctx, 2))) {
|
|
1309
|
+
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 2)");
|
|
1310
|
+
}
|
|
1311
|
+
this.state = 273;
|
|
1312
|
+
_la = this._input.LA(1);
|
|
1313
|
+
if(!(_la===6 || _la===7)) {
|
|
1314
|
+
this._errHandler.recoverInline(this);
|
|
1315
|
+
}
|
|
1316
|
+
else {
|
|
1317
|
+
this._errHandler.reportMatch(this);
|
|
1318
|
+
this.consume();
|
|
1319
|
+
}
|
|
1320
|
+
break;
|
|
1321
|
+
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
this.state = 278;
|
|
1325
|
+
this._errHandler.sync(this);
|
|
1326
|
+
_alt = this._interp.adaptivePredict(this._input,23,this._ctx);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
} catch( error) {
|
|
1330
|
+
if(error instanceof antlr4.error.RecognitionException) {
|
|
1331
|
+
localctx.exception = error;
|
|
1332
|
+
this._errHandler.reportError(this, error);
|
|
1333
|
+
this._errHandler.recover(this, error);
|
|
1334
|
+
} else {
|
|
1335
|
+
throw error;
|
|
1336
|
+
}
|
|
1337
|
+
} finally {
|
|
1338
|
+
this.unrollRecursionContexts(_parentctx)
|
|
1339
|
+
}
|
|
1340
|
+
return localctx;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
primary() {
|
|
1346
|
+
let localctx = new PrimaryContext(this, this._ctx, this.state);
|
|
1347
|
+
this.enterRule(localctx, 44, BrettParser.RULE_primary);
|
|
1348
|
+
var _la = 0;
|
|
1349
|
+
try {
|
|
1350
|
+
this.state = 297;
|
|
1351
|
+
this._errHandler.sync(this);
|
|
1352
|
+
var la_ = this._interp.adaptivePredict(this._input,25,this._ctx);
|
|
1353
|
+
switch(la_) {
|
|
1354
|
+
case 1:
|
|
1355
|
+
localctx = new LiteralExpressionContext(this, localctx);
|
|
1356
|
+
this.enterOuterAlt(localctx, 1);
|
|
1357
|
+
this.state = 279;
|
|
1358
|
+
this.match(BrettParser.NUMBER);
|
|
1359
|
+
break;
|
|
1360
|
+
|
|
1361
|
+
case 2:
|
|
1362
|
+
localctx = new LiteralExpressionContext(this, localctx);
|
|
1363
|
+
this.enterOuterAlt(localctx, 2);
|
|
1364
|
+
this.state = 280;
|
|
1365
|
+
this.match(BrettParser.STRING);
|
|
1366
|
+
break;
|
|
1367
|
+
|
|
1368
|
+
case 3:
|
|
1369
|
+
localctx = new LiteralExpressionContext(this, localctx);
|
|
1370
|
+
this.enterOuterAlt(localctx, 3);
|
|
1371
|
+
this.state = 281;
|
|
1372
|
+
this.match(BrettParser.T__7);
|
|
1373
|
+
break;
|
|
1374
|
+
|
|
1375
|
+
case 4:
|
|
1376
|
+
localctx = new LiteralExpressionContext(this, localctx);
|
|
1377
|
+
this.enterOuterAlt(localctx, 4);
|
|
1378
|
+
this.state = 282;
|
|
1379
|
+
this.match(BrettParser.T__8);
|
|
1380
|
+
break;
|
|
1381
|
+
|
|
1382
|
+
case 5:
|
|
1383
|
+
localctx = new LiteralExpressionContext(this, localctx);
|
|
1384
|
+
this.enterOuterAlt(localctx, 5);
|
|
1385
|
+
this.state = 283;
|
|
1386
|
+
this.match(BrettParser.T__9);
|
|
1387
|
+
break;
|
|
1388
|
+
|
|
1389
|
+
case 6:
|
|
1390
|
+
localctx = new IdentifierExpressionContext(this, localctx);
|
|
1391
|
+
this.enterOuterAlt(localctx, 6);
|
|
1392
|
+
this.state = 284;
|
|
1393
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1394
|
+
break;
|
|
1395
|
+
|
|
1396
|
+
case 7:
|
|
1397
|
+
localctx = new ParenthesizedExpressionContext(this, localctx);
|
|
1398
|
+
this.enterOuterAlt(localctx, 7);
|
|
1399
|
+
this.state = 285;
|
|
1400
|
+
this.match(BrettParser.LPAREN);
|
|
1401
|
+
this.state = 286;
|
|
1402
|
+
this.expression(0);
|
|
1403
|
+
this.state = 287;
|
|
1404
|
+
this.match(BrettParser.RPAREN);
|
|
1405
|
+
break;
|
|
1406
|
+
|
|
1407
|
+
case 8:
|
|
1408
|
+
localctx = new FunctionCallExpressionContext(this, localctx);
|
|
1409
|
+
this.enterOuterAlt(localctx, 8);
|
|
1410
|
+
this.state = 289;
|
|
1411
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1412
|
+
this.state = 290;
|
|
1413
|
+
this.match(BrettParser.LPAREN);
|
|
1414
|
+
this.state = 292;
|
|
1415
|
+
this._errHandler.sync(this);
|
|
1416
|
+
_la = this._input.LA(1);
|
|
1417
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
1418
|
+
this.state = 291;
|
|
1419
|
+
this.argList();
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
this.state = 294;
|
|
1423
|
+
this.match(BrettParser.RPAREN);
|
|
1424
|
+
break;
|
|
1425
|
+
|
|
1426
|
+
case 9:
|
|
1427
|
+
localctx = new ArrayLiteralExpressionContext(this, localctx);
|
|
1428
|
+
this.enterOuterAlt(localctx, 9);
|
|
1429
|
+
this.state = 295;
|
|
1430
|
+
this.arrayLiteral();
|
|
1431
|
+
break;
|
|
1432
|
+
|
|
1433
|
+
case 10:
|
|
1434
|
+
localctx = new ObjectLiteralExpressionContext(this, localctx);
|
|
1435
|
+
this.enterOuterAlt(localctx, 10);
|
|
1436
|
+
this.state = 296;
|
|
1437
|
+
this.objectLiteral();
|
|
1438
|
+
break;
|
|
1439
|
+
|
|
1440
|
+
}
|
|
1441
|
+
} catch (re) {
|
|
1442
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1443
|
+
localctx.exception = re;
|
|
1444
|
+
this._errHandler.reportError(this, re);
|
|
1445
|
+
this._errHandler.recover(this, re);
|
|
1446
|
+
} else {
|
|
1447
|
+
throw re;
|
|
1448
|
+
}
|
|
1449
|
+
} finally {
|
|
1450
|
+
this.exitRule();
|
|
1451
|
+
}
|
|
1452
|
+
return localctx;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
arrayLiteral() {
|
|
1458
|
+
let localctx = new ArrayLiteralContext(this, this._ctx, this.state);
|
|
1459
|
+
this.enterRule(localctx, 46, BrettParser.RULE_arrayLiteral);
|
|
1460
|
+
var _la = 0;
|
|
1461
|
+
try {
|
|
1462
|
+
this.enterOuterAlt(localctx, 1);
|
|
1463
|
+
this.state = 299;
|
|
1464
|
+
this.match(BrettParser.LBRACK);
|
|
1465
|
+
this.state = 308;
|
|
1466
|
+
this._errHandler.sync(this);
|
|
1467
|
+
_la = this._input.LA(1);
|
|
1468
|
+
if((((_la) & ~0x1f) === 0 && ((1 << _la) & 3238004672) !== 0) || ((((_la - 47)) & ~0x1f) === 0 && ((1 << (_la - 47)) & 149) !== 0)) {
|
|
1469
|
+
this.state = 300;
|
|
1470
|
+
this.expression(0);
|
|
1471
|
+
this.state = 305;
|
|
1472
|
+
this._errHandler.sync(this);
|
|
1473
|
+
_la = this._input.LA(1);
|
|
1474
|
+
while(_la===45) {
|
|
1475
|
+
this.state = 301;
|
|
1476
|
+
this.match(BrettParser.COMMA);
|
|
1477
|
+
this.state = 302;
|
|
1478
|
+
this.expression(0);
|
|
1479
|
+
this.state = 307;
|
|
1480
|
+
this._errHandler.sync(this);
|
|
1481
|
+
_la = this._input.LA(1);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
this.state = 310;
|
|
1486
|
+
this.match(BrettParser.RBRACK);
|
|
1487
|
+
} catch (re) {
|
|
1488
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1489
|
+
localctx.exception = re;
|
|
1490
|
+
this._errHandler.reportError(this, re);
|
|
1491
|
+
this._errHandler.recover(this, re);
|
|
1492
|
+
} else {
|
|
1493
|
+
throw re;
|
|
1494
|
+
}
|
|
1495
|
+
} finally {
|
|
1496
|
+
this.exitRule();
|
|
1497
|
+
}
|
|
1498
|
+
return localctx;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
objectLiteral() {
|
|
1504
|
+
let localctx = new ObjectLiteralContext(this, this._ctx, this.state);
|
|
1505
|
+
this.enterRule(localctx, 48, BrettParser.RULE_objectLiteral);
|
|
1506
|
+
var _la = 0;
|
|
1507
|
+
try {
|
|
1508
|
+
this.enterOuterAlt(localctx, 1);
|
|
1509
|
+
this.state = 312;
|
|
1510
|
+
this.match(BrettParser.LBRACE);
|
|
1511
|
+
this.state = 321;
|
|
1512
|
+
this._errHandler.sync(this);
|
|
1513
|
+
_la = this._input.LA(1);
|
|
1514
|
+
if(_la===31 || _la===54) {
|
|
1515
|
+
this.state = 313;
|
|
1516
|
+
this.property();
|
|
1517
|
+
this.state = 318;
|
|
1518
|
+
this._errHandler.sync(this);
|
|
1519
|
+
_la = this._input.LA(1);
|
|
1520
|
+
while(_la===45) {
|
|
1521
|
+
this.state = 314;
|
|
1522
|
+
this.match(BrettParser.COMMA);
|
|
1523
|
+
this.state = 315;
|
|
1524
|
+
this.property();
|
|
1525
|
+
this.state = 320;
|
|
1526
|
+
this._errHandler.sync(this);
|
|
1527
|
+
_la = this._input.LA(1);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
this.state = 323;
|
|
1532
|
+
this.match(BrettParser.RBRACE);
|
|
1533
|
+
} catch (re) {
|
|
1534
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1535
|
+
localctx.exception = re;
|
|
1536
|
+
this._errHandler.reportError(this, re);
|
|
1537
|
+
this._errHandler.recover(this, re);
|
|
1538
|
+
} else {
|
|
1539
|
+
throw re;
|
|
1540
|
+
}
|
|
1541
|
+
} finally {
|
|
1542
|
+
this.exitRule();
|
|
1543
|
+
}
|
|
1544
|
+
return localctx;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
property() {
|
|
1550
|
+
let localctx = new PropertyContext(this, this._ctx, this.state);
|
|
1551
|
+
this.enterRule(localctx, 50, BrettParser.RULE_property);
|
|
1552
|
+
try {
|
|
1553
|
+
this.state = 331;
|
|
1554
|
+
this._errHandler.sync(this);
|
|
1555
|
+
switch(this._input.LA(1)) {
|
|
1556
|
+
case 54:
|
|
1557
|
+
this.enterOuterAlt(localctx, 1);
|
|
1558
|
+
this.state = 325;
|
|
1559
|
+
this.match(BrettParser.IDENTIFIER);
|
|
1560
|
+
this.state = 326;
|
|
1561
|
+
this.match(BrettParser.COLON);
|
|
1562
|
+
this.state = 327;
|
|
1563
|
+
this.expression(0);
|
|
1564
|
+
break;
|
|
1565
|
+
case 31:
|
|
1566
|
+
this.enterOuterAlt(localctx, 2);
|
|
1567
|
+
this.state = 328;
|
|
1568
|
+
this.match(BrettParser.STRING);
|
|
1569
|
+
this.state = 329;
|
|
1570
|
+
this.match(BrettParser.COLON);
|
|
1571
|
+
this.state = 330;
|
|
1572
|
+
this.expression(0);
|
|
1573
|
+
break;
|
|
1574
|
+
default:
|
|
1575
|
+
throw new antlr4.error.NoViableAltException(this);
|
|
1576
|
+
}
|
|
1577
|
+
} catch (re) {
|
|
1578
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1579
|
+
localctx.exception = re;
|
|
1580
|
+
this._errHandler.reportError(this, re);
|
|
1581
|
+
this._errHandler.recover(this, re);
|
|
1582
|
+
} else {
|
|
1583
|
+
throw re;
|
|
1584
|
+
}
|
|
1585
|
+
} finally {
|
|
1586
|
+
this.exitRule();
|
|
1587
|
+
}
|
|
1588
|
+
return localctx;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
argList() {
|
|
1594
|
+
let localctx = new ArgListContext(this, this._ctx, this.state);
|
|
1595
|
+
this.enterRule(localctx, 52, BrettParser.RULE_argList);
|
|
1596
|
+
var _la = 0;
|
|
1597
|
+
try {
|
|
1598
|
+
this.enterOuterAlt(localctx, 1);
|
|
1599
|
+
this.state = 333;
|
|
1600
|
+
this.expression(0);
|
|
1601
|
+
this.state = 338;
|
|
1602
|
+
this._errHandler.sync(this);
|
|
1603
|
+
_la = this._input.LA(1);
|
|
1604
|
+
while(_la===45) {
|
|
1605
|
+
this.state = 334;
|
|
1606
|
+
this.match(BrettParser.COMMA);
|
|
1607
|
+
this.state = 335;
|
|
1608
|
+
this.expression(0);
|
|
1609
|
+
this.state = 340;
|
|
1610
|
+
this._errHandler.sync(this);
|
|
1611
|
+
_la = this._input.LA(1);
|
|
1612
|
+
}
|
|
1613
|
+
} catch (re) {
|
|
1614
|
+
if(re instanceof antlr4.error.RecognitionException) {
|
|
1615
|
+
localctx.exception = re;
|
|
1616
|
+
this._errHandler.reportError(this, re);
|
|
1617
|
+
this._errHandler.recover(this, re);
|
|
1618
|
+
} else {
|
|
1619
|
+
throw re;
|
|
1620
|
+
}
|
|
1621
|
+
} finally {
|
|
1622
|
+
this.exitRule();
|
|
1623
|
+
}
|
|
1624
|
+
return localctx;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
BrettParser.EOF = antlr4.Token.EOF;
|
|
1631
|
+
BrettParser.T__0 = 1;
|
|
1632
|
+
BrettParser.T__1 = 2;
|
|
1633
|
+
BrettParser.T__2 = 3;
|
|
1634
|
+
BrettParser.T__3 = 4;
|
|
1635
|
+
BrettParser.T__4 = 5;
|
|
1636
|
+
BrettParser.T__5 = 6;
|
|
1637
|
+
BrettParser.T__6 = 7;
|
|
1638
|
+
BrettParser.T__7 = 8;
|
|
1639
|
+
BrettParser.T__8 = 9;
|
|
1640
|
+
BrettParser.T__9 = 10;
|
|
1641
|
+
BrettParser.LET = 11;
|
|
1642
|
+
BrettParser.CONST = 12;
|
|
1643
|
+
BrettParser.DEF = 13;
|
|
1644
|
+
BrettParser.IF = 14;
|
|
1645
|
+
BrettParser.ELSE = 15;
|
|
1646
|
+
BrettParser.WHILE = 16;
|
|
1647
|
+
BrettParser.FOR = 17;
|
|
1648
|
+
BrettParser.DO = 18;
|
|
1649
|
+
BrettParser.TRY = 19;
|
|
1650
|
+
BrettParser.CATCH = 20;
|
|
1651
|
+
BrettParser.FINALLY = 21;
|
|
1652
|
+
BrettParser.BREAK = 22;
|
|
1653
|
+
BrettParser.CONTINUE = 23;
|
|
1654
|
+
BrettParser.NEW = 24;
|
|
1655
|
+
BrettParser.VOID = 25;
|
|
1656
|
+
BrettParser.SWITCH = 26;
|
|
1657
|
+
BrettParser.CASE = 27;
|
|
1658
|
+
BrettParser.DEFAULT = 28;
|
|
1659
|
+
BrettParser.RETURN = 29;
|
|
1660
|
+
BrettParser.NUMBER = 30;
|
|
1661
|
+
BrettParser.STRING = 31;
|
|
1662
|
+
BrettParser.EQ = 32;
|
|
1663
|
+
BrettParser.NEQ = 33;
|
|
1664
|
+
BrettParser.LE = 34;
|
|
1665
|
+
BrettParser.GE = 35;
|
|
1666
|
+
BrettParser.LT = 36;
|
|
1667
|
+
BrettParser.GT = 37;
|
|
1668
|
+
BrettParser.PLUS = 38;
|
|
1669
|
+
BrettParser.MINUS = 39;
|
|
1670
|
+
BrettParser.STAR = 40;
|
|
1671
|
+
BrettParser.SLASH = 41;
|
|
1672
|
+
BrettParser.ASSIGN = 42;
|
|
1673
|
+
BrettParser.SEMI = 43;
|
|
1674
|
+
BrettParser.COLON = 44;
|
|
1675
|
+
BrettParser.COMMA = 45;
|
|
1676
|
+
BrettParser.DOT = 46;
|
|
1677
|
+
BrettParser.LPAREN = 47;
|
|
1678
|
+
BrettParser.RPAREN = 48;
|
|
1679
|
+
BrettParser.LBRACE = 49;
|
|
1680
|
+
BrettParser.RBRACE = 50;
|
|
1681
|
+
BrettParser.LBRACK = 51;
|
|
1682
|
+
BrettParser.RBRACK = 52;
|
|
1683
|
+
BrettParser.ARROW = 53;
|
|
1684
|
+
BrettParser.IDENTIFIER = 54;
|
|
1685
|
+
BrettParser.WS = 55;
|
|
1686
|
+
BrettParser.LINE_COMMENT = 56;
|
|
1687
|
+
BrettParser.BLOCK_COMMENT = 57;
|
|
1688
|
+
|
|
1689
|
+
BrettParser.RULE_program = 0;
|
|
1690
|
+
BrettParser.RULE_statement = 1;
|
|
1691
|
+
BrettParser.RULE_block = 2;
|
|
1692
|
+
BrettParser.RULE_variableDeclaration = 3;
|
|
1693
|
+
BrettParser.RULE_ifStatement = 4;
|
|
1694
|
+
BrettParser.RULE_whileStatement = 5;
|
|
1695
|
+
BrettParser.RULE_doWhileStatement = 6;
|
|
1696
|
+
BrettParser.RULE_forStatement = 7;
|
|
1697
|
+
BrettParser.RULE_switchStatement = 8;
|
|
1698
|
+
BrettParser.RULE_switchCase = 9;
|
|
1699
|
+
BrettParser.RULE_defaultCase = 10;
|
|
1700
|
+
BrettParser.RULE_returnStatement = 11;
|
|
1701
|
+
BrettParser.RULE_breakStatement = 12;
|
|
1702
|
+
BrettParser.RULE_continueStatement = 13;
|
|
1703
|
+
BrettParser.RULE_expressionStatement = 14;
|
|
1704
|
+
BrettParser.RULE_functionDeclaration = 15;
|
|
1705
|
+
BrettParser.RULE_parameterList = 16;
|
|
1706
|
+
BrettParser.RULE_parameter = 17;
|
|
1707
|
+
BrettParser.RULE_type = 18;
|
|
1708
|
+
BrettParser.RULE_baseType = 19;
|
|
1709
|
+
BrettParser.RULE_tryCatchStatement = 20;
|
|
1710
|
+
BrettParser.RULE_expression = 21;
|
|
1711
|
+
BrettParser.RULE_primary = 22;
|
|
1712
|
+
BrettParser.RULE_arrayLiteral = 23;
|
|
1713
|
+
BrettParser.RULE_objectLiteral = 24;
|
|
1714
|
+
BrettParser.RULE_property = 25;
|
|
1715
|
+
BrettParser.RULE_argList = 26;
|
|
1716
|
+
|
|
1717
|
+
class ProgramContext extends antlr4.ParserRuleContext {
|
|
1718
|
+
|
|
1719
|
+
constructor(parser, parent, invokingState) {
|
|
1720
|
+
if(parent===undefined) {
|
|
1721
|
+
parent = null;
|
|
1722
|
+
}
|
|
1723
|
+
if(invokingState===undefined || invokingState===null) {
|
|
1724
|
+
invokingState = -1;
|
|
1725
|
+
}
|
|
1726
|
+
super(parent, invokingState);
|
|
1727
|
+
this.parser = parser;
|
|
1728
|
+
this.ruleIndex = BrettParser.RULE_program;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
EOF() {
|
|
1732
|
+
return this.getToken(BrettParser.EOF, 0);
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
statement = function(i) {
|
|
1736
|
+
if(i===undefined) {
|
|
1737
|
+
i = null;
|
|
1738
|
+
}
|
|
1739
|
+
if(i===null) {
|
|
1740
|
+
return this.getTypedRuleContexts(StatementContext);
|
|
1741
|
+
} else {
|
|
1742
|
+
return this.getTypedRuleContext(StatementContext,i);
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
|
|
1746
|
+
enterRule(listener) {
|
|
1747
|
+
if(listener instanceof BrettListener ) {
|
|
1748
|
+
listener.enterProgram(this);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
exitRule(listener) {
|
|
1753
|
+
if(listener instanceof BrettListener ) {
|
|
1754
|
+
listener.exitProgram(this);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
accept(visitor) {
|
|
1759
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
1760
|
+
return visitor.visitProgram(this);
|
|
1761
|
+
} else {
|
|
1762
|
+
return visitor.visitChildren(this);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
class StatementContext extends antlr4.ParserRuleContext {
|
|
1772
|
+
|
|
1773
|
+
constructor(parser, parent, invokingState) {
|
|
1774
|
+
if(parent===undefined) {
|
|
1775
|
+
parent = null;
|
|
1776
|
+
}
|
|
1777
|
+
if(invokingState===undefined || invokingState===null) {
|
|
1778
|
+
invokingState = -1;
|
|
1779
|
+
}
|
|
1780
|
+
super(parent, invokingState);
|
|
1781
|
+
this.parser = parser;
|
|
1782
|
+
this.ruleIndex = BrettParser.RULE_statement;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
variableDeclaration() {
|
|
1786
|
+
return this.getTypedRuleContext(VariableDeclarationContext,0);
|
|
1787
|
+
};
|
|
1788
|
+
|
|
1789
|
+
functionDeclaration() {
|
|
1790
|
+
return this.getTypedRuleContext(FunctionDeclarationContext,0);
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
ifStatement() {
|
|
1794
|
+
return this.getTypedRuleContext(IfStatementContext,0);
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
whileStatement() {
|
|
1798
|
+
return this.getTypedRuleContext(WhileStatementContext,0);
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
forStatement() {
|
|
1802
|
+
return this.getTypedRuleContext(ForStatementContext,0);
|
|
1803
|
+
};
|
|
1804
|
+
|
|
1805
|
+
switchStatement() {
|
|
1806
|
+
return this.getTypedRuleContext(SwitchStatementContext,0);
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
returnStatement() {
|
|
1810
|
+
return this.getTypedRuleContext(ReturnStatementContext,0);
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
expressionStatement() {
|
|
1814
|
+
return this.getTypedRuleContext(ExpressionStatementContext,0);
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
block() {
|
|
1818
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
1819
|
+
};
|
|
1820
|
+
|
|
1821
|
+
breakStatement() {
|
|
1822
|
+
return this.getTypedRuleContext(BreakStatementContext,0);
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
continueStatement() {
|
|
1826
|
+
return this.getTypedRuleContext(ContinueStatementContext,0);
|
|
1827
|
+
};
|
|
1828
|
+
|
|
1829
|
+
doWhileStatement() {
|
|
1830
|
+
return this.getTypedRuleContext(DoWhileStatementContext,0);
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
tryCatchStatement() {
|
|
1834
|
+
return this.getTypedRuleContext(TryCatchStatementContext,0);
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
enterRule(listener) {
|
|
1838
|
+
if(listener instanceof BrettListener ) {
|
|
1839
|
+
listener.enterStatement(this);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
exitRule(listener) {
|
|
1844
|
+
if(listener instanceof BrettListener ) {
|
|
1845
|
+
listener.exitStatement(this);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
accept(visitor) {
|
|
1850
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
1851
|
+
return visitor.visitStatement(this);
|
|
1852
|
+
} else {
|
|
1853
|
+
return visitor.visitChildren(this);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
class BlockContext extends antlr4.ParserRuleContext {
|
|
1863
|
+
|
|
1864
|
+
constructor(parser, parent, invokingState) {
|
|
1865
|
+
if(parent===undefined) {
|
|
1866
|
+
parent = null;
|
|
1867
|
+
}
|
|
1868
|
+
if(invokingState===undefined || invokingState===null) {
|
|
1869
|
+
invokingState = -1;
|
|
1870
|
+
}
|
|
1871
|
+
super(parent, invokingState);
|
|
1872
|
+
this.parser = parser;
|
|
1873
|
+
this.ruleIndex = BrettParser.RULE_block;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
LBRACE() {
|
|
1877
|
+
return this.getToken(BrettParser.LBRACE, 0);
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
RBRACE() {
|
|
1881
|
+
return this.getToken(BrettParser.RBRACE, 0);
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
statement = function(i) {
|
|
1885
|
+
if(i===undefined) {
|
|
1886
|
+
i = null;
|
|
1887
|
+
}
|
|
1888
|
+
if(i===null) {
|
|
1889
|
+
return this.getTypedRuleContexts(StatementContext);
|
|
1890
|
+
} else {
|
|
1891
|
+
return this.getTypedRuleContext(StatementContext,i);
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1895
|
+
enterRule(listener) {
|
|
1896
|
+
if(listener instanceof BrettListener ) {
|
|
1897
|
+
listener.enterBlock(this);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
exitRule(listener) {
|
|
1902
|
+
if(listener instanceof BrettListener ) {
|
|
1903
|
+
listener.exitBlock(this);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
accept(visitor) {
|
|
1908
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
1909
|
+
return visitor.visitBlock(this);
|
|
1910
|
+
} else {
|
|
1911
|
+
return visitor.visitChildren(this);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
|
|
1919
|
+
|
|
1920
|
+
class VariableDeclarationContext extends antlr4.ParserRuleContext {
|
|
1921
|
+
|
|
1922
|
+
constructor(parser, parent, invokingState) {
|
|
1923
|
+
if(parent===undefined) {
|
|
1924
|
+
parent = null;
|
|
1925
|
+
}
|
|
1926
|
+
if(invokingState===undefined || invokingState===null) {
|
|
1927
|
+
invokingState = -1;
|
|
1928
|
+
}
|
|
1929
|
+
super(parent, invokingState);
|
|
1930
|
+
this.parser = parser;
|
|
1931
|
+
this.ruleIndex = BrettParser.RULE_variableDeclaration;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
LET() {
|
|
1935
|
+
return this.getToken(BrettParser.LET, 0);
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1938
|
+
IDENTIFIER() {
|
|
1939
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
1940
|
+
};
|
|
1941
|
+
|
|
1942
|
+
SEMI() {
|
|
1943
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1946
|
+
COLON() {
|
|
1947
|
+
return this.getToken(BrettParser.COLON, 0);
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
type() {
|
|
1951
|
+
return this.getTypedRuleContext(TypeContext,0);
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
ASSIGN() {
|
|
1955
|
+
return this.getToken(BrettParser.ASSIGN, 0);
|
|
1956
|
+
};
|
|
1957
|
+
|
|
1958
|
+
expression() {
|
|
1959
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
CONST() {
|
|
1963
|
+
return this.getToken(BrettParser.CONST, 0);
|
|
1964
|
+
};
|
|
1965
|
+
|
|
1966
|
+
enterRule(listener) {
|
|
1967
|
+
if(listener instanceof BrettListener ) {
|
|
1968
|
+
listener.enterVariableDeclaration(this);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
exitRule(listener) {
|
|
1973
|
+
if(listener instanceof BrettListener ) {
|
|
1974
|
+
listener.exitVariableDeclaration(this);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
accept(visitor) {
|
|
1979
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
1980
|
+
return visitor.visitVariableDeclaration(this);
|
|
1981
|
+
} else {
|
|
1982
|
+
return visitor.visitChildren(this);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
class IfStatementContext extends antlr4.ParserRuleContext {
|
|
1992
|
+
|
|
1993
|
+
constructor(parser, parent, invokingState) {
|
|
1994
|
+
if(parent===undefined) {
|
|
1995
|
+
parent = null;
|
|
1996
|
+
}
|
|
1997
|
+
if(invokingState===undefined || invokingState===null) {
|
|
1998
|
+
invokingState = -1;
|
|
1999
|
+
}
|
|
2000
|
+
super(parent, invokingState);
|
|
2001
|
+
this.parser = parser;
|
|
2002
|
+
this.ruleIndex = BrettParser.RULE_ifStatement;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
IF() {
|
|
2006
|
+
return this.getToken(BrettParser.IF, 0);
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
LPAREN() {
|
|
2010
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
expression() {
|
|
2014
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
RPAREN() {
|
|
2018
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
block = function(i) {
|
|
2022
|
+
if(i===undefined) {
|
|
2023
|
+
i = null;
|
|
2024
|
+
}
|
|
2025
|
+
if(i===null) {
|
|
2026
|
+
return this.getTypedRuleContexts(BlockContext);
|
|
2027
|
+
} else {
|
|
2028
|
+
return this.getTypedRuleContext(BlockContext,i);
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
ELSE() {
|
|
2033
|
+
return this.getToken(BrettParser.ELSE, 0);
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
enterRule(listener) {
|
|
2037
|
+
if(listener instanceof BrettListener ) {
|
|
2038
|
+
listener.enterIfStatement(this);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
exitRule(listener) {
|
|
2043
|
+
if(listener instanceof BrettListener ) {
|
|
2044
|
+
listener.exitIfStatement(this);
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
accept(visitor) {
|
|
2049
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2050
|
+
return visitor.visitIfStatement(this);
|
|
2051
|
+
} else {
|
|
2052
|
+
return visitor.visitChildren(this);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
class WhileStatementContext extends antlr4.ParserRuleContext {
|
|
2062
|
+
|
|
2063
|
+
constructor(parser, parent, invokingState) {
|
|
2064
|
+
if(parent===undefined) {
|
|
2065
|
+
parent = null;
|
|
2066
|
+
}
|
|
2067
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2068
|
+
invokingState = -1;
|
|
2069
|
+
}
|
|
2070
|
+
super(parent, invokingState);
|
|
2071
|
+
this.parser = parser;
|
|
2072
|
+
this.ruleIndex = BrettParser.RULE_whileStatement;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
WHILE() {
|
|
2076
|
+
return this.getToken(BrettParser.WHILE, 0);
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
LPAREN() {
|
|
2080
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
expression() {
|
|
2084
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2085
|
+
};
|
|
2086
|
+
|
|
2087
|
+
RPAREN() {
|
|
2088
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
block() {
|
|
2092
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
enterRule(listener) {
|
|
2096
|
+
if(listener instanceof BrettListener ) {
|
|
2097
|
+
listener.enterWhileStatement(this);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
exitRule(listener) {
|
|
2102
|
+
if(listener instanceof BrettListener ) {
|
|
2103
|
+
listener.exitWhileStatement(this);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
accept(visitor) {
|
|
2108
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2109
|
+
return visitor.visitWhileStatement(this);
|
|
2110
|
+
} else {
|
|
2111
|
+
return visitor.visitChildren(this);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
class DoWhileStatementContext extends antlr4.ParserRuleContext {
|
|
2121
|
+
|
|
2122
|
+
constructor(parser, parent, invokingState) {
|
|
2123
|
+
if(parent===undefined) {
|
|
2124
|
+
parent = null;
|
|
2125
|
+
}
|
|
2126
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2127
|
+
invokingState = -1;
|
|
2128
|
+
}
|
|
2129
|
+
super(parent, invokingState);
|
|
2130
|
+
this.parser = parser;
|
|
2131
|
+
this.ruleIndex = BrettParser.RULE_doWhileStatement;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
DO() {
|
|
2135
|
+
return this.getToken(BrettParser.DO, 0);
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2138
|
+
block() {
|
|
2139
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
WHILE() {
|
|
2143
|
+
return this.getToken(BrettParser.WHILE, 0);
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
LPAREN() {
|
|
2147
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
expression() {
|
|
2151
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2152
|
+
};
|
|
2153
|
+
|
|
2154
|
+
RPAREN() {
|
|
2155
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
SEMI() {
|
|
2159
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2160
|
+
};
|
|
2161
|
+
|
|
2162
|
+
enterRule(listener) {
|
|
2163
|
+
if(listener instanceof BrettListener ) {
|
|
2164
|
+
listener.enterDoWhileStatement(this);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
exitRule(listener) {
|
|
2169
|
+
if(listener instanceof BrettListener ) {
|
|
2170
|
+
listener.exitDoWhileStatement(this);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
accept(visitor) {
|
|
2175
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2176
|
+
return visitor.visitDoWhileStatement(this);
|
|
2177
|
+
} else {
|
|
2178
|
+
return visitor.visitChildren(this);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
|
|
2187
|
+
class ForStatementContext extends antlr4.ParserRuleContext {
|
|
2188
|
+
|
|
2189
|
+
constructor(parser, parent, invokingState) {
|
|
2190
|
+
if(parent===undefined) {
|
|
2191
|
+
parent = null;
|
|
2192
|
+
}
|
|
2193
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2194
|
+
invokingState = -1;
|
|
2195
|
+
}
|
|
2196
|
+
super(parent, invokingState);
|
|
2197
|
+
this.parser = parser;
|
|
2198
|
+
this.ruleIndex = BrettParser.RULE_forStatement;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
FOR() {
|
|
2202
|
+
return this.getToken(BrettParser.FOR, 0);
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
LPAREN() {
|
|
2206
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
SEMI() {
|
|
2210
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
RPAREN() {
|
|
2214
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2215
|
+
};
|
|
2216
|
+
|
|
2217
|
+
block() {
|
|
2218
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
variableDeclaration() {
|
|
2222
|
+
return this.getTypedRuleContext(VariableDeclarationContext,0);
|
|
2223
|
+
};
|
|
2224
|
+
|
|
2225
|
+
expressionStatement() {
|
|
2226
|
+
return this.getTypedRuleContext(ExpressionStatementContext,0);
|
|
2227
|
+
};
|
|
2228
|
+
|
|
2229
|
+
expression = function(i) {
|
|
2230
|
+
if(i===undefined) {
|
|
2231
|
+
i = null;
|
|
2232
|
+
}
|
|
2233
|
+
if(i===null) {
|
|
2234
|
+
return this.getTypedRuleContexts(ExpressionContext);
|
|
2235
|
+
} else {
|
|
2236
|
+
return this.getTypedRuleContext(ExpressionContext,i);
|
|
2237
|
+
}
|
|
2238
|
+
};
|
|
2239
|
+
|
|
2240
|
+
enterRule(listener) {
|
|
2241
|
+
if(listener instanceof BrettListener ) {
|
|
2242
|
+
listener.enterForStatement(this);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
exitRule(listener) {
|
|
2247
|
+
if(listener instanceof BrettListener ) {
|
|
2248
|
+
listener.exitForStatement(this);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
accept(visitor) {
|
|
2253
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2254
|
+
return visitor.visitForStatement(this);
|
|
2255
|
+
} else {
|
|
2256
|
+
return visitor.visitChildren(this);
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
|
|
2265
|
+
class SwitchStatementContext extends antlr4.ParserRuleContext {
|
|
2266
|
+
|
|
2267
|
+
constructor(parser, parent, invokingState) {
|
|
2268
|
+
if(parent===undefined) {
|
|
2269
|
+
parent = null;
|
|
2270
|
+
}
|
|
2271
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2272
|
+
invokingState = -1;
|
|
2273
|
+
}
|
|
2274
|
+
super(parent, invokingState);
|
|
2275
|
+
this.parser = parser;
|
|
2276
|
+
this.ruleIndex = BrettParser.RULE_switchStatement;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
SWITCH() {
|
|
2280
|
+
return this.getToken(BrettParser.SWITCH, 0);
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2283
|
+
LBRACE() {
|
|
2284
|
+
return this.getToken(BrettParser.LBRACE, 0);
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
RBRACE() {
|
|
2288
|
+
return this.getToken(BrettParser.RBRACE, 0);
|
|
2289
|
+
};
|
|
2290
|
+
|
|
2291
|
+
switchCase = function(i) {
|
|
2292
|
+
if(i===undefined) {
|
|
2293
|
+
i = null;
|
|
2294
|
+
}
|
|
2295
|
+
if(i===null) {
|
|
2296
|
+
return this.getTypedRuleContexts(SwitchCaseContext);
|
|
2297
|
+
} else {
|
|
2298
|
+
return this.getTypedRuleContext(SwitchCaseContext,i);
|
|
2299
|
+
}
|
|
2300
|
+
};
|
|
2301
|
+
|
|
2302
|
+
defaultCase() {
|
|
2303
|
+
return this.getTypedRuleContext(DefaultCaseContext,0);
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2306
|
+
enterRule(listener) {
|
|
2307
|
+
if(listener instanceof BrettListener ) {
|
|
2308
|
+
listener.enterSwitchStatement(this);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
exitRule(listener) {
|
|
2313
|
+
if(listener instanceof BrettListener ) {
|
|
2314
|
+
listener.exitSwitchStatement(this);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
accept(visitor) {
|
|
2319
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2320
|
+
return visitor.visitSwitchStatement(this);
|
|
2321
|
+
} else {
|
|
2322
|
+
return visitor.visitChildren(this);
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
|
|
2331
|
+
class SwitchCaseContext extends antlr4.ParserRuleContext {
|
|
2332
|
+
|
|
2333
|
+
constructor(parser, parent, invokingState) {
|
|
2334
|
+
if(parent===undefined) {
|
|
2335
|
+
parent = null;
|
|
2336
|
+
}
|
|
2337
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2338
|
+
invokingState = -1;
|
|
2339
|
+
}
|
|
2340
|
+
super(parent, invokingState);
|
|
2341
|
+
this.parser = parser;
|
|
2342
|
+
this.ruleIndex = BrettParser.RULE_switchCase;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
CASE() {
|
|
2346
|
+
return this.getToken(BrettParser.CASE, 0);
|
|
2347
|
+
};
|
|
2348
|
+
|
|
2349
|
+
expression() {
|
|
2350
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2351
|
+
};
|
|
2352
|
+
|
|
2353
|
+
ARROW() {
|
|
2354
|
+
return this.getToken(BrettParser.ARROW, 0);
|
|
2355
|
+
};
|
|
2356
|
+
|
|
2357
|
+
block() {
|
|
2358
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2359
|
+
};
|
|
2360
|
+
|
|
2361
|
+
enterRule(listener) {
|
|
2362
|
+
if(listener instanceof BrettListener ) {
|
|
2363
|
+
listener.enterSwitchCase(this);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
exitRule(listener) {
|
|
2368
|
+
if(listener instanceof BrettListener ) {
|
|
2369
|
+
listener.exitSwitchCase(this);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
accept(visitor) {
|
|
2374
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2375
|
+
return visitor.visitSwitchCase(this);
|
|
2376
|
+
} else {
|
|
2377
|
+
return visitor.visitChildren(this);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
class DefaultCaseContext extends antlr4.ParserRuleContext {
|
|
2387
|
+
|
|
2388
|
+
constructor(parser, parent, invokingState) {
|
|
2389
|
+
if(parent===undefined) {
|
|
2390
|
+
parent = null;
|
|
2391
|
+
}
|
|
2392
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2393
|
+
invokingState = -1;
|
|
2394
|
+
}
|
|
2395
|
+
super(parent, invokingState);
|
|
2396
|
+
this.parser = parser;
|
|
2397
|
+
this.ruleIndex = BrettParser.RULE_defaultCase;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
DEFAULT() {
|
|
2401
|
+
return this.getToken(BrettParser.DEFAULT, 0);
|
|
2402
|
+
};
|
|
2403
|
+
|
|
2404
|
+
ARROW() {
|
|
2405
|
+
return this.getToken(BrettParser.ARROW, 0);
|
|
2406
|
+
};
|
|
2407
|
+
|
|
2408
|
+
block() {
|
|
2409
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
enterRule(listener) {
|
|
2413
|
+
if(listener instanceof BrettListener ) {
|
|
2414
|
+
listener.enterDefaultCase(this);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
exitRule(listener) {
|
|
2419
|
+
if(listener instanceof BrettListener ) {
|
|
2420
|
+
listener.exitDefaultCase(this);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
accept(visitor) {
|
|
2425
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2426
|
+
return visitor.visitDefaultCase(this);
|
|
2427
|
+
} else {
|
|
2428
|
+
return visitor.visitChildren(this);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
class ReturnStatementContext extends antlr4.ParserRuleContext {
|
|
2438
|
+
|
|
2439
|
+
constructor(parser, parent, invokingState) {
|
|
2440
|
+
if(parent===undefined) {
|
|
2441
|
+
parent = null;
|
|
2442
|
+
}
|
|
2443
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2444
|
+
invokingState = -1;
|
|
2445
|
+
}
|
|
2446
|
+
super(parent, invokingState);
|
|
2447
|
+
this.parser = parser;
|
|
2448
|
+
this.ruleIndex = BrettParser.RULE_returnStatement;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
RETURN() {
|
|
2452
|
+
return this.getToken(BrettParser.RETURN, 0);
|
|
2453
|
+
};
|
|
2454
|
+
|
|
2455
|
+
SEMI() {
|
|
2456
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2457
|
+
};
|
|
2458
|
+
|
|
2459
|
+
expression() {
|
|
2460
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2461
|
+
};
|
|
2462
|
+
|
|
2463
|
+
enterRule(listener) {
|
|
2464
|
+
if(listener instanceof BrettListener ) {
|
|
2465
|
+
listener.enterReturnStatement(this);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
exitRule(listener) {
|
|
2470
|
+
if(listener instanceof BrettListener ) {
|
|
2471
|
+
listener.exitReturnStatement(this);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
accept(visitor) {
|
|
2476
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2477
|
+
return visitor.visitReturnStatement(this);
|
|
2478
|
+
} else {
|
|
2479
|
+
return visitor.visitChildren(this);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
class BreakStatementContext extends antlr4.ParserRuleContext {
|
|
2489
|
+
|
|
2490
|
+
constructor(parser, parent, invokingState) {
|
|
2491
|
+
if(parent===undefined) {
|
|
2492
|
+
parent = null;
|
|
2493
|
+
}
|
|
2494
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2495
|
+
invokingState = -1;
|
|
2496
|
+
}
|
|
2497
|
+
super(parent, invokingState);
|
|
2498
|
+
this.parser = parser;
|
|
2499
|
+
this.ruleIndex = BrettParser.RULE_breakStatement;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
BREAK() {
|
|
2503
|
+
return this.getToken(BrettParser.BREAK, 0);
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
SEMI() {
|
|
2507
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2508
|
+
};
|
|
2509
|
+
|
|
2510
|
+
enterRule(listener) {
|
|
2511
|
+
if(listener instanceof BrettListener ) {
|
|
2512
|
+
listener.enterBreakStatement(this);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
exitRule(listener) {
|
|
2517
|
+
if(listener instanceof BrettListener ) {
|
|
2518
|
+
listener.exitBreakStatement(this);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
accept(visitor) {
|
|
2523
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2524
|
+
return visitor.visitBreakStatement(this);
|
|
2525
|
+
} else {
|
|
2526
|
+
return visitor.visitChildren(this);
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
class ContinueStatementContext extends antlr4.ParserRuleContext {
|
|
2536
|
+
|
|
2537
|
+
constructor(parser, parent, invokingState) {
|
|
2538
|
+
if(parent===undefined) {
|
|
2539
|
+
parent = null;
|
|
2540
|
+
}
|
|
2541
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2542
|
+
invokingState = -1;
|
|
2543
|
+
}
|
|
2544
|
+
super(parent, invokingState);
|
|
2545
|
+
this.parser = parser;
|
|
2546
|
+
this.ruleIndex = BrettParser.RULE_continueStatement;
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
CONTINUE() {
|
|
2550
|
+
return this.getToken(BrettParser.CONTINUE, 0);
|
|
2551
|
+
};
|
|
2552
|
+
|
|
2553
|
+
SEMI() {
|
|
2554
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2555
|
+
};
|
|
2556
|
+
|
|
2557
|
+
enterRule(listener) {
|
|
2558
|
+
if(listener instanceof BrettListener ) {
|
|
2559
|
+
listener.enterContinueStatement(this);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
exitRule(listener) {
|
|
2564
|
+
if(listener instanceof BrettListener ) {
|
|
2565
|
+
listener.exitContinueStatement(this);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
accept(visitor) {
|
|
2570
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2571
|
+
return visitor.visitContinueStatement(this);
|
|
2572
|
+
} else {
|
|
2573
|
+
return visitor.visitChildren(this);
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
class ExpressionStatementContext extends antlr4.ParserRuleContext {
|
|
2583
|
+
|
|
2584
|
+
constructor(parser, parent, invokingState) {
|
|
2585
|
+
if(parent===undefined) {
|
|
2586
|
+
parent = null;
|
|
2587
|
+
}
|
|
2588
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2589
|
+
invokingState = -1;
|
|
2590
|
+
}
|
|
2591
|
+
super(parent, invokingState);
|
|
2592
|
+
this.parser = parser;
|
|
2593
|
+
this.ruleIndex = BrettParser.RULE_expressionStatement;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
expression() {
|
|
2597
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
2598
|
+
};
|
|
2599
|
+
|
|
2600
|
+
SEMI() {
|
|
2601
|
+
return this.getToken(BrettParser.SEMI, 0);
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
enterRule(listener) {
|
|
2605
|
+
if(listener instanceof BrettListener ) {
|
|
2606
|
+
listener.enterExpressionStatement(this);
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
exitRule(listener) {
|
|
2611
|
+
if(listener instanceof BrettListener ) {
|
|
2612
|
+
listener.exitExpressionStatement(this);
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
accept(visitor) {
|
|
2617
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2618
|
+
return visitor.visitExpressionStatement(this);
|
|
2619
|
+
} else {
|
|
2620
|
+
return visitor.visitChildren(this);
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
class FunctionDeclarationContext extends antlr4.ParserRuleContext {
|
|
2630
|
+
|
|
2631
|
+
constructor(parser, parent, invokingState) {
|
|
2632
|
+
if(parent===undefined) {
|
|
2633
|
+
parent = null;
|
|
2634
|
+
}
|
|
2635
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2636
|
+
invokingState = -1;
|
|
2637
|
+
}
|
|
2638
|
+
super(parent, invokingState);
|
|
2639
|
+
this.parser = parser;
|
|
2640
|
+
this.ruleIndex = BrettParser.RULE_functionDeclaration;
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
DEF() {
|
|
2644
|
+
return this.getToken(BrettParser.DEF, 0);
|
|
2645
|
+
};
|
|
2646
|
+
|
|
2647
|
+
IDENTIFIER() {
|
|
2648
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
LPAREN() {
|
|
2652
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2653
|
+
};
|
|
2654
|
+
|
|
2655
|
+
RPAREN() {
|
|
2656
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2657
|
+
};
|
|
2658
|
+
|
|
2659
|
+
block() {
|
|
2660
|
+
return this.getTypedRuleContext(BlockContext,0);
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
parameterList() {
|
|
2664
|
+
return this.getTypedRuleContext(ParameterListContext,0);
|
|
2665
|
+
};
|
|
2666
|
+
|
|
2667
|
+
COLON() {
|
|
2668
|
+
return this.getToken(BrettParser.COLON, 0);
|
|
2669
|
+
};
|
|
2670
|
+
|
|
2671
|
+
type() {
|
|
2672
|
+
return this.getTypedRuleContext(TypeContext,0);
|
|
2673
|
+
};
|
|
2674
|
+
|
|
2675
|
+
enterRule(listener) {
|
|
2676
|
+
if(listener instanceof BrettListener ) {
|
|
2677
|
+
listener.enterFunctionDeclaration(this);
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
exitRule(listener) {
|
|
2682
|
+
if(listener instanceof BrettListener ) {
|
|
2683
|
+
listener.exitFunctionDeclaration(this);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
accept(visitor) {
|
|
2688
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2689
|
+
return visitor.visitFunctionDeclaration(this);
|
|
2690
|
+
} else {
|
|
2691
|
+
return visitor.visitChildren(this);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
class ParameterListContext extends antlr4.ParserRuleContext {
|
|
2701
|
+
|
|
2702
|
+
constructor(parser, parent, invokingState) {
|
|
2703
|
+
if(parent===undefined) {
|
|
2704
|
+
parent = null;
|
|
2705
|
+
}
|
|
2706
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2707
|
+
invokingState = -1;
|
|
2708
|
+
}
|
|
2709
|
+
super(parent, invokingState);
|
|
2710
|
+
this.parser = parser;
|
|
2711
|
+
this.ruleIndex = BrettParser.RULE_parameterList;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
parameter = function(i) {
|
|
2715
|
+
if(i===undefined) {
|
|
2716
|
+
i = null;
|
|
2717
|
+
}
|
|
2718
|
+
if(i===null) {
|
|
2719
|
+
return this.getTypedRuleContexts(ParameterContext);
|
|
2720
|
+
} else {
|
|
2721
|
+
return this.getTypedRuleContext(ParameterContext,i);
|
|
2722
|
+
}
|
|
2723
|
+
};
|
|
2724
|
+
|
|
2725
|
+
COMMA = function(i) {
|
|
2726
|
+
if(i===undefined) {
|
|
2727
|
+
i = null;
|
|
2728
|
+
}
|
|
2729
|
+
if(i===null) {
|
|
2730
|
+
return this.getTokens(BrettParser.COMMA);
|
|
2731
|
+
} else {
|
|
2732
|
+
return this.getToken(BrettParser.COMMA, i);
|
|
2733
|
+
}
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2736
|
+
|
|
2737
|
+
enterRule(listener) {
|
|
2738
|
+
if(listener instanceof BrettListener ) {
|
|
2739
|
+
listener.enterParameterList(this);
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
exitRule(listener) {
|
|
2744
|
+
if(listener instanceof BrettListener ) {
|
|
2745
|
+
listener.exitParameterList(this);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
accept(visitor) {
|
|
2750
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2751
|
+
return visitor.visitParameterList(this);
|
|
2752
|
+
} else {
|
|
2753
|
+
return visitor.visitChildren(this);
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
class ParameterContext extends antlr4.ParserRuleContext {
|
|
2763
|
+
|
|
2764
|
+
constructor(parser, parent, invokingState) {
|
|
2765
|
+
if(parent===undefined) {
|
|
2766
|
+
parent = null;
|
|
2767
|
+
}
|
|
2768
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2769
|
+
invokingState = -1;
|
|
2770
|
+
}
|
|
2771
|
+
super(parent, invokingState);
|
|
2772
|
+
this.parser = parser;
|
|
2773
|
+
this.ruleIndex = BrettParser.RULE_parameter;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
IDENTIFIER() {
|
|
2777
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
2778
|
+
};
|
|
2779
|
+
|
|
2780
|
+
COLON() {
|
|
2781
|
+
return this.getToken(BrettParser.COLON, 0);
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
type() {
|
|
2785
|
+
return this.getTypedRuleContext(TypeContext,0);
|
|
2786
|
+
};
|
|
2787
|
+
|
|
2788
|
+
enterRule(listener) {
|
|
2789
|
+
if(listener instanceof BrettListener ) {
|
|
2790
|
+
listener.enterParameter(this);
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
exitRule(listener) {
|
|
2795
|
+
if(listener instanceof BrettListener ) {
|
|
2796
|
+
listener.exitParameter(this);
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
accept(visitor) {
|
|
2801
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2802
|
+
return visitor.visitParameter(this);
|
|
2803
|
+
} else {
|
|
2804
|
+
return visitor.visitChildren(this);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
class TypeContext extends antlr4.ParserRuleContext {
|
|
2814
|
+
|
|
2815
|
+
constructor(parser, parent, invokingState) {
|
|
2816
|
+
if(parent===undefined) {
|
|
2817
|
+
parent = null;
|
|
2818
|
+
}
|
|
2819
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2820
|
+
invokingState = -1;
|
|
2821
|
+
}
|
|
2822
|
+
super(parent, invokingState);
|
|
2823
|
+
this.parser = parser;
|
|
2824
|
+
this.ruleIndex = BrettParser.RULE_type;
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
|
|
2829
|
+
copyFrom(ctx) {
|
|
2830
|
+
super.copyFrom(ctx);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
|
|
2836
|
+
class ArrayTypeContext extends TypeContext {
|
|
2837
|
+
|
|
2838
|
+
constructor(parser, ctx) {
|
|
2839
|
+
super(parser);
|
|
2840
|
+
super.copyFrom(ctx);
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
type() {
|
|
2844
|
+
return this.getTypedRuleContext(TypeContext,0);
|
|
2845
|
+
};
|
|
2846
|
+
|
|
2847
|
+
enterRule(listener) {
|
|
2848
|
+
if(listener instanceof BrettListener ) {
|
|
2849
|
+
listener.enterArrayType(this);
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
exitRule(listener) {
|
|
2854
|
+
if(listener instanceof BrettListener ) {
|
|
2855
|
+
listener.exitArrayType(this);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
accept(visitor) {
|
|
2860
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2861
|
+
return visitor.visitArrayType(this);
|
|
2862
|
+
} else {
|
|
2863
|
+
return visitor.visitChildren(this);
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
BrettParser.ArrayTypeContext = ArrayTypeContext;
|
|
2871
|
+
|
|
2872
|
+
class SimpleTypeContext extends TypeContext {
|
|
2873
|
+
|
|
2874
|
+
constructor(parser, ctx) {
|
|
2875
|
+
super(parser);
|
|
2876
|
+
super.copyFrom(ctx);
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
baseType() {
|
|
2880
|
+
return this.getTypedRuleContext(BaseTypeContext,0);
|
|
2881
|
+
};
|
|
2882
|
+
|
|
2883
|
+
enterRule(listener) {
|
|
2884
|
+
if(listener instanceof BrettListener ) {
|
|
2885
|
+
listener.enterSimpleType(this);
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
exitRule(listener) {
|
|
2890
|
+
if(listener instanceof BrettListener ) {
|
|
2891
|
+
listener.exitSimpleType(this);
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
accept(visitor) {
|
|
2896
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2897
|
+
return visitor.visitSimpleType(this);
|
|
2898
|
+
} else {
|
|
2899
|
+
return visitor.visitChildren(this);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
BrettParser.SimpleTypeContext = SimpleTypeContext;
|
|
2907
|
+
|
|
2908
|
+
class BaseTypeContext extends antlr4.ParserRuleContext {
|
|
2909
|
+
|
|
2910
|
+
constructor(parser, parent, invokingState) {
|
|
2911
|
+
if(parent===undefined) {
|
|
2912
|
+
parent = null;
|
|
2913
|
+
}
|
|
2914
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2915
|
+
invokingState = -1;
|
|
2916
|
+
}
|
|
2917
|
+
super(parent, invokingState);
|
|
2918
|
+
this.parser = parser;
|
|
2919
|
+
this.ruleIndex = BrettParser.RULE_baseType;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
VOID() {
|
|
2923
|
+
return this.getToken(BrettParser.VOID, 0);
|
|
2924
|
+
};
|
|
2925
|
+
|
|
2926
|
+
IDENTIFIER() {
|
|
2927
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
2928
|
+
};
|
|
2929
|
+
|
|
2930
|
+
enterRule(listener) {
|
|
2931
|
+
if(listener instanceof BrettListener ) {
|
|
2932
|
+
listener.enterBaseType(this);
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
exitRule(listener) {
|
|
2937
|
+
if(listener instanceof BrettListener ) {
|
|
2938
|
+
listener.exitBaseType(this);
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
accept(visitor) {
|
|
2943
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
2944
|
+
return visitor.visitBaseType(this);
|
|
2945
|
+
} else {
|
|
2946
|
+
return visitor.visitChildren(this);
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
|
|
2954
|
+
|
|
2955
|
+
class TryCatchStatementContext extends antlr4.ParserRuleContext {
|
|
2956
|
+
|
|
2957
|
+
constructor(parser, parent, invokingState) {
|
|
2958
|
+
if(parent===undefined) {
|
|
2959
|
+
parent = null;
|
|
2960
|
+
}
|
|
2961
|
+
if(invokingState===undefined || invokingState===null) {
|
|
2962
|
+
invokingState = -1;
|
|
2963
|
+
}
|
|
2964
|
+
super(parent, invokingState);
|
|
2965
|
+
this.parser = parser;
|
|
2966
|
+
this.ruleIndex = BrettParser.RULE_tryCatchStatement;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
TRY() {
|
|
2970
|
+
return this.getToken(BrettParser.TRY, 0);
|
|
2971
|
+
};
|
|
2972
|
+
|
|
2973
|
+
block = function(i) {
|
|
2974
|
+
if(i===undefined) {
|
|
2975
|
+
i = null;
|
|
2976
|
+
}
|
|
2977
|
+
if(i===null) {
|
|
2978
|
+
return this.getTypedRuleContexts(BlockContext);
|
|
2979
|
+
} else {
|
|
2980
|
+
return this.getTypedRuleContext(BlockContext,i);
|
|
2981
|
+
}
|
|
2982
|
+
};
|
|
2983
|
+
|
|
2984
|
+
CATCH() {
|
|
2985
|
+
return this.getToken(BrettParser.CATCH, 0);
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2988
|
+
LPAREN() {
|
|
2989
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
2990
|
+
};
|
|
2991
|
+
|
|
2992
|
+
IDENTIFIER() {
|
|
2993
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
2994
|
+
};
|
|
2995
|
+
|
|
2996
|
+
RPAREN() {
|
|
2997
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
COLON() {
|
|
3001
|
+
return this.getToken(BrettParser.COLON, 0);
|
|
3002
|
+
};
|
|
3003
|
+
|
|
3004
|
+
type() {
|
|
3005
|
+
return this.getTypedRuleContext(TypeContext,0);
|
|
3006
|
+
};
|
|
3007
|
+
|
|
3008
|
+
FINALLY() {
|
|
3009
|
+
return this.getToken(BrettParser.FINALLY, 0);
|
|
3010
|
+
};
|
|
3011
|
+
|
|
3012
|
+
enterRule(listener) {
|
|
3013
|
+
if(listener instanceof BrettListener ) {
|
|
3014
|
+
listener.enterTryCatchStatement(this);
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
exitRule(listener) {
|
|
3019
|
+
if(listener instanceof BrettListener ) {
|
|
3020
|
+
listener.exitTryCatchStatement(this);
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
accept(visitor) {
|
|
3025
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3026
|
+
return visitor.visitTryCatchStatement(this);
|
|
3027
|
+
} else {
|
|
3028
|
+
return visitor.visitChildren(this);
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
|
|
3036
|
+
|
|
3037
|
+
class ExpressionContext extends antlr4.ParserRuleContext {
|
|
3038
|
+
|
|
3039
|
+
constructor(parser, parent, invokingState) {
|
|
3040
|
+
if(parent===undefined) {
|
|
3041
|
+
parent = null;
|
|
3042
|
+
}
|
|
3043
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3044
|
+
invokingState = -1;
|
|
3045
|
+
}
|
|
3046
|
+
super(parent, invokingState);
|
|
3047
|
+
this.parser = parser;
|
|
3048
|
+
this.ruleIndex = BrettParser.RULE_expression;
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
|
|
3053
|
+
copyFrom(ctx) {
|
|
3054
|
+
super.copyFrom(ctx);
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
class MemberExpressionContext extends ExpressionContext {
|
|
3061
|
+
|
|
3062
|
+
constructor(parser, ctx) {
|
|
3063
|
+
super(parser);
|
|
3064
|
+
super.copyFrom(ctx);
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
expression() {
|
|
3068
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3069
|
+
};
|
|
3070
|
+
|
|
3071
|
+
DOT() {
|
|
3072
|
+
return this.getToken(BrettParser.DOT, 0);
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
IDENTIFIER() {
|
|
3076
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3077
|
+
};
|
|
3078
|
+
|
|
3079
|
+
enterRule(listener) {
|
|
3080
|
+
if(listener instanceof BrettListener ) {
|
|
3081
|
+
listener.enterMemberExpression(this);
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
exitRule(listener) {
|
|
3086
|
+
if(listener instanceof BrettListener ) {
|
|
3087
|
+
listener.exitMemberExpression(this);
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
accept(visitor) {
|
|
3092
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3093
|
+
return visitor.visitMemberExpression(this);
|
|
3094
|
+
} else {
|
|
3095
|
+
return visitor.visitChildren(this);
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
BrettParser.MemberExpressionContext = MemberExpressionContext;
|
|
3103
|
+
|
|
3104
|
+
class PrimaryExpressionContext extends ExpressionContext {
|
|
3105
|
+
|
|
3106
|
+
constructor(parser, ctx) {
|
|
3107
|
+
super(parser);
|
|
3108
|
+
super.copyFrom(ctx);
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
primary() {
|
|
3112
|
+
return this.getTypedRuleContext(PrimaryContext,0);
|
|
3113
|
+
};
|
|
3114
|
+
|
|
3115
|
+
enterRule(listener) {
|
|
3116
|
+
if(listener instanceof BrettListener ) {
|
|
3117
|
+
listener.enterPrimaryExpression(this);
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
exitRule(listener) {
|
|
3122
|
+
if(listener instanceof BrettListener ) {
|
|
3123
|
+
listener.exitPrimaryExpression(this);
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
accept(visitor) {
|
|
3128
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3129
|
+
return visitor.visitPrimaryExpression(this);
|
|
3130
|
+
} else {
|
|
3131
|
+
return visitor.visitChildren(this);
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
BrettParser.PrimaryExpressionContext = PrimaryExpressionContext;
|
|
3139
|
+
|
|
3140
|
+
class AssignmentExpressionContext extends ExpressionContext {
|
|
3141
|
+
|
|
3142
|
+
constructor(parser, ctx) {
|
|
3143
|
+
super(parser);
|
|
3144
|
+
super.copyFrom(ctx);
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
IDENTIFIER() {
|
|
3148
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3149
|
+
};
|
|
3150
|
+
|
|
3151
|
+
ASSIGN() {
|
|
3152
|
+
return this.getToken(BrettParser.ASSIGN, 0);
|
|
3153
|
+
};
|
|
3154
|
+
|
|
3155
|
+
expression() {
|
|
3156
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3157
|
+
};
|
|
3158
|
+
|
|
3159
|
+
enterRule(listener) {
|
|
3160
|
+
if(listener instanceof BrettListener ) {
|
|
3161
|
+
listener.enterAssignmentExpression(this);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
exitRule(listener) {
|
|
3166
|
+
if(listener instanceof BrettListener ) {
|
|
3167
|
+
listener.exitAssignmentExpression(this);
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
accept(visitor) {
|
|
3172
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3173
|
+
return visitor.visitAssignmentExpression(this);
|
|
3174
|
+
} else {
|
|
3175
|
+
return visitor.visitChildren(this);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
BrettParser.AssignmentExpressionContext = AssignmentExpressionContext;
|
|
3183
|
+
|
|
3184
|
+
class BinaryExpressionContext extends ExpressionContext {
|
|
3185
|
+
|
|
3186
|
+
constructor(parser, ctx) {
|
|
3187
|
+
super(parser);
|
|
3188
|
+
this.op = null;;
|
|
3189
|
+
super.copyFrom(ctx);
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
expression = function(i) {
|
|
3193
|
+
if(i===undefined) {
|
|
3194
|
+
i = null;
|
|
3195
|
+
}
|
|
3196
|
+
if(i===null) {
|
|
3197
|
+
return this.getTypedRuleContexts(ExpressionContext);
|
|
3198
|
+
} else {
|
|
3199
|
+
return this.getTypedRuleContext(ExpressionContext,i);
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
|
|
3203
|
+
STAR() {
|
|
3204
|
+
return this.getToken(BrettParser.STAR, 0);
|
|
3205
|
+
};
|
|
3206
|
+
|
|
3207
|
+
SLASH() {
|
|
3208
|
+
return this.getToken(BrettParser.SLASH, 0);
|
|
3209
|
+
};
|
|
3210
|
+
|
|
3211
|
+
PLUS() {
|
|
3212
|
+
return this.getToken(BrettParser.PLUS, 0);
|
|
3213
|
+
};
|
|
3214
|
+
|
|
3215
|
+
MINUS() {
|
|
3216
|
+
return this.getToken(BrettParser.MINUS, 0);
|
|
3217
|
+
};
|
|
3218
|
+
|
|
3219
|
+
LT() {
|
|
3220
|
+
return this.getToken(BrettParser.LT, 0);
|
|
3221
|
+
};
|
|
3222
|
+
|
|
3223
|
+
LE() {
|
|
3224
|
+
return this.getToken(BrettParser.LE, 0);
|
|
3225
|
+
};
|
|
3226
|
+
|
|
3227
|
+
GT() {
|
|
3228
|
+
return this.getToken(BrettParser.GT, 0);
|
|
3229
|
+
};
|
|
3230
|
+
|
|
3231
|
+
GE() {
|
|
3232
|
+
return this.getToken(BrettParser.GE, 0);
|
|
3233
|
+
};
|
|
3234
|
+
|
|
3235
|
+
EQ() {
|
|
3236
|
+
return this.getToken(BrettParser.EQ, 0);
|
|
3237
|
+
};
|
|
3238
|
+
|
|
3239
|
+
NEQ() {
|
|
3240
|
+
return this.getToken(BrettParser.NEQ, 0);
|
|
3241
|
+
};
|
|
3242
|
+
|
|
3243
|
+
enterRule(listener) {
|
|
3244
|
+
if(listener instanceof BrettListener ) {
|
|
3245
|
+
listener.enterBinaryExpression(this);
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3249
|
+
exitRule(listener) {
|
|
3250
|
+
if(listener instanceof BrettListener ) {
|
|
3251
|
+
listener.exitBinaryExpression(this);
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
accept(visitor) {
|
|
3256
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3257
|
+
return visitor.visitBinaryExpression(this);
|
|
3258
|
+
} else {
|
|
3259
|
+
return visitor.visitChildren(this);
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
BrettParser.BinaryExpressionContext = BinaryExpressionContext;
|
|
3267
|
+
|
|
3268
|
+
class NewExpressionContext extends ExpressionContext {
|
|
3269
|
+
|
|
3270
|
+
constructor(parser, ctx) {
|
|
3271
|
+
super(parser);
|
|
3272
|
+
super.copyFrom(ctx);
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
NEW() {
|
|
3276
|
+
return this.getToken(BrettParser.NEW, 0);
|
|
3277
|
+
};
|
|
3278
|
+
|
|
3279
|
+
IDENTIFIER() {
|
|
3280
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
LPAREN() {
|
|
3284
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
3285
|
+
};
|
|
3286
|
+
|
|
3287
|
+
RPAREN() {
|
|
3288
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
3289
|
+
};
|
|
3290
|
+
|
|
3291
|
+
argList() {
|
|
3292
|
+
return this.getTypedRuleContext(ArgListContext,0);
|
|
3293
|
+
};
|
|
3294
|
+
|
|
3295
|
+
enterRule(listener) {
|
|
3296
|
+
if(listener instanceof BrettListener ) {
|
|
3297
|
+
listener.enterNewExpression(this);
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
exitRule(listener) {
|
|
3302
|
+
if(listener instanceof BrettListener ) {
|
|
3303
|
+
listener.exitNewExpression(this);
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
accept(visitor) {
|
|
3308
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3309
|
+
return visitor.visitNewExpression(this);
|
|
3310
|
+
} else {
|
|
3311
|
+
return visitor.visitChildren(this);
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
|
|
3315
|
+
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
BrettParser.NewExpressionContext = NewExpressionContext;
|
|
3319
|
+
|
|
3320
|
+
class PreIncrementDecrementContext extends ExpressionContext {
|
|
3321
|
+
|
|
3322
|
+
constructor(parser, ctx) {
|
|
3323
|
+
super(parser);
|
|
3324
|
+
super.copyFrom(ctx);
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
expression() {
|
|
3328
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3329
|
+
};
|
|
3330
|
+
|
|
3331
|
+
enterRule(listener) {
|
|
3332
|
+
if(listener instanceof BrettListener ) {
|
|
3333
|
+
listener.enterPreIncrementDecrement(this);
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
exitRule(listener) {
|
|
3338
|
+
if(listener instanceof BrettListener ) {
|
|
3339
|
+
listener.exitPreIncrementDecrement(this);
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
accept(visitor) {
|
|
3344
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3345
|
+
return visitor.visitPreIncrementDecrement(this);
|
|
3346
|
+
} else {
|
|
3347
|
+
return visitor.visitChildren(this);
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
BrettParser.PreIncrementDecrementContext = PreIncrementDecrementContext;
|
|
3355
|
+
|
|
3356
|
+
class IndexExpressionContext extends ExpressionContext {
|
|
3357
|
+
|
|
3358
|
+
constructor(parser, ctx) {
|
|
3359
|
+
super(parser);
|
|
3360
|
+
super.copyFrom(ctx);
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
expression = function(i) {
|
|
3364
|
+
if(i===undefined) {
|
|
3365
|
+
i = null;
|
|
3366
|
+
}
|
|
3367
|
+
if(i===null) {
|
|
3368
|
+
return this.getTypedRuleContexts(ExpressionContext);
|
|
3369
|
+
} else {
|
|
3370
|
+
return this.getTypedRuleContext(ExpressionContext,i);
|
|
3371
|
+
}
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3374
|
+
LBRACK() {
|
|
3375
|
+
return this.getToken(BrettParser.LBRACK, 0);
|
|
3376
|
+
};
|
|
3377
|
+
|
|
3378
|
+
RBRACK() {
|
|
3379
|
+
return this.getToken(BrettParser.RBRACK, 0);
|
|
3380
|
+
};
|
|
3381
|
+
|
|
3382
|
+
enterRule(listener) {
|
|
3383
|
+
if(listener instanceof BrettListener ) {
|
|
3384
|
+
listener.enterIndexExpression(this);
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
exitRule(listener) {
|
|
3389
|
+
if(listener instanceof BrettListener ) {
|
|
3390
|
+
listener.exitIndexExpression(this);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
accept(visitor) {
|
|
3395
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3396
|
+
return visitor.visitIndexExpression(this);
|
|
3397
|
+
} else {
|
|
3398
|
+
return visitor.visitChildren(this);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
BrettParser.IndexExpressionContext = IndexExpressionContext;
|
|
3406
|
+
|
|
3407
|
+
class PostIncrementDecrementContext extends ExpressionContext {
|
|
3408
|
+
|
|
3409
|
+
constructor(parser, ctx) {
|
|
3410
|
+
super(parser);
|
|
3411
|
+
super.copyFrom(ctx);
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
expression() {
|
|
3415
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3416
|
+
};
|
|
3417
|
+
|
|
3418
|
+
enterRule(listener) {
|
|
3419
|
+
if(listener instanceof BrettListener ) {
|
|
3420
|
+
listener.enterPostIncrementDecrement(this);
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
exitRule(listener) {
|
|
3425
|
+
if(listener instanceof BrettListener ) {
|
|
3426
|
+
listener.exitPostIncrementDecrement(this);
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
accept(visitor) {
|
|
3431
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3432
|
+
return visitor.visitPostIncrementDecrement(this);
|
|
3433
|
+
} else {
|
|
3434
|
+
return visitor.visitChildren(this);
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
BrettParser.PostIncrementDecrementContext = PostIncrementDecrementContext;
|
|
3442
|
+
|
|
3443
|
+
class PrimaryContext extends antlr4.ParserRuleContext {
|
|
3444
|
+
|
|
3445
|
+
constructor(parser, parent, invokingState) {
|
|
3446
|
+
if(parent===undefined) {
|
|
3447
|
+
parent = null;
|
|
3448
|
+
}
|
|
3449
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3450
|
+
invokingState = -1;
|
|
3451
|
+
}
|
|
3452
|
+
super(parent, invokingState);
|
|
3453
|
+
this.parser = parser;
|
|
3454
|
+
this.ruleIndex = BrettParser.RULE_primary;
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
|
|
3458
|
+
|
|
3459
|
+
copyFrom(ctx) {
|
|
3460
|
+
super.copyFrom(ctx);
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
|
|
3466
|
+
class ParenthesizedExpressionContext extends PrimaryContext {
|
|
3467
|
+
|
|
3468
|
+
constructor(parser, ctx) {
|
|
3469
|
+
super(parser);
|
|
3470
|
+
super.copyFrom(ctx);
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
LPAREN() {
|
|
3474
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
3475
|
+
};
|
|
3476
|
+
|
|
3477
|
+
expression() {
|
|
3478
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3479
|
+
};
|
|
3480
|
+
|
|
3481
|
+
RPAREN() {
|
|
3482
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
3483
|
+
};
|
|
3484
|
+
|
|
3485
|
+
enterRule(listener) {
|
|
3486
|
+
if(listener instanceof BrettListener ) {
|
|
3487
|
+
listener.enterParenthesizedExpression(this);
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
|
|
3491
|
+
exitRule(listener) {
|
|
3492
|
+
if(listener instanceof BrettListener ) {
|
|
3493
|
+
listener.exitParenthesizedExpression(this);
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
accept(visitor) {
|
|
3498
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3499
|
+
return visitor.visitParenthesizedExpression(this);
|
|
3500
|
+
} else {
|
|
3501
|
+
return visitor.visitChildren(this);
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
|
|
3505
|
+
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
BrettParser.ParenthesizedExpressionContext = ParenthesizedExpressionContext;
|
|
3509
|
+
|
|
3510
|
+
class ObjectLiteralExpressionContext extends PrimaryContext {
|
|
3511
|
+
|
|
3512
|
+
constructor(parser, ctx) {
|
|
3513
|
+
super(parser);
|
|
3514
|
+
super.copyFrom(ctx);
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
objectLiteral() {
|
|
3518
|
+
return this.getTypedRuleContext(ObjectLiteralContext,0);
|
|
3519
|
+
};
|
|
3520
|
+
|
|
3521
|
+
enterRule(listener) {
|
|
3522
|
+
if(listener instanceof BrettListener ) {
|
|
3523
|
+
listener.enterObjectLiteralExpression(this);
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
exitRule(listener) {
|
|
3528
|
+
if(listener instanceof BrettListener ) {
|
|
3529
|
+
listener.exitObjectLiteralExpression(this);
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
accept(visitor) {
|
|
3534
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3535
|
+
return visitor.visitObjectLiteralExpression(this);
|
|
3536
|
+
} else {
|
|
3537
|
+
return visitor.visitChildren(this);
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
BrettParser.ObjectLiteralExpressionContext = ObjectLiteralExpressionContext;
|
|
3545
|
+
|
|
3546
|
+
class LiteralExpressionContext extends PrimaryContext {
|
|
3547
|
+
|
|
3548
|
+
constructor(parser, ctx) {
|
|
3549
|
+
super(parser);
|
|
3550
|
+
super.copyFrom(ctx);
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
NUMBER() {
|
|
3554
|
+
return this.getToken(BrettParser.NUMBER, 0);
|
|
3555
|
+
};
|
|
3556
|
+
|
|
3557
|
+
STRING() {
|
|
3558
|
+
return this.getToken(BrettParser.STRING, 0);
|
|
3559
|
+
};
|
|
3560
|
+
|
|
3561
|
+
enterRule(listener) {
|
|
3562
|
+
if(listener instanceof BrettListener ) {
|
|
3563
|
+
listener.enterLiteralExpression(this);
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
exitRule(listener) {
|
|
3568
|
+
if(listener instanceof BrettListener ) {
|
|
3569
|
+
listener.exitLiteralExpression(this);
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
accept(visitor) {
|
|
3574
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3575
|
+
return visitor.visitLiteralExpression(this);
|
|
3576
|
+
} else {
|
|
3577
|
+
return visitor.visitChildren(this);
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3581
|
+
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
BrettParser.LiteralExpressionContext = LiteralExpressionContext;
|
|
3585
|
+
|
|
3586
|
+
class ArrayLiteralExpressionContext extends PrimaryContext {
|
|
3587
|
+
|
|
3588
|
+
constructor(parser, ctx) {
|
|
3589
|
+
super(parser);
|
|
3590
|
+
super.copyFrom(ctx);
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
arrayLiteral() {
|
|
3594
|
+
return this.getTypedRuleContext(ArrayLiteralContext,0);
|
|
3595
|
+
};
|
|
3596
|
+
|
|
3597
|
+
enterRule(listener) {
|
|
3598
|
+
if(listener instanceof BrettListener ) {
|
|
3599
|
+
listener.enterArrayLiteralExpression(this);
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
|
|
3603
|
+
exitRule(listener) {
|
|
3604
|
+
if(listener instanceof BrettListener ) {
|
|
3605
|
+
listener.exitArrayLiteralExpression(this);
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3609
|
+
accept(visitor) {
|
|
3610
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3611
|
+
return visitor.visitArrayLiteralExpression(this);
|
|
3612
|
+
} else {
|
|
3613
|
+
return visitor.visitChildren(this);
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
BrettParser.ArrayLiteralExpressionContext = ArrayLiteralExpressionContext;
|
|
3621
|
+
|
|
3622
|
+
class FunctionCallExpressionContext extends PrimaryContext {
|
|
3623
|
+
|
|
3624
|
+
constructor(parser, ctx) {
|
|
3625
|
+
super(parser);
|
|
3626
|
+
super.copyFrom(ctx);
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
IDENTIFIER() {
|
|
3630
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
LPAREN() {
|
|
3634
|
+
return this.getToken(BrettParser.LPAREN, 0);
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
RPAREN() {
|
|
3638
|
+
return this.getToken(BrettParser.RPAREN, 0);
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
argList() {
|
|
3642
|
+
return this.getTypedRuleContext(ArgListContext,0);
|
|
3643
|
+
};
|
|
3644
|
+
|
|
3645
|
+
enterRule(listener) {
|
|
3646
|
+
if(listener instanceof BrettListener ) {
|
|
3647
|
+
listener.enterFunctionCallExpression(this);
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
exitRule(listener) {
|
|
3652
|
+
if(listener instanceof BrettListener ) {
|
|
3653
|
+
listener.exitFunctionCallExpression(this);
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
accept(visitor) {
|
|
3658
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3659
|
+
return visitor.visitFunctionCallExpression(this);
|
|
3660
|
+
} else {
|
|
3661
|
+
return visitor.visitChildren(this);
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
BrettParser.FunctionCallExpressionContext = FunctionCallExpressionContext;
|
|
3669
|
+
|
|
3670
|
+
class IdentifierExpressionContext extends PrimaryContext {
|
|
3671
|
+
|
|
3672
|
+
constructor(parser, ctx) {
|
|
3673
|
+
super(parser);
|
|
3674
|
+
super.copyFrom(ctx);
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
IDENTIFIER() {
|
|
3678
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3679
|
+
};
|
|
3680
|
+
|
|
3681
|
+
enterRule(listener) {
|
|
3682
|
+
if(listener instanceof BrettListener ) {
|
|
3683
|
+
listener.enterIdentifierExpression(this);
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
|
|
3687
|
+
exitRule(listener) {
|
|
3688
|
+
if(listener instanceof BrettListener ) {
|
|
3689
|
+
listener.exitIdentifierExpression(this);
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3693
|
+
accept(visitor) {
|
|
3694
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3695
|
+
return visitor.visitIdentifierExpression(this);
|
|
3696
|
+
} else {
|
|
3697
|
+
return visitor.visitChildren(this);
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3701
|
+
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
BrettParser.IdentifierExpressionContext = IdentifierExpressionContext;
|
|
3705
|
+
|
|
3706
|
+
class ArrayLiteralContext extends antlr4.ParserRuleContext {
|
|
3707
|
+
|
|
3708
|
+
constructor(parser, parent, invokingState) {
|
|
3709
|
+
if(parent===undefined) {
|
|
3710
|
+
parent = null;
|
|
3711
|
+
}
|
|
3712
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3713
|
+
invokingState = -1;
|
|
3714
|
+
}
|
|
3715
|
+
super(parent, invokingState);
|
|
3716
|
+
this.parser = parser;
|
|
3717
|
+
this.ruleIndex = BrettParser.RULE_arrayLiteral;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
LBRACK() {
|
|
3721
|
+
return this.getToken(BrettParser.LBRACK, 0);
|
|
3722
|
+
};
|
|
3723
|
+
|
|
3724
|
+
RBRACK() {
|
|
3725
|
+
return this.getToken(BrettParser.RBRACK, 0);
|
|
3726
|
+
};
|
|
3727
|
+
|
|
3728
|
+
expression = function(i) {
|
|
3729
|
+
if(i===undefined) {
|
|
3730
|
+
i = null;
|
|
3731
|
+
}
|
|
3732
|
+
if(i===null) {
|
|
3733
|
+
return this.getTypedRuleContexts(ExpressionContext);
|
|
3734
|
+
} else {
|
|
3735
|
+
return this.getTypedRuleContext(ExpressionContext,i);
|
|
3736
|
+
}
|
|
3737
|
+
};
|
|
3738
|
+
|
|
3739
|
+
COMMA = function(i) {
|
|
3740
|
+
if(i===undefined) {
|
|
3741
|
+
i = null;
|
|
3742
|
+
}
|
|
3743
|
+
if(i===null) {
|
|
3744
|
+
return this.getTokens(BrettParser.COMMA);
|
|
3745
|
+
} else {
|
|
3746
|
+
return this.getToken(BrettParser.COMMA, i);
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3749
|
+
|
|
3750
|
+
|
|
3751
|
+
enterRule(listener) {
|
|
3752
|
+
if(listener instanceof BrettListener ) {
|
|
3753
|
+
listener.enterArrayLiteral(this);
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
exitRule(listener) {
|
|
3758
|
+
if(listener instanceof BrettListener ) {
|
|
3759
|
+
listener.exitArrayLiteral(this);
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
accept(visitor) {
|
|
3764
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3765
|
+
return visitor.visitArrayLiteral(this);
|
|
3766
|
+
} else {
|
|
3767
|
+
return visitor.visitChildren(this);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
|
|
3775
|
+
|
|
3776
|
+
class ObjectLiteralContext extends antlr4.ParserRuleContext {
|
|
3777
|
+
|
|
3778
|
+
constructor(parser, parent, invokingState) {
|
|
3779
|
+
if(parent===undefined) {
|
|
3780
|
+
parent = null;
|
|
3781
|
+
}
|
|
3782
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3783
|
+
invokingState = -1;
|
|
3784
|
+
}
|
|
3785
|
+
super(parent, invokingState);
|
|
3786
|
+
this.parser = parser;
|
|
3787
|
+
this.ruleIndex = BrettParser.RULE_objectLiteral;
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
LBRACE() {
|
|
3791
|
+
return this.getToken(BrettParser.LBRACE, 0);
|
|
3792
|
+
};
|
|
3793
|
+
|
|
3794
|
+
RBRACE() {
|
|
3795
|
+
return this.getToken(BrettParser.RBRACE, 0);
|
|
3796
|
+
};
|
|
3797
|
+
|
|
3798
|
+
property = function(i) {
|
|
3799
|
+
if(i===undefined) {
|
|
3800
|
+
i = null;
|
|
3801
|
+
}
|
|
3802
|
+
if(i===null) {
|
|
3803
|
+
return this.getTypedRuleContexts(PropertyContext);
|
|
3804
|
+
} else {
|
|
3805
|
+
return this.getTypedRuleContext(PropertyContext,i);
|
|
3806
|
+
}
|
|
3807
|
+
};
|
|
3808
|
+
|
|
3809
|
+
COMMA = function(i) {
|
|
3810
|
+
if(i===undefined) {
|
|
3811
|
+
i = null;
|
|
3812
|
+
}
|
|
3813
|
+
if(i===null) {
|
|
3814
|
+
return this.getTokens(BrettParser.COMMA);
|
|
3815
|
+
} else {
|
|
3816
|
+
return this.getToken(BrettParser.COMMA, i);
|
|
3817
|
+
}
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
|
|
3821
|
+
enterRule(listener) {
|
|
3822
|
+
if(listener instanceof BrettListener ) {
|
|
3823
|
+
listener.enterObjectLiteral(this);
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
exitRule(listener) {
|
|
3828
|
+
if(listener instanceof BrettListener ) {
|
|
3829
|
+
listener.exitObjectLiteral(this);
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
accept(visitor) {
|
|
3834
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3835
|
+
return visitor.visitObjectLiteral(this);
|
|
3836
|
+
} else {
|
|
3837
|
+
return visitor.visitChildren(this);
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
|
|
3841
|
+
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
|
|
3845
|
+
|
|
3846
|
+
class PropertyContext extends antlr4.ParserRuleContext {
|
|
3847
|
+
|
|
3848
|
+
constructor(parser, parent, invokingState) {
|
|
3849
|
+
if(parent===undefined) {
|
|
3850
|
+
parent = null;
|
|
3851
|
+
}
|
|
3852
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3853
|
+
invokingState = -1;
|
|
3854
|
+
}
|
|
3855
|
+
super(parent, invokingState);
|
|
3856
|
+
this.parser = parser;
|
|
3857
|
+
this.ruleIndex = BrettParser.RULE_property;
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3860
|
+
IDENTIFIER() {
|
|
3861
|
+
return this.getToken(BrettParser.IDENTIFIER, 0);
|
|
3862
|
+
};
|
|
3863
|
+
|
|
3864
|
+
COLON() {
|
|
3865
|
+
return this.getToken(BrettParser.COLON, 0);
|
|
3866
|
+
};
|
|
3867
|
+
|
|
3868
|
+
expression() {
|
|
3869
|
+
return this.getTypedRuleContext(ExpressionContext,0);
|
|
3870
|
+
};
|
|
3871
|
+
|
|
3872
|
+
STRING() {
|
|
3873
|
+
return this.getToken(BrettParser.STRING, 0);
|
|
3874
|
+
};
|
|
3875
|
+
|
|
3876
|
+
enterRule(listener) {
|
|
3877
|
+
if(listener instanceof BrettListener ) {
|
|
3878
|
+
listener.enterProperty(this);
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
exitRule(listener) {
|
|
3883
|
+
if(listener instanceof BrettListener ) {
|
|
3884
|
+
listener.exitProperty(this);
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
|
|
3888
|
+
accept(visitor) {
|
|
3889
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3890
|
+
return visitor.visitProperty(this);
|
|
3891
|
+
} else {
|
|
3892
|
+
return visitor.visitChildren(this);
|
|
3893
|
+
}
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
|
|
3900
|
+
|
|
3901
|
+
class ArgListContext extends antlr4.ParserRuleContext {
|
|
3902
|
+
|
|
3903
|
+
constructor(parser, parent, invokingState) {
|
|
3904
|
+
if(parent===undefined) {
|
|
3905
|
+
parent = null;
|
|
3906
|
+
}
|
|
3907
|
+
if(invokingState===undefined || invokingState===null) {
|
|
3908
|
+
invokingState = -1;
|
|
3909
|
+
}
|
|
3910
|
+
super(parent, invokingState);
|
|
3911
|
+
this.parser = parser;
|
|
3912
|
+
this.ruleIndex = BrettParser.RULE_argList;
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
expression = function(i) {
|
|
3916
|
+
if(i===undefined) {
|
|
3917
|
+
i = null;
|
|
3918
|
+
}
|
|
3919
|
+
if(i===null) {
|
|
3920
|
+
return this.getTypedRuleContexts(ExpressionContext);
|
|
3921
|
+
} else {
|
|
3922
|
+
return this.getTypedRuleContext(ExpressionContext,i);
|
|
3923
|
+
}
|
|
3924
|
+
};
|
|
3925
|
+
|
|
3926
|
+
COMMA = function(i) {
|
|
3927
|
+
if(i===undefined) {
|
|
3928
|
+
i = null;
|
|
3929
|
+
}
|
|
3930
|
+
if(i===null) {
|
|
3931
|
+
return this.getTokens(BrettParser.COMMA);
|
|
3932
|
+
} else {
|
|
3933
|
+
return this.getToken(BrettParser.COMMA, i);
|
|
3934
|
+
}
|
|
3935
|
+
};
|
|
3936
|
+
|
|
3937
|
+
|
|
3938
|
+
enterRule(listener) {
|
|
3939
|
+
if(listener instanceof BrettListener ) {
|
|
3940
|
+
listener.enterArgList(this);
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
exitRule(listener) {
|
|
3945
|
+
if(listener instanceof BrettListener ) {
|
|
3946
|
+
listener.exitArgList(this);
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
|
|
3950
|
+
accept(visitor) {
|
|
3951
|
+
if ( visitor instanceof BrettVisitor ) {
|
|
3952
|
+
return visitor.visitArgList(this);
|
|
3953
|
+
} else {
|
|
3954
|
+
return visitor.visitChildren(this);
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
|
|
3958
|
+
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3961
|
+
|
|
3962
|
+
|
|
3963
|
+
|
|
3964
|
+
BrettParser.ProgramContext = ProgramContext;
|
|
3965
|
+
BrettParser.StatementContext = StatementContext;
|
|
3966
|
+
BrettParser.BlockContext = BlockContext;
|
|
3967
|
+
BrettParser.VariableDeclarationContext = VariableDeclarationContext;
|
|
3968
|
+
BrettParser.IfStatementContext = IfStatementContext;
|
|
3969
|
+
BrettParser.WhileStatementContext = WhileStatementContext;
|
|
3970
|
+
BrettParser.DoWhileStatementContext = DoWhileStatementContext;
|
|
3971
|
+
BrettParser.ForStatementContext = ForStatementContext;
|
|
3972
|
+
BrettParser.SwitchStatementContext = SwitchStatementContext;
|
|
3973
|
+
BrettParser.SwitchCaseContext = SwitchCaseContext;
|
|
3974
|
+
BrettParser.DefaultCaseContext = DefaultCaseContext;
|
|
3975
|
+
BrettParser.ReturnStatementContext = ReturnStatementContext;
|
|
3976
|
+
BrettParser.BreakStatementContext = BreakStatementContext;
|
|
3977
|
+
BrettParser.ContinueStatementContext = ContinueStatementContext;
|
|
3978
|
+
BrettParser.ExpressionStatementContext = ExpressionStatementContext;
|
|
3979
|
+
BrettParser.FunctionDeclarationContext = FunctionDeclarationContext;
|
|
3980
|
+
BrettParser.ParameterListContext = ParameterListContext;
|
|
3981
|
+
BrettParser.ParameterContext = ParameterContext;
|
|
3982
|
+
BrettParser.TypeContext = TypeContext;
|
|
3983
|
+
BrettParser.BaseTypeContext = BaseTypeContext;
|
|
3984
|
+
BrettParser.TryCatchStatementContext = TryCatchStatementContext;
|
|
3985
|
+
BrettParser.ExpressionContext = ExpressionContext;
|
|
3986
|
+
BrettParser.PrimaryContext = PrimaryContext;
|
|
3987
|
+
BrettParser.ArrayLiteralContext = ArrayLiteralContext;
|
|
3988
|
+
BrettParser.ObjectLiteralContext = ObjectLiteralContext;
|
|
3989
|
+
BrettParser.PropertyContext = PropertyContext;
|
|
3990
|
+
BrettParser.ArgListContext = ArgListContext;
|