[antlr-interest] Path for tokenVocab

David Holroyd dave at badgers-in-foil.co.uk
Thu Sep 6 00:52:45 PDT 2007


On Wed, Aug 15, 2007 at 07:26:58PM +0000, David Holroyd wrote:
> 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?

Since I'm having this problem in the context of the Maven plugin for
ANTLR3, I've created an issue over here to track it:

  http://jira.codehaus.org/browse/MOJO-905


Ter,

Do you think this is something that ANTLR should handle better, or
should I be trying to work around this in the plugin?


ta,
dave

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


More information about the antlr-interest mailing list