[antlr-interest] empty right hand side

Terence Parr parrt at cs.usfca.edu
Fri Jun 27 11:32:38 PDT 2008


x? is same as (x|).  As a rule, you see:

r : x
   |
   ;

Use nothing to represent "nothing" :)
Ter
On Jun 27, 2008, at 11:13 AM, Edwards, Waverly wrote:

>
> What would and empty right hand side look like in an ANTLR grammar?
>
> While I've been desperately attempting to stand on my own two feet and
> be able to determine a first and follow set from a grammar, I've read
> and
> have been told that determining these sets only become difficult when
> you have an empty production.  What would that look like?  It may  
> sound
> a bit silly but at no time have I ever seen an empty right-hand sides
> (conventionally written using the Greek letter epsilon) in an ANTLR
> grammar.
>
>
> Thank you very much for your time,
>
>
> W.
>
> (if you see this message twice, I apologize.)



More information about the antlr-interest mailing list