[antlr-interest] Re: Import vocabulary
Boulanger Jean-Louis
jean-louis.boulanger at hds.utc.fr
Sun Apr 25 03:23:52 PDT 2004
Selon lgcraymer <lgc at mail1.jpl.nasa.gov>:
> ANTLR only supports one import vocabulary per grammar, and the last
> one should win--there is a string variable that is set for the option.
> Supporting more than one import vocab could be done, but that would
> require a scheme for numbering token types so that they don't overlap.
Perhaps, it's possible to choose another implentation for the "token numbering"
that support multi-import.
> Not a good idea--that would be error prone.
Why ANTLR can't accept more than one import.
I have a similary problem with a tools where i want translate from VHDL to B
(it's a formal method).
I have a specific tools (called ABTOOLS) that parsed, types, .... B file.
I have writed a VHDL grammar with the idea to translate "AST VHDL" to "AST B".
If i can do so, i can you all my B Tool directly.
Today, I writed a library that provide some B tree construt that I use in the
VHDL treewalker, but this solution overide the development.
Boulanger JL
>
> --Loring
>
>
> --- In antlr-interest at yahoogroups.com, "Mike Lischke" <lists at l...> wrote:
> > Hi,
> >
> > How is the import of a vocabulary supposed to work when I import
> more than one? Currently it looks like the last one wins (i.e. tokens
> from previously imported vocabularies are lost). I can put everything
> into one vocabulary, sure, but for a clean implementation I prefer to
> keep my preprocessor vocabulary (ifdef, define etc.) separate from the
> main parser vocabulary.
> >
> > Mike
> > --
> > www.soft-gems.net
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
-------------------------------------------------
Laboratoire Heudiasyc. UMR CNRS 6599
http://www.hds.utc.fr
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