Exemple #1
0
        private LiteralExpressionParser.keyword_return keyword()
        {
            Enter_keyword();
            EnterRule("keyword", 7);
            TraceIn("keyword", 7);
            LiteralExpressionParser.keyword_return retval = new LiteralExpressionParser.keyword_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = null;

            IToken ACCESSOR19 = null;

            object ACCESSOR19_tree = null;

            try { DebugEnterRule(GrammarFileName, "keyword");
                  DebugLocation(29, 19);
                  try
                  {
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:29:9: ( ACCESSOR )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:29:12: ACCESSOR
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(29, 12);
                          ACCESSOR19      = (IToken)Match(input, ACCESSOR, Follow._ACCESSOR_in_keyword164);
                          ACCESSOR19_tree = (object)adaptor.Create(ACCESSOR19);
                          adaptor.AddChild(root_0, ACCESSOR19_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("keyword", 7);
                      LeaveRule("keyword", 7);
                      Leave_keyword();
                  }
                  DebugLocation(29, 19); } finally { DebugExitRule(GrammarFileName, "keyword"); }
            return(retval);
        }
Exemple #2
0
        private LiteralExpressionParser.method_return method()
        {
            Enter_method();
            EnterRule("method", 5);
            TraceIn("method", 5);
            LiteralExpressionParser.method_return retval = new LiteralExpressionParser.method_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = null;

            IToken IDENTIFIER15 = null;

            LiteralExpressionParser.keyword_return keyword14 = default(LiteralExpressionParser.keyword_return);

            object IDENTIFIER15_tree = null;

            try { DebugEnterRule(GrammarFileName, "method");
                  DebugLocation(25, 29);
                  try
                  {
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:25:8: ( keyword | IDENTIFIER )
                      int alt4 = 2;
                      try { DebugEnterDecision(4, decisionCanBacktrack[4]);
                            int LA4_0 = input.LA(1);

                            if ((LA4_0 == ACCESSOR))
                            {
                                alt4 = 1;
                            }
                            else if ((LA4_0 == IDENTIFIER))
                            {
                                alt4 = 2;
                            }
                            else
                            {
                                NoViableAltException nvae = new NoViableAltException("", 4, 0, input);

                                DebugRecognitionException(nvae);
                                throw nvae;
                            } } finally { DebugExitDecision(4); }
                      switch (alt4)
                      {
                      case 1:
                          DebugEnterAlt(1);
                          // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:25:10: keyword
                          {
                              root_0 = (object)adaptor.Nil();

                              DebugLocation(25, 10);
                              PushFollow(Follow._keyword_in_method133);
                              keyword14 = keyword();
                              PopFollow();

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

                      case 2:
                          DebugEnterAlt(2);
                          // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:25:20: IDENTIFIER
                          {
                              root_0 = (object)adaptor.Nil();

                              DebugLocation(25, 20);
                              IDENTIFIER15      = (IToken)Match(input, IDENTIFIER, Follow._IDENTIFIER_in_method137);
                              IDENTIFIER15_tree = (object)adaptor.Create(IDENTIFIER15);
                              adaptor.AddChild(root_0, IDENTIFIER15_tree);
                          }
                          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("method", 5);
                      LeaveRule("method", 5);
                      Leave_method();
                  }
                  DebugLocation(25, 29); } finally { DebugExitRule(GrammarFileName, "method"); }
            return(retval);
        }
Exemple #3
0
        public LiteralExpressionParser.type_return type()
        {
            Enter_type();
            EnterRule("type", 2);
            TraceIn("type", 2);
            LiteralExpressionParser.type_return retval = new LiteralExpressionParser.type_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = null;

            IToken IDENTIFIER10 = null;

            LiteralExpressionParser.typeNamespace_return typeNamespace8 = default(LiteralExpressionParser.typeNamespace_return);
            LiteralExpressionParser.keyword_return       keyword9       = default(LiteralExpressionParser.keyword_return);

            object IDENTIFIER10_tree = null;

            try { DebugEnterRule(GrammarFileName, "type");
                  DebugLocation(15, 43);
                  try
                  {
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:16:6: ( typeNamespace ( keyword | IDENTIFIER ) )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:16:8: typeNamespace ( keyword | IDENTIFIER )
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(16, 8);
                          PushFollow(Follow._typeNamespace_in_type79);
                          typeNamespace8 = typeNamespace();
                          PopFollow();

                          adaptor.AddChild(root_0, typeNamespace8.Tree);
                          DebugLocation(16, 22);
                          // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:16:22: ( keyword | IDENTIFIER )
                          int alt2 = 2;
                          try { DebugEnterSubRule(2);
                                try { DebugEnterDecision(2, decisionCanBacktrack[2]);
                                      int LA2_0 = input.LA(1);

                                      if ((LA2_0 == ACCESSOR))
                                      {
                                          alt2 = 1;
                                      }
                                      else if ((LA2_0 == IDENTIFIER))
                                      {
                                          alt2 = 2;
                                      }
                                      else
                                      {
                                          NoViableAltException nvae = new NoViableAltException("", 2, 0, input);

                                          DebugRecognitionException(nvae);
                                          throw nvae;
                                      } } finally { DebugExitDecision(2); }
                                switch (alt2)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:16:23: keyword
                                    {
                                        DebugLocation(16, 23);
                                        PushFollow(Follow._keyword_in_type82);
                                        keyword9 = keyword();
                                        PopFollow();

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

                                case 2:
                                    DebugEnterAlt(2);
                                    // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:16:33: IDENTIFIER
                                    {
                                        DebugLocation(16, 33);
                                        IDENTIFIER10      = (IToken)Match(input, IDENTIFIER, Follow._IDENTIFIER_in_type86);
                                        IDENTIFIER10_tree = (object)adaptor.Create(IDENTIFIER10);
                                        adaptor.AddChild(root_0, IDENTIFIER10_tree);
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(2); }
                      }

                      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("type", 2);
                      LeaveRule("type", 2);
                      Leave_type();
                  }
                  DebugLocation(16, 43); } finally { DebugExitRule(GrammarFileName, "type"); }
            return(retval);
        }