"Today's Mulan" <to*********@slidemail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I guess this is new, at least to people who don't know about this, like
me, please be prepared to give me a satifying answer,
so please tell me how the compiler "knows" variable "i" as in a
declaration of "int i" is of type "int"?
The compiler saves the variable name, i.e., identifier, and the variable
type, i.e., type-specifier, as two fields of a structure (which may have
more fields), usually in a binary tree (but, occasionally on stacks). The
information in the binary tree is what is left after the C code is lexed
(tokenized) and parsed (syntax checked). Since the information in the
binary tree _usually_ lacks lexical elements such as terminators,
punctuation, etc..., it is called an Abstract Syntax Tree (AST). If the
compiler implementors chose to retain the full lexical information of the C
code in the tree, it'd be called a Concrete Syntax Tree (CST). I guess if
you used stacks it'd be an "Abstract Syntax Stack"...
Rod Pemberton