[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sat, 12 Nov 2005 15:22:58 +0100
It works well for me. For instance the example/calc++ directory
works with a change using glr.cc instead of lalr1.cc. Similarly,
the project I made this for used glr.cc without a single change,
and also works fine using %nondeterministic-parser: this allowed
me to remove so grammar massaging to cope with a local ambiguity
of my language at hand.
There are several remaining issues:
- using cdebugstream instead of stderr
- yyuserAction should probably become a part of the parser
class instead of a free function, at least to obey the exact
same rules of accessibility (friendship with the parser class
does not extend magically to yyuserAction).
- writing test cases
I chose to wrap the C glr parser in a C++ class because that seemed
to simplest. Alternatively one could have written a full parser
from scratch (far from my favorite, but the best result), or
change glr.c so that function declarations could become member
function declaration. I tried to protect glr.c as much as possible
from this, but in retrospect, in selected places (e.g., yyuserAction)
it might be a better choice.
NB: To install it, I first need the glr.c change to be installed
(the one factoring the shared declarations into the header).
Description: Binary data
|[Prev in Thread]
||[Next in Thread]|
- FYI: glr.cc,
Akim Demaille <=