当前位置: 首页>>代码示例>>Java>>正文


Java RewriteRuleSubtreeStream.add方法代码示例

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


在下文中一共展示了RewriteRuleSubtreeStream.add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: functionReturnType

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final CFMLParser.functionReturnType_return functionReturnType() throws RecognitionException {
    CFMLParser.functionReturnType_return retval = new CFMLParser.functionReturnType_return();
    retval.start = input.LT(1);
    int functionReturnType_StartIndex = input.index();
    CommonTree root_0 = null;

    CFMLParser.typeSpec_return typeSpec20 = null;


    RewriteRuleSubtreeStream stream_typeSpec=new RewriteRuleSubtreeStream(adaptor,"rule typeSpec");
    try {
        if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return retval; }
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:383:3: ( typeSpec -> ^( FUNCTION_RETURNTYPE typeSpec ) )
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:383:5: typeSpec
        {
        pushFollow(FOLLOW_typeSpec_in_functionReturnType1662);
        typeSpec20=typeSpec();

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


        // AST REWRITE
        // elements: typeSpec
        // 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();
        // 383:14: -> ^( FUNCTION_RETURNTYPE typeSpec )
        {
            // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:383:17: ^( FUNCTION_RETURNTYPE typeSpec )
            {
            CommonTree root_1 = (CommonTree)adaptor.nil();
            root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FUNCTION_RETURNTYPE, "FUNCTION_RETURNTYPE"), root_1);

            adaptor.addChild(root_1, stream_typeSpec.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, 8, functionReturnType_StartIndex); }
    }
    return retval;
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:70,代码来源:CFMLParser.java

示例2: parameterType

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final CFMLParser.parameterType_return parameterType() throws RecognitionException {
    CFMLParser.parameterType_return retval = new CFMLParser.parameterType_return();
    retval.start = input.LT(1);
    int parameterType_StartIndex = input.index();
    CommonTree root_0 = null;

    CFMLParser.typeSpec_return typeSpec36 = null;


    RewriteRuleSubtreeStream stream_typeSpec=new RewriteRuleSubtreeStream(adaptor,"rule typeSpec");
    try {
        if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return retval; }
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:408:3: ( typeSpec -> ^( PARAMETER_TYPE typeSpec ) )
        // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:408:5: typeSpec
        {
        pushFollow(FOLLOW_typeSpec_in_parameterType1828);
        typeSpec36=typeSpec();

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


        // AST REWRITE
        // elements: typeSpec
        // 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();
        // 408:14: -> ^( PARAMETER_TYPE typeSpec )
        {
            // E:\\BlueDragon\\OpenBD_ANTLR\\src\\com\\naryx\\tagfusion\\cfm\\parser\\CFML.g:408:17: ^( PARAMETER_TYPE typeSpec )
            {
            CommonTree root_1 = (CommonTree)adaptor.nil();
            root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PARAMETER_TYPE, "PARAMETER_TYPE"), root_1);

            adaptor.addChild(root_1, stream_typeSpec.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, 12, parameterType_StartIndex); }
    }
    return retval;
}
 
开发者ID:OpenBD,项目名称:openbd-core,代码行数:70,代码来源:CFMLParser.java

示例3: paramStatement

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的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

示例4: indicatorexpr

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final ParameterizedOperationsParser.indicatorexpr_return indicatorexpr() throws RecognitionException {
	ParameterizedOperationsParser.indicatorexpr_return retval = new ParameterizedOperationsParser.indicatorexpr_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	ParserRuleReturnScope expression1 =null;

	RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");

	try {
		// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:117:15: ( expression -> expression )
		// com/finance/pms/events/operations/parameterized/antlr/ParameterizedOperations.g:117:17: expression
		{
		pushFollow(FOLLOW_expression_in_indicatorexpr99);
		expression1=expression();
		state._fsp--;

		stream_expression.add(expression1.getTree());
		// AST REWRITE
		// elements: expression
		// 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();
		// 117:28: -> expression
		{
			adaptor.addChild(root_0, stream_expression.nextTree());
		}


		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,代码行数:57,代码来源:ParameterizedOperationsParser.java

示例5: selectStatement

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final hqlParser.selectStatement_return selectStatement() throws RecognitionException {
	hqlParser.selectStatement_return retval = new hqlParser.selectStatement_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	ParserRuleReturnScope q =null;

	RewriteRuleSubtreeStream stream_queryRule=new RewriteRuleSubtreeStream(adaptor,"rule queryRule");

	try {
		// hql.g:209:2: (q= queryRule -> ^( QUERY[\"query\"] $q) )
		// hql.g:209:4: q= queryRule
		{
		pushFollow(FOLLOW_queryRule_in_selectStatement802);
		q=queryRule();
		state._fsp--;

		stream_queryRule.add(q.getTree());
		// AST REWRITE
		// elements: q
		// token labels:
		// rule labels: retval, q
		// 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);
		RewriteRuleSubtreeStream stream_q=new RewriteRuleSubtreeStream(adaptor,"rule q",q!=null?q.getTree():null);

		root_0 = (CommonTree)adaptor.nil();
		// 210:2: -> ^( QUERY[\"query\"] $q)
		{
			// hql.g:210:5: ^( QUERY[\"query\"] $q)
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(QUERY, "query"), root_1);
			adaptor.addChild(root_1, stream_q.nextTree());
			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:ltearno,项目名称:hexa.tools,代码行数:65,代码来源:hqlParser.java

示例6: alias

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final hqlParser.alias_return alias() throws RecognitionException {
	hqlParser.alias_return retval = new hqlParser.alias_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	ParserRuleReturnScope i =null;

	RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

	try {
		// hql.g:322:2: (i= identifier -> ^( ALIAS[$i.start] ) )
		// hql.g:322:4: i= identifier
		{
		pushFollow(FOLLOW_identifier_in_alias1537);
		i=identifier();
		state._fsp--;

		stream_identifier.add(i.getTree());
		// AST REWRITE
		// elements:
		// 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();
		// 323:2: -> ^( ALIAS[$i.start] )
		{
			// hql.g:323:5: ^( ALIAS[$i.start] )
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(ALIAS, (i!=null?(i.start):null)), root_1);
			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:ltearno,项目名称:hexa.tools,代码行数:63,代码来源:hqlParser.java

示例7: inList

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final hqlParser.inList_return inList() throws RecognitionException {
	hqlParser.inList_return retval = new hqlParser.inList_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	ParserRuleReturnScope compoundExpr180 =null;

	RewriteRuleSubtreeStream stream_compoundExpr=new RewriteRuleSubtreeStream(adaptor,"rule compoundExpr");

	try {
		// hql.g:487:2: ( compoundExpr -> ^( IN_LIST[\"inList\"] compoundExpr ) )
		// hql.g:487:4: compoundExpr
		{
		pushFollow(FOLLOW_compoundExpr_in_inList2244);
		compoundExpr180=compoundExpr();
		state._fsp--;

		stream_compoundExpr.add(compoundExpr180.getTree());
		// AST REWRITE
		// elements: compoundExpr
		// 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();
		// 488:2: -> ^( IN_LIST[\"inList\"] compoundExpr )
		{
			// hql.g:488:5: ^( IN_LIST[\"inList\"] compoundExpr )
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(IN_LIST, "inList"), root_1);
			adaptor.addChild(root_1, stream_compoundExpr.nextTree());
			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:ltearno,项目名称:hexa.tools,代码行数:64,代码来源:hqlParser.java

示例8: innerSubQuery

import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入方法依赖的package包/类
public final hqlParser.innerSubQuery_return innerSubQuery() throws RecognitionException {
	hqlParser.innerSubQuery_return retval = new hqlParser.innerSubQuery_return();
	retval.start = input.LT(1);

	CommonTree root_0 = null;

	ParserRuleReturnScope queryRule300 =null;

	RewriteRuleSubtreeStream stream_queryRule=new RewriteRuleSubtreeStream(adaptor,"rule queryRule");

	try {
		// hql.g:686:2: ( queryRule -> ^( QUERY[\"query\"] queryRule ) )
		// hql.g:686:4: queryRule
		{
		pushFollow(FOLLOW_queryRule_in_innerSubQuery3521);
		queryRule300=queryRule();
		state._fsp--;

		stream_queryRule.add(queryRule300.getTree());
		// AST REWRITE
		// elements: queryRule
		// 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();
		// 687:2: -> ^( QUERY[\"query\"] queryRule )
		{
			// hql.g:687:5: ^( QUERY[\"query\"] queryRule )
			{
			CommonTree root_1 = (CommonTree)adaptor.nil();
			root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(QUERY, "query"), root_1);
			adaptor.addChild(root_1, stream_queryRule.nextTree());
			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:ltearno,项目名称:hexa.tools,代码行数:64,代码来源:hqlParser.java


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