Examples of ParserRuleReturnScope


Examples of org.antlr.runtime.ParserRuleReturnScope

    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token set10 = null;
    ParserRuleReturnScope relationalExpression9 = null;
    ParserRuleReturnScope relationalExpression11 = null;

    final CommonTree set10_tree = null;

    try {
      // ECalc.g:62:2: ( relationalExpression ( ( EQUALS | NOTEQUALS ) ^
      // relationalExpression )* )
      // ECalc.g:62:4: relationalExpression ( ( EQUALS | NOTEQUALS ) ^
      // relationalExpression )*
      {
        root_0 = (CommonTree) adaptor.nil();

        pushFollow(FOLLOW_relationalExpression_in_equalityExpression150);
        relationalExpression9 = relationalExpression();
        state._fsp--;

        adaptor.addChild(
            root_0,
            relationalExpression9.getTree());

        // ECalc.g:62:25: ( ( EQUALS | NOTEQUALS ) ^
        // relationalExpression )*
        loop3: while (true) {
          int alt3 = 2;
          final int LA3_0 = input.LA(1);
          if (((LA3_0 == EQUALS) || (LA3_0 == NOTEQUALS))) {
            alt3 = 1;
          }

          switch (alt3) {
            case 1:
            // ECalc.g:62:26: ( EQUALS | NOTEQUALS ) ^
            // relationalExpression
            {
              set10 = input.LT(1);
              set10 = input.LT(1);
              if ((input.LA(1) == EQUALS) || (input.LA(1) == NOTEQUALS)) {
                input.consume();
                root_0 = (CommonTree) adaptor.becomeRoot(
                    adaptor.create(set10),
                    root_0);
                state.errorRecovery = false;
              }
              else {
                final MismatchedSetException mse = new MismatchedSetException(
                    null,
                    input);
                throw mse;
              }
              pushFollow(FOLLOW_relationalExpression_in_equalityExpression160);
              relationalExpression11 = relationalExpression();
              state._fsp--;

              adaptor.addChild(
                  root_0,
                  relationalExpression11.getTree());

            }
              break;

            default:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token set13 = null;
    ParserRuleReturnScope additiveExpression12 = null;
    ParserRuleReturnScope additiveExpression14 = null;

    final CommonTree set13_tree = null;

    try {
      // ECalc.g:71:2: ( additiveExpression ( ( LT | LTEQ | GT | GTEQ ) ^
      // additiveExpression )* )
      // ECalc.g:71:4: additiveExpression ( ( LT | LTEQ | GT | GTEQ ) ^
      // additiveExpression )*
      {
        root_0 = (CommonTree) adaptor.nil();

        pushFollow(FOLLOW_additiveExpression_in_relationalExpression200);
        additiveExpression12 = additiveExpression();
        state._fsp--;

        adaptor.addChild(
            root_0,
            additiveExpression12.getTree());

        // ECalc.g:71:23: ( ( LT | LTEQ | GT | GTEQ ) ^
        // additiveExpression )*
        loop4: while (true) {
          int alt4 = 2;
          final int LA4_0 = input.LA(1);
          if ((((LA4_0 >= GT) && (LA4_0 <= GTEQ)) || ((LA4_0 >= LT) && (LA4_0 <= LTEQ)))) {
            alt4 = 1;
          }

          switch (alt4) {
            case 1:
            // ECalc.g:71:25: ( LT | LTEQ | GT | GTEQ ) ^
            // additiveExpression
            {
              set13 = input.LT(1);
              set13 = input.LT(1);
              if (((input.LA(1) >= GT) && (input.LA(1) <= GTEQ)) || ((input.LA(1) >= LT) && (input.LA(1) <= LTEQ))) {
                input.consume();
                root_0 = (CommonTree) adaptor.becomeRoot(
                    adaptor.create(set13),
                    root_0);
                state.errorRecovery = false;
              }
              else {
                final MismatchedSetException mse = new MismatchedSetException(
                    null,
                    input);
                throw mse;
              }
              pushFollow(FOLLOW_additiveExpression_in_relationalExpression215);
              additiveExpression14 = additiveExpression();
              state._fsp--;

              adaptor.addChild(
                  root_0,
                  additiveExpression14.getTree());

            }
              break;

            default:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token set16 = null;
    ParserRuleReturnScope multiplicativeExpression15 = null;
    ParserRuleReturnScope multiplicativeExpression17 = null;

    final CommonTree set16_tree = null;

    try {
      // ECalc.g:80:2: ( multiplicativeExpression ( ( PLUS | MINUS ) ^
      // multiplicativeExpression )* )
      // ECalc.g:80:4: multiplicativeExpression ( ( PLUS | MINUS ) ^
      // multiplicativeExpression )*
      {
        root_0 = (CommonTree) adaptor.nil();

        pushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression258);
        multiplicativeExpression15 = multiplicativeExpression();
        state._fsp--;

        adaptor.addChild(
            root_0,
            multiplicativeExpression15.getTree());

        // ECalc.g:80:29: ( ( PLUS | MINUS ) ^ multiplicativeExpression
        // )*
        loop5: while (true) {
          int alt5 = 2;
          final int LA5_0 = input.LA(1);
          if (((LA5_0 == MINUS) || (LA5_0 == PLUS))) {
            alt5 = 1;
          }

          switch (alt5) {
            case 1:
            // ECalc.g:80:31: ( PLUS | MINUS ) ^
            // multiplicativeExpression
            {
              set16 = input.LT(1);
              set16 = input.LT(1);
              if ((input.LA(1) == MINUS) || (input.LA(1) == PLUS)) {
                input.consume();
                root_0 = (CommonTree) adaptor.becomeRoot(
                    adaptor.create(set16),
                    root_0);
                state.errorRecovery = false;
              }
              else {
                final MismatchedSetException mse = new MismatchedSetException(
                    null,
                    input);
                throw mse;
              }
              pushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression269);
              multiplicativeExpression17 = multiplicativeExpression();
              state._fsp--;

              adaptor.addChild(
                  root_0,
                  multiplicativeExpression17.getTree());

            }
              break;

            default:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token set19 = null;
    ParserRuleReturnScope powerExpression18 = null;
    ParserRuleReturnScope powerExpression20 = null;

    final CommonTree set19_tree = null;

    try {
      // ECalc.g:87:2: ( powerExpression ( ( MULT | DIV | MOD ) ^
      // powerExpression )* )
      // ECalc.g:87:4: powerExpression ( ( MULT | DIV | MOD ) ^
      // powerExpression )*
      {
        root_0 = (CommonTree) adaptor.nil();

        pushFollow(FOLLOW_powerExpression_in_multiplicativeExpression299);
        powerExpression18 = powerExpression();
        state._fsp--;

        adaptor.addChild(
            root_0,
            powerExpression18.getTree());

        // ECalc.g:87:20: ( ( MULT | DIV | MOD ) ^ powerExpression )*
        loop6: while (true) {
          int alt6 = 2;
          final int LA6_0 = input.LA(1);
          if (((LA6_0 == DIV) || ((LA6_0 >= MOD) && (LA6_0 <= MULT)))) {
            alt6 = 1;
          }

          switch (alt6) {
            case 1:
            // ECalc.g:87:22: ( MULT | DIV | MOD ) ^ powerExpression
            {
              set19 = input.LT(1);
              set19 = input.LT(1);
              if ((input.LA(1) == DIV) || ((input.LA(1) >= MOD) && (input.LA(1) <= MULT))) {
                input.consume();
                root_0 = (CommonTree) adaptor.becomeRoot(
                    adaptor.create(set19),
                    root_0);
                state.errorRecovery = false;
              }
              else {
                final MismatchedSetException mse = new MismatchedSetException(
                    null,
                    input);
                throw mse;
              }
              pushFollow(FOLLOW_powerExpression_in_multiplicativeExpression312);
              powerExpression20 = powerExpression();
              state._fsp--;

              adaptor.addChild(
                  root_0,
                  powerExpression20.getTree());

            }
              break;

            default:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token POW22 = null;
    ParserRuleReturnScope unaryExpression21 = null;
    ParserRuleReturnScope unaryExpression23 = null;

    CommonTree POW22_tree = null;

    try {
      // ECalc.g:95:2: ( unaryExpression ( POW ^ unaryExpression )* )
      // ECalc.g:95:4: unaryExpression ( POW ^ unaryExpression )*
      {
        root_0 = (CommonTree) adaptor.nil();

        pushFollow(FOLLOW_unaryExpression_in_powerExpression350);
        unaryExpression21 = unaryExpression();
        state._fsp--;

        adaptor.addChild(
            root_0,
            unaryExpression21.getTree());

        // ECalc.g:95:20: ( POW ^ unaryExpression )*
        loop7: while (true) {
          int alt7 = 2;
          final int LA7_0 = input.LA(1);
          if ((LA7_0 == POW)) {
            alt7 = 1;
          }

          switch (alt7) {
            case 1:
            // ECalc.g:95:22: POW ^ unaryExpression
            {
              POW22 = (Token) match(
                  input,
                  POW,
                  FOLLOW_POW_in_powerExpression354);
              POW22_tree = (CommonTree) adaptor.create(POW22);
              root_0 = (CommonTree) adaptor.becomeRoot(
                  POW22_tree,
                  root_0);

              pushFollow(FOLLOW_unaryExpression_in_powerExpression357);
              unaryExpression23 = unaryExpression();
              state._fsp--;

              adaptor.addChild(
                  root_0,
                  unaryExpression23.getTree());

            }
              break;

            default:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    CommonTree root_0 = null;

    Token NOT25 = null;
    Token MINUS27 = null;
    ParserRuleReturnScope primaryExpression24 = null;
    ParserRuleReturnScope primaryExpression26 = null;
    ParserRuleReturnScope primaryExpression28 = null;

    CommonTree NOT25_tree = null;
    final CommonTree MINUS27_tree = null;
    final RewriteRuleTokenStream stream_MINUS = new RewriteRuleTokenStream(
        adaptor,
        "token MINUS");
    final RewriteRuleSubtreeStream stream_primaryExpression = new RewriteRuleSubtreeStream(
        adaptor,
        "rule primaryExpression");

    try {
      // ECalc.g:101:2: ( primaryExpression | NOT ^ primaryExpression |
      // MINUS primaryExpression -> ^( NEGATE primaryExpression ) )
      int alt8 = 3;
      switch (input.LA(1)) {
        case BOOLEAN:
        case DATETIME:
        case FLOAT:
        case IDENT:
        case INTEGER:
        case STRING:
        case 31:
        case 34: {
          alt8 = 1;
        }
          break;
        case NOT: {
          alt8 = 2;
        }
          break;
        case MINUS: {
          alt8 = 3;
        }
          break;
        default:
          final NoViableAltException nvae = new NoViableAltException(
              "",
              8,
              0,
              input);
          throw nvae;
      }
      switch (alt8) {
        case 1:
        // ECalc.g:101:4: primaryExpression
        {
          root_0 = (CommonTree) adaptor.nil();

          pushFollow(FOLLOW_primaryExpression_in_unaryExpression380);
          primaryExpression24 = primaryExpression();
          state._fsp--;

          adaptor.addChild(
              root_0,
              primaryExpression24.getTree());

        }
          break;
        case 2:
        // ECalc.g:102:8: NOT ^ primaryExpression
        {
          root_0 = (CommonTree) adaptor.nil();

          NOT25 = (Token) match(
              input,
              NOT,
              FOLLOW_NOT_in_unaryExpression389);
          NOT25_tree = (CommonTree) adaptor.create(NOT25);
          root_0 = (CommonTree) adaptor.becomeRoot(
              NOT25_tree,
              root_0);

          pushFollow(FOLLOW_primaryExpression_in_unaryExpression392);
          primaryExpression26 = primaryExpression();
          state._fsp--;

          adaptor.addChild(
              root_0,
              primaryExpression26.getTree());

        }
          break;
        case 3:
        // ECalc.g:103:8: MINUS primaryExpression
        {
          MINUS27 = (Token) match(
              input,
              MINUS,
              FOLLOW_MINUS_in_unaryExpression401);
          stream_MINUS.add(MINUS27);

          pushFollow(FOLLOW_primaryExpression_in_unaryExpression403);
          primaryExpression28 = primaryExpression();
          state._fsp--;

          stream_primaryExpression.add(primaryExpression28.getTree());
          // AST REWRITE
          // elements: primaryExpression
          // token labels:
          // rule labels: retval
          // token list labels:
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    CommonTree root_0 = null;

    Token char_literal29 = null;
    Token char_literal31 = null;
    ParserRuleReturnScope logicalExpression30 = null;
    ParserRuleReturnScope value32 = null;

    final CommonTree char_literal29_tree = null;
    final CommonTree char_literal31_tree = null;

    try {
      // ECalc.g:109:2: ( '(' ! logicalExpression ')' !| value )
      int alt9 = 2;
      final int LA9_0 = input.LA(1);
      if ((LA9_0 == 31)) {
        alt9 = 1;
      }
      else if ((((LA9_0 >= BOOLEAN) && (LA9_0 <= DATETIME)) || (LA9_0 == FLOAT) || ((LA9_0 >= IDENT) && (LA9_0 <= INTEGER)) || (LA9_0 == STRING) || (LA9_0 == 34))) {
        alt9 = 2;
      }

      else {
        final NoViableAltException nvae = new NoViableAltException(
            "",
            9,
            0,
            input);
        throw nvae;
      }

      switch (alt9) {
        case 1:
        // ECalc.g:109:4: '(' ! logicalExpression ')' !
        {
          root_0 = (CommonTree) adaptor.nil();

          char_literal29 = (Token) match(
              input,
              31,
              FOLLOW_31_in_primaryExpression439);
          pushFollow(FOLLOW_logicalExpression_in_primaryExpression442);
          logicalExpression30 = logicalExpression();
          state._fsp--;

          adaptor.addChild(
              root_0,
              logicalExpression30.getTree());

          char_literal31 = (Token) match(
              input,
              32,
              FOLLOW_32_in_primaryExpression444);
        }
          break;
        case 2:
        // ECalc.g:110:4: value
        {
          root_0 = (CommonTree) adaptor.nil();

          pushFollow(FOLLOW_value_in_primaryExpression450);
          value32 = value();
          state._fsp--;

          adaptor.addChild(
              root_0,
              value32.getTree());

        }
          break;

      }
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    Token INTEGER33 = null;
    Token FLOAT34 = null;
    Token DATETIME35 = null;
    Token BOOLEAN36 = null;
    Token STRING37 = null;
    ParserRuleReturnScope function38 = null;
    ParserRuleReturnScope parameter39 = null;

    CommonTree INTEGER33_tree = null;
    CommonTree FLOAT34_tree = null;
    CommonTree DATETIME35_tree = null;
    CommonTree BOOLEAN36_tree = null;
    CommonTree STRING37_tree = null;

    try {
      // ECalc.g:114:2: ( INTEGER | FLOAT | DATETIME | BOOLEAN | STRING |
      // function | parameter )
      int alt10 = 7;
      switch (input.LA(1)) {
        case INTEGER: {
          alt10 = 1;
        }
          break;
        case FLOAT: {
          alt10 = 2;
        }
          break;
        case DATETIME: {
          alt10 = 3;
        }
          break;
        case BOOLEAN: {
          alt10 = 4;
        }
          break;
        case STRING: {
          alt10 = 5;
        }
          break;
        case IDENT: {
          alt10 = 6;
        }
          break;
        case 34: {
          alt10 = 7;
        }
          break;
        default:
          final NoViableAltException nvae = new NoViableAltException(
              "",
              10,
              0,
              input);
          throw nvae;
      }
      switch (alt10) {
        case 1:
        // ECalc.g:114:5: INTEGER
        {
          root_0 = (CommonTree) adaptor.nil();

          INTEGER33 = (Token) match(
              input,
              INTEGER,
              FOLLOW_INTEGER_in_value464);
          INTEGER33_tree = (CommonTree) adaptor.create(INTEGER33);
          adaptor.addChild(
              root_0,
              INTEGER33_tree);

        }
          break;
        case 2:
        // ECalc.g:115:4: FLOAT
        {
          root_0 = (CommonTree) adaptor.nil();

          FLOAT34 = (Token) match(
              input,
              FLOAT,
              FOLLOW_FLOAT_in_value469);
          FLOAT34_tree = (CommonTree) adaptor.create(FLOAT34);
          adaptor.addChild(
              root_0,
              FLOAT34_tree);

        }
          break;
        case 3:
        // ECalc.g:116:5: DATETIME
        {
          root_0 = (CommonTree) adaptor.nil();

          DATETIME35 = (Token) match(
              input,
              DATETIME,
              FOLLOW_DATETIME_in_value475);
          DATETIME35_tree = (CommonTree) adaptor.create(DATETIME35);
          adaptor.addChild(
              root_0,
              DATETIME35_tree);

        }
          break;
        case 4:
        // ECalc.g:117:4: BOOLEAN
        {
          root_0 = (CommonTree) adaptor.nil();

          BOOLEAN36 = (Token) match(
              input,
              BOOLEAN,
              FOLLOW_BOOLEAN_in_value480);
          BOOLEAN36_tree = (CommonTree) adaptor.create(BOOLEAN36);
          adaptor.addChild(
              root_0,
              BOOLEAN36_tree);

        }
          break;
        case 5:
        // ECalc.g:118:4: STRING
        {
          root_0 = (CommonTree) adaptor.nil();

          STRING37 = (Token) match(
              input,
              STRING,
              FOLLOW_STRING_in_value485);
          STRING37_tree = (CommonTree) adaptor.create(STRING37);
          adaptor.addChild(
              root_0,
              STRING37_tree);

        }
          break;
        case 6:
        // ECalc.g:119:4: function
        {
          root_0 = (CommonTree) adaptor.nil();

          pushFollow(FOLLOW_function_in_value490);
          function38 = function();
          state._fsp--;

          adaptor.addChild(
              root_0,
              function38.getTree());

        }
          break;
        case 7:
        // ECalc.g:120:4: parameter
        {
          root_0 = (CommonTree) adaptor.nil();

          pushFollow(FOLLOW_parameter_in_value495);
          parameter39 = parameter();
          state._fsp--;

          adaptor.addChild(
              root_0,
              parameter39.getTree());

        }
          break;

      }
View Full Code Here

Examples of org.antlr.runtime.ParserRuleReturnScope

    Token IDENT44 = null;
    Token char_literal45 = null;
    Token char_literal47 = null;
    Token char_literal49 = null;
    ParserRuleReturnScope logicalExpression46 = null;
    ParserRuleReturnScope logicalExpression48 = null;

    final CommonTree IDENT44_tree = null;
    final CommonTree char_literal45_tree = null;
    final CommonTree char_literal47_tree = null;
    final CommonTree char_literal49_tree = null;
    final RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(
        adaptor,
        "token IDENT");
    final RewriteRuleTokenStream stream_32 = new RewriteRuleTokenStream(
        adaptor,
        "token 32");
    final RewriteRuleTokenStream stream_31 = new RewriteRuleTokenStream(
        adaptor,
        "token 31");
    final RewriteRuleTokenStream stream_33 = new RewriteRuleTokenStream(
        adaptor,
        "token 33");
    final RewriteRuleSubtreeStream stream_logicalExpression = new RewriteRuleSubtreeStream(
        adaptor,
        "rule logicalExpression");

    try {
      // ECalc.g:150:2: ( IDENT '(' ( logicalExpression ( ','
      // logicalExpression )* )? ')' -> ^( IDENT ( logicalExpression )* )
      // )
      // ECalc.g:150:4: IDENT '(' ( logicalExpression ( ','
      // logicalExpression )* )? ')'
      {
        IDENT44 = (Token) match(
            input,
            IDENT,
            FOLLOW_IDENT_in_function685);
        stream_IDENT.add(IDENT44);

        char_literal45 = (Token) match(
            input,
            31,
            FOLLOW_31_in_function687);
        stream_31.add(char_literal45);

        // ECalc.g:150:14: ( logicalExpression ( ',' logicalExpression
        // )* )?
        int alt13 = 2;
        final int LA13_0 = input.LA(1);
        if ((((LA13_0 >= BOOLEAN) && (LA13_0 <= DATETIME)) || (LA13_0 == FLOAT) || ((LA13_0 >= IDENT) && (LA13_0 <= INTEGER)) || (LA13_0 == MINUS) || (LA13_0 == NOT) || (LA13_0 == STRING) || (LA13_0 == 31) || (LA13_0 == 34))) {
          alt13 = 1;
        }
        switch (alt13) {
          case 1:
          // ECalc.g:150:16: logicalExpression ( ',' logicalExpression
          // )*
          {
            pushFollow(FOLLOW_logicalExpression_in_function691);
            logicalExpression46 = logicalExpression();
            state._fsp--;

            stream_logicalExpression.add(logicalExpression46.getTree());
            // ECalc.g:150:34: ( ',' logicalExpression )*
            loop12: while (true) {
              int alt12 = 2;
              final int LA12_0 = input.LA(1);
              if ((LA12_0 == 33)) {
                alt12 = 1;
              }

              switch (alt12) {
                case 1:
                // ECalc.g:150:35: ',' logicalExpression
                {
                  char_literal47 = (Token) match(
                      input,
                      33,
                      FOLLOW_33_in_function694);
                  stream_33.add(char_literal47);

                  pushFollow(FOLLOW_logicalExpression_in_function696);
                  logicalExpression48 = logicalExpression();
                  state._fsp--;

                  stream_logicalExpression.add(logicalExpression48.getTree());
                }
                  break;

                default:
                  break loop12;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.