File: howprec.yo

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (17 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
The first effect of the precedence directives is to assign precedence levels
to the terminal symbols declared. The second effect is to assign precedence
levels to certain rules: each rule gets its precedence from the last terminal
symbol mentioned in the components. (You can also specify explicitly the
precedence of a rule. See section ref(CONDEP)).

Finally, the resolution of conflicts works by comparing the precedence of the
rule being considered with that of the look-ahead token. If the token's
precedence is higher, the choice is to shift. If the rule's precedence is
higher, the choice is to reduce. If they have equal precedence, the choice is
made based on the associativity of that precedence level. The verbose output
file made by `tt(-V)' (see section ref(INVOKING)) shows how each conflict was
resolved.

Not all rules and not all tokens have precedence. If either the rule or the
look-ahead token has no precedence, then the default is to shift.