public Branch(LSLAst node, Branch parent) : base(parent) { Node = node; }
public LoopStatement(Branch parent) : base(parent) { }
public Label(Branch parent) : base(parent) { }
public Branch(Branch parent) : base(parent) { }
public Statement(Branch branch) { this.ParentBranch = branch; }
public ReturnStatement(Branch parent) : base(parent) { }
private void methodOut() { EnterRule_methodOut(); EnterRule("methodOut", 11); TraceIn("methodOut", 11); try { DebugEnterRule(GrammarFileName, "methodOut"); DebugLocation(129, 1); try { // Analyze.g:130:2: ( METHOD_DEF ) DebugEnterAlt(1); // Analyze.g:130:4: METHOD_DEF { DebugLocation(130, 4); Match(input,METHOD_DEF,Follow._METHOD_DEF_in_methodOut288); if (state.failed) return; DebugLocation(131, 3); if (state.backtracking == 1) { FunctionBranches.Add((FunctionBranch)currentBranch); currentBranch = null; } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("methodOut", 11); LeaveRule("methodOut", 11); LeaveRule_methodOut(); } DebugLocation(135, 1); } finally { DebugExitRule(GrammarFileName, "methodOut"); } return; }
public IfElseStatement(Branch parent) : base(parent) { IfBranch = new Branch(this); ElseBranch = new Branch(this); }
private void methodDef() { EnterRule_methodDef(); EnterRule("methodDef", 10); TraceIn("methodDef", 10); LSLAst ID1 = default(LSLAst); LSLAst TYPE2 = default(LSLAst); try { DebugEnterRule(GrammarFileName, "methodDef"); DebugLocation(122, 1); try { // Analyze.g:123:2: ( ^( METHOD_DEF ( TYPE )? ID ( . )* ) ) DebugEnterAlt(1); // Analyze.g:123:4: ^( METHOD_DEF ( TYPE )? ID ( . )* ) { DebugLocation(123, 4); DebugLocation(123, 6); Match(input,METHOD_DEF,Follow._METHOD_DEF_in_methodDef264); if (state.failed) return; Match(input, TokenTypes.Down, null); if (state.failed) return; DebugLocation(123, 17); // Analyze.g:123:17: ( TYPE )? int alt3=2; try { DebugEnterSubRule(3); try { DebugEnterDecision(3, false); int LA3_0 = input.LA(1); if ((LA3_0==TYPE)) { alt3 = 1; } } finally { DebugExitDecision(3); } switch (alt3) { case 1: DebugEnterAlt(1); // Analyze.g:123:17: TYPE { DebugLocation(123, 17); TYPE2=(LSLAst)Match(input,TYPE,Follow._TYPE_in_methodDef266); if (state.failed) return; } break; } } finally { DebugExitSubRule(3); } DebugLocation(123, 23); ID1=(LSLAst)Match(input,ID,Follow._ID_in_methodDef269); if (state.failed) return; DebugLocation(123, 26); // Analyze.g:123:26: ( . )* try { DebugEnterSubRule(4); while (true) { int alt4=2; try { DebugEnterDecision(4, false); int LA4_0 = input.LA(1); if (((LA4_0>=ASSIGN_EQ && LA4_0<=95))) { alt4 = 1; } else if ((LA4_0==UP)) { alt4 = 2; } } finally { DebugExitDecision(4); } switch ( alt4 ) { case 1: DebugEnterAlt(1); // Analyze.g:123:26: . { DebugLocation(123, 26); MatchAny(input); if (state.failed) return; } break; default: goto loop4; } } loop4: ; } finally { DebugExitSubRule(4); } Match(input, TokenTypes.Up, null); if (state.failed) return; DebugLocation(124, 3); if (state.backtracking == 1) { currentBranch = new FunctionBranch(ID1, (TYPE2!=null?TYPE2.Text:null)); } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("methodDef", 10); LeaveRule("methodDef", 10); LeaveRule_methodDef(); } DebugLocation(127, 1); } finally { DebugExitRule(GrammarFileName, "methodDef"); } return; }
private void elsePart() { EnterRule_elsePart(); EnterRule("elsePart", 7); TraceIn("elsePart", 7); try { DebugEnterRule(GrammarFileName, "elsePart"); DebugLocation(90, 1); try { // Analyze.g:91:2: ( ^( ELSE_PART . ) ) DebugEnterAlt(1); // Analyze.g:91:4: ^( ELSE_PART . ) { DebugLocation(91, 4); DebugLocation(91, 6); Match(input,ELSE_PART,Follow._ELSE_PART_in_elsePart211); if (state.failed) return; Match(input, TokenTypes.Down, null); if (state.failed) return; DebugLocation(91, 16); MatchAny(input); if (state.failed) return; Match(input, TokenTypes.Up, null); if (state.failed) return; DebugLocation(92, 3); if (state.backtracking == 1) { if (currentBranch != null) { currentBranch = ((IfElseStatement)currentBranch.ParentBranch).ElseBranch; } } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("elsePart", 7); LeaveRule("elsePart", 7); LeaveRule_elsePart(); } DebugLocation(98, 1); } finally { DebugExitRule(GrammarFileName, "elsePart"); } return; }
private void ifElseOut() { EnterRule_ifElseOut(); EnterRule("ifElseOut", 6); TraceIn("ifElseOut", 6); try { DebugEnterRule(GrammarFileName, "ifElseOut"); DebugLocation(80, 1); try { // Analyze.g:81:2: ( IF_STMT ) DebugEnterAlt(1); // Analyze.g:81:4: IF_STMT { DebugLocation(81, 4); Match(input,IF_STMT,Follow._IF_STMT_in_ifElseOut195); if (state.failed) return; DebugLocation(82, 3); if (state.backtracking == 1) { if (currentBranch != null) { currentBranch = currentBranch.ParentBranch.ParentBranch; } } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("ifElseOut", 6); LeaveRule("ifElseOut", 6); LeaveRule_ifElseOut(); } DebugLocation(88, 1); } finally { DebugExitRule(GrammarFileName, "ifElseOut"); } return; }
private void ifElseStmt() { EnterRule_ifElseStmt(); EnterRule("ifElseStmt", 5); TraceIn("ifElseStmt", 5); try { DebugEnterRule(GrammarFileName, "ifElseStmt"); DebugLocation(68, 1); try { // Analyze.g:69:2: ( IF_STMT ) DebugEnterAlt(1); // Analyze.g:69:4: IF_STMT { DebugLocation(69, 4); Match(input,IF_STMT,Follow._IF_STMT_in_ifElseStmt180); if (state.failed) return; DebugLocation(70, 3); if (state.backtracking == 1) { if (currentBranch != null) { IfElseStatement ifelse = new IfElseStatement(currentBranch); currentBranch.SetNextStatement(ifelse); currentBranch = ifelse.IfBranch; } } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("ifElseStmt", 5); LeaveRule("ifElseStmt", 5); LeaveRule_ifElseStmt(); } DebugLocation(78, 1); } finally { DebugExitRule(GrammarFileName, "ifElseStmt"); } return; }
private void loopOut() { EnterRule_loopOut(); EnterRule("loopOut", 4); TraceIn("loopOut", 4); try { DebugEnterRule(GrammarFileName, "loopOut"); DebugLocation(57, 1); try { // Analyze.g:58:2: ( ( WHILE_STMT | FOR_STMT | DO_WHILE_STMT ) ) DebugEnterAlt(1); // Analyze.g:59:3: ( WHILE_STMT | FOR_STMT | DO_WHILE_STMT ) { DebugLocation(59, 3); if (input.LA(1)==DO_WHILE_STMT||input.LA(1)==FOR_STMT||input.LA(1)==WHILE_STMT) { input.Consume(); state.errorRecovery=false;state.failed=false; } else { if (state.backtracking>0) {state.failed=true; return;} MismatchedSetException mse = new MismatchedSetException(null,input); DebugRecognitionException(mse); throw mse; } DebugLocation(60, 3); if (state.backtracking == 1) { if (currentBranch != null) { currentBranch = currentBranch.ParentBranch; } } } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { TraceOut("loopOut", 4); LeaveRule("loopOut", 4); LeaveRule_loopOut(); } DebugLocation(66, 1); } finally { DebugExitRule(GrammarFileName, "loopOut"); } return; }