[antlr-interest] digit-ended literals (was New faq entries - import/export)

Terence Parr parrt at jguru.com
Tue Oct 30 11:45:15 PST 2001


On Tuesday, October 30, 2001, at 10:45  AM, Bogdan Mitu wrote:

>> Isn't the "if0" in the .txt (persistence) file?  That should be how it
>> communicates.
>>
>> Ter
>
> Yes, "if0" is in the .txt file, as
> "if0"=4
>
> By contrast, "if" is written in .txt file as
> LITERAL_if="if"=4
> and can be referred from outside as XxxTokenTypes.LITERAL_if.
>
> My question is why "if0" is treated different then "if". When I wrote a
> syntax highlighter for Verilog, I wanted to associate keywords with 
> colors
> using a property file, and I went into some trouble because Verilog has
> digit-ended keywords, and the only way to refer them was by some ever
> changing numbers. Not that it would be a great deal, I am just 
> wondering.

The text file is what allows you to refer to "if0" in say the tree 
grammar.  Not the tokens java file.  I think we just ignored the problem 
of what to do with literals that weren't purely letters.

Ter
--
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