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

Calls to default_action_handler with length == 0 #48

Open
mingodad opened this issue Jul 17, 2023 · 1 comment
Open

Calls to default_action_handler with length == 0 #48

mingodad opened this issue Jul 17, 2023 · 1 comment

Comments

@mingodad
Copy link
Contributor

I've noticed that in several grammars there is calls to default_action_handler with length == 0 (see bellow list) which doesn't seems to make sense because nothing can be done.

Also some calls to default_action_handler doesn't contain any nodes[length-1].state()->transitions->reduced_symbol .

Now testing lua.g test.lua
default_handler_counters = call : 699, zero = 42
----
Now testing carbon-lang.g prelude.carbon
default_handler_counters = call : 9743, zero = 302
----
Now testing postgresql-16.g test.sql
default_handler_counters = call : 20521, zero = 4919
----
Now testing lsl_ext.g test.lsl
default_handler_counters = call : 9109, zero = 3
----
Now testing bison.g carbon-lang.y
default_handler_counters = call : 1365, zero = 230
----
Now testing javascript-core.g test.js
default_handler_counters = call : 4295, zero = 0
----
Now testing cparser.g test.c
default_handler_counters = call : 11923, zero = 0
----
Now testing java11.g test.java
default_handler_counters = call : 7884, zero = 0
----
Now testing rust.g test.rs
default_handler_counters = call : 2558, zero = 208
----
Now testing gringo-ng.g test.clingo
default_handler_counters = call : 732, zero = 13
----
Now testing ada-adayacc.g test.adb
default_handler_counters = call : 364, zero = 85
@mingodad
Copy link
Contributor Author

I think that now I better understand the lalr inner working, after going through it step by step with gdb I found that the call with lenght == 0 where due to reducing rules that have empty as one of their possible options but because there was no way to know about it in the action handlers I've added an extra parameter with the reducing transition (see here mingodad@08939ba).

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