<div dir="ltr"><br><br><div class="gmail_quote">2008/9/12 Argiris Kirtzidis <span dir="ltr"><<a href="mailto:akyrtzi@gmail.com">akyrtzi@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Zhongxing Xu wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I agree with Ted that we should separate syntax thing from semantics thing in the AST.<br>
<br>
struct s;<br>
struct s a;<br>
struct s { int d; } x;<br>
<br>
These 'struct s' have different meanings: type declaration, type specifier, type definition.<br>
But syntactically they are all RecordDecl.<br>
</blockquote>
<br></div>
Strictly syntactically speaking, and by standard terminology, here's what the above constructs are:<br>
<br>
struct s;       ->   type-specifier ';'<br>
struct s a;    ->   type-specifier 'a' ';'<br>
struct s { int d; } x;    ->  type-specifier 'x' ';'<br>
<br>
Isn't it more faithful to the syntax to consider "struct s { int d; }" as part of the type-specifier for 'x' ?<br>
<br>
<font color="#888888"></font></blockquote><div><br>These reflected the parsing steps faithfully. But it is not necessary to retain parsing information entirely in the AST. <br></div></div><br></div>