Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.RewriteRuleSubtreeStream


        key_chunk_return cb = null;

        variable_definition_return variable_definition18 = null;


        RewriteRuleSubtreeStream stream_key_chunk=new RewriteRuleSubtreeStream(adaptor,"rule key_chunk");

                String text = "";

        try {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:143:4: ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] )
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( (LA8_0==LEFT_CURLY) ) {
                alt8=1;
            }
            else if ( ((LA8_0>=LEFT_SQUARE && LA8_0<=LITERAL)||LA8_0==COLON) ) {
                alt8=2;
            }
            else {
                if (backtracking>0) {failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("139:1: key_sentence : ( variable_definition | cb= key_chunk -> VT_LITERAL[$cb.start, text] );", 8, 0, input);

                throw nvae;
            }
            switch (alt8) {
                case 1 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:143:4: variable_definition
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_variable_definition_in_key_sentence551);
                    variable_definition18=variable_definition();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) adaptor.addChild(root_0, variable_definition18.getTree());

                    }
                    break;
                case 2 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:144:4: cb= key_chunk
                    {
                    pushFollow(FOLLOW_key_chunk_in_key_sentence558);
                    cb=key_chunk();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) stream_key_chunk.add(cb.getTree());
                    if ( backtracking==0 ) {
                       text = input.toString(cb.start,cb.stop);
                    }

                    // AST REWRITE
                    // elements:
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    if ( backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 145:2: -> VT_LITERAL[$cb.start, text]
                    {
                        adaptor.addChild(root_0, adaptor.create(VT_LITERAL, ((Token)cb.start),  text));
View Full Code Here


        Object root_0 = null;

        value_sentence_return value_sentence20 = null;


        RewriteRuleSubtreeStream stream_value_sentence=new RewriteRuleSubtreeStream(adaptor,"rule value_sentence");
        try {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:153:4: ( ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:153:4: ( value_sentence )+
            {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:153:4: ( value_sentence )+
            int cnt10=0;
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( ((LA10_0>=EQUALS && LA10_0<=LEFT_CURLY)) ) {
                    alt10=1;
                }


                switch (alt10) {
              case 1 :
                  // src/main/resources/org/drools/lang/dsl/DSLMap.g:0:0: value_sentence
                  {
                  pushFollow(FOLLOW_value_sentence_in_value_section594);
                  value_sentence20=value_sentence();
                  _fsp--;
                  if (failed) return retval;
                  if ( backtracking==0 ) stream_value_sentence.add(value_sentence20.getTree());

                  }
                  break;

              default :
                  if ( cnt10 >= 1 ) break loop10;
                  if (backtracking>0) {failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(10, input);
                        throw eee;
                }
                cnt10++;
            } while (true);


            // AST REWRITE
            // elements: value_sentence
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 154:2: -> ^( VT_ENTRY_VAL ( value_sentence )+ )
            {
                // src/main/resources/org/drools/lang/dsl/DSLMap.g:154:5: ^( VT_ENTRY_VAL ( value_sentence )+ )
View Full Code Here

        value_chunk_return vc = null;

        variable_reference_return variable_reference21 = null;


        RewriteRuleSubtreeStream stream_value_chunk=new RewriteRuleSubtreeStream(adaptor,"rule value_chunk");

                String text = "";

        try {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:161:4: ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] )
            int alt11=2;
            int LA11_0 = input.LA(1);

            if ( (LA11_0==LEFT_CURLY) ) {
                alt11=1;
            }
            else if ( ((LA11_0>=EQUALS && LA11_0<=COLON)) ) {
                alt11=2;
            }
            else {
                if (backtracking>0) {failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("157:1: value_sentence : ( variable_reference | vc= value_chunk -> VT_LITERAL[$vc.start, text] );", 11, 0, input);

                throw nvae;
            }
            switch (alt11) {
                case 1 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:161:4: variable_reference
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_variable_reference_in_value_sentence625);
                    variable_reference21=variable_reference();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) adaptor.addChild(root_0, variable_reference21.getTree());

                    }
                    break;
                case 2 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:162:4: vc= value_chunk
                    {
                    pushFollow(FOLLOW_value_chunk_in_value_sentence632);
                    vc=value_chunk();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) stream_value_chunk.add(vc.getTree());
                    if ( backtracking==0 ) {
                       text = input.toString(vc.start,vc.stop);
                    }

                    // AST REWRITE
                    // elements:
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    if ( backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 163:2: -> VT_LITERAL[$vc.start, text]
                    {
                        adaptor.addChild(root_0, adaptor.create(VT_LITERAL, ((Token)vc.start),  text));
View Full Code Here

        Object COLON27_tree=null;
        RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
        RewriteRuleTokenStream stream_RIGHT_CURLY=new RewriteRuleTokenStream(adaptor,"token RIGHT_CURLY");
        RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
        RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY");
        RewriteRuleSubtreeStream stream_pattern=new RewriteRuleSubtreeStream(adaptor,"rule pattern");

                String text = "";
                boolean hasSpaceBefore = false;
                boolean hasSpaceAfter = false;

        try {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:181:4: (lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:181:4: lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY
            {
            lc=(Token)input.LT(1);
            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition710); if (failed) return retval;
            if ( backtracking==0 ) stream_LEFT_CURLY.add(lc);

            if ( backtracking==0 ) {
              
                  CommonToken back2 =  (CommonToken)input.LT(-2);
                  if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true;
                 
            }
            name=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition721); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(name);

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:186:15: ( ( COLON q= LITERAL )? COLON pat= pattern )?
            int alt14=2;
            int LA14_0 = input.LA(1);

            if ( (LA14_0==COLON) ) {
                alt14=1;
            }
            switch (alt14) {
                case 1 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:186:17: ( COLON q= LITERAL )? COLON pat= pattern
                    {
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:186:17: ( COLON q= LITERAL )?
                    int alt13=2;
                    int LA13_0 = input.LA(1);

                    if ( (LA13_0==COLON) ) {
                        int LA13_1 = input.LA(2);

                        if ( (LA13_1==LITERAL) ) {
                            int LA13_2 = input.LA(3);

                            if ( (LA13_2==COLON) ) {
                                int LA13_4 = input.LA(4);

                                if ( (synpred21()) ) {
                                    alt13=1;
                                }
                            }
                        }
                    }
                    switch (alt13) {
                        case 1 :
                            // src/main/resources/org/drools/lang/dsl/DSLMap.g:186:18: COLON q= LITERAL
                            {
                            COLON26=(Token)input.LT(1);
                            match(input,COLON,FOLLOW_COLON_in_variable_definition726); if (failed) return retval;
                            if ( backtracking==0 ) stream_COLON.add(COLON26);

                            q=(Token)input.LT(1);
                            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition730); if (failed) return retval;
                            if ( backtracking==0 ) stream_LITERAL.add(q);


                            }
                            break;

                    }

                    COLON27=(Token)input.LT(1);
                    match(input,COLON,FOLLOW_COLON_in_variable_definition734); if (failed) return retval;
                    if ( backtracking==0 ) stream_COLON.add(COLON27);

                    pushFollow(FOLLOW_pattern_in_variable_definition738);
                    pat=pattern();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) stream_pattern.add(pat.getTree());
                    if ( backtracking==0 ) {
                      text = input.toString(pat.start,pat.stop);
                    }

                    }
                    break;

            }

            rc=(Token)input.LT(1);
            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition747); if (failed) return retval;
            if ( backtracking==0 ) stream_RIGHT_CURLY.add(rc);

            if ( backtracking==0 ) {

                CommonToken rc1 = (CommonToken)input.LT(1);
                if(!"=".equals(rc1.getText()) && ((CommonToken)rc).getStopIndex() < rc1.getStartIndex() - 1) hasSpaceAfter = true;
               
            }

            // AST REWRITE
            // elements: name, q, q, q, q, q, name, q, name, name, name, q, name, name, name, q, q, name
            // token labels: q, name
            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleTokenStream stream_q=new RewriteRuleTokenStream(adaptor,"token q",q);
            RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name);
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 191:2: -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
            if (hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) {
                adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
View Full Code Here

        Object RIGHT_CURLY30_tree=null;
        RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
        RewriteRuleTokenStream stream_RIGHT_CURLY=new RewriteRuleTokenStream(adaptor,"token RIGHT_CURLY");
        RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
        RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY");
        RewriteRuleSubtreeStream stream_pattern=new RewriteRuleSubtreeStream(adaptor,"rule pattern");

                String text = "";

        try {
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:207:4: ( LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] ) -> ^( VT_VAR_DEF $name) )
            // src/main/resources/org/drools/lang/dsl/DSLMap.g:207:4: LEFT_CURLY name= LITERAL ( COLON pat= pattern )? RIGHT_CURLY
            {
            LEFT_CURLY28=(Token)input.LT(1);
            match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition2990); if (failed) return retval;
            if ( backtracking==0 ) stream_LEFT_CURLY.add(LEFT_CURLY28);

            name=(Token)input.LT(1);
            match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition2994); if (failed) return retval;
            if ( backtracking==0 ) stream_LITERAL.add(name);

            // src/main/resources/org/drools/lang/dsl/DSLMap.g:207:28: ( COLON pat= pattern )?
            int alt15=2;
            int LA15_0 = input.LA(1);

            if ( (LA15_0==COLON) ) {
                alt15=1;
            }
            switch (alt15) {
                case 1 :
                    // src/main/resources/org/drools/lang/dsl/DSLMap.g:207:30: COLON pat= pattern
                    {
                    COLON29=(Token)input.LT(1);
                    match(input,COLON,FOLLOW_COLON_in_variable_definition2998); if (failed) return retval;
                    if ( backtracking==0 ) stream_COLON.add(COLON29);

                    pushFollow(FOLLOW_pattern_in_variable_definition21002);
                    pat=pattern();
                    _fsp--;
                    if (failed) return retval;
                    if ( backtracking==0 ) stream_pattern.add(pat.getTree());
                    if ( backtracking==0 ) {
                      text = input.toString(pat.start,pat.stop);
                    }

                    }
                    break;

            }

            RIGHT_CURLY30=(Token)input.LT(1);
            match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition21009); if (failed) return retval;
            if ( backtracking==0 ) stream_RIGHT_CURLY.add(RIGHT_CURLY30);


            // AST REWRITE
            // elements: name, name
            // token labels: name
            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name);
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 208:2: -> {!\"\".equals(text)}? ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
            if (!"".equals(text)) {
                // src/main/resources/org/drools/lang/dsl/DSLMap.g:208:25: ^( VT_VAR_DEF $name VT_PATTERN[$pat.start, text] )
View Full Code Here

            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name);
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 233:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_REF $name) VT_SPACE
            if (hasSpaceBefore && hasSpaceAfter) {
                adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
View Full Code Here

            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name);
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 242:2: -> ^( VT_VAR_REF $name)
            {
                // src/main/resources/org/drools/lang/dsl/DSLMap.g:242:5: ^( VT_VAR_REF $name)
View Full Code Here

            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 248:2: -> VT_CONDITION[$value]
            {
                adaptor.addChild(root_0, adaptor.create(VT_CONDITION, value));
View Full Code Here

            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 253:2: -> VT_CONSEQUENCE[$value]
            {
                adaptor.addChild(root_0, adaptor.create(VT_CONSEQUENCE, value));
View Full Code Here

            // rule labels: retval
            // token list labels:
            // rule list labels:
            if ( backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 258:2: -> VT_KEYWORD[$value]
            {
                adaptor.addChild(root_0, adaptor.create(VT_KEYWORD, value));
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.