Skip to content

Mismatch between parsertl and bison for shift/reduce conflicts #22

@mingodad

Description

@mingodad

While trying to improve the output of parsertl debug/dump to match the bison output I found that on the grammar attached bellow bison reports:

bison-nb -v lua-pluto.g.y
lua-pluto.g.y: warning: 64 shift/reduce conflicts [-Wconflicts-sr]
lua-pluto.g.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples

And gram_grep report only 12:

./gram_grep -f lua-pluto.g test.sql
Warnings from config lua-pluto.g :
SHIFT (args -> . '(' ')') (args -> . '(' expr_comma_list ')')/REDUCE (stat -> funccall) conflict.
SHIFT (safe_name_access -> NAME . '?')/REDUCE (safe_name_access -> NAME) conflict.
SHIFT (funccall -> var . ':' NAME args)/REDUCE (exp -> var) conflict.
SHIFT (args -> . '(' ')') (args -> . '(' expr_comma_list ')')/REDUCE (exp -> var) conflict.
SHIFT (funccall -> funccall . ':' NAME args)/REDUCE (exp -> funccall) conflict.
SHIFT (args -> . '(' ')') (args -> . '(' expr_comma_list ')')/REDUCE (exp -> funccall) conflict.
SHIFT (safe_name_access -> NAME . '?')/REDUCE (safe_name_access -> NAME) conflict.
SHIFT (funccall -> funccall . ':' NAME args)/REDUCE (exp -> funccall PIPE funccall) conflict.
SHIFT (args -> . '(' ')') (args -> . '(' expr_comma_list ')')/REDUCE (exp -> funccall PIPE funccall) conflict.
SHIFT (funccall -> '(' exp ')' . ':' NAME args)/REDUCE (exp -> '(' exp ')') conflict.
SHIFT (args -> . '(' ')') (args -> . '(' expr_comma_list ')')/REDUCE (exp -> '(' exp ')') conflict.
SHIFT (var -> var '[' exp ']' . '?')/REDUCE (var -> var '[' exp ']') conflict.

lua-pluto.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions