[antlr-interest] Converting PCCTS token definitions to ANTLR's

blah blah trigonometric at softhome.net
Tue Aug 20 13:25:32 PDT 2002


I'll attempt the first one:

IDENTIFIER :  ALPHA ( ('_' (ALPHA|DIGIT))? (ALPHA|DIGIT) )* ;
protected ALPHA : ('A'..'Z'|'a'..'z') ;
protected DIGIT : '0'..'9' ;

is this right?
----- Original Message -----
From: "rradh" <rradh at yahoo.com>
To: <antlr-interest at yahoogroups.com>
Sent: Tuesday, August 20, 2002 9:00 PM
Subject: [antlr-interest] Converting PCCTS token definitions to ANTLR's


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


 

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



More information about the antlr-interest mailing list