[antlr-interest] V3 token vocabulary questions

Gavin Lambert antlr at mirality.co.nz
Tue Sep 4 14:13:01 PDT 2007


At 08:42 5/09/2007, Alan Rooks wrote:
 >I'm having some trouble getting equivalent functionality in 
v3.
 >The book's description of the tokenVocab option says "The value
 >associated with this option is the name of a grammar, not the
 >name of a file".  What does that actually mean?

I suspect it just means that you're supposed to use the base name 
(X) instead of the token filename (X.tokens) or the lexer filename 
(XLexer.yourtargetlanguage).

 >I haven't been able to figure out how to get the paraphrases 
(e.g.
 >"a constant, or "+") into the X.tokens file.  Is it 
possible?  The
 >book doesn't say anything about what must be there and in what
 >format, when you do importVocab=X.  The v2 syntax doesn't 
work.
 >Has anyone else figured this out?

As far as I am aware, paraphrases are not (yet) supported in 
v3.  So you won't be able to import them (just like you can't 
generate them when you *are* using an ANTLR-created lexer).

Most likely once they are supported they'll use a similar syntax 
to v2, but I can't say that for sure :)



More information about the antlr-interest mailing list