[antlr-interest] syntactic predicates

mzukowski at yci.com mzukowski at yci.com
Mon Apr 28 09:19:06 PDT 2003


First off you aren't matching COMMA, you are just testing for it in your
syntactic predicate.  Second, your rule is referencing itself without
consuming tokens so it's an infinite loop.

Post a rule with the actual message from antlr or more details on what you
want to do and it'll be easier to help you.

Monty

-----Original Message-----
From: a_j_key [mailto:key at prontomail.com]
Sent: Monday, April 28, 2003 8:57 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] syntactic predicates


Hi all,

I'm stuck with the following: I need to match the rule:
int a, b, c; 
like follows: if variable is followed by COMMA than create a varNode,
otherwise create varDecl. I got the following

varDecl 
  : (varDecl COMMA)=>
      (varDecl)*
  | varDecl
  ;

I don't know what I'm doing wrong. Could anyone give me a hint?

Many thanks in advance,

a.j.key
   


 

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