本文整理汇总了Java中org.antlr.runtime.tree.RewriteRuleSubtreeStream类的典型用法代码示例。如果您正苦于以下问题:Java RewriteRuleSubtreeStream类的具体用法?Java RewriteRuleSubtreeStream怎么用?Java RewriteRuleSubtreeStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RewriteRuleSubtreeStream类属于org.antlr.runtime.tree包,在下文中一共展示了RewriteRuleSubtreeStream类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例4: equalityOperator3
import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入依赖的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;
}
示例5: constant
import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入依赖的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;
}
示例6: 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;
}
示例7: stockhistory
import org.antlr.runtime.tree.RewriteRuleSubtreeStream; //导入依赖的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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}