Exemplo n.º 1
0
        private PointcutParser.compound_return compound()
        {
            Enter_compound();
            EnterRule("compound", 2);
            TraceIn("compound", 2);
            PointcutParser.compound_return retval = new PointcutParser.compound_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken set4 = null;

            PointcutParser.array_return array3 = default(PointcutParser.array_return);
            PointcutParser.array_return array5 = default(PointcutParser.array_return);

            object set4_tree = default(object);

            try { DebugEnterRule(GrammarFileName, "compound");
                  DebugLocation(21, 34);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:21:9: ( array ( ( And | Or ) array )* )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:21:11: array ( ( And | Or ) array )*
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(21, 11);
                          PushFollow(Follow._array_in_compound80);
                          array3 = array();
                          PopFollow();

                          adaptor.AddChild(root_0, array3.Tree);
                          DebugLocation(21, 17);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:21:17: ( ( And | Or ) array )*
                          try { DebugEnterSubRule(2);
                                while (true)
                                {
                                    int alt2 = 2;
                                    try { DebugEnterDecision(2, decisionCanBacktrack[2]);
                                          int LA2_0 = input.LA(1);

                                          if (((LA2_0 >= And && LA2_0 <= Or)))
                                          {
                                              alt2 = 1;
                                          }
                                    } finally { DebugExitDecision(2); }
                                    switch (alt2)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:21:18: ( And | Or ) array
                                        {
                                            DebugLocation(21, 18);
                                            set4 = (IToken)input.LT(1);
                                            set4 = (IToken)input.LT(1);
                                            if ((input.LA(1) >= And && input.LA(1) <= Or))
                                            {
                                                input.Consume();
                                                root_0 = (object)adaptor.BecomeRoot((object)adaptor.Create(set4), root_0);
                                                state.errorRecovery = false;
                                            }
                                            else
                                            {
                                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                                DebugRecognitionException(mse);
                                                throw mse;
                                            }

                                            DebugLocation(21, 28);
                                            PushFollow(Follow._array_in_compound90);
                                            array5 = array();
                                            PopFollow();

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

                                    default:
                                        goto loop2;
                                    }
                                }

loop2:
                                ; } 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("compound", 2);
                      LeaveRule("compound", 2);
                      Leave_compound();
                  }
                  DebugLocation(21, 34); } finally { DebugExitRule(GrammarFileName, "compound"); }
            return(retval);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public PointcutParser.pointcut_return pointcut()
        {
            Enter_pointcut();
            EnterRule("pointcut", 1);
            TraceIn("pointcut", 1);
            PointcutParser.pointcut_return retval = new PointcutParser.pointcut_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken EOF2 = null;

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

            object EOF2_tree = default(object);

            try { DebugEnterRule(GrammarFileName, "pointcut");
                  DebugLocation(18, 23);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:19:9: ( ( compound )? EOF )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:19:11: ( compound )? EOF
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(19, 11);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:19:11: ( compound )?
                          int alt1 = 2;
                          try { DebugEnterSubRule(1);
                                try { DebugEnterDecision(1, decisionCanBacktrack[1]);
                                      int LA1_0 = input.LA(1);

                                      if (((LA1_0 >= NOT && LA1_0 <= Value) || (LA1_0 >= 16 && LA1_0 <= 17)))
                                      {
                                          alt1 = 1;
                                      }
                                } finally { DebugExitDecision(1); }
                                switch (alt1)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:19:11: compound
                                    {
                                        DebugLocation(19, 11);
                                        PushFollow(Follow._compound_in_pointcut70);
                                        compound1 = compound();
                                        PopFollow();

                                        adaptor.AddChild(root_0, compound1.Tree);
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(1); }

                          DebugLocation(19, 21);
                          EOF2      = (IToken)Match(input, EOF, Follow._EOF_in_pointcut73);
                          EOF2_tree = (object)adaptor.Create(EOF2);
                          adaptor.AddChild(root_0, EOF2_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("pointcut", 1);
                      LeaveRule("pointcut", 1);
                      Leave_pointcut();
                  }
                  DebugLocation(19, 23); } finally { DebugExitRule(GrammarFileName, "pointcut"); }
            return(retval);
        }