
124 Compilers – Principles and Practice
flush input up to the next semicolon or brace, and resume scanning. In order to prevent a cascade of
error messages, the parser, after detecting an error, remains in an error state until three tokens have
been successfully read and shifted.
4.4.8 Arbitrary Value Types
The values returned by the actions and the lexical analyzer are integers by default. YACC can
support values of other types, including C structures. The value-stack is declared to be a union of
the various types of the values desired. The user declares the union and associates union member
names with each token and Non-Terminal having a ...