Need help specifying a grammar rule

"Michael J. Roseberry" <>
13 Apr 1998 00:47:42 -0400

          From comp.compilers

Related articles
Need help specifying a grammar rule (Michael J. Roseberry) (1998-04-13)
Re: Need help specifying a grammar rule (Ben Elliston) (1998-04-13)
| List of all articles for this month |

From: "Michael J. Roseberry" <>
Newsgroups: comp.compilers
Date: 13 Apr 1998 00:47:42 -0400
Organization: All USENET --
Keywords: yacc, question, comment


I am a relative newbie at yacc; please help me express the following
production from Ada95 in a yacc-compatable specification. I am
comfortable with left-recursion, but stumbled upon encountering this
rule. Thanks in advance.

expression ::=
                relation { AND relation }
            | relation { AND THEN relation }
            | relation { OR relation }
            | relation { OR ELSE relation }
            | relation { XOR relation }

Michael J. Roseberry
Fort Worth, Texas, uSA
[Unless I'm missing something, you should be able to write this pretty
much as is with some precedence rules. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.