[plug] Using YACC

Russell Steicke russells at plug.linux.org.au
Fri Aug 2 18:14:46 WST 2002


On Fri, Aug 02, 2002 at 07:45:39PM +1000, Buddrige, David wrote:
...
> Does anyone know how to define a grammatical element that has (potentially)
> infinitely repeating parts - ie. possible to have an infinite number of
> lines to a file...

Something like:

file:	lines ;

lines:	/*empty*/ | line lines ;

That could be the wrong way around, but I don't think so.  My copy of the
dragon book (Aho, Sethi and Ullman, "Compilers:  Principles, Techniques
and Tools", the classic parser text) is not at hand right now.



More information about the plug mailing list