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


Java ASTArray类代码示例

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


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

示例1: typeArgumentsDiamond

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void typeArgumentsDiamond() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST typeArgumentsDiamond_AST = null;
	Token first = LT(1);
	
	match(LT);
	match(GT);
	if ( inputState.guessing==0 ) {
		typeArgumentsDiamond_AST = (AST)currentAST.root;
		typeArgumentsDiamond_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENTS,"TYPE_ARGUMENTS",first,LT(1))).add(typeArgumentsDiamond_AST));
		currentAST.root = typeArgumentsDiamond_AST;
		currentAST.child = typeArgumentsDiamond_AST!=null &&typeArgumentsDiamond_AST.getFirstChild()!=null ?
			typeArgumentsDiamond_AST.getFirstChild() : typeArgumentsDiamond_AST;
		currentAST.advanceChildToEnd();
	}
	typeArgumentsDiamond_AST = (AST)currentAST.root;
	returnAST = typeArgumentsDiamond_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:21,代码来源:JavaRecognizer.java

示例2: annotationMemberValuePair

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void annotationMemberValuePair() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST annotationMemberValuePair_AST = null;
	Token  i = null;
	AST i_AST = null;
	AST v_AST = null;
	Token first = LT(1);
	
	i = LT(1);
	i_AST = astFactory.create(i);
	match(IDENT);
	match(ASSIGN);
	annotationMemberValueInitializer();
	v_AST = (AST)returnAST;
	if ( inputState.guessing==0 ) {
		annotationMemberValuePair_AST = (AST)currentAST.root;
		annotationMemberValuePair_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION_MEMBER_VALUE_PAIR,"ANNOTATION_MEMBER_VALUE_PAIR",first,LT(1))).add(i_AST).add(v_AST));
		currentAST.root = annotationMemberValuePair_AST;
		currentAST.child = annotationMemberValuePair_AST!=null &&annotationMemberValuePair_AST.getFirstChild()!=null ?
			annotationMemberValuePair_AST.getFirstChild() : annotationMemberValuePair_AST;
		currentAST.advanceChildToEnd();
	}
	returnAST = annotationMemberValuePair_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:27,代码来源:JavaRecognizer.java

示例3: expression

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void expression() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST expression_AST = null;
	Token first = LT(1);
	
	assignmentExpression();
	astFactory.addASTChild(currentAST, returnAST);
	if ( inputState.guessing==0 ) {
		expression_AST = (AST)currentAST.root;
		expression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(expression_AST));
		currentAST.root = expression_AST;
		currentAST.child = expression_AST!=null &&expression_AST.getFirstChild()!=null ?
			expression_AST.getFirstChild() : expression_AST;
		currentAST.advanceChildToEnd();
	}
	expression_AST = (AST)currentAST.root;
	returnAST = expression_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:21,代码来源:JavaRecognizer.java

示例4: forEachClause

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void forEachClause() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST forEachClause_AST = null;
	AST p_AST = null;
	Token first = LT(1);
	
	parameterDeclaration();
	p_AST = (AST)returnAST;
	astFactory.addASTChild(currentAST, returnAST);
	match(COLON);
	expression();
	astFactory.addASTChild(currentAST, returnAST);
	if ( inputState.guessing==0 ) {
		forEachClause_AST = (AST)currentAST.root;
		forEachClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(FOR_EACH_CLAUSE,"FOR_EACH_CLAUSE",first,LT(1))).add(forEachClause_AST));
		currentAST.root = forEachClause_AST;
		currentAST.child = forEachClause_AST!=null &&forEachClause_AST.getFirstChild()!=null ?
			forEachClause_AST.getFirstChild() : forEachClause_AST;
		currentAST.advanceChildToEnd();
	}
	forEachClause_AST = (AST)currentAST.root;
	returnAST = forEachClause_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:26,代码来源:JavaRecognizer.java

示例5: packageDefinition

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void packageDefinition() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST packageDefinition_AST = null;
	AST an_AST = null;
	AST id_AST = null;
	Token first = LT(1);
	
	annotationsOpt();
	an_AST = (AST)returnAST;
	match(LITERAL_package);
	identifier();
	id_AST = (AST)returnAST;
	if ( inputState.guessing==0 ) {
		packageDefinition_AST = (AST)currentAST.root;
		packageDefinition_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(PACKAGE_DEF,"package",first,LT(1))).add(an_AST).add(id_AST));
		currentAST.root = packageDefinition_AST;
		currentAST.child = packageDefinition_AST!=null &&packageDefinition_AST.getFirstChild()!=null ?
			packageDefinition_AST.getFirstChild() : packageDefinition_AST;
		currentAST.advanceChildToEnd();
	}
	packageDefinition_AST = (AST)currentAST.root;
	returnAST = packageDefinition_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:26,代码来源:GroovyRecognizer.java

示例6: modifiers

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
/** A list of one or more modifier, annotation, or "def". */
public final void modifiers() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST modifiers_AST = null;
	Token first = LT(1);
	
	modifiersInternal();
	astFactory.addASTChild(currentAST, returnAST);
	if ( inputState.guessing==0 ) {
		modifiers_AST = (AST)currentAST.root;
		modifiers_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(modifiers_AST));
		currentAST.root = modifiers_AST;
		currentAST.child = modifiers_AST!=null &&modifiers_AST.getFirstChild()!=null ?
			modifiers_AST.getFirstChild() : modifiers_AST;
		currentAST.advanceChildToEnd();
	}
	modifiers_AST = (AST)currentAST.root;
	returnAST = modifiers_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:22,代码来源:GroovyRecognizer.java

示例7: singleVariable

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
/** Used in cases where a declaration cannot have commas, or ends with the "in" operator instead of '='. */
public final void singleVariable(
	AST mods, AST t
) throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST singleVariable_AST = null;
	AST id_AST = null;
	Token first = LT(1);
	
	variableName();
	id_AST = (AST)returnAST;
	if ( inputState.guessing==0 ) {
		singleVariable_AST = (AST)currentAST.root;
		singleVariable_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(VARIABLE_DEF,"VARIABLE_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST));
		currentAST.root = singleVariable_AST;
		currentAST.child = singleVariable_AST!=null &&singleVariable_AST.getFirstChild()!=null ?
			singleVariable_AST.getFirstChild() : singleVariable_AST;
		currentAST.advanceChildToEnd();
	}
	returnAST = singleVariable_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:24,代码来源:GroovyRecognizer.java

示例8: typeArgumentsDiamond

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void typeArgumentsDiamond() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST typeArgumentsDiamond_AST = null;
	Token first = LT(1);
	
	match(LT);
	match(GT);
	nls();
	if ( inputState.guessing==0 ) {
		typeArgumentsDiamond_AST = (AST)currentAST.root;
		typeArgumentsDiamond_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENTS,"TYPE_ARGUMENTS",first,LT(1))).add(typeArgumentsDiamond_AST));
		currentAST.root = typeArgumentsDiamond_AST;
		currentAST.child = typeArgumentsDiamond_AST!=null &&typeArgumentsDiamond_AST.getFirstChild()!=null ?
			typeArgumentsDiamond_AST.getFirstChild() : typeArgumentsDiamond_AST;
		currentAST.advanceChildToEnd();
	}
	typeArgumentsDiamond_AST = (AST)currentAST.root;
	returnAST = typeArgumentsDiamond_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:22,代码来源:GroovyRecognizer.java

示例9: methodInvocation

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void methodInvocation(
	boolean implicitReceiver
) throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST methodInvocation_AST = null;
	AST methodName_AST = null;
	AST args_AST = null;
	
	identifier();
	methodName_AST = (AST)returnAST;
	argList();
	args_AST = (AST)returnAST;
	if ( inputState.guessing==0 ) {
		methodInvocation_AST = (AST)currentAST.root;
		methodInvocation_AST =
		(AST)astFactory.make( (new ASTArray(3)).add((AST)astFactory.create(METHOD_INV,"methodInv","com.gemstone.gemfire.cache.query.internal.parse.ASTMethodInvocation")).add(methodName_AST).add(args_AST)); 
		((ASTMethodInvocation)methodInvocation_AST).setImplicitReceiver(implicitReceiver);
		currentAST.root = methodInvocation_AST;
		currentAST.child = methodInvocation_AST!=null &&methodInvocation_AST.getFirstChild()!=null ?
			methodInvocation_AST.getFirstChild() : methodInvocation_AST;
		currentAST.advanceChildToEnd();
	}
	returnAST = methodInvocation_AST;
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:27,代码来源:OQLParser.java

示例10: openBlock

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
/** An open block is not allowed to have closure arguments. */
public final void openBlock() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST openBlock_AST = null;
	AST bb_AST = null;
	Token first = LT(1);
	
	match(LCURLY);
	nls();
	blockBody(EOF);
	bb_AST = (AST)returnAST;
	match(RCURLY);
	if ( inputState.guessing==0 ) {
		openBlock_AST = (AST)currentAST.root;
		openBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(SLIST,"{",first,LT(1))).add(bb_AST));
		currentAST.root = openBlock_AST;
		currentAST.child = openBlock_AST!=null &&openBlock_AST.getFirstChild()!=null ?
			openBlock_AST.getFirstChild() : openBlock_AST;
		currentAST.advanceChildToEnd();
	}
	openBlock_AST = (AST)currentAST.root;
	returnAST = openBlock_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:26,代码来源:GroovyRecognizer.java

示例11: implicitParameters

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
/** A block known to be a closure, but which omits its arguments, is given this placeholder.
*  A subsequent pass is responsible for deciding if there is an implicit 'it' parameter,
*  or if the parameter list should be empty.
*/
public final void implicitParameters() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST implicitParameters_AST = null;
	Token first = LT(1);
	
	if ( inputState.guessing==0 ) {
		implicitParameters_AST = (AST)currentAST.root;
		implicitParameters_AST = (AST)astFactory.make( (new ASTArray(1)).add(create(IMPLICIT_PARAMETERS,"IMPLICIT_PARAMETERS",first,LT(1))));
		currentAST.root = implicitParameters_AST;
		currentAST.child = implicitParameters_AST!=null &&implicitParameters_AST.getFirstChild()!=null ?
			implicitParameters_AST.getFirstChild() : implicitParameters_AST;
		currentAST.advanceChildToEnd();
	}
	implicitParameters_AST = (AST)currentAST.root;
	returnAST = implicitParameters_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:23,代码来源:GroovyRecognizer.java

示例12: closableBlockParam

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
/** Simple names, as in {x|...}, are completely equivalent to {(def x)|...}.  Build the right AST. */
public final void closableBlockParam() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST closableBlockParam_AST = null;
	Token  id = null;
	AST id_AST = null;
	Token first = LT(1);
	
	id = LT(1);
	id_AST = astFactory.create(id);
	match(IDENT);
	if ( inputState.guessing==0 ) {
		closableBlockParam_AST = (AST)currentAST.root;
		closableBlockParam_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(PARAMETER_DEF,"PARAMETER_DEF",first,LT(1))).add((AST)astFactory.make( (new ASTArray(1)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))))).add((AST)astFactory.make( (new ASTArray(1)).add(create(TYPE,"TYPE",first,LT(1))))).add(id_AST));
		currentAST.root = closableBlockParam_AST;
		currentAST.child = closableBlockParam_AST!=null &&closableBlockParam_AST.getFirstChild()!=null ?
			closableBlockParam_AST.getFirstChild() : closableBlockParam_AST;
		currentAST.advanceChildToEnd();
	}
	returnAST = closableBlockParam_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:24,代码来源:GroovyRecognizer.java

示例13: assignmentLessExpression

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void assignmentLessExpression() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST assignmentLessExpression_AST = null;
	Token first = LT(1);
	
	{
	conditionalExpression(0);
	astFactory.addASTChild(currentAST, returnAST);
	}
	if ( inputState.guessing==0 ) {
		assignmentLessExpression_AST = (AST)currentAST.root;
		assignmentLessExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(assignmentLessExpression_AST));
		currentAST.root = assignmentLessExpression_AST;
		currentAST.child = assignmentLessExpression_AST!=null &&assignmentLessExpression_AST.getFirstChild()!=null ?
			assignmentLessExpression_AST.getFirstChild() : assignmentLessExpression_AST;
		currentAST.advanceChildToEnd();
	}
	assignmentLessExpression_AST = (AST)currentAST.root;
	returnAST = assignmentLessExpression_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:23,代码来源:GroovyRecognizer.java

示例14: filterExprMain

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void filterExprMain() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST filterExprMain_AST = null;
	
	match(LPAREN);
	filterExpr();
	astFactory.addASTChild(currentAST, returnAST);
	match(RPAREN);
	if ( inputState.guessing==0 ) {
		filterExprMain_AST = (AST)currentAST.root;
		filterExprMain_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(FILTER,"Filter expression main:")).add(filterExprMain_AST));
		currentAST.root = filterExprMain_AST;
		currentAST.child = filterExprMain_AST!=null &&filterExprMain_AST.getFirstChild()!=null ?
			filterExprMain_AST.getFirstChild() : filterExprMain_AST;
		currentAST.advanceChildToEnd();
	}
	filterExprMain_AST = (AST)currentAST.root;
	returnAST = filterExprMain_AST;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JsonQueryParser.java

示例15: finallyClause

import antlr.collections.impl.ASTArray; //导入依赖的package包/类
public final void finallyClause() throws RecognitionException, TokenStreamException {
	
	returnAST = null;
	ASTPair currentAST = new ASTPair();
	AST finallyClause_AST = null;
	AST finallyCs_AST = null;
	Token first = LT(1);
	
	match(LITERAL_finally);
	nlsWarn();
	compoundStatement();
	finallyCs_AST = (AST)returnAST;
	if ( inputState.guessing==0 ) {
		finallyClause_AST = (AST)currentAST.root;
		finallyClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(LITERAL_finally,"finally",first,LT(1))).add(finallyCs_AST));
		currentAST.root = finallyClause_AST;
		currentAST.child = finallyClause_AST!=null &&finallyClause_AST.getFirstChild()!=null ?
			finallyClause_AST.getFirstChild() : finallyClause_AST;
		currentAST.advanceChildToEnd();
	}
	finallyClause_AST = (AST)currentAST.root;
	returnAST = finallyClause_AST;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:24,代码来源:GroovyRecognizer.java


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