Home | History | Annotate | Download | only in doc

Lines Matching full:reduce

232 * Shift/Reduce::      Conflicts: when either shifting or reduction is valid.
236 * Reduce/Reduce:: When two rules are applicable in the same situation.
1405 "reduce/reduce" conflicts (*note Reduce/Reduce::), and "shift/reduce"
1406 conflicts (*note Shift/Reduce::).
1414 However, when faced with unresolved shift/reduce and reduce/reduce
1558 one reduce/reduce conflict. In the conflicting situation the parser
1565 to be silent about the one known reduce/reduce conflict, by adding
1660 reduce/reduce conflict between the rules `expr : ID' and `declarator :
1664 reduce/reduce conflict. Unlike the example from the previous section
1689 enough information to resolve the reduce/reduce conflict (again,
4938 Shift/Reduce Conflicts: Shift/Reduce.), but most real grammars have
4939 harmless shift/reduce conflicts which are resolved in a predictable way
4949 shift/reduce conflicts and no reduce/reduce conflicts. Bison reports
4950 an error if the number of shift/reduce conflicts differs from N, or if
4951 there are any reduce/reduce conflicts.
4953 For deterministic parsers, reduce/reduce conflicts are more serious,
4955 reduce/reduce conflicts for these parsers. With GLR parsers, however,
4958 expected number of reduce/reduce conflicts in GLR parsers, using the
5169 Declare the expected number of shift-reduce conflicts (*note
6231 Unshift a token. This macro is allowed only for rules that reduce
6400 The parser tries, by shifts and reductions, to reduce the entire
6410 * Shift/Reduce:: Conflicts: when either shifting or reduction is valid.
6414 * Reduce/Reduce:: When two rules are applicable in the same situation.
6421 File: bison.info, Node: Lookahead, Next: Shift/Reduce, Up: Algorithm
6426 The Bison parser does _not_ always reduce immediately as soon as the
6464 to reduce before shifting, `1 + 2' would become an `expr'. It would
6475 File: bison.info, Node: Shift/Reduce, Next: Precedence, Prev: Lookahead, Up: Algorithm
6477 5.2 Shift/Reduce Conflicts
6498 is called a "shift/reduce conflict". Bison is designed to resolve
6511 But if the parser chose to reduce when possible rather than shift,
6523 Bison accomplishes by choosing to shift rather than reduce. (It would
6530 shift/reduce conflicts, you can use the `%expect N' declaration. There
6531 will be no warning as long as the number of shift/reduce conflicts is
6561 File: bison.info, Node: Precedence, Next: Contextual Precedence, Prev: Shift/Reduce, Up: Algorithm
6566 Another situation where shift/reduce conflicts appear is in arithmetic
6569 shift and when to reduce.
6597 reduce them via the rule for the subtraction operator? It depends on
6598 the next token. Of course, if the next token is `)', we must reduce;
6599 shifting is invalid because no single rule can reduce the token
6606 in order to permit another opportunity to reduce the difference. The
6609 `(1 - 2) OP 3'. Clearly, then, the choice of shift or reduce should
6618 to shift or reduce when the stack contains `1 - 2' and the lookahead
6677 If the rule's precedence is higher, the choice is to reduce. If they
6693 shift/reduce conflicts that do not involve arithmetics-like operators.
6694 For instance, the "dangling `else'" problem (*note Shift/Reduce
6695 Conflicts: Shift/Reduce.) can be solved elegantly in two different ways.
6717 would be unaware of (e.g., a shift/reduce conflict due to `if test then
6771 File: bison.info, Node: Parser States, Next: Reduce/Reduce, Prev: Contextual Precedence, Up: Algorithm
6787 the parser stack. Or it can say, "Reduce using rule number N." This
6797 File: bison.info, Node: Reduce/Reduce, Next: Mysterious Conflicts, Prev: Parser States, Up: Algorithm
6799 5.6 Reduce/Reduce Conflicts
6802 A reduce/reduce conflict occurs if there are two or more rules that
6827 There is also more than one way to reduce nothing-at-all into a
6838 Bison resolves a reduce/reduce conflict by choosing to use the rule
6840 this. Every reduce/reduce conflict must be studied and usually
6848 Here is another common error that yields a reduce/reduce conflict:
6908 However this ambiguity is now a shift/reduce conflict, and therefore it
6947 File: bison.info, Node: Mysterious Conflicts, Next: Tuning LR, Prev: Reduce/Reduce, Up: Algorithm
6952 Sometimes reduce/reduce conflicts can occur that don't look warranted.
6991 beyond just mysterious reduce/reduce conflicts. The best way to fix
7167 This effect can significantly reduce the complexity of developing
7198 largest lookahead set in each parser state. To reduce the size of the
7431 when Bison disables reduce actions during conflict resolution,
7445 reduce and which reduction to apply based on a summary of the preceding
7452 decision at the point it must be made in a shift-reduce parser.
7461 differently in cases where there is a shift-reduce conflict that has not
7463 reduce-reduce conflict. When a GLR parser encounters such a situation,
7910 Bison parsers are "shift/reduce automata". In some cases (much more
7944 calc.y: conflicts: 7 shift/reduce
7968 State 8 conflicts: 1 shift/reduce
7969 State 9 conflicts: 1 shift/reduce
7970 State 10 conflicts: 1 shift/reduce
7971 State 11 conflicts: 4 shift/reduce
8053 $default reduce using rule 5 (exp)
8056 (`$default'), the parser will reduce it. If it was coming from State
8130 shift/reduce':
8143 '/' [reduce using rule 1 (exp)]
8144 $default reduce using rule 1 (exp)
8156 arbitrarily chose to disable the reduction, see *note Shift/Reduce
8157 Conflicts: Shift/Reduce. Discarded actions are reported between square
8184 '/' [reduce using rule 1 (exp)]
8185 $default reduce using rule 1 (exp)
8193 Conflict between rule 1 and token '+' resolved as reduce (%left '+').
8194 Conflict between rule 1 and token '-' resolved as reduce (%left '-').
8210 '/' [reduce using rule 2 (exp)]
8211 $default reduce using rule 2 (exp)
8223 '/' [reduce using rule 3 (exp)]
8224 $default reduce using rule 3 (exp)
8239 '+' [reduce using rule 4 (exp)]
8240 '-' [reduce using rule 4 (exp)]
8241 '*' [reduce using rule 4 (exp)]
8242 '/' [reduce using rule 4 (exp)]
8243 $default reduce using rule 4 (exp)
8259 As another means to gain better understanding of the shift/reduce
8347 "." reduce using rule 4 (b)
8348 $default reduce using rule 3 (a)
8352 [image src="figs/example-reduce.png" text=" .------------------.
8369 reduction, see *note Shift/Reduce Conflicts: Shift/Reduce. Discarded
10820 parse time to resolve reduce/reduce conflicts. *Note Writing GLR
10868 there is a reduce/reduce conflict with a rule having the same
11217 less as well. This can significantly reduce the complexity of
12203 * conflicts <2>: Shift/Reduce. (line 6)
12206 * conflicts, reduce/reduce: Reduce/Reduce. (line 6)
12215 * dangling else: Shift/Reduce. (line 6)
12253 * else, dangling: Shift/Reduce. (line 6)
12473 * reduce/reduce conflict: Reduce/Reduce. (line 6)
12474 * reduce/reduce conflicts <1>: Simple GLR Parsers. (line 6)
12475 * reduce/reduce conflicts <2>: GLR Parsers. (line 6)
12476 * reduce/reduce conflicts: Merging GLR Parses. (line 6)
12501 * shift/reduce conflicts <1>: Simple GLR Parsers. (line 6)
12502 * shift/reduce conflicts <2>: GLR Parsers. (line 6)
12503 * shift/reduce conflicts: Shift/Reduce. (line 6)
12772 Node: Shift/Reduce263942
12781 Node: Reduce/Reduce276926