[antlr-interest] New faq entries - import/export

Terence Parr parrt at jguru.com
Mon Oct 29 16:50:54 PST 2001

On Monday, October 29, 2001, at 09:57  AM, Bogdan Mitu wrote:

> Hi Ter,
> I have some comments about the 3rd entry: Why can't I get the
> exportVocab/importVocab directives to work with string literals across
> multiple files?
> I will argue that:
> 1. The real problem with that grammar is not the import/export 
> relation, but
> a bug in ANTLR.
> 2. The approach suggested for import/export, while correct (when not 
> problem
> 1.), is not the best.
> 1. String literals in parser are not always converted to lexer tokens. 
> For
> instance, an occurrence of the string "if" in the parser grammar is
> translated to LITERAL_if, but string "if0" (with a digit at the end) is 
> not
> converted to anything (just a commented line in XxxTokenTypes.txt). The 
> same
> happens in the grammar that originated this thread, were the string was
> ".accept" (starting with dot), and was not converted properly. This a 
> bug in

I use string literals across multiple files all the time (for example, 
my tree grammars use literals all the time).

What exactly is the bug you refer to?  "if0" is specifically a literal 
that doesn't work or is the whole literals scheme broken from your 

Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list