From: Eric Schwartz Date: 2005-04-27T06:44:30+09:00 Subject: Re: Is Ruby grammar context free? Peter Suk writes: > Okay, this part is probably context free. I can come up with a context > free grammar for something analogous: > > X -> S1 d | S2 > S1 -> a S1 b | c > S2 -> a S2 b | > > This produces the language { a^n c b^n d } where x ^ n denotes x > repeated n times. Actually, the c and d are optional: X -> S2 X -> a S2 b X -> a b and by implication X -> a^n b^n I'm not sure how that affects your attempt to replicate heredocs in a CFG. -=Eric -- Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare. -- Blair Houghton.