help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simplifying a "recursive, zero-or more" - grammar


From: Joel E. Denny
Subject: Re: Simplifying a "recursive, zero-or more" - grammar
Date: Sun, 19 Feb 2006 21:11:24 -0500 (EST)

On Sun, 19 Feb 2006, Frans Englich wrote:

> ------------------------------------------------------
> FirstProlog: /* empty */
> | FirstPrologPart FirstPrologPart
> | FirstPrologPart
> 
> FirstPrologPart: DefaultNamespaceDecl
> | Setter
> | NamespaceDecl
> | Foo
> | Bar
> ------------------------------------------------------
> 
> In other words, this grammar (intentionally) allows zero or more 
> DefaultNAmespaceDecl, Setter or NamespaceDecl in arbitrary order. For 
> example: "Setter, Setter, NamespaceDecl", or simply "<empty>".

No, it allows 0, 1, or 2 only.

> Here's another version, which as far as I can tell, achieves the same:
> 
> ------------------------------------------------------
> FirstProlog: /* empty */
> | FirstProlog DefaultNamespaceDecl
> | FirstProlog Setter
> | FirstProlog NamespaceDecl
> | FirstProlog Foo
> | FirstProlog Bar
> ------------------------------------------------------

This is 0 or more.

Joel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]