Re: languages
- From: Barb Knox <see@xxxxxxxxx>
- Date: Mon, 13 Feb 2006 22:41:36 +1300
In article <1139815101.878766.110190@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"jason_box" <cppisfun@xxxxxxxxx> wrote:
Here is the grammar I came up with.
S-> aBa
B-> b | BB | S | lambda
for the gramma L = {a^nb*a^n : a >= 0 }
(You mean "n >= 0").
First, note that your grammar fails to generate the case of n=0.
Second, simplify things by replacing "b*" with just "b". Once you've
solved this, then tweak the answer to generate "b*" rather than "b".
With those 2 hints, have another try at it.
--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb | Quidquid latine dictum sit,
| B B a a r b b | altum viditur.
| BBB aa a r bbb |
-----------------------------
.
- Follow-Ups:
- Re: languages
- From: jason_box
- Re: languages
- References:
- languages
- From: jason_box
- Re: languages
- From: Barb Knox
- Re: languages
- From: jason_box
- languages
- Prev by Date: Re: languages
- Next by Date: Re: Ambuguity of CFG
- Previous by thread: Re: languages
- Next by thread: Re: languages
- Index(es):