Esempio n. 1
0
	private AstParserRuleReturnScope<CommonTree, IToken> forEachStatement()
	{
		EnterRule_forEachStatement();
		EnterRule("forEachStatement", 58);
		TraceIn("forEachStatement", 58);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken f = default(IToken);
		IToken EACH185 = default(IToken);
		IToken LPAREN186 = default(IToken);
		IToken RPAREN188 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> forInClause187 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> statement189 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree f_tree = default(CommonTree);
		CommonTree EACH185_tree = default(CommonTree);
		CommonTree LPAREN186_tree = default(CommonTree);
		CommonTree RPAREN188_tree = default(CommonTree);
		RewriteRuleITokenStream stream_FOR=new RewriteRuleITokenStream(adaptor,"token FOR");
		RewriteRuleITokenStream stream_EACH=new RewriteRuleITokenStream(adaptor,"token EACH");
		RewriteRuleITokenStream stream_LPAREN=new RewriteRuleITokenStream(adaptor,"token LPAREN");
		RewriteRuleITokenStream stream_RPAREN=new RewriteRuleITokenStream(adaptor,"token RPAREN");
		RewriteRuleSubtreeStream stream_forInClause=new RewriteRuleSubtreeStream(adaptor,"rule forInClause");
		RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
		try { DebugEnterRule(GrammarFileName, "forEachStatement");
		DebugLocation(491, 1);
		try
		{
			// AS3.g:492:2: (f= FOR EACH LPAREN forInClause RPAREN statement -> ^( FOR_EACH_LOOP $f forInClause statement ) )
			DebugEnterAlt(1);
			// AS3.g:492:4: f= FOR EACH LPAREN forInClause RPAREN statement
			{
			DebugLocation(492, 5);
			f=(IToken)Match(input,FOR,Follow._FOR_in_forEachStatement2672); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_FOR.Add(f);

			DebugLocation(492, 10);
			EACH185=(IToken)Match(input,EACH,Follow._EACH_in_forEachStatement2674); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_EACH.Add(EACH185);

			DebugLocation(493, 3);
			LPAREN186=(IToken)Match(input,LPAREN,Follow._LPAREN_in_forEachStatement2678); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_LPAREN.Add(LPAREN186);

			DebugLocation(494, 3);
			PushFollow(Follow._forInClause_in_forEachStatement2682);
			forInClause187=forInClause();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_forInClause.Add(forInClause187.Tree);
			DebugLocation(495, 3);
			RPAREN188=(IToken)Match(input,RPAREN,Follow._RPAREN_in_forEachStatement2686); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_RPAREN.Add(RPAREN188);

			DebugLocation(496, 3);
			PushFollow(Follow._statement_in_forEachStatement2690);
			statement189=statement();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_statement.Add(statement189.Tree);


			{
			// AST REWRITE
			// elements: f, forInClause, statement
			// token labels: f
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleITokenStream stream_f=new RewriteRuleITokenStream(adaptor,"token f",f);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 497:3: -> ^( FOR_EACH_LOOP $f forInClause statement )
			{
				DebugLocation(497, 6);
				// AS3.g:497:6: ^( FOR_EACH_LOOP $f forInClause statement )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(497, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(FOR_EACH_LOOP, "FOR_EACH_LOOP"), root_1);

				DebugLocation(497, 23);
				adaptor.AddChild(root_1, stream_f.NextNode());
				DebugLocation(497, 25);
				adaptor.AddChild(root_1, stream_forInClause.NextTree());
				DebugLocation(497, 37);
				adaptor.AddChild(root_1, stream_statement.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("forEachStatement", 58);
			LeaveRule("forEachStatement", 58);
			LeaveRule_forEachStatement();
		}
		DebugLocation(498, 1);
		} finally { DebugExitRule(GrammarFileName, "forEachStatement"); }
		return retval;

	}
Esempio n. 2
0
	private AstParserRuleReturnScope<CommonTree, IToken> returnStatement()
	{
		EnterRule_returnStatement();
		EnterRule("returnStatement", 50);
		TraceIn("returnStatement", 50);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken RETURN168 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> s = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> expression169 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree RETURN168_tree = default(CommonTree);
		RewriteRuleITokenStream stream_RETURN=new RewriteRuleITokenStream(adaptor,"token RETURN");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "returnStatement");
		DebugLocation(450, 1);
		try
		{
			// AS3.g:451:2: ( RETURN ( expression )? s= semi -> ^( RETURN_STATEMENT RETURN ( expression )? ) )
			DebugEnterAlt(1);
			// AS3.g:451:4: RETURN ( expression )? s= semi
			{
			DebugLocation(451, 4);
			RETURN168=(IToken)Match(input,RETURN,Follow._RETURN_in_returnStatement2421); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_RETURN.Add(RETURN168);

			DebugLocation(451, 11);
			// AS3.g:451:11: ( expression )?
			int alt39=2;
			try { DebugEnterSubRule(39);
			try { DebugEnterDecision(39, false);
			int LA39_1 = input.LA(1);

			if ((LA39_1==AS||LA39_1==BNOT||(LA39_1>=DEC && LA39_1<=DECIMAL_LITERAL)||(LA39_1>=DYNAMIC && LA39_1<=E4X_ATTRI)||(LA39_1>=FALSE && LA39_1<=FLOAT_LITERAL)||LA39_1==FUNCTION||LA39_1==GET||(LA39_1>=HEX_LITERAL && LA39_1<=IDENT)||LA39_1==INC||(LA39_1>=INTERNAL && LA39_1<=IS)||(LA39_1>=LBRACK && LA39_1<=LCURLY)||LA39_1==LNOT||LA39_1==LPAREN||LA39_1==MINUS||LA39_1==NAMESPACE||LA39_1==NEW||LA39_1==NULL||LA39_1==OCTAL_LITERAL||LA39_1==PLUS||LA39_1==PRIVATE||(LA39_1>=PROTECTED && LA39_1<=PUBLIC)||LA39_1==REGEX_LITERAL||LA39_1==SET||(LA39_1>=STRING_LITERAL_DOUBLE && LA39_1<=SUPER)||LA39_1==TRUE||LA39_1==USE||LA39_1==XML||LA39_1==XML_LITERAL||LA39_1==243||(LA39_1>=255 && LA39_1<=257)))
			{
				alt39 = 1;
			}
			} finally { DebugExitDecision(39); }
			switch (alt39)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:451:11: expression
				{
				DebugLocation(451, 11);
				PushFollow(Follow._expression_in_returnStatement2423);
				expression169=expression();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_expression.Add(expression169.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(39); }

			DebugLocation(451, 24);
			PushFollow(Follow._semi_in_returnStatement2428);
			s=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(s.Tree);


			{
			// AST REWRITE
			// elements: RETURN, expression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 452:9: -> ^( RETURN_STATEMENT RETURN ( expression )? )
			{
				DebugLocation(452, 12);
				// AS3.g:452:12: ^( RETURN_STATEMENT RETURN ( expression )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(452, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(RETURN_STATEMENT, "RETURN_STATEMENT"), root_1);

				DebugLocation(452, 31);
				adaptor.AddChild(root_1, stream_RETURN.NextNode());
				DebugLocation(452, 38);
				// AS3.g:452:38: ( expression )?
				if (stream_expression.HasNext)
				{
					DebugLocation(452, 38);
					adaptor.AddChild(root_1, stream_expression.NextTree());

				}
				stream_expression.Reset();
				DebugLocation(452, 50);
				adaptor.AddChild(root_1, maybeSemi(s));

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("returnStatement", 50);
			LeaveRule("returnStatement", 50);
			LeaveRule_returnStatement();
		}
		DebugLocation(453, 1);
		} finally { DebugExitRule(GrammarFileName, "returnStatement"); }
		return retval;

	}
Esempio n. 3
0
	private AstParserRuleReturnScope<CommonTree, IToken> breakStatement()
	{
		EnterRule_breakStatement();
		EnterRule("breakStatement", 52);
		TraceIn("breakStatement", 52);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken BREAK171 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> s = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree BREAK171_tree = default(CommonTree);
		RewriteRuleITokenStream stream_BREAK=new RewriteRuleITokenStream(adaptor,"token BREAK");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "breakStatement");
		DebugLocation(460, 1);
		try
		{
			// AS3.g:461:2: ( BREAK s= semi -> ^( BREAK_STATEMENT BREAK ) )
			DebugEnterAlt(1);
			// AS3.g:461:4: BREAK s= semi
			{
			DebugLocation(461, 4);
			BREAK171=(IToken)Match(input,BREAK,Follow._BREAK_in_breakStatement2495); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_BREAK.Add(BREAK171);

			DebugLocation(461, 11);
			PushFollow(Follow._semi_in_breakStatement2499);
			s=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(s.Tree);


			{
			// AST REWRITE
			// elements: BREAK
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 462:9: -> ^( BREAK_STATEMENT BREAK )
			{
				DebugLocation(462, 12);
				// AS3.g:462:12: ^( BREAK_STATEMENT BREAK )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(462, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(BREAK_STATEMENT, "BREAK_STATEMENT"), root_1);

				DebugLocation(462, 30);
				adaptor.AddChild(root_1, stream_BREAK.NextNode());
				DebugLocation(462, 36);
				adaptor.AddChild(root_1, maybeSemi(s));

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("breakStatement", 52);
			LeaveRule("breakStatement", 52);
			LeaveRule_breakStatement();
		}
		DebugLocation(463, 1);
		} finally { DebugExitRule(GrammarFileName, "breakStatement"); }
		return retval;

	}
Esempio n. 4
0
	private AstParserRuleReturnScope<CommonTree, IToken> ifStatement()
	{
		EnterRule_ifStatement();
		EnterRule("ifStatement", 44);
		TraceIn("ifStatement", 44);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken IF148 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> condition149 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> statement150 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> elseClause151 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree IF148_tree = default(CommonTree);
		RewriteRuleITokenStream stream_IF=new RewriteRuleITokenStream(adaptor,"token IF");
		RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
		RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
		RewriteRuleSubtreeStream stream_elseClause=new RewriteRuleSubtreeStream(adaptor,"rule elseClause");
		try { DebugEnterRule(GrammarFileName, "ifStatement");
		DebugLocation(417, 1);
		try
		{
			// AS3.g:418:2: ( IF condition statement ( ( ELSE )=> elseClause )? -> ^( IF_STMT IF condition statement ( elseClause )? ) )
			DebugEnterAlt(1);
			// AS3.g:418:4: IF condition statement ( ( ELSE )=> elseClause )?
			{
			DebugLocation(418, 4);
			IF148=(IToken)Match(input,IF,Follow._IF_in_ifStatement2217); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_IF.Add(IF148);

			DebugLocation(418, 7);
			PushFollow(Follow._condition_in_ifStatement2219);
			condition149=condition();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_condition.Add(condition149.Tree);
			DebugLocation(418, 17);
			PushFollow(Follow._statement_in_ifStatement2221);
			statement150=statement();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_statement.Add(statement150.Tree);
			DebugLocation(419, 3);
			// AS3.g:419:3: ( ( ELSE )=> elseClause )?
			int alt35=2;
			try { DebugEnterSubRule(35);
			try { DebugEnterDecision(35, false);
			int LA35_1 = input.LA(1);

			if ((LA35_1==ELSE))
			{
				int LA35_2 = input.LA(2);

				if ((EvaluatePredicate(synpred14_AS3_fragment)))
				{
					alt35 = 1;
				}
			}
			} finally { DebugExitDecision(35); }
			switch (alt35)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:419:4: ( ELSE )=> elseClause
				{
				DebugLocation(419, 12);
				PushFollow(Follow._elseClause_in_ifStatement2230);
				elseClause151=elseClause();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_elseClause.Add(elseClause151.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(35); }



			{
			// AST REWRITE
			// elements: IF, condition, statement, elseClause
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 420:9: -> ^( IF_STMT IF condition statement ( elseClause )? )
			{
				DebugLocation(420, 12);
				// AS3.g:420:12: ^( IF_STMT IF condition statement ( elseClause )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(420, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(IF_STMT, "IF_STMT"), root_1);

				DebugLocation(420, 22);
				adaptor.AddChild(root_1, stream_IF.NextNode());
				DebugLocation(420, 25);
				adaptor.AddChild(root_1, stream_condition.NextTree());
				DebugLocation(420, 35);
				adaptor.AddChild(root_1, stream_statement.NextTree());
				DebugLocation(420, 45);
				// AS3.g:420:45: ( elseClause )?
				if (stream_elseClause.HasNext)
				{
					DebugLocation(420, 45);
					adaptor.AddChild(root_1, stream_elseClause.NextTree());

				}
				stream_elseClause.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("ifStatement", 44);
			LeaveRule("ifStatement", 44);
			LeaveRule_ifStatement();
		}
		DebugLocation(421, 1);
		} finally { DebugExitRule(GrammarFileName, "ifStatement"); }
		return retval;

	}
Esempio n. 5
0
	private AstParserRuleReturnScope<CommonTree, IToken> throwStatement()
	{
		EnterRule_throwStatement();
		EnterRule("throwStatement", 46);
		TraceIn("throwStatement", 46);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken string_literal154 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> s = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> expression155 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree string_literal154_tree = default(CommonTree);
		RewriteRuleITokenStream stream_253=new RewriteRuleITokenStream(adaptor,"token 253");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "throwStatement");
		DebugLocation(428, 1);
		try
		{
			// AS3.g:429:2: ( 'throw' expression s= semi -> ^( THROW_STATEMENT 'throw' expression ) )
			DebugEnterAlt(1);
			// AS3.g:429:4: 'throw' expression s= semi
			{
			DebugLocation(429, 4);
			string_literal154=(IToken)Match(input,253,Follow._253_in_throwStatement2298); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_253.Add(string_literal154);

			DebugLocation(429, 12);
			PushFollow(Follow._expression_in_throwStatement2300);
			expression155=expression();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_expression.Add(expression155.Tree);
			DebugLocation(429, 24);
			PushFollow(Follow._semi_in_throwStatement2304);
			s=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(s.Tree);


			{
			// AST REWRITE
			// elements: 253, expression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 430:9: -> ^( THROW_STATEMENT 'throw' expression )
			{
				DebugLocation(430, 12);
				// AS3.g:430:12: ^( THROW_STATEMENT 'throw' expression )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(430, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(THROW_STATEMENT, "THROW_STATEMENT"), root_1);

				DebugLocation(430, 30);
				adaptor.AddChild(root_1, stream_253.NextNode());
				DebugLocation(430, 38);
				adaptor.AddChild(root_1, stream_expression.NextTree());
				DebugLocation(430, 49);
				adaptor.AddChild(root_1, maybeSemi(s));

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("throwStatement", 46);
			LeaveRule("throwStatement", 46);
			LeaveRule_throwStatement();
		}
		DebugLocation(431, 1);
		} finally { DebugExitRule(GrammarFileName, "throwStatement"); }
		return retval;

	}
Esempio n. 6
0
        private AstParserRuleReturnScope <object, IToken> plain_elem()
        {
            EnterRule_plain_elem();
            EnterRule("plain_elem", 5);
            TraceIn("plain_elem", 5);
            AstParserRuleReturnScope <object, IToken> retval = new AstParserRuleReturnScope <object, IToken>();

            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken i1       = default(IToken);
            IToken i2       = default(IToken);
            IToken al       = default(IToken);
            IToken ID12     = default(IToken);
            IToken FROM13   = default(IToken);
            IToken TO14     = default(IToken);
            IToken ID15     = default(IToken);
            IToken LENGTH16 = default(IToken);

            object i1_tree       = default(object);
            object i2_tree       = default(object);
            object al_tree       = default(object);
            object ID12_tree     = default(object);
            object FROM13_tree   = default(object);
            object TO14_tree     = default(object);
            object ID15_tree     = default(object);
            object LENGTH16_tree = default(object);
            RewriteRuleITokenStream stream_INT         = new RewriteRuleITokenStream(adaptor, "token INT");
            RewriteRuleITokenStream stream_ALIGN_RIGHT = new RewriteRuleITokenStream(adaptor, "token ALIGN_RIGHT");
            RewriteRuleITokenStream stream_ID          = new RewriteRuleITokenStream(adaptor, "token ID");
            RewriteRuleITokenStream stream_FROM        = new RewriteRuleITokenStream(adaptor, "token FROM");
            RewriteRuleITokenStream stream_TO          = new RewriteRuleITokenStream(adaptor, "token TO");
            RewriteRuleITokenStream stream_ALIGN_LEFT  = new RewriteRuleITokenStream(adaptor, "token ALIGN_LEFT");
            RewriteRuleITokenStream stream_LENGTH      = new RewriteRuleITokenStream(adaptor, "token LENGTH");

            try { DebugEnterRule(GrammarFileName, "plain_elem");
                  DebugLocation(47, 2);
                  try
                  {
                      // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:47:11: ( ID FROM i1= INT TO i2= INT (al= ALIGN_LEFT |al= ALIGN_RIGHT )? -> ^( ID $i1 $i2 ( $al)? ) | ID LENGTH i1= INT (al= ALIGN_LEFT |al= ALIGN_RIGHT )? -> ^( ID $i1 ( $al)? ) )
                      int alt5 = 2;
                      try { DebugEnterDecision(5, false);
                            int LA5_0 = input.LA(1);

                            if ((LA5_0 == ID))
                            {
                                int LA5_1 = input.LA(2);

                                if ((LA5_1 == FROM))
                                {
                                    alt5 = 1;
                                }
                                else if ((LA5_1 == LENGTH))
                                {
                                    alt5 = 2;
                                }
                                else
                                {
                                    NoViableAltException nvae = new NoViableAltException("", 5, 1, input);
                                    DebugRecognitionException(nvae);
                                    throw nvae;
                                }
                            }
                            else
                            {
                                NoViableAltException nvae = new NoViableAltException("", 5, 0, input);
                                DebugRecognitionException(nvae);
                                throw nvae;
                            } } finally { DebugExitDecision(5); }
                      switch (alt5)
                      {
                      case 1:
                          DebugEnterAlt(1);
                          // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:3: ID FROM i1= INT TO i2= INT (al= ALIGN_LEFT |al= ALIGN_RIGHT )?
                          {
                              DebugLocation(48, 3);
                              ID12 = (IToken)Match(input, ID, Follow._ID_in_plain_elem181);
                              stream_ID.Add(ID12);

                              DebugLocation(48, 6);
                              FROM13 = (IToken)Match(input, FROM, Follow._FROM_in_plain_elem183);
                              stream_FROM.Add(FROM13);

                              DebugLocation(48, 13);
                              i1 = (IToken)Match(input, INT, Follow._INT_in_plain_elem187);
                              stream_INT.Add(i1);

                              DebugLocation(48, 18);
                              TO14 = (IToken)Match(input, TO, Follow._TO_in_plain_elem189);
                              stream_TO.Add(TO14);

                              DebugLocation(48, 23);
                              i2 = (IToken)Match(input, INT, Follow._INT_in_plain_elem193);
                              stream_INT.Add(i2);

                              DebugLocation(48, 28);
                              // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:28: (al= ALIGN_LEFT |al= ALIGN_RIGHT )?
                              int alt3 = 3;
                              try { DebugEnterSubRule(3);
                                    try { DebugEnterDecision(3, false);
                                          int LA3_0 = input.LA(1);

                                          if ((LA3_0 == ALIGN_LEFT))
                                          {
                                              alt3 = 1;
                                          }
                                          else if ((LA3_0 == ALIGN_RIGHT))
                                          {
                                              alt3 = 2;
                                          }
                                    } finally { DebugExitDecision(3); }
                                    switch (alt3)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:29: al= ALIGN_LEFT
                                        {
                                            DebugLocation(48, 31);
                                            al = (IToken)Match(input, ALIGN_LEFT, Follow._ALIGN_LEFT_in_plain_elem198);
                                            stream_ALIGN_LEFT.Add(al);
                                        }
                                        break;

                                    case 2:
                                        DebugEnterAlt(2);
                                        // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:45: al= ALIGN_RIGHT
                                        {
                                            DebugLocation(48, 47);
                                            al = (IToken)Match(input, ALIGN_RIGHT, Follow._ALIGN_RIGHT_in_plain_elem204);
                                            stream_ALIGN_RIGHT.Add(al);
                                        }
                                        break;
                                    }
                              } finally { DebugExitSubRule(3); }



                              {
                                  // AST REWRITE
                                  // elements: i2, ID, al, i1
                                  // token labels: al, i2, i1
                                  // rule labels: retval
                                  // token list labels:
                                  // rule list labels:
                                  // wildcard labels:
                                  retval.Tree = root_0;
                                  RewriteRuleITokenStream  stream_al     = new RewriteRuleITokenStream(adaptor, "token al", al);
                                  RewriteRuleITokenStream  stream_i2     = new RewriteRuleITokenStream(adaptor, "token i2", i2);
                                  RewriteRuleITokenStream  stream_i1     = new RewriteRuleITokenStream(adaptor, "token i1", i1);
                                  RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);

                                  root_0 = (object)adaptor.Nil();
                                  // 48:62: -> ^( ID $i1 $i2 ( $al)? )
                                  {
                                      DebugLocation(48, 65);
                                      // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:65: ^( ID $i1 $i2 ( $al)? )
                                      {
                                          object root_1 = (object)adaptor.Nil();
                                          DebugLocation(48, 67);
                                          root_1 = (object)adaptor.BecomeRoot(stream_ID.NextNode(), root_1);

                                          DebugLocation(48, 71);
                                          adaptor.AddChild(root_1, stream_i1.NextNode());
                                          DebugLocation(48, 75);
                                          adaptor.AddChild(root_1, stream_i2.NextNode());
                                          DebugLocation(48, 79);
                                          // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:48:79: ( $al)?
                                          if (stream_al.HasNext)
                                          {
                                              DebugLocation(48, 79);
                                              adaptor.AddChild(root_1, stream_al.NextNode());
                                          }
                                          stream_al.Reset();

                                          adaptor.AddChild(root_0, root_1);
                                      }
                                  }

                                  retval.Tree = root_0;
                              }
                          }
                          break;

                      case 2:
                          DebugEnterAlt(2);
                          // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:3: ID LENGTH i1= INT (al= ALIGN_LEFT |al= ALIGN_RIGHT )?
                          {
                              DebugLocation(50, 3);
                              ID15 = (IToken)Match(input, ID, Follow._ID_in_plain_elem230);
                              stream_ID.Add(ID15);

                              DebugLocation(50, 6);
                              LENGTH16 = (IToken)Match(input, LENGTH, Follow._LENGTH_in_plain_elem232);
                              stream_LENGTH.Add(LENGTH16);

                              DebugLocation(50, 15);
                              i1 = (IToken)Match(input, INT, Follow._INT_in_plain_elem236);
                              stream_INT.Add(i1);

                              DebugLocation(50, 20);
                              // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:20: (al= ALIGN_LEFT |al= ALIGN_RIGHT )?
                              int alt4 = 3;
                              try { DebugEnterSubRule(4);
                                    try { DebugEnterDecision(4, false);
                                          int LA4_0 = input.LA(1);

                                          if ((LA4_0 == ALIGN_LEFT))
                                          {
                                              alt4 = 1;
                                          }
                                          else if ((LA4_0 == ALIGN_RIGHT))
                                          {
                                              alt4 = 2;
                                          }
                                    } finally { DebugExitDecision(4); }
                                    switch (alt4)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:21: al= ALIGN_LEFT
                                        {
                                            DebugLocation(50, 23);
                                            al = (IToken)Match(input, ALIGN_LEFT, Follow._ALIGN_LEFT_in_plain_elem241);
                                            stream_ALIGN_LEFT.Add(al);
                                        }
                                        break;

                                    case 2:
                                        DebugEnterAlt(2);
                                        // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:37: al= ALIGN_RIGHT
                                        {
                                            DebugLocation(50, 39);
                                            al = (IToken)Match(input, ALIGN_RIGHT, Follow._ALIGN_RIGHT_in_plain_elem247);
                                            stream_ALIGN_RIGHT.Add(al);
                                        }
                                        break;
                                    }
                              } finally { DebugExitSubRule(4); }



                              {
                                  // AST REWRITE
                                  // elements: i1, al, ID
                                  // token labels: al, i1
                                  // rule labels: retval
                                  // token list labels:
                                  // rule list labels:
                                  // wildcard labels:
                                  retval.Tree = root_0;
                                  RewriteRuleITokenStream  stream_al     = new RewriteRuleITokenStream(adaptor, "token al", al);
                                  RewriteRuleITokenStream  stream_i1     = new RewriteRuleITokenStream(adaptor, "token i1", i1);
                                  RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);

                                  root_0 = (object)adaptor.Nil();
                                  // 50:54: -> ^( ID $i1 ( $al)? )
                                  {
                                      DebugLocation(50, 57);
                                      // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:57: ^( ID $i1 ( $al)? )
                                      {
                                          object root_1 = (object)adaptor.Nil();
                                          DebugLocation(50, 59);
                                          root_1 = (object)adaptor.BecomeRoot(stream_ID.NextNode(), root_1);

                                          DebugLocation(50, 63);
                                          adaptor.AddChild(root_1, stream_i1.NextNode());
                                          DebugLocation(50, 67);
                                          // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:50:67: ( $al)?
                                          if (stream_al.HasNext)
                                          {
                                              DebugLocation(50, 67);
                                              adaptor.AddChild(root_1, stream_al.NextNode());
                                          }
                                          stream_al.Reset();

                                          adaptor.AddChild(root_0, root_1);
                                      }
                                  }

                                  retval.Tree = root_0;
                              }
                          }
                          break;
                      }
                      retval.Stop = (IToken)input.LT(-1);

                      retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                      adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                  }
                  catch (RecognitionException re)
                  {
                      ReportError(re);
                      Recover(input, re);
                      retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                  }
                  finally
                  {
                      TraceOut("plain_elem", 5);
                      LeaveRule("plain_elem", 5);
                      LeaveRule_plain_elem();
                  }
                  DebugLocation(51, 2); } finally { DebugExitRule(GrammarFileName, "plain_elem"); }
            return(retval);
        }
Esempio n. 7
0
	private AstParserRuleReturnScope<CommonTree, IToken> parameterRestDeclaration()
	{
		EnterRule_parameterRestDeclaration();
		EnterRule("parameterRestDeclaration", 37);
		TraceIn("parameterRestDeclaration", 37);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken REST120 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> ident121 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> typeExpression122 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree REST120_tree = default(CommonTree);
		RewriteRuleITokenStream stream_REST=new RewriteRuleITokenStream(adaptor,"token REST");
		RewriteRuleSubtreeStream stream_ident=new RewriteRuleSubtreeStream(adaptor,"rule ident");
		RewriteRuleSubtreeStream stream_typeExpression=new RewriteRuleSubtreeStream(adaptor,"rule typeExpression");
		try { DebugEnterRule(GrammarFileName, "parameterRestDeclaration");
		DebugLocation(353, 1);
		try
		{
			// AS3.g:354:2: ( REST ( ident )? ( typeExpression )? -> ^( PARAM REST ( ident )? ( typeExpression )? ) )
			DebugEnterAlt(1);
			// AS3.g:354:4: REST ( ident )? ( typeExpression )?
			{
			DebugLocation(354, 4);
			REST120=(IToken)Match(input,REST,Follow._REST_in_parameterRestDeclaration1932); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_REST.Add(REST120);

			DebugLocation(354, 9);
			// AS3.g:354:9: ( ident )?
			int alt31=2;
			try { DebugEnterSubRule(31);
			try { DebugEnterDecision(31, false);
			int LA31_1 = input.LA(1);

			if ((LA31_1==AS||LA31_1==DYNAMIC||LA31_1==GET||LA31_1==IDENT||LA31_1==IS||LA31_1==NAMESPACE||LA31_1==SET||LA31_1==SUPER||LA31_1==USE||LA31_1==XML))
			{
				alt31 = 1;
			}
			} finally { DebugExitDecision(31); }
			switch (alt31)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:354:9: ident
				{
				DebugLocation(354, 9);
				PushFollow(Follow._ident_in_parameterRestDeclaration1934);
				ident121=ident();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_ident.Add(ident121.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(31); }

			DebugLocation(354, 16);
			// AS3.g:354:16: ( typeExpression )?
			int alt32=2;
			try { DebugEnterSubRule(32);
			try { DebugEnterDecision(32, false);
			int LA32_1 = input.LA(1);

			if ((LA32_1==COLON))
			{
				alt32 = 1;
			}
			} finally { DebugExitDecision(32); }
			switch (alt32)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:354:16: typeExpression
				{
				DebugLocation(354, 16);
				PushFollow(Follow._typeExpression_in_parameterRestDeclaration1937);
				typeExpression122=typeExpression();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_typeExpression.Add(typeExpression122.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(32); }



			{
			// AST REWRITE
			// elements: REST, ident, typeExpression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 355:3: -> ^( PARAM REST ( ident )? ( typeExpression )? )
			{
				DebugLocation(355, 6);
				// AS3.g:355:6: ^( PARAM REST ( ident )? ( typeExpression )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(355, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PARAM, "PARAM"), root_1);

				DebugLocation(355, 14);
				adaptor.AddChild(root_1, stream_REST.NextNode());
				DebugLocation(355, 19);
				// AS3.g:355:19: ( ident )?
				if (stream_ident.HasNext)
				{
					DebugLocation(355, 19);
					adaptor.AddChild(root_1, stream_ident.NextTree());

				}
				stream_ident.Reset();
				DebugLocation(355, 26);
				// AS3.g:355:26: ( typeExpression )?
				if (stream_typeExpression.HasNext)
				{
					DebugLocation(355, 26);
					adaptor.AddChild(root_1, stream_typeExpression.NextTree());

				}
				stream_typeExpression.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("parameterRestDeclaration", 37);
			LeaveRule("parameterRestDeclaration", 37);
			LeaveRule_parameterRestDeclaration();
		}
		DebugLocation(356, 1);
		} finally { DebugExitRule(GrammarFileName, "parameterRestDeclaration"); }
		return retval;

	}
Esempio n. 8
0
	private AstParserRuleReturnScope<CommonTree, IToken> stringLiteralSingle()
	{
		EnterRule_stringLiteralSingle();
		EnterRule("stringLiteralSingle", 128);
		TraceIn("stringLiteralSingle", 128);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken STRING_LITERAL_SINGLE426 = default(IToken);

		CommonTree STRING_LITERAL_SINGLE426_tree = default(CommonTree);
		RewriteRuleITokenStream stream_STRING_LITERAL_SINGLE=new RewriteRuleITokenStream(adaptor,"token STRING_LITERAL_SINGLE");
		try { DebugEnterRule(GrammarFileName, "stringLiteralSingle");
		DebugLocation(978, 4);
		try
		{
			// AS3.g:979:5: ( STRING_LITERAL_SINGLE -> ^( LITERAL_SINGLE_STRING STRING_LITERAL_SINGLE ) )
			DebugEnterAlt(1);
			// AS3.g:979:7: STRING_LITERAL_SINGLE
			{
			DebugLocation(979, 7);
			STRING_LITERAL_SINGLE426=(IToken)Match(input,STRING_LITERAL_SINGLE,Follow._STRING_LITERAL_SINGLE_in_stringLiteralSingle5208); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_STRING_LITERAL_SINGLE.Add(STRING_LITERAL_SINGLE426);



			{
			// AST REWRITE
			// elements: STRING_LITERAL_SINGLE
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 979:29: -> ^( LITERAL_SINGLE_STRING STRING_LITERAL_SINGLE )
			{
				DebugLocation(979, 32);
				// AS3.g:979:32: ^( LITERAL_SINGLE_STRING STRING_LITERAL_SINGLE )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(979, 34);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(LITERAL_SINGLE_STRING, "LITERAL_SINGLE_STRING"), root_1);

				DebugLocation(979, 56);
				adaptor.AddChild(root_1, stream_STRING_LITERAL_SINGLE.NextNode());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("stringLiteralSingle", 128);
			LeaveRule("stringLiteralSingle", 128);
			LeaveRule_stringLiteralSingle();
		}
		DebugLocation(980, 4);
		} finally { DebugExitRule(GrammarFileName, "stringLiteralSingle"); }
		return retval;

	}
Esempio n. 9
0
	private AstParserRuleReturnScope<CommonTree, IToken> regexpLiteral()
	{
		EnterRule_regexpLiteral();
		EnterRule("regexpLiteral", 131);
		TraceIn("regexpLiteral", 131);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken REGEX_LITERAL429 = default(IToken);

		CommonTree REGEX_LITERAL429_tree = default(CommonTree);
		RewriteRuleITokenStream stream_REGEX_LITERAL=new RewriteRuleITokenStream(adaptor,"token REGEX_LITERAL");
		try { DebugEnterRule(GrammarFileName, "regexpLiteral");
		DebugLocation(997, 1);
		try
		{
			// AS3.g:998:2: ( REGEX_LITERAL -> ^( LITERAL_REGEX REGEX_LITERAL ) )
			DebugEnterAlt(1);
			// AS3.g:998:4: REGEX_LITERAL
			{
			DebugLocation(998, 4);
			REGEX_LITERAL429=(IToken)Match(input,REGEX_LITERAL,Follow._REGEX_LITERAL_in_regexpLiteral5299); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_REGEX_LITERAL.Add(REGEX_LITERAL429);



			{
			// AST REWRITE
			// elements: REGEX_LITERAL
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 999:3: -> ^( LITERAL_REGEX REGEX_LITERAL )
			{
				DebugLocation(999, 6);
				// AS3.g:999:6: ^( LITERAL_REGEX REGEX_LITERAL )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(999, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(LITERAL_REGEX, "LITERAL_REGEX"), root_1);

				DebugLocation(999, 22);
				adaptor.AddChild(root_1, stream_REGEX_LITERAL.NextNode());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("regexpLiteral", 131);
			LeaveRule("regexpLiteral", 131);
			LeaveRule_regexpLiteral();
		}
		DebugLocation(1000, 1);
		} finally { DebugExitRule(GrammarFileName, "regexpLiteral"); }
		return retval;

	}
Esempio n. 10
0
        private AstParserRuleReturnScope <object, IToken> sort_term()
        {
            EnterRule_sort_term();
            EnterRule("sort_term", 3);
            TraceIn("sort_term", 3);
            AstParserRuleReturnScope <object, IToken> retval = new AstParserRuleReturnScope <object, IToken>();

            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken DIRECTION6 = default(IToken);
            AstParserRuleReturnScope <object, IToken> scoped_sort_term5 = default(AstParserRuleReturnScope <object, IToken>);
            AstParserRuleReturnScope <object, IToken> identifier7       = default(AstParserRuleReturnScope <object, IToken>);

            object DIRECTION6_tree = default(object);
            RewriteRuleITokenStream  stream_DIRECTION  = new RewriteRuleITokenStream(adaptor, "token DIRECTION");
            RewriteRuleSubtreeStream stream_identifier = new RewriteRuleSubtreeStream(adaptor, "rule identifier");

            try
            {
                DebugEnterRule(GrammarFileName, "sort_term");
                DebugLocation(49, 1);
                try
                {
                    // ../Grammars/OslcOrderBy.g:49:13: ( scoped_sort_term | DIRECTION identifier -> ^( 'simple_term' identifier DIRECTION ) )
                    int alt2 = 2;
                    try
                    {
                        DebugEnterDecision(2, false);
                        int LA2_1 = input.LA(1);

                        if (((LA2_1 >= PNAME_LN && LA2_1 <= PNAME_NS)))
                        {
                            alt2 = 1;
                        }
                        else if ((LA2_1 == DIRECTION))
                        {
                            alt2 = 2;
                        }
                        else
                        {
                            NoViableAltException nvae = new NoViableAltException("", 2, 0, input, 1);
                            DebugRecognitionException(nvae);
                            throw nvae;
                        }
                    }
                    finally { DebugExitDecision(2); }
                    switch (alt2)
                    {
                    case 1:
                        DebugEnterAlt(1);
                        // ../Grammars/OslcOrderBy.g:49:15: scoped_sort_term
                        {
                            root_0 = (object)adaptor.Nil();

                            DebugLocation(49, 15);
                            PushFollow(Follow._scoped_sort_term_in_sort_term120);
                            scoped_sort_term5 = scoped_sort_term();
                            PopFollow();

                            adaptor.AddChild(root_0, scoped_sort_term5.Tree);
                        }
                        break;

                    case 2:
                        DebugEnterAlt(2);
                        // ../Grammars/OslcOrderBy.g:49:34: DIRECTION identifier
                        {
                            DebugLocation(49, 34);
                            DIRECTION6 = (IToken)Match(input, DIRECTION, Follow._DIRECTION_in_sort_term124);
                            stream_DIRECTION.Add(DIRECTION6);

                            DebugLocation(49, 44);
                            PushFollow(Follow._identifier_in_sort_term126);
                            identifier7 = identifier();
                            PopFollow();

                            stream_identifier.Add(identifier7.Tree);


                            {
                                // AST REWRITE
                                // elements: identifier, DIRECTION, SIMPLE_TERM
                                // token labels:
                                // rule labels: retval
                                // token list labels:
                                // rule list labels:
                                // wildcard labels:
                                retval.Tree = root_0;
                                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.Tree : null);

                                root_0 = (object)adaptor.Nil();
                                // 49:55: -> ^( 'simple_term' identifier DIRECTION )
                                {
                                    DebugLocation(49, 58);
                                    // ../Grammars/OslcOrderBy.g:49:58: ^( 'simple_term' identifier DIRECTION )
                                    {
                                        object root_1 = (object)adaptor.Nil();
                                        DebugLocation(49, 61);
                                        root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(SIMPLE_TERM, "SIMPLE_TERM"), root_1);

                                        DebugLocation(49, 75);
                                        adaptor.AddChild(root_1, stream_identifier.NextTree());
                                        DebugLocation(49, 86);
                                        adaptor.AddChild(root_1, stream_DIRECTION.NextNode());

                                        adaptor.AddChild(root_0, root_1);
                                    }
                                }

                                retval.Tree = root_0;
                            }
                        }
                        break;
                    }
                    retval.Stop = (IToken)input.LT(-1);

                    retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                    adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                }
                catch (RecognitionException re)
                {
                    ReportError(re);
                    Recover(input, re);
                    retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                }
                finally
                {
                    TraceOut("sort_term", 3);
                    LeaveRule("sort_term", 3);
                    LeaveRule_sort_term();
                }
                DebugLocation(50, 1);
            }
            finally { DebugExitRule(GrammarFileName, "sort_term"); }
            return(retval);
        }
Esempio n. 11
0
	private AstParserRuleReturnScope<CommonTree, IToken> postfixExpression()
	{
		EnterRule_postfixExpression();
		EnterRule("postfixExpression", 119);
		TraceIn("postfixExpression", 119);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken DOT383 = default(IToken);
		IToken E4X_DESC385 = default(IToken);
		IToken LBRACK387 = default(IToken);
		IToken RBRACK389 = default(IToken);
		IToken INC391 = default(IToken);
		IToken DEC392 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> primaryExpression381 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> propOrIdent382 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> e4xExpression384 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> e4xExpression386 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> expression388 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> arguments390 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree DOT383_tree = default(CommonTree);
		CommonTree E4X_DESC385_tree = default(CommonTree);
		CommonTree LBRACK387_tree = default(CommonTree);
		CommonTree RBRACK389_tree = default(CommonTree);
		CommonTree INC391_tree = default(CommonTree);
		CommonTree DEC392_tree = default(CommonTree);
		RewriteRuleITokenStream stream_DOT=new RewriteRuleITokenStream(adaptor,"token DOT");
		RewriteRuleITokenStream stream_E4X_DESC=new RewriteRuleITokenStream(adaptor,"token E4X_DESC");
		RewriteRuleITokenStream stream_LBRACK=new RewriteRuleITokenStream(adaptor,"token LBRACK");
		RewriteRuleITokenStream stream_RBRACK=new RewriteRuleITokenStream(adaptor,"token RBRACK");
		RewriteRuleITokenStream stream_INC=new RewriteRuleITokenStream(adaptor,"token INC");
		RewriteRuleITokenStream stream_DEC=new RewriteRuleITokenStream(adaptor,"token DEC");
		RewriteRuleSubtreeStream stream_primaryExpression=new RewriteRuleSubtreeStream(adaptor,"rule primaryExpression");
		RewriteRuleSubtreeStream stream_propOrIdent=new RewriteRuleSubtreeStream(adaptor,"rule propOrIdent");
		RewriteRuleSubtreeStream stream_e4xExpression=new RewriteRuleSubtreeStream(adaptor,"rule e4xExpression");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		RewriteRuleSubtreeStream stream_arguments=new RewriteRuleSubtreeStream(adaptor,"rule arguments");
		try { DebugEnterRule(GrammarFileName, "postfixExpression");
		DebugLocation(885, 2);
		try
		{
			// AS3.g:886:2: ( ( primaryExpression -> primaryExpression ) ( propOrIdent -> ^( PROP_ACCESS $postfixExpression propOrIdent ) | DOT e4xExpression -> ^( E4X_EXPRESSION $postfixExpression e4xExpression ) | E4X_DESC e4xExpression -> ^( E4X_EXPRESSION $postfixExpression E4X_DESC e4xExpression ) | LBRACK expression RBRACK -> ^( ARRAY_ACCESS $postfixExpression ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK ) ) | arguments -> ^( FUNCTION_CALL $postfixExpression arguments ) )* ( INC -> ^( POST_INC $postfixExpression INC ) | DEC -> ^( POST_DEC $postfixExpression DEC ) )? )
			DebugEnterAlt(1);
			// AS3.g:886:4: ( primaryExpression -> primaryExpression ) ( propOrIdent -> ^( PROP_ACCESS $postfixExpression propOrIdent ) | DOT e4xExpression -> ^( E4X_EXPRESSION $postfixExpression e4xExpression ) | E4X_DESC e4xExpression -> ^( E4X_EXPRESSION $postfixExpression E4X_DESC e4xExpression ) | LBRACK expression RBRACK -> ^( ARRAY_ACCESS $postfixExpression ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK ) ) | arguments -> ^( FUNCTION_CALL $postfixExpression arguments ) )* ( INC -> ^( POST_INC $postfixExpression INC ) | DEC -> ^( POST_DEC $postfixExpression DEC ) )?
			{
			DebugLocation(886, 4);
			// AS3.g:886:4: ( primaryExpression -> primaryExpression )
			DebugEnterAlt(1);
			// AS3.g:886:5: primaryExpression
			{
			DebugLocation(886, 5);
			PushFollow(Follow._primaryExpression_in_postfixExpression4595);
			primaryExpression381=primaryExpression();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_primaryExpression.Add(primaryExpression381.Tree);


			{
			// AST REWRITE
			// elements: primaryExpression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 886:23: -> primaryExpression
			{
				DebugLocation(886, 26);
				adaptor.AddChild(root_0, stream_primaryExpression.NextTree());

			}

			retval.Tree = root_0;
			}
			}

			}

			DebugLocation(887, 3);
			// AS3.g:887:3: ( propOrIdent -> ^( PROP_ACCESS $postfixExpression propOrIdent ) | DOT e4xExpression -> ^( E4X_EXPRESSION $postfixExpression e4xExpression ) | E4X_DESC e4xExpression -> ^( E4X_EXPRESSION $postfixExpression E4X_DESC e4xExpression ) | LBRACK expression RBRACK -> ^( ARRAY_ACCESS $postfixExpression ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK ) ) | arguments -> ^( FUNCTION_CALL $postfixExpression arguments ) )*
			try { DebugEnterSubRule(87);
			while (true)
			{
				int alt87=6;
				try { DebugEnterDecision(87, false);
				switch (input.LA(1))
				{
				case DOT:
					{
					int LA87_2 = input.LA(2);

					if ((LA87_2==AS||LA87_2==DYNAMIC||LA87_2==GET||LA87_2==IDENT||(LA87_2>=INTERNAL && LA87_2<=IS)||LA87_2==NAMESPACE||LA87_2==PRIVATE||(LA87_2>=PROTECTED && LA87_2<=PUBLIC)||LA87_2==SET||LA87_2==SUPER||LA87_2==USE||LA87_2==XML))
					{
						alt87 = 1;
					}
					else if ((LA87_2==E4X_ATTRI||LA87_2==LPAREN||LA87_2==STAR))
					{
						alt87 = 2;
					}


					}
					break;
				case E4X_DESC:
					{
					alt87 = 3;
					}
					break;
				case LBRACK:
					{
					alt87 = 4;
					}
					break;
				case LPAREN:
					{
					alt87 = 5;
					}
					break;
				}

				} finally { DebugExitDecision(87); }
				switch ( alt87 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:888:13: propOrIdent
					{
					DebugLocation(888, 13);
					PushFollow(Follow._propOrIdent_in_postfixExpression4619);
					propOrIdent382=propOrIdent();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_propOrIdent.Add(propOrIdent382.Tree);


					{
					// AST REWRITE
					// elements: postfixExpression, propOrIdent
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					if (state.backtracking == 0) {
					retval.Tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

					root_0 = (CommonTree)adaptor.Nil();
					// 889:13: -> ^( PROP_ACCESS $postfixExpression propOrIdent )
					{
						DebugLocation(889, 16);
						// AS3.g:889:16: ^( PROP_ACCESS $postfixExpression propOrIdent )
						{
						CommonTree root_1 = (CommonTree)adaptor.Nil();
						DebugLocation(889, 18);
						root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PROP_ACCESS, "PROP_ACCESS"), root_1);

						DebugLocation(889, 31);
						adaptor.AddChild(root_1, stream_retval.NextTree());
						DebugLocation(889, 49);
						adaptor.AddChild(root_1, stream_propOrIdent.NextTree());

						adaptor.AddChild(root_0, root_1);
						}

					}

					retval.Tree = root_0;
					}
					}

					}
					break;
				case 2:
					DebugEnterAlt(2);
					// AS3.g:892:13: DOT e4xExpression
					{
					DebugLocation(892, 13);
					DOT383=(IToken)Match(input,DOT,Follow._DOT_in_postfixExpression4674); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_DOT.Add(DOT383);

					DebugLocation(892, 17);
					PushFollow(Follow._e4xExpression_in_postfixExpression4676);
					e4xExpression384=e4xExpression();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_e4xExpression.Add(e4xExpression384.Tree);


					{
					// AST REWRITE
					// elements: postfixExpression, e4xExpression
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					if (state.backtracking == 0) {
					retval.Tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

					root_0 = (CommonTree)adaptor.Nil();
					// 893:13: -> ^( E4X_EXPRESSION $postfixExpression e4xExpression )
					{
						DebugLocation(893, 16);
						// AS3.g:893:16: ^( E4X_EXPRESSION $postfixExpression e4xExpression )
						{
						CommonTree root_1 = (CommonTree)adaptor.Nil();
						DebugLocation(893, 18);
						root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(E4X_EXPRESSION, "E4X_EXPRESSION"), root_1);

						DebugLocation(893, 34);
						adaptor.AddChild(root_1, stream_retval.NextTree());
						DebugLocation(893, 52);
						adaptor.AddChild(root_1, stream_e4xExpression.NextTree());

						adaptor.AddChild(root_0, root_1);
						}

					}

					retval.Tree = root_0;
					}
					}

					}
					break;
				case 3:
					DebugEnterAlt(3);
					// AS3.g:896:13: E4X_DESC e4xExpression
					{
					DebugLocation(896, 13);
					E4X_DESC385=(IToken)Match(input,E4X_DESC,Follow._E4X_DESC_in_postfixExpression4719); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_E4X_DESC.Add(E4X_DESC385);

					DebugLocation(896, 22);
					PushFollow(Follow._e4xExpression_in_postfixExpression4721);
					e4xExpression386=e4xExpression();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_e4xExpression.Add(e4xExpression386.Tree);


					{
					// AST REWRITE
					// elements: postfixExpression, E4X_DESC, e4xExpression
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					if (state.backtracking == 0) {
					retval.Tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

					root_0 = (CommonTree)adaptor.Nil();
					// 897:13: -> ^( E4X_EXPRESSION $postfixExpression E4X_DESC e4xExpression )
					{
						DebugLocation(897, 16);
						// AS3.g:897:16: ^( E4X_EXPRESSION $postfixExpression E4X_DESC e4xExpression )
						{
						CommonTree root_1 = (CommonTree)adaptor.Nil();
						DebugLocation(897, 18);
						root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(E4X_EXPRESSION, "E4X_EXPRESSION"), root_1);

						DebugLocation(897, 34);
						adaptor.AddChild(root_1, stream_retval.NextTree());
						DebugLocation(897, 52);
						adaptor.AddChild(root_1, stream_E4X_DESC.NextNode());
						DebugLocation(897, 61);
						adaptor.AddChild(root_1, stream_e4xExpression.NextTree());

						adaptor.AddChild(root_0, root_1);
						}

					}

					retval.Tree = root_0;
					}
					}

					}
					break;
				case 4:
					DebugEnterAlt(4);
					// AS3.g:900:13: LBRACK expression RBRACK
					{
					DebugLocation(900, 13);
					LBRACK387=(IToken)Match(input,LBRACK,Follow._LBRACK_in_postfixExpression4778); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_LBRACK.Add(LBRACK387);

					DebugLocation(900, 20);
					PushFollow(Follow._expression_in_postfixExpression4780);
					expression388=expression();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_expression.Add(expression388.Tree);
					DebugLocation(900, 31);
					RBRACK389=(IToken)Match(input,RBRACK,Follow._RBRACK_in_postfixExpression4782); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_RBRACK.Add(RBRACK389);



					{
					// AST REWRITE
					// elements: postfixExpression, LBRACK, expression, RBRACK
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					if (state.backtracking == 0) {
					retval.Tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

					root_0 = (CommonTree)adaptor.Nil();
					// 901:13: -> ^( ARRAY_ACCESS $postfixExpression ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK ) )
					{
						DebugLocation(901, 16);
						// AS3.g:901:16: ^( ARRAY_ACCESS $postfixExpression ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK ) )
						{
						CommonTree root_1 = (CommonTree)adaptor.Nil();
						DebugLocation(901, 18);
						root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(ARRAY_ACCESS, "ARRAY_ACCESS"), root_1);

						DebugLocation(901, 32);
						adaptor.AddChild(root_1, stream_retval.NextTree());
						DebugLocation(901, 50);
						// AS3.g:901:50: ^( ARRAY_SUBSCRIPT LBRACK expression RBRACK )
						{
						CommonTree root_2 = (CommonTree)adaptor.Nil();
						DebugLocation(901, 52);
						root_2 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(ARRAY_SUBSCRIPT, "ARRAY_SUBSCRIPT"), root_2);

						DebugLocation(901, 68);
						adaptor.AddChild(root_2, stream_LBRACK.NextNode());
						DebugLocation(901, 75);
						adaptor.AddChild(root_2, stream_expression.NextTree());
						DebugLocation(901, 86);
						adaptor.AddChild(root_2, stream_RBRACK.NextNode());

						adaptor.AddChild(root_1, root_2);
						}

						adaptor.AddChild(root_0, root_1);
						}

					}

					retval.Tree = root_0;
					}
					}

					}
					break;
				case 5:
					DebugEnterAlt(5);
					// AS3.g:904:13: arguments
					{
					DebugLocation(904, 13);
					PushFollow(Follow._arguments_in_postfixExpression4833);
					arguments390=arguments();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_arguments.Add(arguments390.Tree);


					{
					// AST REWRITE
					// elements: postfixExpression, arguments
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					if (state.backtracking == 0) {
					retval.Tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

					root_0 = (CommonTree)adaptor.Nil();
					// 905:13: -> ^( FUNCTION_CALL $postfixExpression arguments )
					{
						DebugLocation(905, 16);
						// AS3.g:905:16: ^( FUNCTION_CALL $postfixExpression arguments )
						{
						CommonTree root_1 = (CommonTree)adaptor.Nil();
						DebugLocation(905, 18);
						root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(FUNCTION_CALL, "FUNCTION_CALL"), root_1);

						DebugLocation(905, 33);
						adaptor.AddChild(root_1, stream_retval.NextTree());
						DebugLocation(905, 51);
						adaptor.AddChild(root_1, stream_arguments.NextTree());

						adaptor.AddChild(root_0, root_1);
						}

					}

					retval.Tree = root_0;
					}
					}

					}
					break;

				default:
					goto loop87;
				}
			}

			loop87:
				;

			} finally { DebugExitSubRule(87); }

			DebugLocation(908, 3);
			// AS3.g:908:3: ( INC -> ^( POST_INC $postfixExpression INC ) | DEC -> ^( POST_DEC $postfixExpression DEC ) )?
			int alt88=3;
			try { DebugEnterSubRule(88);
			try { DebugEnterDecision(88, false);
			int LA88_1 = input.LA(1);

			if ((LA88_1==INC))
			{
				alt88 = 1;
			}
			else if ((LA88_1==DEC))
			{
				alt88 = 2;
			}
			} finally { DebugExitDecision(88); }
			switch (alt88)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:908:6: INC
				{
				DebugLocation(908, 6);
				INC391=(IToken)Match(input,INC,Follow._INC_in_postfixExpression4877); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_INC.Add(INC391);



				{
				// AST REWRITE
				// elements: postfixExpression, INC
				// token labels: 
				// rule labels: retval
				// token list labels: 
				// rule list labels: 
				// wildcard labels: 
				if (state.backtracking == 0) {
				retval.Tree = root_0;
				RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

				root_0 = (CommonTree)adaptor.Nil();
				// 908:10: -> ^( POST_INC $postfixExpression INC )
				{
					DebugLocation(908, 13);
					// AS3.g:908:13: ^( POST_INC $postfixExpression INC )
					{
					CommonTree root_1 = (CommonTree)adaptor.Nil();
					DebugLocation(908, 15);
					root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(POST_INC, "POST_INC"), root_1);

					DebugLocation(908, 25);
					adaptor.AddChild(root_1, stream_retval.NextTree());
					DebugLocation(908, 43);
					adaptor.AddChild(root_1, stream_INC.NextNode());

					adaptor.AddChild(root_0, root_1);
					}

				}

				retval.Tree = root_0;
				}
				}

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// AS3.g:909:6: DEC
				{
				DebugLocation(909, 6);
				DEC392=(IToken)Match(input,DEC,Follow._DEC_in_postfixExpression4895); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_DEC.Add(DEC392);



				{
				// AST REWRITE
				// elements: postfixExpression, DEC
				// token labels: 
				// rule labels: retval
				// token list labels: 
				// rule list labels: 
				// wildcard labels: 
				if (state.backtracking == 0) {
				retval.Tree = root_0;
				RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

				root_0 = (CommonTree)adaptor.Nil();
				// 909:10: -> ^( POST_DEC $postfixExpression DEC )
				{
					DebugLocation(909, 13);
					// AS3.g:909:13: ^( POST_DEC $postfixExpression DEC )
					{
					CommonTree root_1 = (CommonTree)adaptor.Nil();
					DebugLocation(909, 15);
					root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(POST_DEC, "POST_DEC"), root_1);

					DebugLocation(909, 25);
					adaptor.AddChild(root_1, stream_retval.NextTree());
					DebugLocation(909, 43);
					adaptor.AddChild(root_1, stream_DEC.NextNode());

					adaptor.AddChild(root_0, root_1);
					}

				}

				retval.Tree = root_0;
				}
				}

				}
				break;

			}
			} finally { DebugExitSubRule(88); }


			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("postfixExpression", 119);
			LeaveRule("postfixExpression", 119);
			LeaveRule_postfixExpression();
		}
		DebugLocation(912, 2);
		} finally { DebugExitRule(GrammarFileName, "postfixExpression"); }
		return retval;

	}
Esempio n. 12
0
        private AstParserRuleReturnScope <object, IToken> prefix_binding()
        {
            EnterRule_prefix_binding();
            EnterRule("prefix_binding", 2);
            TraceIn("prefix_binding", 2);
            AstParserRuleReturnScope <object, IToken> retval = new AstParserRuleReturnScope <object, IToken>();

            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken PN_PREFIX4    = default(IToken);
            IToken char_literal5 = default(IToken);
            IToken IRI_REF6      = default(IToken);

            object PN_PREFIX4_tree    = default(object);
            object char_literal5_tree = default(object);
            object IRI_REF6_tree      = default(object);
            RewriteRuleITokenStream stream_PN_PREFIX = new RewriteRuleITokenStream(adaptor, "token PN_PREFIX");
            RewriteRuleITokenStream stream_IRI_REF   = new RewriteRuleITokenStream(adaptor, "token IRI_REF");
            RewriteRuleITokenStream stream_21        = new RewriteRuleITokenStream(adaptor, "token 21");

            try { DebugEnterRule(GrammarFileName, "prefix_binding");
                  DebugLocation(46, 4);
                  try
                  {
                      // ../Grammars/OslcPrefix.g:46:16: ( PN_PREFIX '=' IRI_REF -> ^( 'prefix' PN_PREFIX IRI_REF ) )
                      DebugEnterAlt(1);
                      // ../Grammars/OslcPrefix.g:46:18: PN_PREFIX '=' IRI_REF
                      {
                          DebugLocation(46, 18);
                          PN_PREFIX4 = (IToken)Match(input, PN_PREFIX, Follow._PN_PREFIX_in_prefix_binding105);
                          stream_PN_PREFIX.Add(PN_PREFIX4);

                          DebugLocation(46, 28);
                          char_literal5 = (IToken)Match(input, 21, Follow._21_in_prefix_binding107);
                          stream_21.Add(char_literal5);

                          DebugLocation(46, 32);
                          IRI_REF6 = (IToken)Match(input, IRI_REF, Follow._IRI_REF_in_prefix_binding109);
                          stream_IRI_REF.Add(IRI_REF6);



                          {
                              // AST REWRITE
                              // elements: IRI_REF, PREFIX, PN_PREFIX
                              // token labels:
                              // rule labels: retval
                              // token list labels:
                              // rule list labels:
                              // wildcard labels:
                              retval.Tree = root_0;
                              RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);

                              root_0 = (object)adaptor.Nil();
                              // 46:40: -> ^( 'prefix' PN_PREFIX IRI_REF )
                              {
                                  DebugLocation(46, 43);
                                  // ../Grammars/OslcPrefix.g:46:43: ^( 'prefix' PN_PREFIX IRI_REF )
                                  {
                                      object root_1 = (object)adaptor.Nil();
                                      DebugLocation(46, 46);
                                      root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(PREFIX, "PREFIX"), root_1);

                                      DebugLocation(46, 55);
                                      adaptor.AddChild(root_1, stream_PN_PREFIX.NextNode());
                                      DebugLocation(46, 65);
                                      adaptor.AddChild(root_1, stream_IRI_REF.NextNode());

                                      adaptor.AddChild(root_0, root_1);
                                  }
                              }

                              retval.Tree = root_0;
                          }
                      }

                      retval.Stop = (IToken)input.LT(-1);

                      retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                      adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                  }
                  catch (RecognitionException re)
                  {
                      ReportError(re);
                      Recover(input, re);
                      retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                  }
                  finally
                  {
                      TraceOut("prefix_binding", 2);
                      LeaveRule("prefix_binding", 2);
                      LeaveRule_prefix_binding();
                  }
                  DebugLocation(47, 4); } finally { DebugExitRule(GrammarFileName, "prefix_binding"); }
            return(retval);
        }
Esempio n. 13
0
        private PointcutParser.atom_return atom()
        {
            Enter_atom();
            EnterRule("atom", 6);
            TraceIn("atom", 6);
            PointcutParser.atom_return retval = new PointcutParser.atom_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken char_literal15 = null;
            IToken Identifier16   = null;
            IToken Value17        = null;
            IToken char_literal18 = null;
            IToken char_literal20 = null;

            PointcutParser.compound_return compound19 = default(PointcutParser.compound_return);

            object char_literal15_tree                = default(object);
            object Identifier16_tree                  = default(object);
            object Value17_tree                       = default(object);
            object char_literal18_tree                = default(object);
            object char_literal20_tree                = default(object);
            RewriteRuleITokenStream stream_16         = new RewriteRuleITokenStream(adaptor, "token 16");
            RewriteRuleITokenStream stream_Identifier = new RewriteRuleITokenStream(adaptor, "token Identifier");

            try { DebugEnterRule(GrammarFileName, "atom");
                  DebugLocation(33, 22);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:33:6: ( '@' Identifier -> ^( POINTCUTREF Identifier ) | Value | '(' compound ')' )
                      int alt8 = 3;
                      try { DebugEnterDecision(8, decisionCanBacktrack[8]);
                            switch (input.LA(1))
                            {
                            case 16:
                            {
                                alt8 = 1;
                            }
                            break;

                            case Value:
                            {
                                alt8 = 2;
                            }
                            break;

                            case 17:
                            {
                                alt8 = 3;
                            }
                            break;

                            default:
                            {
                                NoViableAltException nvae = new NoViableAltException("", 8, 0, input);

                                DebugRecognitionException(nvae);
                                throw nvae;
                            }
                            }
                      } finally { DebugExitDecision(8); }
                      switch (alt8)
                      {
                      case 1:
                          DebugEnterAlt(1);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:33:8: '@' Identifier
                          {
                              DebugLocation(33, 8);
                              char_literal15 = (IToken)Match(input, 16, Follow._16_in_atom190);
                              stream_16.Add(char_literal15);

                              DebugLocation(33, 12);
                              Identifier16 = (IToken)Match(input, Identifier, Follow._Identifier_in_atom192);
                              stream_Identifier.Add(Identifier16);



                              {
                                  // AST REWRITE
                                  // elements: Identifier
                                  // token labels:
                                  // rule labels: retval
                                  // token list labels:
                                  // rule list labels:
                                  // wildcard labels:
                                  retval.Tree = root_0;
                                  RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);

                                  root_0 = (object)adaptor.Nil();
                                  // 33:23: -> ^( POINTCUTREF Identifier )
                                  {
                                      DebugLocation(33, 26);
                                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:33:26: ^( POINTCUTREF Identifier )
                                      {
                                          object root_1 = (object)adaptor.Nil();
                                          DebugLocation(33, 28);
                                          root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(POINTCUTREF, "POINTCUTREF"), root_1);

                                          DebugLocation(33, 40);
                                          adaptor.AddChild(root_1, stream_Identifier.NextNode());

                                          adaptor.AddChild(root_0, root_1);
                                      }
                                  }

                                  retval.Tree = root_0;
                              }
                          }
                          break;

                      case 2:
                          DebugEnterAlt(2);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:34:5: Value
                          {
                              root_0 = (object)adaptor.Nil();

                              DebugLocation(34, 5);
                              Value17      = (IToken)Match(input, Value, Follow._Value_in_atom206);
                              Value17_tree = (object)adaptor.Create(Value17);
                              adaptor.AddChild(root_0, Value17_tree);
                          }
                          break;

                      case 3:
                          DebugEnterAlt(3);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:35:5: '(' compound ')'
                          {
                              root_0 = (object)adaptor.Nil();

                              DebugLocation(35, 8);
                              char_literal18 = (IToken)Match(input, 17, Follow._17_in_atom213);
                              DebugLocation(35, 10);
                              PushFollow(Follow._compound_in_atom216);
                              compound19 = compound();
                              PopFollow();

                              adaptor.AddChild(root_0, compound19.Tree);
                              DebugLocation(35, 22);
                              char_literal20 = (IToken)Match(input, 18, Follow._18_in_atom218);
                          }
                          break;
                      }
                      retval.Stop = (IToken)input.LT(-1);

                      retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                      adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                  }
                  catch (RecognitionException re)
                  {
                      ReportError(re);
                      Recover(input, re);
                      retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                  }
                  finally
                  {
                      TraceOut("atom", 6);
                      LeaveRule("atom", 6);
                      Leave_atom();
                  }
                  DebugLocation(35, 22); } finally { DebugExitRule(GrammarFileName, "atom"); }
            return(retval);
        }
Esempio n. 14
0
        private PointcutParser.criteria_return criteria()
        {
            Enter_criteria();
            EnterRule("criteria", 5);
            TraceIn("criteria", 5);
            PointcutParser.criteria_return retval = new PointcutParser.criteria_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken Identifier12   = null;
            IToken char_literal13 = null;

            PointcutParser.atom_return  atom11  = default(PointcutParser.atom_return);
            PointcutParser.array_return array14 = default(PointcutParser.array_return);

            object Identifier12_tree                   = default(object);
            object char_literal13_tree                 = default(object);
            RewriteRuleITokenStream  stream_15         = new RewriteRuleITokenStream(adaptor, "token 15");
            RewriteRuleITokenStream  stream_Identifier = new RewriteRuleITokenStream(adaptor, "token Identifier");
            RewriteRuleSubtreeStream stream_array      = new RewriteRuleSubtreeStream(adaptor, "rule array");

            try { DebugEnterRule(GrammarFileName, "criteria");
                  DebugLocation(30, 60);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:30:10: ( atom | ( Identifier ( ':' array )? ) -> ^( CRITERIA Identifier ( array )? ) )
                      int alt7 = 2;
                      try { DebugEnterDecision(7, decisionCanBacktrack[7]);
                            int LA7_0 = input.LA(1);

                            if ((LA7_0 == Value || (LA7_0 >= 16 && LA7_0 <= 17)))
                            {
                                alt7 = 1;
                            }
                            else if ((LA7_0 == Identifier))
                            {
                                alt7 = 2;
                            }
                            else
                            {
                                NoViableAltException nvae = new NoViableAltException("", 7, 0, input);

                                DebugRecognitionException(nvae);
                                throw nvae;
                            } } finally { DebugExitDecision(7); }
                      switch (alt7)
                      {
                      case 1:
                          DebugEnterAlt(1);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:30:12: atom
                          {
                              root_0 = (object)adaptor.Nil();

                              DebugLocation(30, 12);
                              PushFollow(Follow._atom_in_criteria157);
                              atom11 = atom();
                              PopFollow();

                              adaptor.AddChild(root_0, atom11.Tree);
                          }
                          break;

                      case 2:
                          DebugEnterAlt(2);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:4: ( Identifier ( ':' array )? )
                          {
                              DebugLocation(31, 4);
                              // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:4: ( Identifier ( ':' array )? )
                              DebugEnterAlt(1);
                              // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:5: Identifier ( ':' array )?
                              {
                                  DebugLocation(31, 5);
                                  Identifier12 = (IToken)Match(input, Identifier, Follow._Identifier_in_criteria163);
                                  stream_Identifier.Add(Identifier12);

                                  DebugLocation(31, 16);
                                  // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:16: ( ':' array )?
                                  int alt6 = 2;
                                  try { DebugEnterSubRule(6);
                                        try { DebugEnterDecision(6, decisionCanBacktrack[6]);
                                              int LA6_0 = input.LA(1);

                                              if ((LA6_0 == 15))
                                              {
                                                  alt6 = 1;
                                              }
                                        } finally { DebugExitDecision(6); }
                                        switch (alt6)
                                        {
                                        case 1:
                                            DebugEnterAlt(1);
                                            // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:17: ':' array
                                            {
                                                DebugLocation(31, 17);
                                                char_literal13 = (IToken)Match(input, 15, Follow._15_in_criteria166);
                                                stream_15.Add(char_literal13);

                                                DebugLocation(31, 21);
                                                PushFollow(Follow._array_in_criteria168);
                                                array14 = array();
                                                PopFollow();

                                                stream_array.Add(array14.Tree);
                                            }
                                            break;
                                        }
                                  } finally { DebugExitSubRule(6); }
                              }



                              {
                                  // AST REWRITE
                                  // elements: array, Identifier
                                  // token labels:
                                  // rule labels: retval
                                  // token list labels:
                                  // rule list labels:
                                  // wildcard labels:
                                  retval.Tree = root_0;
                                  RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);

                                  root_0 = (object)adaptor.Nil();
                                  // 31:29: -> ^( CRITERIA Identifier ( array )? )
                                  {
                                      DebugLocation(31, 32);
                                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:32: ^( CRITERIA Identifier ( array )? )
                                      {
                                          object root_1 = (object)adaptor.Nil();
                                          DebugLocation(31, 34);
                                          root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(CRITERIA, "CRITERIA"), root_1);

                                          DebugLocation(31, 43);
                                          adaptor.AddChild(root_1, stream_Identifier.NextNode());
                                          DebugLocation(31, 54);
                                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:31:54: ( array )?
                                          if (stream_array.HasNext)
                                          {
                                              DebugLocation(31, 54);
                                              adaptor.AddChild(root_1, stream_array.NextTree());
                                          }
                                          stream_array.Reset();

                                          adaptor.AddChild(root_0, root_1);
                                      }
                                  }

                                  retval.Tree = root_0;
                              }
                          }
                          break;
                      }
                      retval.Stop = (IToken)input.LT(-1);

                      retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                      adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                  }
                  catch (RecognitionException re)
                  {
                      ReportError(re);
                      Recover(input, re);
                      retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                  }
                  finally
                  {
                      TraceOut("criteria", 5);
                      LeaveRule("criteria", 5);
                      Leave_criteria();
                  }
                  DebugLocation(31, 60); } finally { DebugExitRule(GrammarFileName, "criteria"); }
            return(retval);
        }
Esempio n. 15
0
	private AstParserRuleReturnScope<CommonTree, IToken> packageDecl()
	{
		EnterRule_packageDecl();
		EnterRule("packageDecl", 5);
		TraceIn("packageDecl", 5);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken PACKAGE11 = default(IToken);
		IToken LCURLY13 = default(IToken);
		IToken RCURLY15 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> identifierStar12 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> packageBlockEntry14 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree PACKAGE11_tree = default(CommonTree);
		CommonTree LCURLY13_tree = default(CommonTree);
		CommonTree RCURLY15_tree = default(CommonTree);
		RewriteRuleITokenStream stream_PACKAGE=new RewriteRuleITokenStream(adaptor,"token PACKAGE");
		RewriteRuleITokenStream stream_LCURLY=new RewriteRuleITokenStream(adaptor,"token LCURLY");
		RewriteRuleITokenStream stream_RCURLY=new RewriteRuleITokenStream(adaptor,"token RCURLY");
		RewriteRuleSubtreeStream stream_identifierStar=new RewriteRuleSubtreeStream(adaptor,"rule identifierStar");
		RewriteRuleSubtreeStream stream_packageBlockEntry=new RewriteRuleSubtreeStream(adaptor,"rule packageBlockEntry");
		try { DebugEnterRule(GrammarFileName, "packageDecl");
		DebugLocation(139, 1);
		try
		{
			// AS3.g:140:2: ( PACKAGE ( identifierStar )? LCURLY ( packageBlockEntry )* RCURLY -> ^( PACKAGE_DECL PACKAGE ( identifierStar )? LCURLY ( packageBlockEntry )* RCURLY ) )
			DebugEnterAlt(1);
			// AS3.g:140:4: PACKAGE ( identifierStar )? LCURLY ( packageBlockEntry )* RCURLY
			{
			DebugLocation(140, 4);
			PACKAGE11=(IToken)Match(input,PACKAGE,Follow._PACKAGE_in_packageDecl590); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_PACKAGE.Add(PACKAGE11);

			DebugLocation(140, 12);
			// AS3.g:140:12: ( identifierStar )?
			int alt5=2;
			try { DebugEnterSubRule(5);
			try { DebugEnterDecision(5, false);
			int LA5_1 = input.LA(1);

			if ((LA5_1==AS||LA5_1==DYNAMIC||LA5_1==GET||LA5_1==IDENT||LA5_1==IS||LA5_1==NAMESPACE||LA5_1==SET||LA5_1==SUPER||LA5_1==USE||LA5_1==XML))
			{
				alt5 = 1;
			}
			} finally { DebugExitDecision(5); }
			switch (alt5)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:140:12: identifierStar
				{
				DebugLocation(140, 12);
				PushFollow(Follow._identifierStar_in_packageDecl592);
				identifierStar12=identifierStar();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_identifierStar.Add(identifierStar12.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(5); }

			DebugLocation(141, 3);
			LCURLY13=(IToken)Match(input,LCURLY,Follow._LCURLY_in_packageDecl597); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_LCURLY.Add(LCURLY13);

			DebugLocation(142, 9);
			// AS3.g:142:9: ( packageBlockEntry )*
			try { DebugEnterSubRule(6);
			while (true)
			{
				int alt6=2;
				try { DebugEnterDecision(6, false);
				int LA6_1 = input.LA(1);

				if ((LA6_1==AS||LA6_1==BNOT||LA6_1==BREAK||LA6_1==CLASS||LA6_1==CONST||LA6_1==CONTINUE||(LA6_1>=DEC && LA6_1<=DECIMAL_LITERAL)||LA6_1==DEFAULT||LA6_1==DO||(LA6_1>=DYNAMIC && LA6_1<=E4X_ATTRI)||(LA6_1>=FALSE && LA6_1<=FOR)||LA6_1==FUNCTION||LA6_1==GET||(LA6_1>=HEX_LITERAL && LA6_1<=IDENT)||LA6_1==IF||LA6_1==IMPORT||LA6_1==INC||LA6_1==INTERFACE||(LA6_1>=INTERNAL && LA6_1<=IS)||(LA6_1>=LBRACK && LA6_1<=LCURLY)||LA6_1==LNOT||LA6_1==LPAREN||LA6_1==MINUS||LA6_1==NAMESPACE||LA6_1==NEW||LA6_1==NULL||LA6_1==OCTAL_LITERAL||LA6_1==PLUS||LA6_1==PRIVATE||(LA6_1>=PROTECTED && LA6_1<=PUBLIC)||LA6_1==REGEX_LITERAL||LA6_1==RETURN||(LA6_1>=SEMI && LA6_1<=SET)||LA6_1==STATIC||(LA6_1>=STRING_LITERAL_DOUBLE && LA6_1<=SWITCH)||LA6_1==TRUE||(LA6_1>=USE && LA6_1<=VAR)||LA6_1==WHILE||LA6_1==WITH||LA6_1==XML||LA6_1==XML_LITERAL||(LA6_1>=243 && LA6_1<=246)||LA6_1==248||LA6_1==250||(LA6_1>=252 && LA6_1<=257)))
				{
					alt6 = 1;
				}


				} finally { DebugExitDecision(6); }
				switch ( alt6 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:142:9: packageBlockEntry
					{
					DebugLocation(142, 9);
					PushFollow(Follow._packageBlockEntry_in_packageDecl608);
					packageBlockEntry14=packageBlockEntry();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_packageBlockEntry.Add(packageBlockEntry14.Tree);

					}
					break;

				default:
					goto loop6;
				}
			}

			loop6:
				;

			} finally { DebugExitSubRule(6); }

			DebugLocation(143, 3);
			RCURLY15=(IToken)Match(input,RCURLY,Follow._RCURLY_in_packageDecl613); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_RCURLY.Add(RCURLY15);



			{
			// AST REWRITE
			// elements: PACKAGE, identifierStar, LCURLY, packageBlockEntry, RCURLY
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 144:3: -> ^( PACKAGE_DECL PACKAGE ( identifierStar )? LCURLY ( packageBlockEntry )* RCURLY )
			{
				DebugLocation(144, 6);
				// AS3.g:144:6: ^( PACKAGE_DECL PACKAGE ( identifierStar )? LCURLY ( packageBlockEntry )* RCURLY )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(144, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PACKAGE_DECL, "PACKAGE_DECL"), root_1);

				DebugLocation(144, 21);
				adaptor.AddChild(root_1, stream_PACKAGE.NextNode());
				DebugLocation(144, 29);
				// AS3.g:144:29: ( identifierStar )?
				if (stream_identifierStar.HasNext)
				{
					DebugLocation(144, 29);
					adaptor.AddChild(root_1, stream_identifierStar.NextTree());

				}
				stream_identifierStar.Reset();
				DebugLocation(144, 45);
				adaptor.AddChild(root_1, stream_LCURLY.NextNode());
				DebugLocation(144, 52);
				// AS3.g:144:52: ( packageBlockEntry )*
				while ( stream_packageBlockEntry.HasNext )
				{
					DebugLocation(144, 52);
					adaptor.AddChild(root_1, stream_packageBlockEntry.NextTree());

				}
				stream_packageBlockEntry.Reset();
				DebugLocation(144, 71);
				adaptor.AddChild(root_1, stream_RCURLY.NextNode());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("packageDecl", 5);
			LeaveRule("packageDecl", 5);
			LeaveRule_packageDecl();
		}
		DebugLocation(145, 1);
		} finally { DebugExitRule(GrammarFileName, "packageDecl"); }
		return retval;

	}
Esempio n. 16
0
	private AstParserRuleReturnScope<CommonTree, IToken> newExpression()
	{
		EnterRule_newExpression();
		EnterRule("newExpression", 132);
		TraceIn("newExpression", 132);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken NEW430 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> fullNewSubexpression431 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> arguments432 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree NEW430_tree = default(CommonTree);
		RewriteRuleITokenStream stream_NEW=new RewriteRuleITokenStream(adaptor,"token NEW");
		RewriteRuleSubtreeStream stream_fullNewSubexpression=new RewriteRuleSubtreeStream(adaptor,"rule fullNewSubexpression");
		RewriteRuleSubtreeStream stream_arguments=new RewriteRuleSubtreeStream(adaptor,"rule arguments");
		try { DebugEnterRule(GrammarFileName, "newExpression");
		DebugLocation(1002, 1);
		try
		{
			// AS3.g:1003:2: ( NEW fullNewSubexpression arguments -> ^( NEW_EXPRESSION NEW fullNewSubexpression arguments ) )
			DebugEnterAlt(1);
			// AS3.g:1003:4: NEW fullNewSubexpression arguments
			{
			DebugLocation(1003, 4);
			NEW430=(IToken)Match(input,NEW,Follow._NEW_in_newExpression5320); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_NEW.Add(NEW430);

			DebugLocation(1003, 8);
			PushFollow(Follow._fullNewSubexpression_in_newExpression5322);
			fullNewSubexpression431=fullNewSubexpression();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_fullNewSubexpression.Add(fullNewSubexpression431.Tree);
			DebugLocation(1003, 29);
			PushFollow(Follow._arguments_in_newExpression5324);
			arguments432=arguments();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_arguments.Add(arguments432.Tree);


			{
			// AST REWRITE
			// elements: NEW, fullNewSubexpression, arguments
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 1003:39: -> ^( NEW_EXPRESSION NEW fullNewSubexpression arguments )
			{
				DebugLocation(1003, 42);
				// AS3.g:1003:42: ^( NEW_EXPRESSION NEW fullNewSubexpression arguments )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(1003, 44);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NEW_EXPRESSION, "NEW_EXPRESSION"), root_1);

				DebugLocation(1003, 59);
				adaptor.AddChild(root_1, stream_NEW.NextNode());
				DebugLocation(1003, 63);
				adaptor.AddChild(root_1, stream_fullNewSubexpression.NextTree());
				DebugLocation(1003, 84);
				adaptor.AddChild(root_1, stream_arguments.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("newExpression", 132);
			LeaveRule("newExpression", 132);
			LeaveRule_newExpression();
		}
		DebugLocation(1004, 1);
		} finally { DebugExitRule(GrammarFileName, "newExpression"); }
		return retval;

	}
Esempio n. 17
0
	private AstParserRuleReturnScope<CommonTree, IToken> typeExpression()
	{
		EnterRule_typeExpression();
		EnterRule("typeExpression", 71);
		TraceIn("typeExpression", 71);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken COLON232 = default(IToken);
		IToken string_literal234 = default(IToken);
		IToken STAR235 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> typeIdentifier233 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree COLON232_tree = default(CommonTree);
		CommonTree string_literal234_tree = default(CommonTree);
		CommonTree STAR235_tree = default(CommonTree);
		RewriteRuleITokenStream stream_COLON=new RewriteRuleITokenStream(adaptor,"token COLON");
		RewriteRuleITokenStream stream_257=new RewriteRuleITokenStream(adaptor,"token 257");
		RewriteRuleITokenStream stream_STAR=new RewriteRuleITokenStream(adaptor,"token STAR");
		RewriteRuleSubtreeStream stream_typeIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule typeIdentifier");
		try { DebugEnterRule(GrammarFileName, "typeExpression");
		DebugLocation(567, 4);
		try
		{
			// AS3.g:568:2: ( COLON ( typeIdentifier | 'void' | STAR ) -> ^( TYPE_SPEC COLON ( typeIdentifier )? ( 'void' )? ( STAR )? ) )
			DebugEnterAlt(1);
			// AS3.g:569:3: COLON ( typeIdentifier | 'void' | STAR )
			{
			DebugLocation(569, 3);
			COLON232=(IToken)Match(input,COLON,Follow._COLON_in_typeExpression3075); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_COLON.Add(COLON232);

			DebugLocation(569, 9);
			// AS3.g:569:9: ( typeIdentifier | 'void' | STAR )
			int alt49=3;
			try { DebugEnterSubRule(49);
			try { DebugEnterDecision(49, false);
			switch (input.LA(1))
			{
			case AS:
			case DYNAMIC:
			case GET:
			case IDENT:
			case IS:
			case NAMESPACE:
			case SET:
			case SUPER:
			case USE:
			case XML:
				{
				alt49 = 1;
				}
				break;
			case 257:
				{
				alt49 = 2;
				}
				break;
			case STAR:
				{
				alt49 = 3;
				}
				break;
			default:
				{
					if (state.backtracking>0) {state.failed=true; return retval;}
					NoViableAltException nvae = new NoViableAltException("", 49, 0, input, 1);
					DebugRecognitionException(nvae);
					throw nvae;
				}
			}

			} finally { DebugExitDecision(49); }
			switch (alt49)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:569:10: typeIdentifier
				{
				DebugLocation(569, 10);
				PushFollow(Follow._typeIdentifier_in_typeExpression3078);
				typeIdentifier233=typeIdentifier();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_typeIdentifier.Add(typeIdentifier233.Tree);

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// AS3.g:569:27: 'void'
				{
				DebugLocation(569, 27);
				string_literal234=(IToken)Match(input,257,Follow._257_in_typeExpression3082); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_257.Add(string_literal234);


				}
				break;
			case 3:
				DebugEnterAlt(3);
				// AS3.g:569:36: STAR
				{
				DebugLocation(569, 36);
				STAR235=(IToken)Match(input,STAR,Follow._STAR_in_typeExpression3086); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_STAR.Add(STAR235);


				}
				break;

			}
			} finally { DebugExitSubRule(49); }



			{
			// AST REWRITE
			// elements: COLON, typeIdentifier, 257, STAR
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 570:3: -> ^( TYPE_SPEC COLON ( typeIdentifier )? ( 'void' )? ( STAR )? )
			{
				DebugLocation(570, 6);
				// AS3.g:570:6: ^( TYPE_SPEC COLON ( typeIdentifier )? ( 'void' )? ( STAR )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(570, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(TYPE_SPEC, "TYPE_SPEC"), root_1);

				DebugLocation(570, 18);
				adaptor.AddChild(root_1, stream_COLON.NextNode());
				DebugLocation(570, 24);
				// AS3.g:570:24: ( typeIdentifier )?
				if (stream_typeIdentifier.HasNext)
				{
					DebugLocation(570, 24);
					adaptor.AddChild(root_1, stream_typeIdentifier.NextTree());

				}
				stream_typeIdentifier.Reset();
				DebugLocation(570, 40);
				// AS3.g:570:40: ( 'void' )?
				if (stream_257.HasNext)
				{
					DebugLocation(570, 40);
					adaptor.AddChild(root_1, stream_257.NextNode());

				}
				stream_257.Reset();
				DebugLocation(570, 48);
				// AS3.g:570:48: ( STAR )?
				if (stream_STAR.HasNext)
				{
					DebugLocation(570, 48);
					adaptor.AddChild(root_1, stream_STAR.NextNode());

				}
				stream_STAR.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("typeExpression", 71);
			LeaveRule("typeExpression", 71);
			LeaveRule_typeExpression();
		}
		DebugLocation(571, 4);
		} finally { DebugExitRule(GrammarFileName, "typeExpression"); }
		return retval;

	}
Esempio n. 18
0
	private AstParserRuleReturnScope<CommonTree, IToken> interfaceDefinition()
	{
		EnterRule_interfaceDefinition();
		EnterRule("interfaceDefinition", 12);
		TraceIn("interfaceDefinition", 12);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken INTERFACE43 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> modifiers42 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> ident44 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> interfaceExtendsClause45 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> typeBlock46 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree INTERFACE43_tree = default(CommonTree);
		RewriteRuleITokenStream stream_INTERFACE=new RewriteRuleITokenStream(adaptor,"token INTERFACE");
		RewriteRuleSubtreeStream stream_modifiers=new RewriteRuleSubtreeStream(adaptor,"rule modifiers");
		RewriteRuleSubtreeStream stream_ident=new RewriteRuleSubtreeStream(adaptor,"rule ident");
		RewriteRuleSubtreeStream stream_interfaceExtendsClause=new RewriteRuleSubtreeStream(adaptor,"rule interfaceExtendsClause");
		RewriteRuleSubtreeStream stream_typeBlock=new RewriteRuleSubtreeStream(adaptor,"rule typeBlock");
		try { DebugEnterRule(GrammarFileName, "interfaceDefinition");
		DebugLocation(194, 1);
		try
		{
			// AS3.g:195:2: ( modifiers INTERFACE ident ( interfaceExtendsClause )? typeBlock -> ^( INTERFACE_DEF modifiers INTERFACE ident ( interfaceExtendsClause )? typeBlock ) )
			DebugEnterAlt(1);
			// AS3.g:195:4: modifiers INTERFACE ident ( interfaceExtendsClause )? typeBlock
			{
			DebugLocation(195, 4);
			PushFollow(Follow._modifiers_in_interfaceDefinition981);
			modifiers42=modifiers();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_modifiers.Add(modifiers42.Tree);
			DebugLocation(196, 3);
			INTERFACE43=(IToken)Match(input,INTERFACE,Follow._INTERFACE_in_interfaceDefinition985); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_INTERFACE.Add(INTERFACE43);

			DebugLocation(196, 13);
			PushFollow(Follow._ident_in_interfaceDefinition987);
			ident44=ident();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_ident.Add(ident44.Tree);
			DebugLocation(197, 3);
			// AS3.g:197:3: ( interfaceExtendsClause )?
			int alt12=2;
			try { DebugEnterSubRule(12);
			try { DebugEnterDecision(12, false);
			int LA12_1 = input.LA(1);

			if ((LA12_1==EXTENDS))
			{
				alt12 = 1;
			}
			} finally { DebugExitDecision(12); }
			switch (alt12)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:197:3: interfaceExtendsClause
				{
				DebugLocation(197, 3);
				PushFollow(Follow._interfaceExtendsClause_in_interfaceDefinition991);
				interfaceExtendsClause45=interfaceExtendsClause();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_interfaceExtendsClause.Add(interfaceExtendsClause45.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(12); }

			DebugLocation(198, 3);
			PushFollow(Follow._typeBlock_in_interfaceDefinition996);
			typeBlock46=typeBlock();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_typeBlock.Add(typeBlock46.Tree);


			{
			// AST REWRITE
			// elements: modifiers, INTERFACE, ident, interfaceExtendsClause, typeBlock
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 199:3: -> ^( INTERFACE_DEF modifiers INTERFACE ident ( interfaceExtendsClause )? typeBlock )
			{
				DebugLocation(199, 6);
				// AS3.g:199:6: ^( INTERFACE_DEF modifiers INTERFACE ident ( interfaceExtendsClause )? typeBlock )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(199, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(INTERFACE_DEF, "INTERFACE_DEF"), root_1);

				DebugLocation(199, 22);
				adaptor.AddChild(root_1, stream_modifiers.NextTree());
				DebugLocation(199, 32);
				adaptor.AddChild(root_1, stream_INTERFACE.NextNode());
				DebugLocation(199, 42);
				adaptor.AddChild(root_1, stream_ident.NextTree());
				DebugLocation(199, 48);
				// AS3.g:199:48: ( interfaceExtendsClause )?
				if (stream_interfaceExtendsClause.HasNext)
				{
					DebugLocation(199, 48);
					adaptor.AddChild(root_1, stream_interfaceExtendsClause.NextTree());

				}
				stream_interfaceExtendsClause.Reset();
				DebugLocation(199, 72);
				adaptor.AddChild(root_1, stream_typeBlock.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("interfaceDefinition", 12);
			LeaveRule("interfaceDefinition", 12);
			LeaveRule_interfaceDefinition();
		}
		DebugLocation(200, 1);
		} finally { DebugExitRule(GrammarFileName, "interfaceDefinition"); }
		return retval;

	}
Esempio n. 19
0
	private AstParserRuleReturnScope<CommonTree, IToken> basicParameterDeclaration()
	{
		EnterRule_basicParameterDeclaration();
		EnterRule("basicParameterDeclaration", 35);
		TraceIn("basicParameterDeclaration", 35);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken CONST114 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> ident115 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> typeExpression116 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> parameterDefault117 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree CONST114_tree = default(CommonTree);
		RewriteRuleITokenStream stream_CONST=new RewriteRuleITokenStream(adaptor,"token CONST");
		RewriteRuleSubtreeStream stream_ident=new RewriteRuleSubtreeStream(adaptor,"rule ident");
		RewriteRuleSubtreeStream stream_typeExpression=new RewriteRuleSubtreeStream(adaptor,"rule typeExpression");
		RewriteRuleSubtreeStream stream_parameterDefault=new RewriteRuleSubtreeStream(adaptor,"rule parameterDefault");
		try { DebugEnterRule(GrammarFileName, "basicParameterDeclaration");
		DebugLocation(343, 1);
		try
		{
			// AS3.g:344:2: ( ( CONST )? ident ( typeExpression )? ( parameterDefault )? -> ^( PARAM ( CONST )? ident ( typeExpression )? ( parameterDefault )? ) )
			DebugEnterAlt(1);
			// AS3.g:344:4: ( CONST )? ident ( typeExpression )? ( parameterDefault )?
			{
			DebugLocation(344, 4);
			// AS3.g:344:4: ( CONST )?
			int alt28=2;
			try { DebugEnterSubRule(28);
			try { DebugEnterDecision(28, false);
			int LA28_1 = input.LA(1);

			if ((LA28_1==CONST))
			{
				alt28 = 1;
			}
			} finally { DebugExitDecision(28); }
			switch (alt28)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:344:4: CONST
				{
				DebugLocation(344, 4);
				CONST114=(IToken)Match(input,CONST,Follow._CONST_in_basicParameterDeclaration1877); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_CONST.Add(CONST114);


				}
				break;

			}
			} finally { DebugExitSubRule(28); }

			DebugLocation(344, 11);
			PushFollow(Follow._ident_in_basicParameterDeclaration1880);
			ident115=ident();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_ident.Add(ident115.Tree);
			DebugLocation(344, 17);
			// AS3.g:344:17: ( typeExpression )?
			int alt29=2;
			try { DebugEnterSubRule(29);
			try { DebugEnterDecision(29, false);
			int LA29_1 = input.LA(1);

			if ((LA29_1==COLON))
			{
				alt29 = 1;
			}
			} finally { DebugExitDecision(29); }
			switch (alt29)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:344:17: typeExpression
				{
				DebugLocation(344, 17);
				PushFollow(Follow._typeExpression_in_basicParameterDeclaration1882);
				typeExpression116=typeExpression();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_typeExpression.Add(typeExpression116.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(29); }

			DebugLocation(344, 33);
			// AS3.g:344:33: ( parameterDefault )?
			int alt30=2;
			try { DebugEnterSubRule(30);
			try { DebugEnterDecision(30, false);
			int LA30_1 = input.LA(1);

			if ((LA30_1==ASSIGN))
			{
				alt30 = 1;
			}
			} finally { DebugExitDecision(30); }
			switch (alt30)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:344:33: parameterDefault
				{
				DebugLocation(344, 33);
				PushFollow(Follow._parameterDefault_in_basicParameterDeclaration1885);
				parameterDefault117=parameterDefault();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_parameterDefault.Add(parameterDefault117.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(30); }



			{
			// AST REWRITE
			// elements: CONST, ident, typeExpression, parameterDefault
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 345:3: -> ^( PARAM ( CONST )? ident ( typeExpression )? ( parameterDefault )? )
			{
				DebugLocation(345, 6);
				// AS3.g:345:6: ^( PARAM ( CONST )? ident ( typeExpression )? ( parameterDefault )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(345, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PARAM, "PARAM"), root_1);

				DebugLocation(345, 14);
				// AS3.g:345:14: ( CONST )?
				if (stream_CONST.HasNext)
				{
					DebugLocation(345, 14);
					adaptor.AddChild(root_1, stream_CONST.NextNode());

				}
				stream_CONST.Reset();
				DebugLocation(345, 21);
				adaptor.AddChild(root_1, stream_ident.NextTree());
				DebugLocation(345, 27);
				// AS3.g:345:27: ( typeExpression )?
				if (stream_typeExpression.HasNext)
				{
					DebugLocation(345, 27);
					adaptor.AddChild(root_1, stream_typeExpression.NextTree());

				}
				stream_typeExpression.Reset();
				DebugLocation(345, 43);
				// AS3.g:345:43: ( parameterDefault )?
				if (stream_parameterDefault.HasNext)
				{
					DebugLocation(345, 43);
					adaptor.AddChild(root_1, stream_parameterDefault.NextTree());

				}
				stream_parameterDefault.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("basicParameterDeclaration", 35);
			LeaveRule("basicParameterDeclaration", 35);
			LeaveRule_basicParameterDeclaration();
		}
		DebugLocation(346, 1);
		} finally { DebugExitRule(GrammarFileName, "basicParameterDeclaration"); }
		return retval;

	}
Esempio n. 20
0
	private AstParserRuleReturnScope<CommonTree, IToken> classExtendsClause()
	{
		EnterRule_classExtendsClause();
		EnterRule("classExtendsClause", 14);
		TraceIn("classExtendsClause", 14);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken EXTENDS52 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> identifier53 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree EXTENDS52_tree = default(CommonTree);
		RewriteRuleITokenStream stream_EXTENDS=new RewriteRuleITokenStream(adaptor,"token EXTENDS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		try { DebugEnterRule(GrammarFileName, "classExtendsClause");
		DebugLocation(210, 1);
		try
		{
			// AS3.g:211:2: ( EXTENDS identifier -> ^( EXTENDS_CLAUSE EXTENDS identifier ) )
			DebugEnterAlt(1);
			// AS3.g:211:4: EXTENDS identifier
			{
			DebugLocation(211, 4);
			EXTENDS52=(IToken)Match(input,EXTENDS,Follow._EXTENDS_in_classExtendsClause1069); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_EXTENDS.Add(EXTENDS52);

			DebugLocation(211, 12);
			PushFollow(Follow._identifier_in_classExtendsClause1071);
			identifier53=identifier();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_identifier.Add(identifier53.Tree);


			{
			// AST REWRITE
			// elements: EXTENDS, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 212:9: -> ^( EXTENDS_CLAUSE EXTENDS identifier )
			{
				DebugLocation(212, 12);
				// AS3.g:212:12: ^( EXTENDS_CLAUSE EXTENDS identifier )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(212, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(EXTENDS_CLAUSE, "EXTENDS_CLAUSE"), root_1);

				DebugLocation(212, 29);
				adaptor.AddChild(root_1, stream_EXTENDS.NextNode());
				DebugLocation(212, 37);
				adaptor.AddChild(root_1, stream_identifier.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("classExtendsClause", 14);
			LeaveRule("classExtendsClause", 14);
			LeaveRule_classExtendsClause();
		}
		DebugLocation(213, 1);
		} finally { DebugExitRule(GrammarFileName, "classExtendsClause"); }
		return retval;

	}
Esempio n. 21
0
	private AstParserRuleReturnScope<CommonTree, IToken> block()
	{
		EnterRule_block();
		EnterRule("block", 38);
		TraceIn("block", 38);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken LCURLY123 = default(IToken);
		IToken RCURLY125 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> blockEntry124 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree LCURLY123_tree = default(CommonTree);
		CommonTree RCURLY125_tree = default(CommonTree);
		RewriteRuleITokenStream stream_LCURLY=new RewriteRuleITokenStream(adaptor,"token LCURLY");
		RewriteRuleITokenStream stream_RCURLY=new RewriteRuleITokenStream(adaptor,"token RCURLY");
		RewriteRuleSubtreeStream stream_blockEntry=new RewriteRuleSubtreeStream(adaptor,"rule blockEntry");
		try { DebugEnterRule(GrammarFileName, "block");
		DebugLocation(357, 1);
		try
		{
			// AS3.g:358:2: ( LCURLY ( blockEntry )* RCURLY -> ^( BLOCK LCURLY ( blockEntry )* RCURLY ) )
			DebugEnterAlt(1);
			// AS3.g:358:4: LCURLY ( blockEntry )* RCURLY
			{
			DebugLocation(358, 4);
			LCURLY123=(IToken)Match(input,LCURLY,Follow._LCURLY_in_block1964); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_LCURLY.Add(LCURLY123);

			DebugLocation(358, 11);
			// AS3.g:358:11: ( blockEntry )*
			try { DebugEnterSubRule(33);
			while (true)
			{
				int alt33=2;
				try { DebugEnterDecision(33, false);
				int LA33_1 = input.LA(1);

				if ((LA33_1==AS||LA33_1==BNOT||LA33_1==BREAK||LA33_1==CONST||LA33_1==CONTINUE||(LA33_1>=DEC && LA33_1<=DECIMAL_LITERAL)||LA33_1==DEFAULT||LA33_1==DO||(LA33_1>=DYNAMIC && LA33_1<=E4X_ATTRI)||(LA33_1>=FALSE && LA33_1<=FOR)||LA33_1==FUNCTION||LA33_1==GET||(LA33_1>=HEX_LITERAL && LA33_1<=IDENT)||LA33_1==IF||LA33_1==INC||(LA33_1>=INTERNAL && LA33_1<=IS)||(LA33_1>=LBRACK && LA33_1<=LCURLY)||LA33_1==LNOT||LA33_1==LPAREN||LA33_1==MINUS||LA33_1==NAMESPACE||LA33_1==NEW||LA33_1==NULL||LA33_1==OCTAL_LITERAL||LA33_1==PLUS||LA33_1==PRIVATE||(LA33_1>=PROTECTED && LA33_1<=PUBLIC)||LA33_1==REGEX_LITERAL||LA33_1==RETURN||(LA33_1>=SEMI && LA33_1<=SET)||(LA33_1>=STRING_LITERAL_DOUBLE && LA33_1<=SWITCH)||LA33_1==TRUE||(LA33_1>=USE && LA33_1<=VAR)||LA33_1==WHILE||LA33_1==WITH||LA33_1==XML||LA33_1==XML_LITERAL||LA33_1==243||(LA33_1>=253 && LA33_1<=257)))
				{
					alt33 = 1;
				}


				} finally { DebugExitDecision(33); }
				switch ( alt33 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:358:11: blockEntry
					{
					DebugLocation(358, 11);
					PushFollow(Follow._blockEntry_in_block1966);
					blockEntry124=blockEntry();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_blockEntry.Add(blockEntry124.Tree);

					}
					break;

				default:
					goto loop33;
				}
			}

			loop33:
				;

			} finally { DebugExitSubRule(33); }

			DebugLocation(358, 23);
			RCURLY125=(IToken)Match(input,RCURLY,Follow._RCURLY_in_block1969); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_RCURLY.Add(RCURLY125);



			{
			// AST REWRITE
			// elements: LCURLY, blockEntry, RCURLY
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 359:3: -> ^( BLOCK LCURLY ( blockEntry )* RCURLY )
			{
				DebugLocation(359, 6);
				// AS3.g:359:6: ^( BLOCK LCURLY ( blockEntry )* RCURLY )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(359, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(BLOCK, "BLOCK"), root_1);

				DebugLocation(359, 14);
				adaptor.AddChild(root_1, stream_LCURLY.NextNode());
				DebugLocation(359, 21);
				// AS3.g:359:21: ( blockEntry )*
				while ( stream_blockEntry.HasNext )
				{
					DebugLocation(359, 21);
					adaptor.AddChild(root_1, stream_blockEntry.NextTree());

				}
				stream_blockEntry.Reset();
				DebugLocation(359, 33);
				adaptor.AddChild(root_1, stream_RCURLY.NextNode());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("block", 38);
			LeaveRule("block", 38);
			LeaveRule_block();
		}
		DebugLocation(360, 1);
		} finally { DebugExitRule(GrammarFileName, "block"); }
		return retval;

	}
Esempio n. 22
0
	private AstParserRuleReturnScope<CommonTree, IToken> interfaceExtendsClause()
	{
		EnterRule_interfaceExtendsClause();
		EnterRule("interfaceExtendsClause", 15);
		TraceIn("interfaceExtendsClause", 15);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken EXTENDS54 = default(IToken);
		IToken COMMA56 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> identifier55 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> identifier57 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree EXTENDS54_tree = default(CommonTree);
		CommonTree COMMA56_tree = default(CommonTree);
		RewriteRuleITokenStream stream_EXTENDS=new RewriteRuleITokenStream(adaptor,"token EXTENDS");
		RewriteRuleITokenStream stream_COMMA=new RewriteRuleITokenStream(adaptor,"token COMMA");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		try { DebugEnterRule(GrammarFileName, "interfaceExtendsClause");
		DebugLocation(215, 1);
		try
		{
			// AS3.g:216:2: ( EXTENDS identifier ( COMMA identifier )* -> ^( EXTENDS_CLAUSE EXTENDS ( identifier )+ ) )
			DebugEnterAlt(1);
			// AS3.g:216:4: EXTENDS identifier ( COMMA identifier )*
			{
			DebugLocation(216, 4);
			EXTENDS54=(IToken)Match(input,EXTENDS,Follow._EXTENDS_in_interfaceExtendsClause1100); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_EXTENDS.Add(EXTENDS54);

			DebugLocation(216, 12);
			PushFollow(Follow._identifier_in_interfaceExtendsClause1102);
			identifier55=identifier();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_identifier.Add(identifier55.Tree);
			DebugLocation(216, 23);
			// AS3.g:216:23: ( COMMA identifier )*
			try { DebugEnterSubRule(14);
			while (true)
			{
				int alt14=2;
				try { DebugEnterDecision(14, false);
				int LA14_1 = input.LA(1);

				if ((LA14_1==COMMA))
				{
					alt14 = 1;
				}


				} finally { DebugExitDecision(14); }
				switch ( alt14 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:216:25: COMMA identifier
					{
					DebugLocation(216, 25);
					COMMA56=(IToken)Match(input,COMMA,Follow._COMMA_in_interfaceExtendsClause1106); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_COMMA.Add(COMMA56);

					DebugLocation(216, 31);
					PushFollow(Follow._identifier_in_interfaceExtendsClause1108);
					identifier57=identifier();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_identifier.Add(identifier57.Tree);

					}
					break;

				default:
					goto loop14;
				}
			}

			loop14:
				;

			} finally { DebugExitSubRule(14); }



			{
			// AST REWRITE
			// elements: EXTENDS, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 217:9: -> ^( EXTENDS_CLAUSE EXTENDS ( identifier )+ )
			{
				DebugLocation(217, 12);
				// AS3.g:217:12: ^( EXTENDS_CLAUSE EXTENDS ( identifier )+ )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(217, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(EXTENDS_CLAUSE, "EXTENDS_CLAUSE"), root_1);

				DebugLocation(217, 29);
				adaptor.AddChild(root_1, stream_EXTENDS.NextNode());
				DebugLocation(217, 37);
				if (!(stream_identifier.HasNext))
				{
					throw new RewriteEarlyExitException();
				}
				while ( stream_identifier.HasNext )
				{
					DebugLocation(217, 37);
					adaptor.AddChild(root_1, stream_identifier.NextTree());

				}
				stream_identifier.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("interfaceExtendsClause", 15);
			LeaveRule("interfaceExtendsClause", 15);
			LeaveRule_interfaceExtendsClause();
		}
		DebugLocation(218, 1);
		} finally { DebugExitRule(GrammarFileName, "interfaceExtendsClause"); }
		return retval;

	}
Esempio n. 23
0
	private AstParserRuleReturnScope<CommonTree, IToken> elseClause()
	{
		EnterRule_elseClause();
		EnterRule("elseClause", 45);
		TraceIn("elseClause", 45);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken ELSE152 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> statement153 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree ELSE152_tree = default(CommonTree);
		RewriteRuleITokenStream stream_ELSE=new RewriteRuleITokenStream(adaptor,"token ELSE");
		RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
		try { DebugEnterRule(GrammarFileName, "elseClause");
		DebugLocation(423, 1);
		try
		{
			// AS3.g:424:2: ( ELSE statement -> ^( ELSE_CLAUSE ELSE statement ) )
			DebugEnterAlt(1);
			// AS3.g:424:4: ELSE statement
			{
			DebugLocation(424, 4);
			ELSE152=(IToken)Match(input,ELSE,Follow._ELSE_in_elseClause2266); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_ELSE.Add(ELSE152);

			DebugLocation(424, 9);
			PushFollow(Follow._statement_in_elseClause2268);
			statement153=statement();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_statement.Add(statement153.Tree);


			{
			// AST REWRITE
			// elements: ELSE, statement
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 425:9: -> ^( ELSE_CLAUSE ELSE statement )
			{
				DebugLocation(425, 12);
				// AS3.g:425:12: ^( ELSE_CLAUSE ELSE statement )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(425, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(ELSE_CLAUSE, "ELSE_CLAUSE"), root_1);

				DebugLocation(425, 26);
				adaptor.AddChild(root_1, stream_ELSE.NextNode());
				DebugLocation(425, 31);
				adaptor.AddChild(root_1, stream_statement.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("elseClause", 45);
			LeaveRule("elseClause", 45);
			LeaveRule_elseClause();
		}
		DebugLocation(426, 1);
		} finally { DebugExitRule(GrammarFileName, "elseClause"); }
		return retval;

	}
Esempio n. 24
0
	private AstParserRuleReturnScope<CommonTree, IToken> implementsClause()
	{
		EnterRule_implementsClause();
		EnterRule("implementsClause", 16);
		TraceIn("implementsClause", 16);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken IMPLEMENTS58 = default(IToken);
		IToken COMMA60 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> identifier59 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> identifier61 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree IMPLEMENTS58_tree = default(CommonTree);
		CommonTree COMMA60_tree = default(CommonTree);
		RewriteRuleITokenStream stream_IMPLEMENTS=new RewriteRuleITokenStream(adaptor,"token IMPLEMENTS");
		RewriteRuleITokenStream stream_COMMA=new RewriteRuleITokenStream(adaptor,"token COMMA");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		try { DebugEnterRule(GrammarFileName, "implementsClause");
		DebugLocation(220, 1);
		try
		{
			// AS3.g:221:2: ( IMPLEMENTS identifier ( COMMA identifier )* -> ^( IMPLEMENTS_CLAUSE IMPLEMENTS ( identifier )+ ) )
			DebugEnterAlt(1);
			// AS3.g:221:4: IMPLEMENTS identifier ( COMMA identifier )*
			{
			DebugLocation(221, 4);
			IMPLEMENTS58=(IToken)Match(input,IMPLEMENTS,Follow._IMPLEMENTS_in_implementsClause1140); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_IMPLEMENTS.Add(IMPLEMENTS58);

			DebugLocation(221, 15);
			PushFollow(Follow._identifier_in_implementsClause1142);
			identifier59=identifier();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_identifier.Add(identifier59.Tree);
			DebugLocation(221, 26);
			// AS3.g:221:26: ( COMMA identifier )*
			try { DebugEnterSubRule(15);
			while (true)
			{
				int alt15=2;
				try { DebugEnterDecision(15, false);
				int LA15_1 = input.LA(1);

				if ((LA15_1==COMMA))
				{
					alt15 = 1;
				}


				} finally { DebugExitDecision(15); }
				switch ( alt15 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:221:28: COMMA identifier
					{
					DebugLocation(221, 28);
					COMMA60=(IToken)Match(input,COMMA,Follow._COMMA_in_implementsClause1146); if (state.failed) return retval; 
					if (state.backtracking == 0) stream_COMMA.Add(COMMA60);

					DebugLocation(221, 34);
					PushFollow(Follow._identifier_in_implementsClause1148);
					identifier61=identifier();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_identifier.Add(identifier61.Tree);

					}
					break;

				default:
					goto loop15;
				}
			}

			loop15:
				;

			} finally { DebugExitSubRule(15); }



			{
			// AST REWRITE
			// elements: IMPLEMENTS, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 222:9: -> ^( IMPLEMENTS_CLAUSE IMPLEMENTS ( identifier )+ )
			{
				DebugLocation(222, 12);
				// AS3.g:222:12: ^( IMPLEMENTS_CLAUSE IMPLEMENTS ( identifier )+ )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(222, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(IMPLEMENTS_CLAUSE, "IMPLEMENTS_CLAUSE"), root_1);

				DebugLocation(222, 32);
				adaptor.AddChild(root_1, stream_IMPLEMENTS.NextNode());
				DebugLocation(222, 43);
				if (!(stream_identifier.HasNext))
				{
					throw new RewriteEarlyExitException();
				}
				while ( stream_identifier.HasNext )
				{
					DebugLocation(222, 43);
					adaptor.AddChild(root_1, stream_identifier.NextTree());

				}
				stream_identifier.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("implementsClause", 16);
			LeaveRule("implementsClause", 16);
			LeaveRule_implementsClause();
		}
		DebugLocation(223, 1);
		} finally { DebugExitRule(GrammarFileName, "implementsClause"); }
		return retval;

	}
Esempio n. 25
0
	private AstParserRuleReturnScope<CommonTree, IToken> tryStatement()
	{
		EnterRule_tryStatement();
		EnterRule("tryStatement", 47);
		TraceIn("tryStatement", 47);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken string_literal156 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> block157 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> catchBlock158 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> finallyBlock159 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree string_literal156_tree = default(CommonTree);
		RewriteRuleITokenStream stream_254=new RewriteRuleITokenStream(adaptor,"token 254");
		RewriteRuleSubtreeStream stream_block=new RewriteRuleSubtreeStream(adaptor,"rule block");
		RewriteRuleSubtreeStream stream_catchBlock=new RewriteRuleSubtreeStream(adaptor,"rule catchBlock");
		RewriteRuleSubtreeStream stream_finallyBlock=new RewriteRuleSubtreeStream(adaptor,"rule finallyBlock");
		try { DebugEnterRule(GrammarFileName, "tryStatement");
		DebugLocation(433, 1);
		try
		{
			// AS3.g:434:2: ( 'try' block ( catchBlock )* ( finallyBlock )? -> ^( TRY_STATEMENT 'try' block ( catchBlock )* ( finallyBlock )? ) )
			DebugEnterAlt(1);
			// AS3.g:434:4: 'try' block ( catchBlock )* ( finallyBlock )?
			{
			DebugLocation(434, 4);
			string_literal156=(IToken)Match(input,254,Follow._254_in_tryStatement2335); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_254.Add(string_literal156);

			DebugLocation(435, 3);
			PushFollow(Follow._block_in_tryStatement2339);
			block157=block();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_block.Add(block157.Tree);
			DebugLocation(436, 3);
			// AS3.g:436:3: ( catchBlock )*
			try { DebugEnterSubRule(36);
			while (true)
			{
				int alt36=2;
				try { DebugEnterDecision(36, false);
				int LA36_1 = input.LA(1);

				if ((LA36_1==242))
				{
					alt36 = 1;
				}


				} finally { DebugExitDecision(36); }
				switch ( alt36 )
				{
				case 1:
					DebugEnterAlt(1);
					// AS3.g:436:3: catchBlock
					{
					DebugLocation(436, 3);
					PushFollow(Follow._catchBlock_in_tryStatement2343);
					catchBlock158=catchBlock();
					PopFollow();
					if (state.failed) return retval;
					if (state.backtracking == 0) stream_catchBlock.Add(catchBlock158.Tree);

					}
					break;

				default:
					goto loop36;
				}
			}

			loop36:
				;

			} finally { DebugExitSubRule(36); }

			DebugLocation(437, 3);
			// AS3.g:437:3: ( finallyBlock )?
			int alt37=2;
			try { DebugEnterSubRule(37);
			try { DebugEnterDecision(37, false);
			int LA37_1 = input.LA(1);

			if ((LA37_1==247))
			{
				alt37 = 1;
			}
			} finally { DebugExitDecision(37); }
			switch (alt37)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:437:3: finallyBlock
				{
				DebugLocation(437, 3);
				PushFollow(Follow._finallyBlock_in_tryStatement2348);
				finallyBlock159=finallyBlock();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_finallyBlock.Add(finallyBlock159.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(37); }



			{
			// AST REWRITE
			// elements: 254, block, catchBlock, finallyBlock
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 438:9: -> ^( TRY_STATEMENT 'try' block ( catchBlock )* ( finallyBlock )? )
			{
				DebugLocation(438, 12);
				// AS3.g:438:12: ^( TRY_STATEMENT 'try' block ( catchBlock )* ( finallyBlock )? )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(438, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(TRY_STATEMENT, "TRY_STATEMENT"), root_1);

				DebugLocation(438, 28);
				adaptor.AddChild(root_1, stream_254.NextNode());
				DebugLocation(438, 34);
				adaptor.AddChild(root_1, stream_block.NextTree());
				DebugLocation(438, 40);
				// AS3.g:438:40: ( catchBlock )*
				while ( stream_catchBlock.HasNext )
				{
					DebugLocation(438, 40);
					adaptor.AddChild(root_1, stream_catchBlock.NextTree());

				}
				stream_catchBlock.Reset();
				DebugLocation(438, 52);
				// AS3.g:438:52: ( finallyBlock )?
				if (stream_finallyBlock.HasNext)
				{
					DebugLocation(438, 52);
					adaptor.AddChild(root_1, stream_finallyBlock.NextTree());

				}
				stream_finallyBlock.Reset();

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("tryStatement", 47);
			LeaveRule("tryStatement", 47);
			LeaveRule_tryStatement();
		}
		DebugLocation(439, 1);
		} finally { DebugExitRule(GrammarFileName, "tryStatement"); }
		return retval;

	}
Esempio n. 26
0
	private AstParserRuleReturnScope<CommonTree, IToken> includeDirective()
	{
		EnterRule_includeDirective();
		EnterRule("includeDirective", 20);
		TraceIn("includeDirective", 20);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken string_literal73 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> s = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> stringLiteral74 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree string_literal73_tree = default(CommonTree);
		RewriteRuleITokenStream stream_248=new RewriteRuleITokenStream(adaptor,"token 248");
		RewriteRuleSubtreeStream stream_stringLiteral=new RewriteRuleSubtreeStream(adaptor,"rule stringLiteral");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "includeDirective");
		DebugLocation(247, 1);
		try
		{
			// AS3.g:248:2: ( 'include' stringLiteral s= semi -> ^( INCLUDE_DIRECTIVE 'include' stringLiteral ) )
			DebugEnterAlt(1);
			// AS3.g:248:4: 'include' stringLiteral s= semi
			{
			DebugLocation(248, 4);
			string_literal73=(IToken)Match(input,248,Follow._248_in_includeDirective1329); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_248.Add(string_literal73);

			DebugLocation(248, 14);
			PushFollow(Follow._stringLiteral_in_includeDirective1331);
			stringLiteral74=stringLiteral();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_stringLiteral.Add(stringLiteral74.Tree);
			DebugLocation(248, 29);
			PushFollow(Follow._semi_in_includeDirective1335);
			s=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(s.Tree);


			{
			// AST REWRITE
			// elements: 248, stringLiteral
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 249:9: -> ^( INCLUDE_DIRECTIVE 'include' stringLiteral )
			{
				DebugLocation(249, 12);
				// AS3.g:249:12: ^( INCLUDE_DIRECTIVE 'include' stringLiteral )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(249, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(INCLUDE_DIRECTIVE, "INCLUDE_DIRECTIVE"), root_1);

				DebugLocation(249, 32);
				adaptor.AddChild(root_1, stream_248.NextNode());
				DebugLocation(249, 42);
				adaptor.AddChild(root_1, stream_stringLiteral.NextTree());
				DebugLocation(249, 56);
				adaptor.AddChild(root_1, maybeSemi(s));

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("includeDirective", 20);
			LeaveRule("includeDirective", 20);
			LeaveRule_includeDirective();
		}
		DebugLocation(250, 1);
		} finally { DebugExitRule(GrammarFileName, "includeDirective"); }
		return retval;

	}
Esempio n. 27
0
	private AstParserRuleReturnScope<CommonTree, IToken> continueStatement()
	{
		EnterRule_continueStatement();
		EnterRule("continueStatement", 51);
		TraceIn("continueStatement", 51);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken CONTINUE170 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> s = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree CONTINUE170_tree = default(CommonTree);
		RewriteRuleITokenStream stream_CONTINUE=new RewriteRuleITokenStream(adaptor,"token CONTINUE");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "continueStatement");
		DebugLocation(455, 1);
		try
		{
			// AS3.g:456:2: ( CONTINUE s= semi -> ^( CONTINUE_STATEMENT CONTINUE ) )
			DebugEnterAlt(1);
			// AS3.g:456:4: CONTINUE s= semi
			{
			DebugLocation(456, 4);
			CONTINUE170=(IToken)Match(input,CONTINUE,Follow._CONTINUE_in_continueStatement2462); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_CONTINUE.Add(CONTINUE170);

			DebugLocation(456, 14);
			PushFollow(Follow._semi_in_continueStatement2466);
			s=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(s.Tree);


			{
			// AST REWRITE
			// elements: CONTINUE
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 457:9: -> ^( CONTINUE_STATEMENT CONTINUE )
			{
				DebugLocation(457, 12);
				// AS3.g:457:12: ^( CONTINUE_STATEMENT CONTINUE )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(457, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CONTINUE_STATEMENT, "CONTINUE_STATEMENT"), root_1);

				DebugLocation(457, 33);
				adaptor.AddChild(root_1, stream_CONTINUE.NextNode());
				DebugLocation(457, 42);
				adaptor.AddChild(root_1, maybeSemi(s));

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("continueStatement", 51);
			LeaveRule("continueStatement", 51);
			LeaveRule_continueStatement();
		}
		DebugLocation(458, 1);
		} finally { DebugExitRule(GrammarFileName, "continueStatement"); }
		return retval;

	}
Esempio n. 28
0
	private AstParserRuleReturnScope<CommonTree, IToken> methodDefinition()
	{
		EnterRule_methodDefinition();
		EnterRule("methodDefinition", 21);
		TraceIn("methodDefinition", 21);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken FUNCTION76 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> modifiers75 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> accessorRole77 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> methodName78 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> parameterDeclarationList79 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> typeExpression80 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> maybeBlock81 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree FUNCTION76_tree = default(CommonTree);
		RewriteRuleITokenStream stream_FUNCTION=new RewriteRuleITokenStream(adaptor,"token FUNCTION");
		RewriteRuleSubtreeStream stream_modifiers=new RewriteRuleSubtreeStream(adaptor,"rule modifiers");
		RewriteRuleSubtreeStream stream_accessorRole=new RewriteRuleSubtreeStream(adaptor,"rule accessorRole");
		RewriteRuleSubtreeStream stream_methodName=new RewriteRuleSubtreeStream(adaptor,"rule methodName");
		RewriteRuleSubtreeStream stream_parameterDeclarationList=new RewriteRuleSubtreeStream(adaptor,"rule parameterDeclarationList");
		RewriteRuleSubtreeStream stream_typeExpression=new RewriteRuleSubtreeStream(adaptor,"rule typeExpression");
		RewriteRuleSubtreeStream stream_maybeBlock=new RewriteRuleSubtreeStream(adaptor,"rule maybeBlock");
		try { DebugEnterRule(GrammarFileName, "methodDefinition");
		DebugLocation(253, 1);
		try
		{
			// AS3.g:254:2: ( modifiers FUNCTION ( accessorRole )? methodName parameterDeclarationList ( typeExpression )? maybeBlock -> ^( METHOD_DEF modifiers FUNCTION ( accessorRole )? methodName parameterDeclarationList ( typeExpression )? maybeBlock ) )
			DebugEnterAlt(1);
			// AS3.g:255:3: modifiers FUNCTION ( accessorRole )? methodName parameterDeclarationList ( typeExpression )? maybeBlock
			{
			DebugLocation(255, 3);
			PushFollow(Follow._modifiers_in_methodDefinition1369);
			modifiers75=modifiers();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_modifiers.Add(modifiers75.Tree);
			DebugLocation(256, 3);
			FUNCTION76=(IToken)Match(input,FUNCTION,Follow._FUNCTION_in_methodDefinition1373); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_FUNCTION.Add(FUNCTION76);

			DebugLocation(257, 9);
			// AS3.g:257:9: ( accessorRole )?
			int alt18=2;
			try { DebugEnterSubRule(18);
			try { DebugEnterDecision(18, false);
			int LA18_1 = input.LA(1);

			if ((LA18_1==GET))
			{
				int LA18_2 = input.LA(2);

				if ((LA18_2==AS||LA18_2==DYNAMIC||LA18_2==GET||LA18_2==IDENT||LA18_2==IS||LA18_2==NAMESPACE||LA18_2==SET||LA18_2==SUPER||LA18_2==USE||LA18_2==XML))
				{
					alt18 = 1;
				}
			}
			else if ((LA18_1==SET))
			{
				int LA18_2 = input.LA(2);

				if ((LA18_2==AS||LA18_2==DYNAMIC||LA18_2==GET||LA18_2==IDENT||LA18_2==IS||LA18_2==NAMESPACE||LA18_2==SET||LA18_2==SUPER||LA18_2==USE||LA18_2==XML))
				{
					alt18 = 1;
				}
			}
			} finally { DebugExitDecision(18); }
			switch (alt18)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:257:9: accessorRole
				{
				DebugLocation(257, 9);
				PushFollow(Follow._accessorRole_in_methodDefinition1383);
				accessorRole77=accessorRole();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_accessorRole.Add(accessorRole77.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(18); }

			DebugLocation(258, 3);
			PushFollow(Follow._methodName_in_methodDefinition1388);
			methodName78=methodName();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_methodName.Add(methodName78.Tree);
			DebugLocation(259, 3);
			PushFollow(Follow._parameterDeclarationList_in_methodDefinition1392);
			parameterDeclarationList79=parameterDeclarationList();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_parameterDeclarationList.Add(parameterDeclarationList79.Tree);
			DebugLocation(260, 3);
			// AS3.g:260:3: ( typeExpression )?
			int alt19=2;
			try { DebugEnterSubRule(19);
			try { DebugEnterDecision(19, false);
			int LA19_1 = input.LA(1);

			if ((LA19_1==COLON))
			{
				alt19 = 1;
			}
			} finally { DebugExitDecision(19); }
			switch (alt19)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:260:3: typeExpression
				{
				DebugLocation(260, 3);
				PushFollow(Follow._typeExpression_in_methodDefinition1396);
				typeExpression80=typeExpression();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_typeExpression.Add(typeExpression80.Tree);

				}
				break;

			}
			} finally { DebugExitSubRule(19); }

			DebugLocation(261, 9);
			PushFollow(Follow._maybeBlock_in_methodDefinition1407);
			maybeBlock81=maybeBlock();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_maybeBlock.Add(maybeBlock81.Tree);


			{
			// AST REWRITE
			// elements: modifiers, FUNCTION, accessorRole, methodName, parameterDeclarationList, typeExpression, maybeBlock
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 262:3: -> ^( METHOD_DEF modifiers FUNCTION ( accessorRole )? methodName parameterDeclarationList ( typeExpression )? maybeBlock )
			{
				DebugLocation(262, 6);
				// AS3.g:262:6: ^( METHOD_DEF modifiers FUNCTION ( accessorRole )? methodName parameterDeclarationList ( typeExpression )? maybeBlock )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(262, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(METHOD_DEF, "METHOD_DEF"), root_1);

				DebugLocation(262, 19);
				adaptor.AddChild(root_1, stream_modifiers.NextTree());
				DebugLocation(262, 29);
				adaptor.AddChild(root_1, stream_FUNCTION.NextNode());
				DebugLocation(262, 38);
				// AS3.g:262:38: ( accessorRole )?
				if (stream_accessorRole.HasNext)
				{
					DebugLocation(262, 38);
					adaptor.AddChild(root_1, stream_accessorRole.NextTree());

				}
				stream_accessorRole.Reset();
				DebugLocation(263, 17);
				adaptor.AddChild(root_1, stream_methodName.NextTree());
				DebugLocation(264, 5);
				adaptor.AddChild(root_1, stream_parameterDeclarationList.NextTree());
				DebugLocation(265, 5);
				// AS3.g:265:5: ( typeExpression )?
				if (stream_typeExpression.HasNext)
				{
					DebugLocation(265, 5);
					adaptor.AddChild(root_1, stream_typeExpression.NextTree());

				}
				stream_typeExpression.Reset();
				DebugLocation(266, 5);
				adaptor.AddChild(root_1, stream_maybeBlock.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("methodDefinition", 21);
			LeaveRule("methodDefinition", 21);
			LeaveRule_methodDefinition();
		}
		DebugLocation(268, 1);
		} finally { DebugExitRule(GrammarFileName, "methodDefinition"); }
		return retval;

	}
Esempio n. 29
0
	private AstParserRuleReturnScope<CommonTree, IToken> switchStatement()
	{
		EnterRule_switchStatement();
		EnterRule("switchStatement", 53);
		TraceIn("switchStatement", 53);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken SWITCH172 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> condition173 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> switchBlock174 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree SWITCH172_tree = default(CommonTree);
		RewriteRuleITokenStream stream_SWITCH=new RewriteRuleITokenStream(adaptor,"token SWITCH");
		RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
		RewriteRuleSubtreeStream stream_switchBlock=new RewriteRuleSubtreeStream(adaptor,"rule switchBlock");
		try { DebugEnterRule(GrammarFileName, "switchStatement");
		DebugLocation(465, 1);
		try
		{
			// AS3.g:466:2: ( SWITCH condition switchBlock -> ^( SWITCH_STATEMENT SWITCH condition switchBlock ) )
			DebugEnterAlt(1);
			// AS3.g:466:4: SWITCH condition switchBlock
			{
			DebugLocation(466, 4);
			SWITCH172=(IToken)Match(input,SWITCH,Follow._SWITCH_in_switchStatement2528); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_SWITCH.Add(SWITCH172);

			DebugLocation(466, 11);
			PushFollow(Follow._condition_in_switchStatement2530);
			condition173=condition();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_condition.Add(condition173.Tree);
			DebugLocation(467, 3);
			PushFollow(Follow._switchBlock_in_switchStatement2534);
			switchBlock174=switchBlock();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_switchBlock.Add(switchBlock174.Tree);


			{
			// AST REWRITE
			// elements: SWITCH, condition, switchBlock
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 468:9: -> ^( SWITCH_STATEMENT SWITCH condition switchBlock )
			{
				DebugLocation(468, 12);
				// AS3.g:468:12: ^( SWITCH_STATEMENT SWITCH condition switchBlock )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(468, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(SWITCH_STATEMENT, "SWITCH_STATEMENT"), root_1);

				DebugLocation(468, 31);
				adaptor.AddChild(root_1, stream_SWITCH.NextNode());
				DebugLocation(468, 38);
				adaptor.AddChild(root_1, stream_condition.NextTree());
				DebugLocation(468, 48);
				adaptor.AddChild(root_1, stream_switchBlock.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("switchStatement", 53);
			LeaveRule("switchStatement", 53);
			LeaveRule_switchStatement();
		}
		DebugLocation(469, 1);
		} finally { DebugExitRule(GrammarFileName, "switchStatement"); }
		return retval;

	}
Esempio n. 30
0
	private AstParserRuleReturnScope<CommonTree, IToken> namespaceDefinition()
	{
		EnterRule_namespaceDefinition();
		EnterRule("namespaceDefinition", 25);
		TraceIn("namespaceDefinition", 25);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken NAMESPACE86 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> modifiers85 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> namespaceName87 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree NAMESPACE86_tree = default(CommonTree);
		RewriteRuleITokenStream stream_NAMESPACE=new RewriteRuleITokenStream(adaptor,"token NAMESPACE");
		RewriteRuleSubtreeStream stream_modifiers=new RewriteRuleSubtreeStream(adaptor,"rule modifiers");
		RewriteRuleSubtreeStream stream_namespaceName=new RewriteRuleSubtreeStream(adaptor,"rule namespaceName");
		try { DebugEnterRule(GrammarFileName, "namespaceDefinition");
		DebugLocation(286, 1);
		try
		{
			// AS3.g:287:2: ( modifiers NAMESPACE namespaceName -> ^( NAMESPACE_DEF modifiers NAMESPACE namespaceName ) )
			DebugEnterAlt(1);
			// AS3.g:287:4: modifiers NAMESPACE namespaceName
			{
			DebugLocation(287, 4);
			PushFollow(Follow._modifiers_in_namespaceDefinition1573);
			modifiers85=modifiers();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_modifiers.Add(modifiers85.Tree);
			DebugLocation(287, 14);
			NAMESPACE86=(IToken)Match(input,NAMESPACE,Follow._NAMESPACE_in_namespaceDefinition1575); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_NAMESPACE.Add(NAMESPACE86);

			DebugLocation(287, 24);
			PushFollow(Follow._namespaceName_in_namespaceDefinition1577);
			namespaceName87=namespaceName();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_namespaceName.Add(namespaceName87.Tree);


			{
			// AST REWRITE
			// elements: modifiers, NAMESPACE, namespaceName
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 288:3: -> ^( NAMESPACE_DEF modifiers NAMESPACE namespaceName )
			{
				DebugLocation(288, 6);
				// AS3.g:288:6: ^( NAMESPACE_DEF modifiers NAMESPACE namespaceName )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(288, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(NAMESPACE_DEF, "NAMESPACE_DEF"), root_1);

				DebugLocation(288, 22);
				adaptor.AddChild(root_1, stream_modifiers.NextTree());
				DebugLocation(288, 32);
				adaptor.AddChild(root_1, stream_NAMESPACE.NextNode());
				DebugLocation(288, 42);
				adaptor.AddChild(root_1, stream_namespaceName.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("namespaceDefinition", 25);
			LeaveRule("namespaceDefinition", 25);
			LeaveRule_namespaceDefinition();
		}
		DebugLocation(289, 1);
		} finally { DebugExitRule(GrammarFileName, "namespaceDefinition"); }
		return retval;

	}
Esempio n. 31
0
	private AstParserRuleReturnScope<CommonTree, IToken> forStatement()
	{
		EnterRule_forStatement();
		EnterRule("forStatement", 59);
		TraceIn("forStatement", 59);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken FOR190 = default(IToken);
		IToken LPAREN191 = default(IToken);
		IToken RPAREN193 = default(IToken);
		IToken RPAREN196 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> forInClause192 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> statement194 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> traditionalForClause195 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> statement197 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree FOR190_tree = default(CommonTree);
		CommonTree LPAREN191_tree = default(CommonTree);
		CommonTree RPAREN193_tree = default(CommonTree);
		CommonTree RPAREN196_tree = default(CommonTree);
		RewriteRuleITokenStream stream_FOR=new RewriteRuleITokenStream(adaptor,"token FOR");
		RewriteRuleITokenStream stream_LPAREN=new RewriteRuleITokenStream(adaptor,"token LPAREN");
		RewriteRuleITokenStream stream_RPAREN=new RewriteRuleITokenStream(adaptor,"token RPAREN");
		RewriteRuleSubtreeStream stream_forInClause=new RewriteRuleSubtreeStream(adaptor,"rule forInClause");
		RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
		RewriteRuleSubtreeStream stream_traditionalForClause=new RewriteRuleSubtreeStream(adaptor,"rule traditionalForClause");
		try { DebugEnterRule(GrammarFileName, "forStatement");
		DebugLocation(500, 1);
		try
		{
			// AS3.g:502:2: ( FOR LPAREN ( forInClause RPAREN statement -> ^( FOR_IN_LOOP FOR LPAREN forInClause RPAREN statement ) | traditionalForClause RPAREN statement -> ^( FOR_LOOP FOR LPAREN traditionalForClause RPAREN statement ) ) )
			DebugEnterAlt(1);
			// AS3.g:502:4: FOR LPAREN ( forInClause RPAREN statement -> ^( FOR_IN_LOOP FOR LPAREN forInClause RPAREN statement ) | traditionalForClause RPAREN statement -> ^( FOR_LOOP FOR LPAREN traditionalForClause RPAREN statement ) )
			{
			DebugLocation(502, 4);
			FOR190=(IToken)Match(input,FOR,Follow._FOR_in_forStatement2717); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_FOR.Add(FOR190);

			DebugLocation(503, 3);
			LPAREN191=(IToken)Match(input,LPAREN,Follow._LPAREN_in_forStatement2721); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_LPAREN.Add(LPAREN191);

			DebugLocation(504, 3);
			// AS3.g:504:3: ( forInClause RPAREN statement -> ^( FOR_IN_LOOP FOR LPAREN forInClause RPAREN statement ) | traditionalForClause RPAREN statement -> ^( FOR_LOOP FOR LPAREN traditionalForClause RPAREN statement ) )
			int alt43=2;
			try { DebugEnterSubRule(43);
			try { DebugEnterDecision(43, false);
			try
			{
				alt43 = dfa43.Predict(input);
			}
			catch (NoViableAltException nvae)
			{
				DebugRecognitionException(nvae);
				throw;
			}
			} finally { DebugExitDecision(43); }
			switch (alt43)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:504:5: forInClause RPAREN statement
				{
				DebugLocation(504, 5);
				PushFollow(Follow._forInClause_in_forStatement2727);
				forInClause192=forInClause();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_forInClause.Add(forInClause192.Tree);
				DebugLocation(504, 17);
				RPAREN193=(IToken)Match(input,RPAREN,Follow._RPAREN_in_forStatement2729); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_RPAREN.Add(RPAREN193);

				DebugLocation(504, 24);
				PushFollow(Follow._statement_in_forStatement2731);
				statement194=statement();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_statement.Add(statement194.Tree);


				{
				// AST REWRITE
				// elements: FOR, LPAREN, forInClause, RPAREN, statement
				// token labels: 
				// rule labels: retval
				// token list labels: 
				// rule list labels: 
				// wildcard labels: 
				if (state.backtracking == 0) {
				retval.Tree = root_0;
				RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

				root_0 = (CommonTree)adaptor.Nil();
				// 505:4: -> ^( FOR_IN_LOOP FOR LPAREN forInClause RPAREN statement )
				{
					DebugLocation(505, 7);
					// AS3.g:505:7: ^( FOR_IN_LOOP FOR LPAREN forInClause RPAREN statement )
					{
					CommonTree root_1 = (CommonTree)adaptor.Nil();
					DebugLocation(505, 9);
					root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(FOR_IN_LOOP, "FOR_IN_LOOP"), root_1);

					DebugLocation(505, 21);
					adaptor.AddChild(root_1, stream_FOR.NextNode());
					DebugLocation(505, 25);
					adaptor.AddChild(root_1, stream_LPAREN.NextNode());
					DebugLocation(505, 32);
					adaptor.AddChild(root_1, stream_forInClause.NextTree());
					DebugLocation(505, 44);
					adaptor.AddChild(root_1, stream_RPAREN.NextNode());
					DebugLocation(505, 51);
					adaptor.AddChild(root_1, stream_statement.NextTree());

					adaptor.AddChild(root_0, root_1);
					}

				}

				retval.Tree = root_0;
				}
				}

				}
				break;
			case 2:
				DebugEnterAlt(2);
				// AS3.g:507:5: traditionalForClause RPAREN statement
				{
				DebugLocation(507, 5);
				PushFollow(Follow._traditionalForClause_in_forStatement2757);
				traditionalForClause195=traditionalForClause();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_traditionalForClause.Add(traditionalForClause195.Tree);
				DebugLocation(507, 26);
				RPAREN196=(IToken)Match(input,RPAREN,Follow._RPAREN_in_forStatement2759); if (state.failed) return retval; 
				if (state.backtracking == 0) stream_RPAREN.Add(RPAREN196);

				DebugLocation(507, 33);
				PushFollow(Follow._statement_in_forStatement2761);
				statement197=statement();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_statement.Add(statement197.Tree);


				{
				// AST REWRITE
				// elements: FOR, LPAREN, traditionalForClause, RPAREN, statement
				// token labels: 
				// rule labels: retval
				// token list labels: 
				// rule list labels: 
				// wildcard labels: 
				if (state.backtracking == 0) {
				retval.Tree = root_0;
				RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

				root_0 = (CommonTree)adaptor.Nil();
				// 508:4: -> ^( FOR_LOOP FOR LPAREN traditionalForClause RPAREN statement )
				{
					DebugLocation(508, 7);
					// AS3.g:508:7: ^( FOR_LOOP FOR LPAREN traditionalForClause RPAREN statement )
					{
					CommonTree root_1 = (CommonTree)adaptor.Nil();
					DebugLocation(508, 9);
					root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(FOR_LOOP, "FOR_LOOP"), root_1);

					DebugLocation(508, 18);
					adaptor.AddChild(root_1, stream_FOR.NextNode());
					DebugLocation(508, 22);
					adaptor.AddChild(root_1, stream_LPAREN.NextNode());
					DebugLocation(508, 29);
					adaptor.AddChild(root_1, stream_traditionalForClause.NextTree());
					DebugLocation(508, 50);
					adaptor.AddChild(root_1, stream_RPAREN.NextNode());
					DebugLocation(508, 57);
					adaptor.AddChild(root_1, stream_statement.NextTree());

					adaptor.AddChild(root_0, root_1);
					}

				}

				retval.Tree = root_0;
				}
				}

				}
				break;

			}
			} finally { DebugExitSubRule(43); }


			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("forStatement", 59);
			LeaveRule("forStatement", 59);
			LeaveRule_forStatement();
		}
		DebugLocation(510, 1);
		} finally { DebugExitRule(GrammarFileName, "forStatement"); }
		return retval;

	}
Esempio n. 32
0
	private AstParserRuleReturnScope<CommonTree, IToken> variableInitializer()
	{
		EnterRule_variableInitializer();
		EnterRule("variableInitializer", 31);
		TraceIn("variableInitializer", 31);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken ASSIGN102 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> expression103 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree ASSIGN102_tree = default(CommonTree);
		RewriteRuleITokenStream stream_ASSIGN=new RewriteRuleITokenStream(adaptor,"token ASSIGN");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		try { DebugEnterRule(GrammarFileName, "variableInitializer");
		DebugLocation(316, 1);
		try
		{
			// AS3.g:317:2: ( ASSIGN expression -> ^( VAR_INITIALIZER ASSIGN expression ) )
			DebugEnterAlt(1);
			// AS3.g:317:4: ASSIGN expression
			{
			DebugLocation(317, 4);
			ASSIGN102=(IToken)Match(input,ASSIGN,Follow._ASSIGN_in_variableInitializer1737); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_ASSIGN.Add(ASSIGN102);

			DebugLocation(317, 11);
			PushFollow(Follow._expression_in_variableInitializer1739);
			expression103=expression();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_expression.Add(expression103.Tree);


			{
			// AST REWRITE
			// elements: ASSIGN, expression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 318:9: -> ^( VAR_INITIALIZER ASSIGN expression )
			{
				DebugLocation(318, 12);
				// AS3.g:318:12: ^( VAR_INITIALIZER ASSIGN expression )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(318, 14);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(VAR_INITIALIZER, "VAR_INITIALIZER"), root_1);

				DebugLocation(318, 30);
				adaptor.AddChild(root_1, stream_ASSIGN.NextNode());
				DebugLocation(318, 37);
				adaptor.AddChild(root_1, stream_expression.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("variableInitializer", 31);
			LeaveRule("variableInitializer", 31);
			LeaveRule_variableInitializer();
		}
		DebugLocation(319, 1);
		} finally { DebugExitRule(GrammarFileName, "variableInitializer"); }
		return retval;

	}
Esempio n. 33
0
	private AstParserRuleReturnScope<CommonTree, IToken> doWhileStatement()
	{
		EnterRule_doWhileStatement();
		EnterRule("doWhileStatement", 68);
		TraceIn("doWhileStatement", 68);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken DO218 = default(IToken);
		IToken WHILE220 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> statement219 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> condition221 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> semi222 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree DO218_tree = default(CommonTree);
		CommonTree WHILE220_tree = default(CommonTree);
		RewriteRuleITokenStream stream_DO=new RewriteRuleITokenStream(adaptor,"token DO");
		RewriteRuleITokenStream stream_WHILE=new RewriteRuleITokenStream(adaptor,"token WHILE");
		RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
		RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
		RewriteRuleSubtreeStream stream_semi=new RewriteRuleSubtreeStream(adaptor,"rule semi");
		try { DebugEnterRule(GrammarFileName, "doWhileStatement");
		DebugLocation(553, 1);
		try
		{
			// AS3.g:554:2: ( DO statement WHILE condition semi -> ^( DO_WHILE_LOOP DO statement WHILE condition ) )
			DebugEnterAlt(1);
			// AS3.g:554:4: DO statement WHILE condition semi
			{
			DebugLocation(554, 4);
			DO218=(IToken)Match(input,DO,Follow._DO_in_doWhileStatement2989); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_DO.Add(DO218);

			DebugLocation(554, 7);
			PushFollow(Follow._statement_in_doWhileStatement2991);
			statement219=statement();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_statement.Add(statement219.Tree);
			DebugLocation(554, 17);
			WHILE220=(IToken)Match(input,WHILE,Follow._WHILE_in_doWhileStatement2993); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_WHILE.Add(WHILE220);

			DebugLocation(554, 23);
			PushFollow(Follow._condition_in_doWhileStatement2995);
			condition221=condition();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_condition.Add(condition221.Tree);
			DebugLocation(554, 33);
			PushFollow(Follow._semi_in_doWhileStatement2997);
			semi222=semi();
			PopFollow();
			if (state.failed) return retval;
			if (state.backtracking == 0) stream_semi.Add(semi222.Tree);


			{
			// AST REWRITE
			// elements: DO, statement, WHILE, condition
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 555:3: -> ^( DO_WHILE_LOOP DO statement WHILE condition )
			{
				DebugLocation(555, 6);
				// AS3.g:555:6: ^( DO_WHILE_LOOP DO statement WHILE condition )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(555, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(DO_WHILE_LOOP, "DO_WHILE_LOOP"), root_1);

				DebugLocation(555, 22);
				adaptor.AddChild(root_1, stream_DO.NextNode());
				DebugLocation(555, 25);
				adaptor.AddChild(root_1, stream_statement.NextTree());
				DebugLocation(555, 35);
				adaptor.AddChild(root_1, stream_WHILE.NextNode());
				DebugLocation(555, 41);
				adaptor.AddChild(root_1, stream_condition.NextTree());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("doWhileStatement", 68);
			LeaveRule("doWhileStatement", 68);
			LeaveRule_doWhileStatement();
		}
		DebugLocation(556, 1);
		} finally { DebugExitRule(GrammarFileName, "doWhileStatement"); }
		return retval;

	}
Esempio n. 34
0
	private AstParserRuleReturnScope<CommonTree, IToken> parameterDeclarationList()
	{
		EnterRule_parameterDeclarationList();
		EnterRule("parameterDeclarationList", 33);
		TraceIn("parameterDeclarationList", 33);
		AstParserRuleReturnScope<CommonTree, IToken> retval = new AstParserRuleReturnScope<CommonTree, IToken>();
		retval.Start = (IToken)input.LT(1);

		CommonTree root_0 = default(CommonTree);

		IToken LPAREN107 = default(IToken);
		IToken COMMA109 = default(IToken);
		IToken RPAREN111 = default(IToken);
		AstParserRuleReturnScope<CommonTree, IToken> parameterDeclaration108 = default(AstParserRuleReturnScope<CommonTree, IToken>);
		AstParserRuleReturnScope<CommonTree, IToken> parameterDeclaration110 = default(AstParserRuleReturnScope<CommonTree, IToken>);

		CommonTree LPAREN107_tree = default(CommonTree);
		CommonTree COMMA109_tree = default(CommonTree);
		CommonTree RPAREN111_tree = default(CommonTree);
		RewriteRuleITokenStream stream_LPAREN=new RewriteRuleITokenStream(adaptor,"token LPAREN");
		RewriteRuleITokenStream stream_COMMA=new RewriteRuleITokenStream(adaptor,"token COMMA");
		RewriteRuleITokenStream stream_RPAREN=new RewriteRuleITokenStream(adaptor,"token RPAREN");
		RewriteRuleSubtreeStream stream_parameterDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule parameterDeclaration");
		try { DebugEnterRule(GrammarFileName, "parameterDeclarationList");
		DebugLocation(329, 1);
		try
		{
			// AS3.g:330:2: ( LPAREN ( parameterDeclaration ( COMMA parameterDeclaration )* )? RPAREN -> ^( PARAMS LPAREN ( parameterDeclaration )* RPAREN ) )
			DebugEnterAlt(1);
			// AS3.g:330:4: LPAREN ( parameterDeclaration ( COMMA parameterDeclaration )* )? RPAREN
			{
			DebugLocation(330, 4);
			LPAREN107=(IToken)Match(input,LPAREN,Follow._LPAREN_in_parameterDeclarationList1810); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_LPAREN.Add(LPAREN107);

			DebugLocation(331, 3);
			// AS3.g:331:3: ( parameterDeclaration ( COMMA parameterDeclaration )* )?
			int alt26=2;
			try { DebugEnterSubRule(26);
			try { DebugEnterDecision(26, false);
			int LA26_1 = input.LA(1);

			if ((LA26_1==AS||LA26_1==CONST||LA26_1==DYNAMIC||LA26_1==GET||LA26_1==IDENT||LA26_1==IS||LA26_1==NAMESPACE||LA26_1==REST||LA26_1==SET||LA26_1==SUPER||LA26_1==USE||LA26_1==XML))
			{
				alt26 = 1;
			}
			} finally { DebugExitDecision(26); }
			switch (alt26)
			{
			case 1:
				DebugEnterAlt(1);
				// AS3.g:331:5: parameterDeclaration ( COMMA parameterDeclaration )*
				{
				DebugLocation(331, 5);
				PushFollow(Follow._parameterDeclaration_in_parameterDeclarationList1816);
				parameterDeclaration108=parameterDeclaration();
				PopFollow();
				if (state.failed) return retval;
				if (state.backtracking == 0) stream_parameterDeclaration.Add(parameterDeclaration108.Tree);
				DebugLocation(332, 4);
				// AS3.g:332:4: ( COMMA parameterDeclaration )*
				try { DebugEnterSubRule(25);
				while (true)
				{
					int alt25=2;
					try { DebugEnterDecision(25, false);
					int LA25_1 = input.LA(1);

					if ((LA25_1==COMMA))
					{
						alt25 = 1;
					}


					} finally { DebugExitDecision(25); }
					switch ( alt25 )
					{
					case 1:
						DebugEnterAlt(1);
						// AS3.g:332:5: COMMA parameterDeclaration
						{
						DebugLocation(332, 5);
						COMMA109=(IToken)Match(input,COMMA,Follow._COMMA_in_parameterDeclarationList1822); if (state.failed) return retval; 
						if (state.backtracking == 0) stream_COMMA.Add(COMMA109);

						DebugLocation(332, 11);
						PushFollow(Follow._parameterDeclaration_in_parameterDeclarationList1824);
						parameterDeclaration110=parameterDeclaration();
						PopFollow();
						if (state.failed) return retval;
						if (state.backtracking == 0) stream_parameterDeclaration.Add(parameterDeclaration110.Tree);

						}
						break;

					default:
						goto loop25;
					}
				}

				loop25:
					;

				} finally { DebugExitSubRule(25); }


				}
				break;

			}
			} finally { DebugExitSubRule(26); }

			DebugLocation(334, 3);
			RPAREN111=(IToken)Match(input,RPAREN,Follow._RPAREN_in_parameterDeclarationList1835); if (state.failed) return retval; 
			if (state.backtracking == 0) stream_RPAREN.Add(RPAREN111);



			{
			// AST REWRITE
			// elements: LPAREN, parameterDeclaration, RPAREN
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			if (state.backtracking == 0) {
			retval.Tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.Tree:null);

			root_0 = (CommonTree)adaptor.Nil();
			// 335:3: -> ^( PARAMS LPAREN ( parameterDeclaration )* RPAREN )
			{
				DebugLocation(335, 6);
				// AS3.g:335:6: ^( PARAMS LPAREN ( parameterDeclaration )* RPAREN )
				{
				CommonTree root_1 = (CommonTree)adaptor.Nil();
				DebugLocation(335, 8);
				root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(PARAMS, "PARAMS"), root_1);

				DebugLocation(335, 15);
				adaptor.AddChild(root_1, stream_LPAREN.NextNode());
				DebugLocation(335, 22);
				// AS3.g:335:22: ( parameterDeclaration )*
				while ( stream_parameterDeclaration.HasNext )
				{
					DebugLocation(335, 22);
					adaptor.AddChild(root_1, stream_parameterDeclaration.NextTree());

				}
				stream_parameterDeclaration.Reset();
				DebugLocation(335, 44);
				adaptor.AddChild(root_1, stream_RPAREN.NextNode());

				adaptor.AddChild(root_0, root_1);
				}

			}

			retval.Tree = root_0;
			}
			}

			}

			retval.Stop = (IToken)input.LT(-1);

			if (state.backtracking == 0) {
			retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
			adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
			}
		}
		catch (RecognitionException re)
		{
			ReportError(re);
			Recover(input,re);
		retval.Tree = (CommonTree)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);

		}
		finally
		{
			TraceOut("parameterDeclarationList", 33);
			LeaveRule("parameterDeclarationList", 33);
			LeaveRule_parameterDeclarationList();
		}
		DebugLocation(336, 1);
		} finally { DebugExitRule(GrammarFileName, "parameterDeclarationList"); }
		return retval;

	}
		// $ANTLR start "identifier"
		// C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:262:1: identifier : ID -> ^( IDENTIFIER ID ) ;
		public identifier_return identifier() // throws RecognitionException [1]
		{
			var retval = new identifier_return();
			retval.Start = input.LT( 1 );

			CommonTree root_0 = null;

			IToken ID92 = null;

			CommonTree ID92_tree = null;
			var stream_ID = new RewriteRuleTokenStream( adaptor, "token ID" );

			try
			{
				// C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:263:2: ( ID -> ^( IDENTIFIER ID ) )
				// C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:263:4: ID
				{
					ID92 = (IToken)Match( input, ID, FOLLOW_ID_in_identifier1399 );
					stream_ID.Add( ID92 );


					// AST REWRITE
					// elements:          ID
					// token labels:      
					// rule labels:       retval
					// token list labels: 
					// rule list labels:  
					// wildcard labels: 
					retval.Tree = root_0;
					var stream_retval = new RewriteRuleSubtreeStream( adaptor, "rule retval", retval != null ? retval.Tree : null );

					root_0 = (CommonTree)adaptor.GetNilNode();
					// 263:7: -> ^( IDENTIFIER ID )
					{
						// C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:263:10: ^( IDENTIFIER ID )
						{
							var root_1 = (CommonTree)adaptor.GetNilNode();
							root_1 = (CommonTree)adaptor.BecomeRoot( adaptor.Create( IDENTIFIER, "IDENTIFIER" ), root_1 );

							adaptor.AddChild( root_1, stream_ID.NextNode() );

							adaptor.AddChild( root_0, root_1 );
						}
					}

					retval.Tree = root_0;
					retval.Tree = root_0;
				}

				retval.Stop = input.LT( -1 );

				retval.Tree = adaptor.RulePostProcessing( root_0 );
				adaptor.SetTokenBoundaries( retval.Tree, (IToken)retval.Start, (IToken)retval.Stop );
			}
			catch ( RecognitionException re )
			{
				ReportError( re );
				Recover( input, re );
				// Conversion of the second argument necessary, but harmless
				retval.Tree = adaptor.ErrorNode( input, (IToken)retval.Start, input.LT( -1 ), re );
			}
			finally {}
			return retval;
		}
Esempio n. 36
0
        private AstParserRuleReturnScope <object, IToken> plain_descr()
        {
            EnterRule_plain_descr();
            EnterRule("plain_descr", 2);
            TraceIn("plain_descr", 2);
            AstParserRuleReturnScope <object, IToken> retval = new AstParserRuleReturnScope <object, IToken>();

            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken PLAIN3        = default(IToken);
            IToken ID4           = default(IToken);
            IToken BEGIN5        = default(IToken);
            IToken END6          = default(IToken);
            IToken char_literal7 = default(IToken);
            AstParserRuleReturnScope <object, IToken> pl = default(AstParserRuleReturnScope <object, IToken>);

            object PLAIN3_tree                              = default(object);
            object ID4_tree                                 = default(object);
            object BEGIN5_tree                              = default(object);
            object END6_tree                                = default(object);
            object char_literal7_tree                       = default(object);
            RewriteRuleITokenStream  stream_ID              = new RewriteRuleITokenStream(adaptor, "token ID");
            RewriteRuleITokenStream  stream_END             = new RewriteRuleITokenStream(adaptor, "token END");
            RewriteRuleITokenStream  stream_PLAIN           = new RewriteRuleITokenStream(adaptor, "token PLAIN");
            RewriteRuleITokenStream  stream_24              = new RewriteRuleITokenStream(adaptor, "token 24");
            RewriteRuleITokenStream  stream_BEGIN           = new RewriteRuleITokenStream(adaptor, "token BEGIN");
            RewriteRuleSubtreeStream stream_plain_elem_list = new RewriteRuleSubtreeStream(adaptor, "rule plain_elem_list");

            try { DebugEnterRule(GrammarFileName, "plain_descr");
                  DebugLocation(30, 1);
                  try
                  {
                      // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:30:12: ( PLAIN ID BEGIN pl= plain_elem_list END ';' -> ^( PLAIN_FILE ID $pl) )
                      DebugEnterAlt(1);
                      // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:31:2: PLAIN ID BEGIN pl= plain_elem_list END ';'
                      {
                          DebugLocation(31, 2);
                          PLAIN3 = (IToken)Match(input, PLAIN, Follow._PLAIN_in_plain_descr99);
                          stream_PLAIN.Add(PLAIN3);

                          DebugLocation(31, 8);
                          ID4 = (IToken)Match(input, ID, Follow._ID_in_plain_descr101);
                          stream_ID.Add(ID4);

                          DebugLocation(32, 2);
                          BEGIN5 = (IToken)Match(input, BEGIN, Follow._BEGIN_in_plain_descr104);
                          stream_BEGIN.Add(BEGIN5);

                          DebugLocation(33, 6);
                          PushFollow(Follow._plain_elem_list_in_plain_descr111);
                          pl = plain_elem_list();
                          PopFollow();

                          stream_plain_elem_list.Add(pl.Tree);
                          DebugLocation(34, 2);
                          END6 = (IToken)Match(input, END, Follow._END_in_plain_descr114);
                          stream_END.Add(END6);

                          DebugLocation(34, 6);
                          char_literal7 = (IToken)Match(input, 24, Follow._24_in_plain_descr116);
                          stream_24.Add(char_literal7);



                          {
                              // AST REWRITE
                              // elements: pl, ID
                              // token labels:
                              // rule labels: retval, pl
                              // token list labels:
                              // rule list labels:
                              // wildcard labels:
                              retval.Tree = root_0;
                              RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null?retval.Tree:null);
                              RewriteRuleSubtreeStream stream_pl     = new RewriteRuleSubtreeStream(adaptor, "rule pl", pl != null?pl.Tree:null);

                              root_0 = (object)adaptor.Nil();
                              // 34:10: -> ^( PLAIN_FILE ID $pl)
                              {
                                  DebugLocation(34, 13);
                                  // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:34:13: ^( PLAIN_FILE ID $pl)
                                  {
                                      object root_1 = (object)adaptor.Nil();
                                      DebugLocation(34, 15);
                                      root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(PLAIN_FILE, "PLAIN_FILE"), root_1);

                                      DebugLocation(34, 26);
                                      adaptor.AddChild(root_1, stream_ID.NextNode());
                                      DebugLocation(34, 30);
                                      adaptor.AddChild(root_1, stream_pl.NextTree());

                                      adaptor.AddChild(root_0, root_1);
                                  }
                              }

                              retval.Tree = root_0;
                          }
                      }

                      retval.Stop = (IToken)input.LT(-1);

                      retval.Tree = (object)adaptor.RulePostProcessing(root_0);
                      adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop);
                  }
                  catch (RecognitionException re)
                  {
                      ReportError(re);
                      Recover(input, re);
                      retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re);
                  }
                  finally
                  {
                      TraceOut("plain_descr", 2);
                      LeaveRule("plain_descr", 2);
                      LeaveRule_plain_descr();
                  }
                  DebugLocation(35, 1); } finally { DebugExitRule(GrammarFileName, "plain_descr"); }
            return(retval);
        }