Related articles |
---|
WANTED: stylistic advice/guidelines for YACC and LEX timd@Starbase.NeoSoft.COM (1996-01-27) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX scooter@mccabe.com (Scott Stanchfield) (1996-01-29) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX rmonroe@hever.demon.co.uk (Robert F. Monroe) (1996-01-31) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX rmonroe@hever.demon.co.uk (Robert F. Monroe) (1996-02-02) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX Robert@hever.demon.co.uk (Robert F. Monroe) (1996-02-04) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX rmonroe@hever.demon.co.uk (Robert F. Monroe) (1996-02-09) |
Re: WANTED: stylistic advice/guidelines for YACC and LEX ltribble@msmail4.hac.com (Tribble, Louis) (1996-02-09) |
From: | Robert F. Monroe <rmonroe@hever.demon.co.uk> |
Newsgroups: | comp.compilers |
Date: | 9 Feb 1996 12:15:13 -0500 |
Organization: | Compilers Central |
References: | 96-02-019 96-01-139 96-02-052 |
Keywords: | yacc, lex, errors |
I wrote:
> class SentenceReport: public yy_parse
> {
[snip]
> public:
>
> sentence *PrintReport(sentence *s);
> };
That should read: int PrintReport(void);
> At one point I was considering
> hiding the parse tree data structures from the parser. The only way
> that I could think of doing that would rely too heavily on void
> pointers (at least the way I have it in my mind). In the end, it
> seemed that the parser has a right to know the internal representation
> of what it is parsing, so I chucked the idea.
About two minutes after clicking the 'send' button, I realised that
statement is totally incorrect. The yacc and lex modules only use
pointers to words and sentences and they do not reference the members
of the word or sentence classes, so all they would need to see is a
forward declaration of the classes. They would be roughly equivalent
to Ada private types. That would be a simple change to the source and
it is important because by doing so, the implementation of the word
and sentence classes could be changed without requiring the parser or
scanner to be recompiled.
The things that you think about after clicking 'send'.
Bob.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.