TT.CSharpGenerator.ifStatement C# (CSharp) Method

ifStatement() public method

public ifStatement ( ) : CSharpGenerator.ifStatement_return
return CSharpGenerator.ifStatement_return
    public CSharpGenerator.ifStatement_return ifStatement() // throws RecognitionException [1]
    {   
        CSharpGenerator.ifStatement_return retval = new CSharpGenerator.ifStatement_return();
        retval.Start = input.LT(1);

        CommonTree ID6 = null;
        CSharpGenerator.statement_return statement7 = default(CSharpGenerator.statement_return);


        try 
    	{
            // TT\\CSharpGenerator.g:26:2: ( ^( IF ID statement ) -> ifVariableStatement(name=$ID.textstatement=$statement.st))
            // TT\\CSharpGenerator.g:26:4: ^( IF ID statement )
            {
            	Match(input,IF,FOLLOW_IF_in_ifStatement127); 

            	Match(input, Token.DOWN, null); 
            	ID6=(CommonTree)Match(input,ID,FOLLOW_ID_in_ifStatement129); 
            	PushFollow(FOLLOW_statement_in_ifStatement131);
            	statement7 = statement();
            	state.followingStackPointer--;


            	Match(input, Token.UP, null); 


            	// TEMPLATE REWRITE
            	// 26:23: -> ifVariableStatement(name=$ID.textstatement=$statement.st)
            	{
            	    retval.ST = templateLib.GetInstanceOf("ifVariableStatement",
            	  new STAttrMap().Add("name", ((ID6 != null) ? ID6.Text : null)).Add("statement", ((statement7 != null) ? statement7.ST : null)));
            	}


            }

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "ifStatement"