yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.87k stars 1.05k forks source link

Bison warnings when building parser_gram.y with bison 3.4.2 #2983

Open mbautin opened 4 years ago

mbautin commented 4 years ago

[BISON][QLParser] Building parser with bison 3.4.2 parser_gram.y:53.1-41: warning: deprecated directive, use ‘%define api.parser.class {GramProcessor}’ [-Wdeprecated] 53 | %define parser_class_name {GramProcessor} | ^~~~~~~~~ parser_gram.y: warning: 9 nonterminals useless in grammar [-Wother] parser_gram.y: warning: 38 rules useless in grammar [-Wother] parser_gram.y:1442.1-9: warning: nonterminal useless in grammar: key_match [-Wother] 1442 | key_match: | ^~~~~ parser_gram.y:1483.1-11: warning: nonterminal useless in grammar: key_actions [-Wother] 1483 | key_actions: | ^~~ parser_gram.y:1501.1-10: warning: nonterminal useless in grammar: key_update [-Wother] 1501 | key_update: | ^~~~~~ parser_gram.y:1507.1-10: warning: nonterminal useless in grammar: key_delete [-Wother] 1507 | key_delete: | ^~~~~~ parser_gram.y:1513.1-10: warning: nonterminal useless in grammar: key_action [-Wother] 1513 | key_action: | ^~~~~~ parser_gram.y:6502.1-16: warning: nonterminal useless in grammar: NumericOnly_list [-Wother] 6502 | NumericOnly_list: | ^~~~ parser_gram.y:7849.1-16: warning: nonterminal useless in grammar: privilege_target [-Wother] 7849 | privilege_target: | ^~~~ parser_gram.y:7903.1-27: warning: nonterminal useless in grammar: function_with_argtypes_list [-Wother] 7903 | function_with_argtypes_list: | ^~~~~~~ parser_gram.y:7950.1-14: warning: nonterminal useless in grammar: opt_granted_by [-Wother] 7950 | opt_granted_by: | ^~~~~~ parser_gram.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]

mbautin commented 4 years ago

Also happens with Bison 3.0.5

[5/1665] [BISON][QLParser] Building parser with bison 3.0.5 parser_gram.y: warning: 9 nonterminals useless in grammar [-Wother] parser_gram.y: warning: 38 rules useless in grammar [-Wother] parser_gram.y:422.86-94: warning: nonterminal useless in grammar: key_match [-Wother] %type TableLikeOptionList TableLikeOption key_actions key_delete key_match ^^^^^^^^^ parser_gram.y:422.63-73: warning: nonterminal useless in grammar: key_actions [-Wother] %type TableLikeOptionList TableLikeOption key_actions key_delete key_match ^^^^^^^^^^^ parser_gram.y:423.27-36: warning: nonterminal useless in grammar: key_update [-Wother] key_update key_action ConstraintAttributeSpec ConstraintAttributeElem ^^^^^^^^^^ parser_gram.y:422.75-84: warning: nonterminal useless in grammar: key_delete [-Wother] %type TableLikeOptionList TableLikeOption key_actions key_delete key_match ^^^^^^^^^^ parser_gram.y:423.38-47: warning: nonterminal useless in grammar: key_action [-Wother] key_update key_action ConstraintAttributeSpec ConstraintAttributeElem ^^^^^^^^^^ parser_gram.y:570.37-52: warning: nonterminal useless in grammar: NumericOnly_list [-Wother] type_list NumericOnly_list ^^^^^^^^^^^^^^^^ parser_gram.y:490.27-42: warning: nonterminal useless in grammar: privilege_target [-Wother] privilege_target ^^^^^^^^^^^^^^^^ parser_gram.y:545.66-92: warning: nonterminal useless in grammar: function_with_argtypes_list [-Wother] grantee_list privileges privilege_list function_with_argtypes_list ^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:526.36-49: warning: nonterminal useless in grammar: opt_granted_by [-Wother] RoleSpec opt_granted_by ^^^^^^^^^^^^^^ parser_gram.y:1443.3-1445.3: warning: rule useless in grammar [-Wother] MATCH FULL { ^^^^^^^^^^^^ parser_gram.y:1446.5-1448.3: warning: rule useless in grammar [-Wother] | MATCH PARTIAL { ^^^^^^^^^^^^^^^ parser_gram.y:1449.5-1451.3: warning: rule useless in grammar [-Wother] | MATCH SIMPLE { ^^^^^^^^^^^^^^ parser_gram.y:1452.15-1454.3: warning: rule useless in grammar [-Wother] | /EMPTY/ { ^ parser_gram.y:1484.3-1486.3: warning: rule useless in grammar [-Wother] key_update { ^^^^^^^^^^^^ parser_gram.y:1487.5-1489.3: warning: rule useless in grammar [-Wother] | key_delete { ^^^^^^^^^^^^ parser_gram.y:1490.5-1492.3: warning: rule useless in grammar [-Wother] | key_update key_delete { ^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1493.5-1495.3: warning: rule useless in grammar [-Wother] | key_delete key_update { ^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1496.15-1498.3: warning: rule useless in grammar [-Wother] | /EMPTY/ { ^ parser_gram.y:1502.3-1504.3: warning: rule useless in grammar [-Wother] ON UPDATE key_action { ^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1508.3-1510.3: warning: rule useless in grammar [-Wother] ON DELETE_P key_action { ^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1514.3-54: warning: rule useless in grammar [-Wother] NO ACTION { $$ = FKCONSTR_ACTION_NOACTION; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1515.5-54: warning: rule useless in grammar [-Wother] | RESTRICT { $$ = FKCONSTR_ACTION_RESTRICT; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1516.5-53: warning: rule useless in grammar [-Wother] | CASCADE { $$ = FKCONSTR_ACTION_CASCADE; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1517.5-53: warning: rule useless in grammar [-Wother] | SET NULL_P { $$ = FKCONSTR_ACTION_SETNULL; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:1518.5-56: warning: rule useless in grammar [-Wother] | SET DEFAULT { $$ = FKCONSTR_ACTION_SETDEFAULT; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:6503.3-6505.3: warning: rule useless in grammar [-Wother] NumericOnly { ^^^^^^^^^^^^^ parser_gram.y:6506.5-6508.3: warning: rule useless in grammar [-Wother] | NumericOnly_list ',' NumericOnly { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7850.3-7851.3: warning: rule useless in grammar [-Wother] qualified_name_list { ^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7852.5-7853.3: warning: rule useless in grammar [-Wother] | TABLE qualified_name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7854.5-7855.3: warning: rule useless in grammar [-Wother] | SEQUENCE qualified_name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7856.5-7857.3: warning: rule useless in grammar [-Wother] | FOREIGN DATA_P WRAPPER name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7858.5-7859.3: warning: rule useless in grammar [-Wother] | FOREIGN SERVER name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7860.5-7861.3: warning: rule useless in grammar [-Wother] | FUNCTION function_with_argtypes_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7862.5-7863.3: warning: rule useless in grammar [-Wother] | DATABASE name_list { ^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7864.5-7865.3: warning: rule useless in grammar [-Wother] | DOMAIN_P any_name_list { ^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7866.5-7867.3: warning: rule useless in grammar [-Wother] | LANGUAGE name_list { ^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7868.5-7869.3: warning: rule useless in grammar [-Wother] | LARGE_P OBJECT_P NumericOnly_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7870.5-7871.3: warning: rule useless in grammar [-Wother] | SCHEMA name_list { ^^^^^^^^^^^^^^^^^^ parser_gram.y:7872.5-7873.3: warning: rule useless in grammar [-Wother] | TABLESPACE name_list { ^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7874.5-7875.3: warning: rule useless in grammar [-Wother] | TYPE_P any_name_list { ^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7876.5-7877.3: warning: rule useless in grammar [-Wother] | ALL TABLES IN_P SCHEMA name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7878.5-7879.3: warning: rule useless in grammar [-Wother] | ALL SEQUENCES IN_P SCHEMA name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7880.5-7881.3: warning: rule useless in grammar [-Wother] | ALL FUNCTIONS IN_P SCHEMA name_list { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7904.3-7905.3: warning: rule useless in grammar [-Wother] function_with_argtypes { ^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7906.5-7907.3: warning: rule useless in grammar [-Wother] | function_with_argtypes_list ',' function_with_argtypes { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7951.3-7953.3: warning: rule useless in grammar [-Wother] GRANTED BY RoleSpec { ^^^^^^^^^^^^^^^^^^^^^ parser_gram.y:7954.15-31: warning: rule useless in grammar [-Wother] | /EMPTY/ { $$ = nullptr; } ^^^^^^^^^^^^^^^^^