[antlr-interest] Epsilon productions and end of file

Marcin Rzeznicki marcin-rzeznicki at wp.pl
Tue Dec 16 15:28:50 PST 2003


----- Wiadomosc oryginalna ----- 
Od: "Arnar Birgisson" <arnarb at oddi.is>
Do: <antlr-interest at yahoogroups.com>
Wyslano: 16 grudnia 2003 20:51
Temat: Re: [antlr-interest] Epsilon productions and end of file


> Hello,

Hi

> This means that you must specifically tell ANTLR where to expect
> end-of-file, and for that you use the special token EOF.

Yes, but when I use explicit EOF, it does not calculate follow sets as I
would expect. For example

S -> AB , means taht follow set of S goes to follow set of B (with $)

S -> AB EOF ends with EOF in follow set of S, nothing to do with B

>
> As for epsilon-productions, you would use the ? operator. In you
> example,
>
> production: ( other_production )? ;

Isn't taht valid only for regular languages ? Does that hold with
context-free ones ?
--
Greetings
Marcin Rzeznicki




 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

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




More information about the antlr-interest mailing list