help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reentrant flex, bison glue


From: John W. Millaway
Subject: Re: reentrant flex, bison glue
Date: Wed, 13 Mar 2002 11:38:45 -0800 (PST)

> You missing something: you are talking of bison producing LALR C
> parsers only.  I'm talking about Bison.  We already have a functional
> C++ Bison.  We should have DLR, and maybe other techniques.

How does LALR/DLR affect the scanner API? I would LOVE to put token buffer
support into flex, but that's for a different day. Does the new bison support a
scanner object? If not, then how does that affect the scanner API? The bison
glue was developed before I saw any action in the bison list about the new
stuff. If it totally breaks the new bison model, then by all means let's remove
it from flex.

> Basically, I guess the reason I could not understand you is that I
> don't expect Bison and Flex to try to be smart with my code.  I want
> them to expand the rules, period.  I'm the chief for the rest of the
> code.

I disagree entirely. Flex is not just a tool that builds a giant switch
statement. It is a scanner generator. Look at some other tools. If Antlr
(http://www.antlr.org/) had C support, I'd use it over flex/bison without a
second thought. Antlr is better in every way than flex/bison. The challenge is
to improve flex to "catch up" to these modern tools. That's what you're doing
with bison, isn't it?

> I suppose it means the user must not have code using the names yylloc
> and yylval but as local variables?

No. If a user wants to declare variables "yylloc" and "yylval" for some god
awful reason, that's perfectly fine. It will not clash with flex, since those
are struct members in flex. I think the user won't be able to access those
variables from within the scanner actions, though. But even so, the user
shouldn't prefix her variables with "yy" if she doesn't expect possible clashes
with flex/bison!

>  I also guess you can't use this
> feature when you renamed yy to foo? (I mean, using Bison's
> --name-prefix, not Flex's equivalent option).

No, look in the flex tests/ directory. The bison glue examples use the prefix
"test" or something like that.


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]