[antlr-interest] (no subject)
Gerald Rosenberg
gerald at certiv.net
Fri Oct 31 17:37:59 PDT 2008
At 04:36 PM 10/31/2008, =?ISO-8859-2?Q?Imre_Andr=E1s?= wrote:
>--- unreachable.g --------------------
>grammar unreachable;
>
>ID : ('a'..'z'|'A'..'Z')+ ;
....
>sequence returns [String value]: 'SEQUENCE' WS* '{' WS*
>e=rightValue {$value=$e.value;} (WS* ',' WS* e=rightValue {$value +=
>$e.value;})* WS* '}' {return $value;};
The unreacheable compile analysis-time error is likely due to the
fact that ID will consume all alpha characters, leaving no way to
match the literal 'SEQUENCE'.
BTW, since you are skip()ing whitespace, you can remove the WS* from
the parser rules with no affect.
More information about the antlr-interest
mailing list