| 1 |
The tt(%union) directive is used to specify a union of semantic value types. |
| 2 |
Although each semantic value type can be used for each tt(STYPE_) variable, |
| 3 |
(non)terminals are in practice associated with a single type. These |
| 4 |
associations are automatically applied through b()'s dollar-notations. |
| 5 |
|
| 6 |
Note that the tt(%union) directive is now largely superseded by the facilities |
| 7 |
offered by the tt(%polymorphic) directive. Using tt(%union) is considered |
| 8 |
somewhat `old school', as tt(%polymorphic) implements cleaner type |
| 9 |
definitions, allowing b() and the bf(C++) compiler to verify that types are |
| 10 |
correctly being used. |
| 11 |
|
| 12 |
In the next overview the notation $1 is used as a generic reference to |
| 13 |
semantic values of production rule components. Instead of $1 other available |
| 14 |
numbered dollar references can also be used. |
| 15 |
|