multiplicative : primary "*" multiplicative { return $1 * $3; }
/ primary
"primary" refers to another rule in the grammar, which is defined as integer or a parenthesized expression. This snippet defines "multiplicative", which is either a primary, or a primary followed by an asterisk followed by another multiplicative. (This recursively expands to allow any number of primaries, separated by asterisks.)The value of the multiplicative expression is the value of the first term times the value of the third term. (The second term is just the literal string "*".)