Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.RewriteRuleTokenStream


        CommonTree char_literal46_tree = null;
        CommonTree IDENT47_tree = null;
        CommonTree IDENT49_tree = null;
        CommonTree char_literal50_tree = null;
        RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
        RewriteRuleTokenStream stream_41 = new RewriteRuleTokenStream(adaptor, "token 41");
        RewriteRuleTokenStream stream_40 = new RewriteRuleTokenStream(adaptor, "token 40");
        RewriteRuleSubtreeStream stream_attribRelate = new RewriteRuleSubtreeStream(adaptor, "rule attribRelate");
        try {
            // /home/langera/dev/freud/src/grammar/Css.g:94:2: ( '[' IDENT ( attribRelate IDENT )? ']' -> ^( ATTRIB IDENT ( attribRelate ( IDENT )* )? ) )
            // /home/langera/dev/freud/src/grammar/Css.g:94:4: '[' IDENT ( attribRelate IDENT )? ']'
            {
                char_literal46 = (Token) match(input, 40, FOLLOW_40_in_attrib540);
                stream_40.add(char_literal46);

                IDENT47 = (Token) match(input, IDENT, FOLLOW_IDENT_in_attrib542);
                stream_IDENT.add(IDENT47);

                // /home/langera/dev/freud/src/grammar/Css.g:94:14: ( attribRelate IDENT )?
View Full Code Here


        Token string_literal53 = null;

        CommonTree char_literal51_tree = null;
        CommonTree string_literal52_tree = null;
        CommonTree string_literal53_tree = null;
        RewriteRuleTokenStream stream_43 = new RewriteRuleTokenStream(adaptor, "token 43");
        RewriteRuleTokenStream stream_44 = new RewriteRuleTokenStream(adaptor, "token 44");
        RewriteRuleTokenStream stream_42 = new RewriteRuleTokenStream(adaptor, "token 42");

        try {
            // /home/langera/dev/freud/src/grammar/Css.g:98:2: ( '=' -> ATTRIBEQUAL | '~=' -> HASVALUE | '|=' -> BEGINSWITH )
            int alt22 = 3;
            switch (input.LA(1)) {
                case 42: {
                    alt22 = 1;
                }
                break;
                case 43: {
                    alt22 = 2;
                }
                break;
                case 44: {
                    alt22 = 3;
                }
                break;
                default:
                    NoViableAltException nvae =
                            new NoViableAltException("", 22, 0, input);

                    throw nvae;
            }

            switch (alt22) {
                case 1:
                    // /home/langera/dev/freud/src/grammar/Css.g:98:4: '='
                {
                    char_literal51 = (Token) match(input, 42, FOLLOW_42_in_attribRelate581);
                    stream_42.add(char_literal51);


                    // AST REWRITE
                    // elements:
                    // token labels:
View Full Code Here

        CssParser.args_return args56 = null;


        CommonTree IDENT54_tree = null;
        CommonTree char_literal55_tree = null;
        RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
        RewriteRuleTokenStream stream_38 = new RewriteRuleTokenStream(adaptor, "token 38");
        RewriteRuleSubtreeStream stream_args = new RewriteRuleSubtreeStream(adaptor, "rule args");
        try {
            // /home/langera/dev/freud/src/grammar/Css.g:104:2: ( IDENT ':' args -> ^( PROPERTY IDENT args ) )
            // /home/langera/dev/freud/src/grammar/Css.g:104:4: IDENT ':' args
            {
                IDENT54 = (Token) match(input, IDENT, FOLLOW_IDENT_in_declaration618);
                stream_IDENT.add(IDENT54);

                char_literal55 = (Token) match(input, 38, FOLLOW_38_in_declaration620);
                stream_38.add(char_literal55);

                pushFollow(FOLLOW_args_in_declaration622);
                args56 = args();

                state._fsp--;
View Full Code Here

        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;

View Full Code Here

        CommonTree IDENT62_tree = null;
        CommonTree char_literal63_tree = null;
        CommonTree IDENT64_tree = null;
        CommonTree char_literal65_tree = null;
        CommonTree IDENT66_tree = null;
        RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
        RewriteRuleTokenStream stream_36 = new RewriteRuleTokenStream(adaptor, "token 36");

        try {
            // /home/langera/dev/freud/src/grammar/Css.g:112:2: ( ( IDENT unit ) | IDENT | '#' IDENT -> ^( COLOUR '#' IDENT ) | '.' IDENT | function )
            int alt25 = 5;
            alt25 = dfa25.predict(input);
            switch (alt25) {
                case 1:
                    // /home/langera/dev/freud/src/grammar/Css.g:112:4: ( IDENT unit )
                {
                    root_0 = (CommonTree) adaptor.nil();

                    // /home/langera/dev/freud/src/grammar/Css.g:112:4: ( IDENT unit )
                    // /home/langera/dev/freud/src/grammar/Css.g:112:5: IDENT unit
                    {
                        IDENT60 = (Token) match(input, IDENT, FOLLOW_IDENT_in_expr670);
                        IDENT60_tree = (CommonTree) adaptor.create(IDENT60);
                        adaptor.addChild(root_0, IDENT60_tree);

                        pushFollow(FOLLOW_unit_in_expr672);
                        unit61 = unit();

                        state._fsp--;

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

                    }


                }
                break;
                case 2:
                    // /home/langera/dev/freud/src/grammar/Css.g:113:4: IDENT
                {
                    root_0 = (CommonTree) adaptor.nil();

                    IDENT62 = (Token) match(input, IDENT, FOLLOW_IDENT_in_expr678);
                    IDENT62_tree = (CommonTree) adaptor.create(IDENT62);
                    adaptor.addChild(root_0, IDENT62_tree);


                }
                break;
                case 3:
                    // /home/langera/dev/freud/src/grammar/Css.g:114:4: '#' IDENT
                {
                    char_literal63 = (Token) match(input, 36, FOLLOW_36_in_expr683);
                    stream_36.add(char_literal63);

                    IDENT64 = (Token) match(input, IDENT, FOLLOW_IDENT_in_expr685);
                    stream_IDENT.add(IDENT64);


                    // AST REWRITE
                    // elements: 36, 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();
                    // 114:14: -> ^( COLOUR '#' IDENT )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:114:17: ^( COLOUR '#' IDENT )
                        {
                            CommonTree root_1 = (CommonTree) adaptor.nil();
                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(COLOUR, "COLOUR"), root_1);

                            adaptor.addChild(root_1, stream_36.nextNode());
                            adaptor.addChild(root_1, stream_IDENT.nextNode());

                            adaptor.addChild(root_0, root_1);
                        }
View Full Code Here


        CommonTree IDENT69_tree = null;
        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());
                    adaptor.addChild(root_0, stream_61.nextNode());
                    // /home/langera/dev/freud/src/grammar/Css.g:124:37: ( args )*
                    while (stream_args.hasNext()) {
                        adaptor.addChild(root_0, stream_args.nextTree());

                    }
View Full Code Here

    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--;
View Full Code Here

    final CommonTree char_literal40_tree = null;
    final CommonTree IDENT41_tree = null;
    final CommonTree INTEGER42_tree = null;
    final CommonTree char_literal43_tree = null;
    final RewriteRuleTokenStream stream_INTEGER = new RewriteRuleTokenStream(
        adaptor,
        "token INTEGER");
    final RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(
        adaptor,
        "token IDENT");
    final RewriteRuleTokenStream stream_35 = new RewriteRuleTokenStream(
        adaptor,
        "token 35");
    final RewriteRuleTokenStream stream_34 = new RewriteRuleTokenStream(
        adaptor,
        "token 34");

    try {
      // ECalc.g:124:2: ( '[' ( IDENT | INTEGER ) ']' -> ^( PARAM ( IDENT
      // )? ( INTEGER )? ) )
      // ECalc.g:124:4: '[' ( IDENT | INTEGER ) ']'
      {
        char_literal40 = (Token) match(
            input,
            34,
            FOLLOW_34_in_parameter506);
        stream_34.add(char_literal40);

        // ECalc.g:124:8: ( IDENT | INTEGER )
        int alt11 = 2;
        final int LA11_0 = input.LA(1);
        if ((LA11_0 == IDENT)) {
View Full Code Here

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

View Full Code Here

TOP

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

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.