[antlr-interest] Lables for tokens cause "cannot resolve symbol" errors

charlweed charlweed at yahoo.com
Mon Aug 16 16:03:08 PDT 2004


Hi,
I'm trying to mod a Java grammer, but when ever I try to create  a
lable for a token, I get a "cannot resolve symbol" chen I compile the
JavaRecogniser. AST lables work fine. Is there some odd config that is
messed up somewhere?

In the eample below, note that the identifier assignmentTokens_AST IS
generated, but plain assignmentTokens is not.....


expression
	:  assignmentTokens :assignmentExpression
	   {
           #expression = #(#[EXPR,"EXPR"],#expression);                   
           _engine.wrapWithSetter((IndexedToken)assignmentTokens);
           }
	;


	public final void expression() throws RecognitionException,
TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST expression_AST = null;
		AST assignmentTokens_AST = null;
		
		assignmentExpression();
		assignmentTokens_AST = (AST)returnAST;
		astFactory.addASTChild(currentAST, returnAST);
		if ( inputState.guessing==0 ) {
			expression_AST = (AST)currentAST.root;
			
			expression_AST = (AST)astFactory.make( (new
ASTArray(2)).add(astFactory.create(EXPR,"EXPR")).add(expression_AST));
			_engine.wrapWithSetter((IndexedToken)assignmentTokens);/*"cannot
resolve symbol" Error!*/
			
			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;
	}



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list