• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RewriteRuleTokenStream类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.antlr.runtime.tree.RewriteRuleTokenStream的典型用法代码示例。如果您正苦于以下问题:Java RewriteRuleTokenStream类的具体用法?Java RewriteRuleTokenStream怎么用?Java RewriteRuleTokenStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RewriteRuleTokenStream类属于org.antlr.runtime.tree包,在下文中一共展示了RewriteRuleTokenStream类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: paramStatement

import org.antlr.runtime.tree.RewriteRuleTokenStream; //导入依赖的package包/类
public final CFMLParser.paramStatement_return paramStatement() throws RecognitionException {
    CFMLParser.paramStatement_return retval = new CFMLParser.paramStatement_return();
    retval.start = input.LT(1);
    int paramStatement_StartIndex = input.index();
    CommonTree root_0 = null;

    Token lc=null;
    CFMLParser.paramStatementAttributes_return paramStatementAttributes174 = null;


    CommonTree lc_tree=null;
    RewriteRuleTokenStream stream_PARAM=new RewriteRuleTokenStream(adaptor,"token PARAM");
    RewriteRuleSubtreeStream stream_paramStatementAttributes=new RewriteRuleSubtreeStream(adaptor,"rule paramStatementAttributes");
    try {
        if ( state.backtracking>0 && alreadyParsedRule(input, 39) ) { return retval; }
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:563:3: (lc= PARAM paramStatementAttributes -> ^( PARAMSTATEMENT[$lc] paramStatementAttributes ) )
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:563:5: lc= PARAM paramStatementAttributes
        {
        lc=(Token)match(input,PARAM,FOLLOW_PARAM_in_paramStatement2992); if (state.failed) return retval; 
        if ( state.backtracking==0 ) stream_PARAM.add(lc);

        pushFollow(FOLLOW_paramStatementAttributes_in_paramStatement2994);
        paramStatementAttributes174=paramStatementAttributes();

        state._fsp--;
        if (state.failed) return retval;
        if ( state.backtracking==0 ) stream_paramStatementAttributes.add(paramStatementAttributes174.getTree());


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

        root_0 = (CommonTree)adaptor.nil();
        // 563:40: -> ^( PARAMSTATEMENT[$lc] paramStatementAttributes )
        {
            // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:563:43: ^( PARAMSTATEMENT[$lc] paramStatementAttributes )
            {
            CommonTree root_1 = (CommonTree)adaptor.nil();
            root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PARAMSTATEMENT, lc), root_1);

            adaptor.addChild(root_1, stream_paramStatementAttributes.nextTree());

            adaptor.addChild(root_0, root_1);
            }

        }

        retval.tree = root_0;}
        }

        retval.stop = input.LT(-1);

        if ( state.backtracking==0 ) {

        retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    }

    catch (RecognitionException e) {
      throw e;
    }
    finally {
        if ( state.backtracking>0 ) { memoize(input, 39, paramStatement_StartIndex); }
    }
    return retval;
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:76,代码来源:CFMLParser.java


示例2: equalityOperator3

import org.antlr.runtime.tree.RewriteRuleTokenStream; //导入依赖的package包/类
public final CFMLParser.equalityOperator3_return equalityOperator3() throws RecognitionException {
    CFMLParser.equalityOperator3_return retval = new CFMLParser.equalityOperator3_return();
    retval.start = input.LT(1);
    int equalityOperator3_StartIndex = input.index();
    CommonTree root_0 = null;

    Token lc=null;
    Token NOT243=null;
    Token CONTAIN244=null;

    CommonTree lc_tree=null;
    CommonTree NOT243_tree=null;
    CommonTree CONTAIN244_tree=null;
    RewriteRuleTokenStream stream_CONTAIN=new RewriteRuleTokenStream(adaptor,"token CONTAIN");
    RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,"token NOT");
    RewriteRuleTokenStream stream_DOES=new RewriteRuleTokenStream(adaptor,"token DOES");

    try {
        if ( state.backtracking>0 && alreadyParsedRule(input, 56) ) { return retval; }
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:657:5: (lc= DOES NOT CONTAIN -> ^( DOESNOTCONTAIN[$lc] ) )
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:657:9: lc= DOES NOT CONTAIN
        {
        lc=(Token)match(input,DOES,FOLLOW_DOES_in_equalityOperator33845); if (state.failed) return retval; 
        if ( state.backtracking==0 ) stream_DOES.add(lc);

        NOT243=(Token)match(input,NOT,FOLLOW_NOT_in_equalityOperator33847); if (state.failed) return retval; 
        if ( state.backtracking==0 ) stream_NOT.add(NOT243);

        CONTAIN244=(Token)match(input,CONTAIN,FOLLOW_CONTAIN_in_equalityOperator33849); if (state.failed) return retval; 
        if ( state.backtracking==0 ) stream_CONTAIN.add(CONTAIN244);



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

        root_0 = (CommonTree)adaptor.nil();
        // 657:29: -> ^( DOESNOTCONTAIN[$lc] )
        {
            // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:657:32: ^( DOESNOTCONTAIN[$lc] )
            {
            CommonTree root_1 = (CommonTree)adaptor.nil();
            root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DOESNOTCONTAIN, lc), root_1);

            adaptor.addChild(root_0, root_1);
            }

        }

        retval.tree = root_0;}
        }

        retval.stop = input.LT(-1);

        if ( state.backtracking==0 ) {

        retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    }

    catch (RecognitionException e) {
      throw e;
    }
    finally {
        if ( state.backtracking>0 ) { memoize(input, 56, equalityOperator3_StartIndex); }
    }
    return retval;
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:78,代码来源:CFMLParser.java


示例3: constant

import org.antlr.runtime.tree.RewriteRuleTokenStream; //导入依赖的package包/类
public final ParameterizedIndicatorsParser.constant_return constant() throws RecognitionException {
	ParameterizedIndicatorsParser.constant_return retval = new ParameterizedIndicatorsParser.constant_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	Token NumberToken68=null;

	CommonTree NumberToken68_tree=null;
	RewriteRuleTokenStream stream_NumberToken=new RewriteRuleTokenStream(adaptor,"token NumberToken");

	try {
		// com/finance/pms/events/calculation/parametrizedindicators/antlr/ParameterizedIndicators.g:193:10: ( NumberToken -> ^( Number NumberToken ) )
		// com/finance/pms/events/calculation/parametrizedindicators/antlr/ParameterizedIndicators.g:193:13: NumberToken
		{
		NumberToken68=(Token)match(input,NumberToken,FOLLOW_NumberToken_in_constant871);  
		stream_NumberToken.add(NumberToken68);

		// AST REWRITE
		// elements: NumberToken
		// 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.getTree():null);

		root_0 = (CommonTree)adaptor.nil();
		// 193:25: -> ^( Number NumberToken )
		{
			// com/finance/pms/events/calculation/parametrizedindicators/antlr/ParameterizedIndicators.g:193:28: ^( Number NumberToken )
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(Number, "Number"), root_1);
			adaptor.addChild(root_1, stream_NumberToken.nextNode());
			adaptor.addChild(root_0, root_1);
			}

		}


		retval.tree = root_0;

		}

		retval.stop = input.LT(-1);

		retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
		adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
		retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
	}
	finally {
		// do for sure before leaving
	}
	return retval;
}
 
开发者ID:premiummarkets,项目名称:pm,代码行数:63,代码来源:ParameterizedIndicatorsParser.java


示例4: stockhistory

import org.antlr.runtime.tree.RewriteRuleTokenStream; //导入依赖的package包/类
public final ParameterizedOperationsParser.stockhistory_return stockhistory() throws RecognitionException {
	ParameterizedOperationsParser.stockhistory_return retval = new ParameterizedOperationsParser.stockhistory_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	Token HistoricalData17=null;

	CommonTree HistoricalData17_tree=null;
	RewriteRuleTokenStream stream_HistoricalData=new RewriteRuleTokenStream(adaptor,"token HistoricalData");

	try {
		// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:128:14: ( HistoricalData -> ^( StockOperation ^( OperationOutput HistoricalData ) ) )
		// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:128:16: HistoricalData
		{
		HistoricalData17=(Token)match(input,HistoricalData,FOLLOW_HistoricalData_in_stockhistory294);  
		stream_HistoricalData.add(HistoricalData17);

		// AST REWRITE
		// elements: HistoricalData
		// 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.getTree():null);

		root_0 = (CommonTree)adaptor.nil();
		// 128:31: -> ^( StockOperation ^( OperationOutput HistoricalData ) )
		{
			// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:128:34: ^( StockOperation ^( OperationOutput HistoricalData ) )
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(StockOperation, "StockOperation"), root_1);
			// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:128:51: ^( OperationOutput HistoricalData )
			{
			CommonTree root_2 = (CommonTree)adaptor.nil();
			root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(OperationOutput, "OperationOutput"), root_2);
			adaptor.addChild(root_2, stream_HistoricalData.nextNode());
			adaptor.addChild(root_1, root_2);
			}

			adaptor.addChild(root_0, root_1);
			}

		}


		retval.tree = root_0;

		}

		retval.stop = input.LT(-1);

		retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
		adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
		retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
	}
	finally {
		// do for sure before leaving
	}
	return retval;
}
 
开发者ID:premiummarkets,项目名称:pm,代码行数:70,代码来源:ParameterizedOperationsParser.java



注:本文中的org.antlr.runtime.tree.RewriteRuleTokenStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VideoSurfaceView类代码示例发布时间:2022-05-22
下一篇:
Java BoundTransportAddress类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap