예제 #1
0
        private PointcutParser.negation_return negation()
        {
            Enter_negation();
            EnterRule("negation", 4);
            TraceIn("negation", 4);
            PointcutParser.negation_return retval = new PointcutParser.negation_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken NOT9 = null;

            PointcutParser.criteria_return criteria10 = default(PointcutParser.criteria_return);

            object NOT9_tree = default(object);

            try { DebugEnterRule(GrammarFileName, "negation");
                  DebugLocation(28, 27);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:28:10: ( ( NOT )? criteria )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:28:12: ( NOT )? criteria
                      {
                          root_0 = (object)adaptor.Nil();

                          DebugLocation(28, 12);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:28:12: ( NOT )?
                          int alt5 = 2;
                          try { DebugEnterSubRule(5);
                                try { DebugEnterDecision(5, decisionCanBacktrack[5]);
                                      int LA5_0 = input.LA(1);

                                      if ((LA5_0 == NOT))
                                      {
                                          alt5 = 1;
                                      }
                                } finally { DebugExitDecision(5); }
                                switch (alt5)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:28:13: NOT
                                    {
                                        DebugLocation(28, 16);
                                        NOT9      = (IToken)Match(input, NOT, Follow._NOT_in_negation144);
                                        NOT9_tree = (object)adaptor.Create(NOT9);
                                        root_0    = (object)adaptor.BecomeRoot(NOT9_tree, root_0);
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(5); }

                          DebugLocation(28, 20);
                          PushFollow(Follow._criteria_in_negation149);
                          criteria10 = criteria();
                          PopFollow();

                          adaptor.AddChild(root_0, criteria10.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("negation", 4);
                      LeaveRule("negation", 4);
                      Leave_negation();
                  }
                  DebugLocation(28, 27); } finally { DebugExitRule(GrammarFileName, "negation"); }
            return(retval);
        }
예제 #2
0
        private PointcutParser.array_return array()
        {
            Enter_array();
            EnterRule("array", 3);
            TraceIn("array", 3);
            PointcutParser.array_return retval = new PointcutParser.array_return();
            retval.Start = (IToken)input.LT(1);

            object root_0 = default(object);

            IToken char_literal7 = null;

            PointcutParser.negation_return negation6 = default(PointcutParser.negation_return);
            PointcutParser.negation_return negation8 = default(PointcutParser.negation_return);

            object char_literal7_tree                = default(object);
            RewriteRuleITokenStream  stream_14       = new RewriteRuleITokenStream(adaptor, "token 14");
            RewriteRuleSubtreeStream stream_negation = new RewriteRuleSubtreeStream(adaptor, "rule negation");

            try { DebugEnterRule(GrammarFileName, "array");
                  DebugLocation(23, 3);
                  try
                  {
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:23:7: ( negation ( ( ',' negation )+ -> ^( ARRAY ( negation )* ) | -> negation ) )
                      DebugEnterAlt(1);
                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:23:9: negation ( ( ',' negation )+ -> ^( ARRAY ( negation )* ) | -> negation )
                      {
                          DebugLocation(23, 9);
                          PushFollow(Follow._negation_in_array100);
                          negation6 = negation();
                          PopFollow();

                          stream_negation.Add(negation6.Tree);
                          DebugLocation(23, 18);
                          // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:23:18: ( ( ',' negation )+ -> ^( ARRAY ( negation )* ) | -> negation )
                          int alt4 = 2;
                          try { DebugEnterSubRule(4);
                                try { DebugEnterDecision(4, decisionCanBacktrack[4]);
                                      int LA4_0 = input.LA(1);

                                      if ((LA4_0 == 14))
                                      {
                                          alt4 = 1;
                                      }
                                      else if ((LA4_0 == EOF || (LA4_0 >= And && LA4_0 <= Or) || LA4_0 == 18))
                                      {
                                          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\\SheepAspect\\Saql\\Ast\\Pointcut.g:24:4: ( ',' negation )+
                                    {
                                        DebugLocation(24, 4);
                                        // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:24:4: ( ',' negation )+
                                        int cnt3 = 0;
                                        try { DebugEnterSubRule(3);
                                              while (true)
                                              {
                                                  int alt3 = 2;
                                                  try { DebugEnterDecision(3, decisionCanBacktrack[3]);
                                                        int LA3_0 = input.LA(1);

                                                        if ((LA3_0 == 14))
                                                        {
                                                            alt3 = 1;
                                                        }
                                                  } finally { DebugExitDecision(3); }
                                                  switch (alt3)
                                                  {
                                                  case 1:
                                                      DebugEnterAlt(1);
                                                      // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:24:5: ',' negation
                                                      {
                                                          DebugLocation(24, 5);
                                                          char_literal7 = (IToken)Match(input, 14, Follow._14_in_array108);
                                                          stream_14.Add(char_literal7);

                                                          DebugLocation(24, 9);
                                                          PushFollow(Follow._negation_in_array110);
                                                          negation8 = negation();
                                                          PopFollow();

                                                          stream_negation.Add(negation8.Tree);
                                                      }
                                                      break;

                                                  default:
                                                      if (cnt3 >= 1)
                                                      {
                                                          goto loop3;
                                                      }

                                                      EarlyExitException eee3 = new EarlyExitException(3, input);
                                                      DebugRecognitionException(eee3);
                                                      throw eee3;
                                                  }
                                                  cnt3++;
                                              }
loop3:
                                              ; } finally { DebugExitSubRule(3); }



                                        {
                                            // AST REWRITE
                                            // elements: negation
                                            // 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();
                                            // 24:20: -> ^( ARRAY ( negation )* )
                                            {
                                                DebugLocation(24, 23);
                                                // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:24:23: ^( ARRAY ( negation )* )
                                                {
                                                    object root_1 = (object)adaptor.Nil();
                                                    DebugLocation(24, 25);
                                                    root_1 = (object)adaptor.BecomeRoot((object)adaptor.Create(ARRAY, "ARRAY"), root_1);

                                                    DebugLocation(24, 31);
                                                    // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:24:31: ( negation )*
                                                    while (stream_negation.HasNext)
                                                    {
                                                        DebugLocation(24, 31);
                                                        adaptor.AddChild(root_1, stream_negation.NextTree());
                                                    }
                                                    stream_negation.Reset();

                                                    adaptor.AddChild(root_0, root_1);
                                                }
                                            }

                                            retval.Tree = root_0;
                                        }
                                    }
                                    break;

                                case 2:
                                    DebugEnterAlt(2);
                                    // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:25:7:
                                    {
                                        {
                                            // AST REWRITE
                                            // elements: negation
                                            // 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();
                                            // 25:7: -> negation
                                            {
                                                DebugLocation(25, 10);
                                                adaptor.AddChild(root_0, stream_negation.NextTree());
                                            }

                                            retval.Tree = root_0;
                                        }
                                    }
                                    break;
                                }
                          } finally { DebugExitSubRule(4); }
                      }

                      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("array", 3);
                      LeaveRule("array", 3);
                      Leave_array();
                  }
                  DebugLocation(26, 3); } finally { DebugExitRule(GrammarFileName, "array"); }
            return(retval);
        }