Re: Exercise 2.1.2 from Aho&Ulman The theory of Parsing textbook?



Tegiri Nenashi <TegiriNenashi@xxxxxxxxx> writes:

Not only that but terms like aXa were also wrong. How about

Y = YaYbY + YbYaY + 1

That looks much better. Each Y introduces an equal number of a's and
b's.

For those who don't understand his notation, it is the style Mark
Williams-Hopkins uses and equivalent to the more common yacc-style
notation:

Y : Y a Y b Y
| Y b Y a Y
| /* empty */
;

or the BNF:

<Y> ::= <Y> a <Y> b <Y>
| <Y> b <Y> a <Y>
|
.



Relevant Pages