|Semantics make a grammar ambiguous firstname.lastname@example.org (Bill A) (1999-04-26)|
|Re: Semantics make a grammar ambiguous email@example.com (Robert Sherry) (1999-04-29)|
|Re: Semantics make a grammar ambiguous firstname.lastname@example.org (1999-04-30)|
|Re: Semantics make a grammar ambiguous email@example.com (Bill A.) (1999-04-30)|
|Re: Semantics make a grammar ambiguous firstname.lastname@example.org (Tzvetan Mikov) (1999-05-03)|
|Re: Semantics make a grammar ambiguous email@example.com (1999-05-07)|
|From:||"Bill A." <firstname.lastname@example.org>|
|Date:||30 Apr 1999 22:59:23 -0400|
|Organization:||Posted via RemarQ Communities, Inc.|
Robert Sherry wrote in message 99-04-099...
>I gather that your scanner does the lookup into the symbol table.
Yes, it does.
>However, if you were to switch to having it return ID for all
>variables and type names you might introduce shift/reduce conflicts in
:) You're right again! I did this and got exactly what you describe - many
> I had a problem like this when I was trying to write a parser
>for a spice like language. Spice is a language for describing analog
>circuits. I solved the problem by having the parser feed information
>back to the scanner about what to expect. Knows the scanner would know
>whether it should expect a type or a identifier.
This is quite clever - thanks! Never quite thought of using the
parser to tell the scanner what it can and can't output. I will do
this - I can see already that this is what I can do and I can leave
the grammer alone.
>The text books say that this is a bad idea but it might solve your problem.
A bad idea that solves a nasty problem...Isn't that a good idea? :)
>This idea has
>another problem. Consider the statement: <snip>
Yes, it does. But I've heard the not long ago that Standard C
practice was to disallow a default int type. I guess I have the
situation now that register <id OR typedef_name> <id>; always sees the
typedef because my scanner does a lookup and changes an ID token to
<typedef> token when a <typedef> is present (the whole reason for my
> I hope this helps. Good Luck.
Very much so. Thanks Robert for your feedback and idea!
Return to the
Search the comp.compilers archives again.