[cfe-dev] Cleaning up the representation of Decls in the AST
snaroff at apple.com
Fri Sep 12 05:45:12 PDT 2008
On Sep 11, 2008, at 1:51 PM, Ted Kremenek wrote:
> From my perspective, Decls just represent syntax, and if our current
> ASTs cannot adequately capture such elements of the syntax then they
> need to be augmented.
I'm trying to catch up and understand this thread (since there still
seems to be some disagreement on what's best).
That said, I'm not sure I understand your point that "Decls just
represent syntax". Since your argument seems to revolve around it, I
need some clarification.
From my perspective, Decls don't just represent syntax. For example,
VarDecl has a method "getInit()" which returns an expression. The
initializer is an important part of the semantics of the program.
There are many other examples...
My point is the Decl AST's contain lots of semantics and weren't
designed to capture all syntactic elements. There is a ton of
punctuation ('(', ',', ';', '*')) which is "lost".
Since I know you understand all this, I must be missing something
critical to your thinking...
More information about the cfe-dev