Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grammar conflicts #48

Open
mingodad opened this issue Sep 28, 2023 · 0 comments
Open

Grammar conflicts #48

mingodad opened this issue Sep 28, 2023 · 0 comments

Comments

@mingodad
Copy link

I've just added mango.[yl] to https://mingodad.github.io/parsertl-playground/playground/ an Yacc/Lex compatible online editor/tester (select MangoFix parser from Examples then click Parse to see a parser tree for the content in Input source editor).

I fixed some conflicts there see definition, annotation_list, annotation_list_opt, declare_struct ... , but still there is some conflicts:

state 48 SHIFT (type_specifier -> IDENTIFIER . ASTERISK)/REDUCE (primary_expression -> IDENTIFIER) conflict.
state 192 SHIFT (type_specifier -> IDENTIFIER . ASTERISK)/REDUCE (primary_expression -> IDENTIFIER) conflict.
state 234:COLON REDUCE (selector_1 -> IDENTIFIER)/REDUCE (primary_expression -> primary_expression DOT IDENTIFIER) conflict.
state 234:LP REDUCE (selector_1 -> IDENTIFIER)/REDUCE (primary_expression -> primary_expression DOT IDENTIFIER) conflict.
state 235:COLON REDUCE (selector_1 -> key_work_identifier)/REDUCE (primary_expression -> primary_expression DOT key_work_identifier) conflict.
state 235:LP REDUCE (selector_1 -> key_work_identifier)/REDUCE (primary_expression -> primary_expression DOT key_work_identifier) conflict.

The rule primary_expression is too broad and as it's now accept things like:

    12("str");
    "str"(23.5);
    nil("str");
    NULL("str");

I hope https://mingodad.github.io/parsertl-playground/playground/ can help debug/develop/test/document this project grammar.

The repository is here https://github.com/mingodad/parsertl-playground .

Any feedback is welcome !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant