[antlr-interest] Converting PCCTS token definitions to ANTLR's
rradh
rradh at yahoo.com
Tue Aug 20 13:00:31 PDT 2002
Hi,
This question must have been asked many times before... :)
I have a PCCTS grammar file that has the foll tokens definitions.
Since lexical analysis was DFA based the order of definition of the
tokens was honored during the matching of the tokens.
#token IDENTIFIER "[A-Za-z]({_}[A-Za-z0-9]+)*"
#token V_NAME "[A-Za-z_]({[A-Za-z\[\]<>_0-9./\#]}(\[[0-9]+\])*)*"
#token C_NAME "[A-Za-z\*\?<_] ( (([A-Za-z_./\#\*\?])*{[0-9]+{\\}{:[0-
9]+{\\}{:[0-9]+}}})* (\[ (([A-Za-z_./\#\*\?<>])*{[0-9]+{\\}{:[0-9]+
{\\}{:[0-9]+}}}{{\\},})+ \] )* ( < (([A-Za-z_./\#\*\?\[\]<>])*{[0-9]+
{\\}{:[0-9]+{\\}{:[0-9]+}}} {{\\},} )+ >)* ($\{(([A-Za-z\[\]<>_0-9./
\#])*(\[[0-9]+\])*)+\})*)*"
I know that ANTLR will complain about "lexical nondeterminism" on
these token definitions.
Any suggestions on rewriting them for ANTLR (or pointers to more
documentation )?
Regards
Rajesh
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list