|Building a parse tree that reflects C Semantics firstname.lastname@example.org (VBDis) (2002-10-13)|
|Re: Building a parse tree that reflects C Semantics email@example.com (Josef Grosch) (2002-10-18)|
|Re: Building a parse tree that reflects C Semantics firstname.lastname@example.org (Ira Baxter) (2002-10-20)|
|Re: Building a parse tree that reflects C Semantics email@example.com (Mark) (2002-10-20)|
|Re: Building a parse tree that reflects C Semantics firstname.lastname@example.org (Rodney M. Bates) (2002-10-20)|
|Re: Building a parse tree that reflects C Semantics email@example.com (David Thompson) (2002-10-25)|
|Re: Building a parse tree that reflects C Semantics firstname.lastname@example.org (Rodney M. Bates) (2002-11-06)|
|[1 later articles]|
|Date:||13 Oct 2002 16:05:26 -0400|
|Organization:||AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com|
|Posted-Date:||13 Oct 2002 16:05:26 EDT|
I've constructed a C grammar for CoCo/R, with only a few remaining
LL(1) errors. Now I want to create a parse tree, and have some
problems with the interpretation of the type declarations. The
following questions are independent from the grammar and tool type,
any hints are welcome:
How to create an parse tree in general?
It's easy to create an tree node for every reduction, with the reduced
tokens becoming children of that node. But how to create or transform
that tree in a way, that it reflects the semantics of the parsed text,
instead of the syntax?
How to interpret the type declaration syntax of C, in order to obtain
general type descriptions for every declaration?
The resulting description should express something like "pointer to:
array [...] of: ...", or some other straight type description. There
exist rules how to interpret type declarations "manually" (look right,
look left...), but I could not yet create equivalent code for an
automated interpretation of the scattered pieces of every declaration.
Where can I find sample C or C++ grammars (for download), with added
actions for the semantical interpretation of the rules?
Return to the
Search the comp.compilers archives again.