[antlr-interest] paraphrase without lexer

Ric Klaren klaren at cs.utwente.nl
Mon Apr 15 09:21:21 PDT 2002


Hi,

On Mon, Apr 15, 2002 at 05:05:25PM +0200, Silvain Piree wrote:
> As such, I really like your solution of overriding reportError. Thank you
> for that suggestion!

Ack a fourth solution. Make your own 'yourparserTokenTypes.txt' the format
is pretty easy. Make an example lexer with several of the options and see
what's dumped in the txt file. Then do an importvocab on it and you should
be ok. If you do some tricks with your own lexer and some handy comments
and a script you may even create it automatically from your (lex?)
lexerinput file.

Here's a few snips from an antlr generated:

// $ANTLR 2.7.2a2 (20020112-1): parser.g -> Modest_TokenTypes.txt$
Modest_    // output token vocab name
TYPEDEF="typedef"=4
WS=96
C_COMMENT("'C-comment'")=97

Counting starts at 4.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
 Time what is time - I wish I knew how to tell You why - It hurts to know -
          Aren't we machines - Time what is time - Unlock the door
               - And see the truth - Then time is time again
                From: 'Time what is Time' by Blind Guardian


 

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



More information about the antlr-interest mailing list