Untitled
user_2381398
plain_text
3 years ago
18 kB
7
Indexable
$ bison -d -Wcounterexamples parser.y
parser.y: warning: 11 nonterminals useless in grammar [-Wother]
parser.y: warning: 30 rules useless in grammar [-Wother]
parser.y:178.1-18: warning: nonterminal useless in grammar: arrays_declaration [-Wother]
178 | arrays_declaration:
| ^~~~~~~~~~~~~~~~~~
parser.y:217.1-19: warning: nonterminal useless in grammar: function_expression [-Wother]
217 | function_expression:
| ^~~~~~~~~~~~~~~~~~~
parser.y:221.1-20: warning: nonterminal useless in grammar: procedure_expression [-Wother]
221 | procedure_expression:
| ^~~~~~~~~~~~~~~~~~~~
parser.y:224.1-16: warning: nonterminal useless in grammar: formal_arguments [-Wother]
224 | formal_arguments:
| ^~~~~~~~~~~~~~~~
parser.y:230.1-15: warning: nonterminal useless in grammar: formal_argument [-Wother]
230 | formal_argument: IDENTIFIER COLON type
| ^~~~~~~~~~~~~~~
parser.y:240.1-16: warning: nonterminal useless in grammar: unary_expression [-Wother]
240 | unary_expression:
| ^~~~~~~~~~~~~~~~
parser.y:251.1-25: warning: nonterminal useless in grammar: multiplicative_expression [-Wother]
251 | multiplicative_expression:
| ^~~~~~~~~~~~~~~~~~~~~~~~~
parser.y:267.1-18: warning: nonterminal useless in grammar: primary_expression [-Wother]
267 | primary_expression:
| ^~~~~~~~~~~~~~~~~~
parser.y:298.1-9: warning: nonterminal useless in grammar: condition [-Wother]
298 | condition:
| ^~~~~~~~~
parser.y:304.1-16: warning: nonterminal useless in grammar: simple_condition [-Wother]
304 | simple_condition:
| ^~~~~~~~~~~~~~~~
parser.y:310.1-10: warning: nonterminal useless in grammar: comparison [-Wother]
310 | comparison:
| ^~~~~~~~~~
parser.y: warning: 18 shift/reduce conflicts [-Wconflicts-sr]
parser.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
parser.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
Example: •
First reduce derivation
program
↳ 1: ε •
Second reduce derivation
program
↳ 2: program_units
↳ 5: ε •
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLON type COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 9: • CONST IDENTIFIER COLON type COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 9: CONST IDENTIFIER COLON type COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 10: • CONST IDENTIFIER COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 10: CONST IDENTIFIER COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 11: • CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 11: CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLONEQUALS MINUS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 12: • CONST IDENTIFIER COLONEQUALS MINUS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 12: CONST IDENTIFIER COLONEQUALS MINUS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLON type COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 13: • VAR IDENTIFIER COLON type COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 13: VAR IDENTIFIER COLON type COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 14: • VAR IDENTIFIER COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 14: VAR IDENTIFIER COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLON type
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 15: • VAR IDENTIFIER COLON type
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 15: VAR IDENTIFIER COLON type
parser.y: warning: shift/reduce conflict on token BEGIN_KEYWORD [-Wcounterexamples]
Example: • BEGIN_KEYWORD END
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 16: blocks
↳ 18: • BEGIN_KEYWORD program_units END
↳ 18: ε
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 16: blocks
↳ 18: BEGIN_KEYWORD program_units END
↳ 18: ε
parser.y: warning: shift/reduce conflict on token IDENTIFIER [-Wcounterexamples]
Example: • IDENTIFIER COLONEQUALS expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 19: • IDENTIFIER COLONEQUALS expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 19: IDENTIFIER COLONEQUALS expression
parser.y: warning: shift/reduce conflict on token PUT [-Wcounterexamples]
Example: • PUT expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 20: • PUT expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 20: PUT expression
parser.y: warning: shift/reduce conflict on token GET [-Wcounterexamples]
Example: • GET IDENTIFIER
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 21: • GET IDENTIFIER
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 21: GET IDENTIFIER
parser.y: warning: shift/reduce conflict on token RESULT [-Wcounterexamples]
Example: • RESULT expression OR RETURN
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 22: • RESULT expression OR RETURN
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 22: RESULT expression OR RETURN
parser.y: warning: shift/reduce conflict on token EXIT [-Wcounterexamples]
Example: • EXIT
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 23: • EXIT
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 23: EXIT
parser.y: warning: shift/reduce conflict on token EXIT [-Wcounterexamples]
Example: • EXIT WHEN bool_expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 24: • EXIT WHEN bool_expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 24: EXIT WHEN bool_expression
parser.y: warning: shift/reduce conflict on token SKIP [-Wcounterexamples]
Example: • SKIP
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 25: • SKIP
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 25: SKIP
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLON type COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 9: • CONST IDENTIFIER COLON type COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 9: CONST IDENTIFIER COLON type COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 10: • CONST IDENTIFIER COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 10: CONST IDENTIFIER COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 11: • CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 11: CONST IDENTIFIER COLON type COLONEQUALS MINUS constant_exp
parser.y: warning: shift/reduce conflict on token CONST [-Wcounterexamples]
Example: • CONST IDENTIFIER COLONEQUALS MINUS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 6: constant_declaration
↳ 12: • CONST IDENTIFIER COLONEQUALS MINUS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 6: constant_declaration
↳ 12: CONST IDENTIFIER COLONEQUALS MINUS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLON type COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 13: • VAR IDENTIFIER COLON type COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 13: VAR IDENTIFIER COLON type COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLONEQUALS constant_exp
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 14: • VAR IDENTIFIER COLONEQUALS constant_exp
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 14: VAR IDENTIFIER COLONEQUALS constant_exp
parser.y: warning: shift/reduce conflict on token VAR [-Wcounterexamples]
Example: • VAR IDENTIFIER COLON type
Shift derivation
program_units
↳ 3: program_unit
↳ 7: variables_declaration
↳ 15: • VAR IDENTIFIER COLON type
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 7: variables_declaration
↳ 15: VAR IDENTIFIER COLON type
parser.y: warning: shift/reduce conflict on token BEGIN_KEYWORD [-Wcounterexamples]
Example: • BEGIN_KEYWORD END
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 16: blocks
↳ 18: • BEGIN_KEYWORD program_units END
↳ 18: ε
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 16: blocks
↳ 18: BEGIN_KEYWORD program_units END
↳ 18: ε
parser.y: warning: shift/reduce conflict on token IDENTIFIER [-Wcounterexamples]
Example: • IDENTIFIER COLONEQUALS expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 19: • IDENTIFIER COLONEQUALS expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 19: IDENTIFIER COLONEQUALS expression
parser.y: warning: shift/reduce conflict on token PUT [-Wcounterexamples]
Example: • PUT expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 20: • PUT expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 20: PUT expression
parser.y: warning: shift/reduce conflict on token GET [-Wcounterexamples]
Example: • GET IDENTIFIER
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 21: • GET IDENTIFIER
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 21: GET IDENTIFIER
parser.y: warning: shift/reduce conflict on token RESULT [-Wcounterexamples]
Example: • RESULT expression OR RETURN
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 22: • RESULT expression OR RETURN
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 22: RESULT expression OR RETURN
parser.y: warning: shift/reduce conflict on token EXIT [-Wcounterexamples]
Example: • EXIT
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 23: • EXIT
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 23: EXIT
parser.y: warning: shift/reduce conflict on token EXIT [-Wcounterexamples]
Example: • EXIT WHEN bool_expression
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 24: • EXIT WHEN bool_expression
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 24: EXIT WHEN bool_expression
parser.y: warning: shift/reduce conflict on token SKIP [-Wcounterexamples]
Example: • SKIP
Shift derivation
program_units
↳ 3: program_unit
↳ 8: statements
↳ 17: simple
↳ 25: • SKIP
Reduce derivation
program_units
↳ 4: program_units program_unit
↳ 5: ε • ↳ 8: statements
↳ 17: simple
↳ 25: SKIP
Editor is loading...