Re: Semantics make a grammar ambiguous

dplass@yahoo.com
30 Apr 1999 22:58:47 -0400

          From comp.compilers

Related articles
Semantics make a grammar ambiguous bill@megahits.com (Bill A) (1999-04-26)
Re: Semantics make a grammar ambiguous rsherry@home.com (Robert Sherry) (1999-04-29)
Re: Semantics make a grammar ambiguous dplass@yahoo.com (1999-04-30)
Re: Semantics make a grammar ambiguous bill@megahits.com (Bill A.) (1999-04-30)
Re: Semantics make a grammar ambiguous mikov@usa.net (Tzvetan Mikov) (1999-05-03)
Re: Semantics make a grammar ambiguous rkrayhawk@aol.com (1999-05-07)
| List of all articles for this month |

From: dplass@yahoo.com
Newsgroups: comp.compilers
Date: 30 Apr 1999 22:58:47 -0400
Organization: Deja News - The Leader in Internet Discussion
References: 99-04-087 99-04-099
Keywords: C, parse

    Robert Sherry <rsherry@home.com> wrote:
> The C compilers that I have worked on kept type names in a
> different name space ( symbol table ) then variable names. In
> addition, type names and variable names both came back from the
> scanner as a token of type ID. I gather that your scanner does the
> lookup into the symbol table. This might be the cause of your
> problem. However, if you were to switch to having it return ID for all
> variables and type names you might introduce shift/reduce conflicts in
> your grammar.


This is the method that I'm using - separate type and symbol tables.
Then, you can also add your 'intrinsic' types to the type table and write
kooky stuff like this:
        int int;
['course this means that your scanner can't lookup symbols in *either* table]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.