An action accompanies a syntactic rule and contains C code to be executed each time an instance of that rule is recognized. The task of most actions is to compute a semantic value for the grouping built by the rule from the semantic values associated with tokens or smaller groupings.
Most rules have just one action at the end of the rule, following all the components.
Thus, the value of the first symbol in the rule becomes the value of the whole rule. Of course, the default rule is valid only if the two data types match. This is a very risky practice, and to use it reliably you must be certain of the context in which the rule is applied. Go to the first , previous , next , last section, table of contents .