
Syntax-directed Translation 153
parenthesis, it is a delimiter – it may trigger some action, but has no value. Non-terminal symbols can
have any values you want, as decided by the semantics of the language and created by the action code
in the parser. Usually, the action code builds a semantic tree corresponding to the input, so that later
phases can process a whole statement or even a whole program at a time.
In real parsers, the values of different symbols use different data types, e.g. int and double for
numeric symbols, char * for strings. We have seen previously that yacc handles multiple value
types by creating a C union typedef called ...