Ejemplo n.º 1
0
  // $ANTLR start "expression"
  // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:69:1: expression : andexpression ;
  public final CriteriaParser.expression_return expression() throws RecognitionException {
    CriteriaParser.expression_return retval = new CriteriaParser.expression_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    CriteriaParser.andexpression_return andexpression1 = null;

    try {
      // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:69:12: ( andexpression )
      // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:69:14: andexpression
      {
        root_0 = (Object) adaptor.nil();

        pushFollow(FOLLOW_andexpression_in_expression380);
        andexpression1 = andexpression();

        state._fsp--;

        adaptor.addChild(root_0, andexpression1.getTree());
      }

      retval.stop = 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 {
    }
    return retval;
  }
Ejemplo n.º 2
0
  // $ANTLR start "atom"
  // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:1: atom : ( NULL | NUMBER | STRING |
  // FIELD | LPAREN andexpression RPAREN );
  public final CriteriaParser.atom_return atom() throws RecognitionException {
    CriteriaParser.atom_return retval = new CriteriaParser.atom_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    Token NULL14 = null;
    Token NUMBER15 = null;
    Token STRING16 = null;
    Token FIELD17 = null;
    Token LPAREN18 = null;
    Token RPAREN20 = null;
    CriteriaParser.andexpression_return andexpression19 = null;

    Object NULL14_tree = null;
    Object NUMBER15_tree = null;
    Object STRING16_tree = null;
    Object FIELD17_tree = null;
    Object LPAREN18_tree = null;
    Object RPAREN20_tree = null;

    try {
      // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:6: ( NULL | NUMBER | STRING |
      // FIELD | LPAREN andexpression RPAREN )
      int alt5 = 5;
      switch (input.LA(1)) {
        case NULL:
          {
            alt5 = 1;
          }
          break;
        case NUMBER:
          {
            alt5 = 2;
          }
          break;
        case STRING:
          {
            alt5 = 3;
          }
          break;
        case FIELD:
          {
            alt5 = 4;
          }
          break;
        case LPAREN:
          {
            alt5 = 5;
          }
          break;
        default:
          NoViableAltException nvae = new NoViableAltException("", 5, 0, input);

          throw nvae;
      }

      switch (alt5) {
        case 1:
          // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:8: NULL
          {
            root_0 = (Object) adaptor.nil();

            NULL14 = (Token) match(input, NULL, FOLLOW_NULL_in_atom477);
            NULL14_tree = (Object) adaptor.create(NULL14);
            adaptor.addChild(root_0, NULL14_tree);
          }
          break;
        case 2:
          // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:14: NUMBER
          {
            root_0 = (Object) adaptor.nil();

            NUMBER15 = (Token) match(input, NUMBER, FOLLOW_NUMBER_in_atom480);
            NUMBER15_tree = (Object) adaptor.create(NUMBER15);
            adaptor.addChild(root_0, NUMBER15_tree);
          }
          break;
        case 3:
          // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:23: STRING
          {
            root_0 = (Object) adaptor.nil();

            STRING16 = (Token) match(input, STRING, FOLLOW_STRING_in_atom484);
            STRING16_tree = (Object) adaptor.create(STRING16);
            adaptor.addChild(root_0, STRING16_tree);
          }
          break;
        case 4:
          // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:32: FIELD
          {
            root_0 = (Object) adaptor.nil();

            FIELD17 = (Token) match(input, FIELD, FOLLOW_FIELD_in_atom488);
            FIELD17_tree = (Object) adaptor.create(FIELD17);
            adaptor.addChild(root_0, FIELD17_tree);
          }
          break;
        case 5:
          // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:82:40: LPAREN andexpression
          // RPAREN
          {
            root_0 = (Object) adaptor.nil();

            LPAREN18 = (Token) match(input, LPAREN, FOLLOW_LPAREN_in_atom492);
            pushFollow(FOLLOW_andexpression_in_atom495);
            andexpression19 = andexpression();

            state._fsp--;

            adaptor.addChild(root_0, andexpression19.getTree());
            RPAREN20 = (Token) match(input, RPAREN, FOLLOW_RPAREN_in_atom497);
          }
          break;
      }
      retval.stop = 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 {
    }
    return retval;
  }
Ejemplo n.º 3
0
  // $ANTLR start "andexpression"
  // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:72:1: andexpression : orexpression ( AND
  // orexpression )* ;
  public final CriteriaParser.andexpression_return andexpression() throws RecognitionException {
    CriteriaParser.andexpression_return retval = new CriteriaParser.andexpression_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    Token AND3 = null;
    CriteriaParser.orexpression_return orexpression2 = null;

    CriteriaParser.orexpression_return orexpression4 = null;

    Object AND3_tree = null;

    try {
      // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:72:15: ( orexpression ( AND
      // orexpression )* )
      // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:72:17: orexpression ( AND
      // orexpression )*
      {
        root_0 = (Object) adaptor.nil();

        pushFollow(FOLLOW_orexpression_in_andexpression389);
        orexpression2 = orexpression();

        state._fsp--;

        adaptor.addChild(root_0, orexpression2.getTree());
        // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:72:30: ( AND orexpression )*
        loop1:
        do {
          int alt1 = 2;
          switch (input.LA(1)) {
            case AND:
              {
                alt1 = 1;
              }
              break;
          }

          switch (alt1) {
            case 1:
              // com/pmerienne/eventmonitoring/shared/parser/Criteria.g:72:31: AND orexpression
              {
                AND3 = (Token) match(input, AND, FOLLOW_AND_in_andexpression392);
                AND3_tree = (Object) adaptor.create(AND3);
                root_0 = (Object) adaptor.becomeRoot(AND3_tree, root_0);

                pushFollow(FOLLOW_orexpression_in_andexpression395);
                orexpression4 = orexpression();

                state._fsp--;

                adaptor.addChild(root_0, orexpression4.getTree());
              }
              break;

            default:
              break loop1;
          }
        } while (true);
      }

      retval.stop = 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 {
    }
    return retval;
  }