Exemplo n.º 1
0
        private LiteralExpressionParser.args_return args()
        {
            Enter_args();
            EnterRule("args", 6);
            TraceIn("args", 6);
            LiteralExpressionParser.args_return retval = new LiteralExpressionParser.args_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = null;

            IToken char_literal17 = null;

            LiteralExpressionParser.type_return type16 = default(LiteralExpressionParser.type_return);
            LiteralExpressionParser.type_return type18 = default(LiteralExpressionParser.type_return);

            object char_literal17_tree = null;

            try { DebugEnterRule(GrammarFileName, "args");
                  DebugLocation(27, 26);
                  try
                  {
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:6: ( ( type ( ',' type )* )? )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:8: ( type ( ',' type )* )?
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(27, 8);
                          // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:8: ( type ( ',' type )* )?
                          int alt6 = 2;
                          try { DebugEnterSubRule(6);
                                try { DebugEnterDecision(6, decisionCanBacktrack[6]);
                                      int LA6_0 = input.LA(1);

                                      if (((LA6_0 >= ACCESSOR && LA6_0 <= IDENTIFIER) || LA6_0 == 12))
                                      {
                                          alt6 = 1;
                                      }
                                } finally { DebugExitDecision(6); }
                                switch (alt6)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:9: type ( ',' type )*
                                    {
                                        DebugLocation(27, 9);
                                        PushFollow(Follow._type_in_args146);
                                        type16 = type();
                                        PopFollow();

                                        adaptor.AddChild(root_0, type16.Tree);
                                        DebugLocation(27, 14);
                                        // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:14: ( ',' type )*
                                        try { DebugEnterSubRule(5);
                                              while (true)
                                              {
                                                  int alt5 = 2;
                                                  try { DebugEnterDecision(5, decisionCanBacktrack[5]);
                                                        int LA5_0 = input.LA(1);

                                                        if ((LA5_0 == 13))
                                                        {
                                                            alt5 = 1;
                                                        }
                                                  } finally { DebugExitDecision(5); }
                                                  switch (alt5)
                                                  {
                                                  case 1:
                                                      DebugEnterAlt(1);
                                                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:27:15: ',' type
                                                      {
                                                          DebugLocation(27, 15);
                                                          char_literal17      = (IToken)Match(input, 13, Follow._13_in_args149);
                                                          char_literal17_tree = (object)adaptor.Create(char_literal17);
                                                          adaptor.AddChild(root_0, char_literal17_tree);

                                                          DebugLocation(27, 19);
                                                          PushFollow(Follow._type_in_args151);
                                                          type18 = type();
                                                          PopFollow();

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

                                                  default:
                                                      goto loop5;
                                                  }
                                              }

loop5:
                                              ; } finally { DebugExitSubRule(5); }
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(6); }
                      }

                      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("args", 6);
                      LeaveRule("args", 6);
                      Leave_args();
                  }
                  DebugLocation(27, 26); } finally { DebugExitRule(GrammarFileName, "args"); }
            return(retval);
        }
Exemplo n.º 2
0
        public LiteralExpressionParser.methodExp_return methodExp()
        {
            Enter_methodExp();
            EnterRule("methodExp", 1);
            TraceIn("methodExp", 1);
            LiteralExpressionParser.methodExp_return retval = new LiteralExpressionParser.methodExp_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = null;

            IToken ACCESSOR1     = null;
            IToken char_literal3 = null;
            IToken char_literal5 = null;
            IToken char_literal7 = null;

            LiteralExpressionParser.type_return   type2   = default(LiteralExpressionParser.type_return);
            LiteralExpressionParser.method_return method4 = default(LiteralExpressionParser.method_return);
            LiteralExpressionParser.args_return   args6   = default(LiteralExpressionParser.args_return);

            object ACCESSOR1_tree     = null;
            object char_literal3_tree = null;
            object char_literal5_tree = null;
            object char_literal7_tree = null;

            try { DebugEnterRule(GrammarFileName, "methodExp");
                  DebugLocation(12, 52);
                  try
                  {
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:13:11: ( ( ACCESSOR )? type '.' method '(' args ')' )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:13:13: ( ACCESSOR )? type '.' method '(' args ')'
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(13, 13);
                          // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:13:13: ( ACCESSOR )?
                          int alt1 = 2;
                          try { DebugEnterSubRule(1);
                                try { DebugEnterDecision(1, decisionCanBacktrack[1]);
                                      int LA1_0 = input.LA(1);

                                      if ((LA1_0 == ACCESSOR))
                                      {
                                          int LA1_1 = input.LA(2);

                                          if (((LA1_1 >= ACCESSOR && LA1_1 <= IDENTIFIER) || LA1_1 == 12))
                                          {
                                              alt1 = 1;
                                          }
                                      }
                                } finally { DebugExitDecision(1); }
                                switch (alt1)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:13:14: ACCESSOR
                                    {
                                        DebugLocation(13, 14);
                                        ACCESSOR1      = (IToken)Match(input, ACCESSOR, Follow._ACCESSOR_in_methodExp55);
                                        ACCESSOR1_tree = (object)adaptor.Create(ACCESSOR1);
                                        adaptor.AddChild(root_0, ACCESSOR1_tree);
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(1); }

                          DebugLocation(13, 25);
                          PushFollow(Follow._type_in_methodExp59);
                          type2 = type();
                          PopFollow();

                          adaptor.AddChild(root_0, type2.Tree);
                          DebugLocation(13, 30);
                          char_literal3      = (IToken)Match(input, 8, Follow._8_in_methodExp61);
                          char_literal3_tree = (object)adaptor.Create(char_literal3);
                          adaptor.AddChild(root_0, char_literal3_tree);

                          DebugLocation(13, 34);
                          PushFollow(Follow._method_in_methodExp63);
                          method4 = method();
                          PopFollow();

                          adaptor.AddChild(root_0, method4.Tree);
                          DebugLocation(13, 41);
                          char_literal5      = (IToken)Match(input, 9, Follow._9_in_methodExp65);
                          char_literal5_tree = (object)adaptor.Create(char_literal5);
                          adaptor.AddChild(root_0, char_literal5_tree);

                          DebugLocation(13, 45);
                          PushFollow(Follow._args_in_methodExp67);
                          args6 = args();
                          PopFollow();

                          adaptor.AddChild(root_0, args6.Tree);
                          DebugLocation(13, 50);
                          char_literal7      = (IToken)Match(input, 10, Follow._10_in_methodExp69);
                          char_literal7_tree = (object)adaptor.Create(char_literal7);
                          adaptor.AddChild(root_0, char_literal7_tree);
                      }

                      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("methodExp", 1);
                      LeaveRule("methodExp", 1);
                      Leave_methodExp();
                  }
                  DebugLocation(13, 52); } finally { DebugExitRule(GrammarFileName, "methodExp"); }
            return(retval);
        }