[antlr-interest] Composing tree grammars

Terence Parr parrt at cs.usfca.edu
Fri Feb 6 13:08:05 PST 2009


oh. right.

ok, it's a token type problem. it *must* import the vocab.

crap. adding to bug list.  no easy fix unless you comment out some  
code.  remove this test:

	/** Load a vocab file <vocabName>.tokens and return max token type  
found. */
	public int importTokenVocabulary(GrammarAST tokenVocabOptionAST,
									 String vocabName)
	{
		if ( !getGrammarIsRoot() ) {
			ErrorManager.grammarWarning(ErrorManager.MSG_TOKEN_VOCAB_IN_DELEGATE,
										this,
										tokenVocabOptionAST.token,
										name);
			return composite.maxTokenType;
		}

in Grammar.java

Ter

On Feb 6, 2009, at 12:51 PM, andreas.meyer at smartshift.de wrote:

>> Hi. Can you try putting
>>
>> tokenVocab=SimpleC;
>>
>> in the root grammar too?
>> T
>
> I tried both SimpleC and SimpleCWalker vocabs (specified both in  
> SimpleCWalker.g and ...Walker2.g), but anyway:
>
>
> warning(160): SimpleCWalker.g:4:5: tokenVocab option ignored in  
> imported grammar SimpleCWalker
>
> Andreas
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list