[antlr-interest] Path for tokenVocab

David Holroyd dave at badgers-in-foil.co.uk
Wed Aug 15 12:26:58 PDT 2007


On Mon, Aug 13, 2007 at 03:18:18PM -0700, Terence Parr wrote:
> 
> On Aug 13, 2007, at 2:01 PM, David Holroyd wrote:
> >So, it would be *really* nice if the tokenVocab option value could  
> >take a 'package prefix',
> >
> >e.g.
> >  tokenVocab=org/example/SomeGrammar;
> >or
> >  tokenVocab=org.example.SomeGrammar;

> Hmm...the problem is that I envisioned the tokenVocab as a grammar  
> name not a file name.  We'd really need org/example/ 
> SomeGrammar.tokens...hmm...Can you list multiple patterns in the -lib  
> option? (can't remember if I have implemented that).

Tool.java only allows for a single libDirectory.  Even if multiple dirs
could be specified, it would be nice to accommodate the pathological case
of trying to support multiple grammars with the same name (maybe other
people wrote the grammars, and I'm just trying to use the .tokens
files).

Regarding grammar-name vs. file-name, is it reasonable to use the same
sort of translation as for Java class files.  e.g.

  tokenVocab = org.example.SomeGrammar
  token file = ${lib}/org/example/SomeGrammar.tokens

That should be backwards compatible with the current tokenVocab usage, I
think?

ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list