Re: How to construct a BNF for a language mechanically and incrementally?

2009-12-28 Thread Philip Herron
On Mon, 2009-12-28 at 20:54 -0600, Peng Yu wrote: > It seems to me that to use bison I have to have a BNF first. I'm > reading Programming Language Pragmatics 3rd Ed (PLP3). What is not > clear to me is that how to construct the BNF for a language? Based on > my reading of PLP3, I haven't found a f

How to construct a BNF for a language mechanically and incrementally?

2009-12-28 Thread Peng Yu
It seems to me that to use bison I have to have a BNF first. I'm reading Programming Language Pragmatics 3rd Ed (PLP3). What is not clear to me is that how to construct the BNF for a language? Based on my reading of PLP3, I haven't found a formal way to construct BNF. What I understand is that, to

Re: Where to put '#define YYSTYPE char *'?

2009-12-28 Thread Hans Aberg
On 28 Dec 2009, at 03:55, Peng Yu wrote: I have the following example6.y and example6.l files. The compilation gives me warnings. I'm not sure where to put '#define YYSTYPE char *' (it is currently in example6.y). Could somebody let me know? The example is from http://tldp.org/HOWTO/Lex-YACC-HOW