Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.RewriteRuleSubtreeStream


        CssParser.expr_return expr59 = null;


        CommonTree char_literal58_tree = null;
        RewriteRuleTokenStream stream_31 = new RewriteRuleTokenStream(adaptor, "token 31");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor, "rule expr");
        try {
            // /home/langera/dev/freud/src/grammar/Css.g:108:2: ( expr ( ( ',' )? expr )* -> ( expr )* )
            // /home/langera/dev/freud/src/grammar/Css.g:108:4: expr ( ( ',' )? expr )*
            {
                pushFollow(FOLLOW_expr_in_args645);
                expr57 = expr();

                state._fsp--;

                stream_expr.add(expr57.getTree());
                // /home/langera/dev/freud/src/grammar/Css.g:108:9: ( ( ',' )? expr )*
                loop24:
                do {
                    int alt24 = 2;
                    int LA24_0 = input.LA(1);

                    if ((LA24_0 == IDENT || LA24_0 == 31 || (LA24_0 >= 36 && LA24_0 <= 37))) {
                        alt24 = 1;
                    }


                    switch (alt24) {
                        case 1:
                            // /home/langera/dev/freud/src/grammar/Css.g:108:10: ( ',' )? expr
                        {
                            // /home/langera/dev/freud/src/grammar/Css.g:108:10: ( ',' )?
                            int alt23 = 2;
                            int LA23_0 = input.LA(1);

                            if ((LA23_0 == 31)) {
                                alt23 = 1;
                            }
                            switch (alt23) {
                                case 1:
                                    // /home/langera/dev/freud/src/grammar/Css.g:108:10: ','
                                {
                                    char_literal58 = (Token) match(input, 31, FOLLOW_31_in_args648);
                                    stream_31.add(char_literal58);


                                }
                                break;

                            }

                            pushFollow(FOLLOW_expr_in_args651);
                            expr59 = expr();

                            state._fsp--;

                            stream_expr.add(expr59.getTree());

                        }
                        break;

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


                // AST REWRITE
                // elements: expr
                // 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 = (CommonTree) adaptor.nil();
                // 108:22: -> ( expr )*
                {
                    // /home/langera/dev/freud/src/grammar/Css.g:108:25: ( expr )*
 
View Full Code Here


                    // 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 = (CommonTree) adaptor.nil();
                    // 114:14: -> ^( COLOUR '#' IDENT )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:114:17: ^( COLOUR '#' IDENT )
View Full Code Here

        CommonTree char_literal70_tree = null;
        CommonTree char_literal72_tree = null;
        RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
        RewriteRuleTokenStream stream_62 = new RewriteRuleTokenStream(adaptor, "token 62");
        RewriteRuleTokenStream stream_61 = new RewriteRuleTokenStream(adaptor, "token 61");
        RewriteRuleSubtreeStream stream_args = new RewriteRuleSubtreeStream(adaptor, "rule args");
        try {
            // /home/langera/dev/freud/src/grammar/Css.g:124:2: ( IDENT '(' ( args )? ')' -> IDENT '(' ( args )* ')' )
            // /home/langera/dev/freud/src/grammar/Css.g:124:4: IDENT '(' ( args )? ')'
            {
                IDENT69 = (Token) match(input, IDENT, FOLLOW_IDENT_in_function767);
                stream_IDENT.add(IDENT69);

                char_literal70 = (Token) match(input, 61, FOLLOW_61_in_function769);
                stream_61.add(char_literal70);

                // /home/langera/dev/freud/src/grammar/Css.g:124:14: ( args )?
                int alt26 = 2;
                int LA26_0 = input.LA(1);

                if ((LA26_0 == IDENT || (LA26_0 >= 36 && LA26_0 <= 37))) {
                    alt26 = 1;
                }
                switch (alt26) {
                    case 1:
                        // /home/langera/dev/freud/src/grammar/Css.g:124:14: args
                    {
                        pushFollow(FOLLOW_args_in_function771);
                        args71 = args();

                        state._fsp--;

                        stream_args.add(args71.getTree());

                    }
                    break;

                }

                char_literal72 = (Token) match(input, 62, FOLLOW_62_in_function774);
                stream_62.add(char_literal72);


                // AST REWRITE
                // elements: 62, args, 61, IDENT
                // 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 = (CommonTree) adaptor.nil();
                // 124:24: -> IDENT '(' ( args )* ')'
                {
                    adaptor.addChild(root_0, stream_IDENT.nextNode());
View Full Code Here

    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:
          // rule list labels:
          // wildcard labels:
          retval.tree = root_0;
          final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(
              adaptor,
              "rule retval",
              retval != null ? retval.getTree() : null);

          root_0 = (CommonTree) adaptor.nil();
View Full Code Here

        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(
            adaptor,
            "rule retval",
            retval != null ? retval.getTree() : null);

        root_0 = (CommonTree) adaptor.nil();
View Full Code Here

        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;
              }
            }

          }
            break;

        }

        char_literal49 = (Token) match(
            input,
            32,
            FOLLOW_32_in_function703);
        stream_32.add(char_literal49);

        // AST REWRITE
        // elements: IDENT, logicalExpression
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        final RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(
            adaptor,
            "rule retval",
            retval != null ? retval.getTree() : null);

        root_0 = (CommonTree) adaptor.nil();
View Full Code Here

TOP

Related Classes of org.antlr.runtime.tree.RewriteRuleSubtreeStream

Copyright © 2018 www.massapicom. 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.