>I just start reading the book "flex & bison Text Processing Tools" by
>John Levine. Please excuse me if I ask some question that are
>available somewhere in the book. When the grammar become huge, it
>would be inconvenient put all BNFs in a single file. I'm wondering how
>a huge grammar is handled
I have the source files listed at the end of the message. I basically
want to parse a file with only numbers (separated by spaces) and print
the numbers out. It is an overkill to use bison/flex. But I just want
to try how to use bison/flex.
I need to understand how to debug the program. Could some
On Tue, Dec 29, 2009 at 2:49 AM, Hans Aberg wrote:
> On 29 Dec 2009, at 03:54, 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?
On Tue, Dec 29, 2009 at 2:49 AM, Hans Aberg wrote:
> On 29 Dec 2009, at 03:54, 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?
Hi,
According to section 1.2 in the Bison manual
"A terminal symbol that stands for a particular keyword in the language
should be named after that keyword converted to upper case".
When I follow this convention however, I get a syntax error and a
warning in parser.h where the token type for t
Joel E. Denny wrote:
[...]
I agree. Of course, we're probably a few decades too late to change the
default Flex behavior, which is inherited from Lex and specified by POSIX.
However, it would be nice if Flex provided an option to avoid namespace
pollution. (If there's something already, I mi
On Tue, 29 Dec 2009, August Karlstrom wrote:
> Joel E. Denny wrote:
> > I'm guessing your parser.h is included in a scanner generated by Flex, which
> > defines the macro BEGIN.
>
> Yes, that's the case. Do you know if there is there a way around this or do I
> have to add a prefix to the token (
Joel E. Denny wrote:
I'm guessing your parser.h is included in a scanner generated by Flex,
which defines the macro BEGIN.
Yes, that's the case. Do you know if there is there a way around this or
do I have to add a prefix to the token (or all tokens for sake of
consistency)?
Obviously, the
On Tue, 29 Dec 2009, August Karlstrom wrote:
> When I follow this convention however, I get a syntax error and a
> warning in parser.h where the token type for the keyword BEGIN is defined:
>
> error: expected identifier before ‘(’ token
> warning: "BEGIN" redefined
>
> If I change
>
> %token B
Hi,
According to section 1.2 in the Bison manual
"A terminal symbol that stands for a particular keyword in the language
should be named after that keyword converted to upper case".
When I follow this convention however, I get a syntax error and a
warning in parser.h where the token type for th
10 matches
Mail list logo