People have made some good suggestions here but let me just throw in my
$.02
1. You never really told us whehter you think you have a scanner or a
parser problem. For discussion purposes, I am assuming you have a
parser problem. If you can get to the point of understanding LALR
closure, the -d optin to yacc or bison will give you a y.debug
file which will show you exactly what static decisions are being
made. One thing to be careful of: Bison (and yacc) are
LALR(1). This means that if you inadvertantly code a grammar that
is LALR(>1), then bison will do what it does based on the
assumption that you are giving it LALR(1). This will be wrong. If
you really do have a grammar that is not LA1, you might have/want
to take a look at PCCTS (pronounced pockets). That will handle
LR(k).
2. Not a quick solution, but in addition to the suggested reading
that came out on this list, there's a really excellent chapter of
LALR in the Dragon Book: Principles of Compiler Construction by
Aho and Ullman (Addison Wesley). The other stuff will have much
more meaning if you can hack through this.
Lemme know.
--
-Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED]
-Stranger things have happened but none stranger than this. Steven W. Orr-
Does your driver's license say Organ Donor?Black holes are where God \
-------divided by zero. Listen to me! We are all individuals!---------
On Tue, 12 Sep 2000, Bruce McCulley wrote:
=>I'm trying to debug a program that includes a proprietary language
=>implemented using flex and yacc, and I've run into a brick wall (or
=>perhaps it's the limits of my knowledge appearing to be a brick wall?)
=>
=>I've got a hard failure with a particular input sequence, easily
=>reproducible. Thing is, it looks ok to my visual inspection, and the
=>execution context looks ok right up until it SEGVs with a null pointer.
=>Thing is, I'm trying to find where the pointer should be set, and it
=>looks like it may be in a stack frame identified as "yyparse()" which
=>gdb says is in the yacc input source. I've been unable to find that
=>function anywhere, and I'm hoping someone on this list might be able to
=>help me. Anyone able to give me a lifeline, please?
=>
=>THANKS!
=>
=>--Bruce McCulley
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************