[antlr-interest] How do I specify literals in lexer?

Ric Klaren klaren at cs.utwente.nl
Sun Sep 7 05:44:25 PDT 2003


On Wed, Sep 03, 2003 at 07:46:18PM -0000, atripp54321 wrote:
> I have a grammar file that contains a lexer but no parser and
> I want to specify literals in it. The ANTLR documentation says:
>
> "Second, literals may be specified in the lexer grammar by means of
> the literal option".

That should read: 'in the tokens sections' in stead of by means etc...
although you can just do it in the parser as well. Check the manual for
syntax (or one of the examples the flexlex example form c++ should give you
an idea probably)

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  Chaos always defeats order because it is better organized.
  --- Terry Pratchet


 

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




More information about the antlr-interest mailing list