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

option -t do not generate code for "reduces" #11

Open
akakima opened this issue Nov 25, 2016 · 4 comments
Open

option -t do not generate code for "reduces" #11

akakima opened this issue Nov 25, 2016 · 4 comments

Comments

@akakima
Copy link

akakima commented Nov 25, 2016

When we use the option -t to trace parser at runtime, there is no code generated for "reduces".
Is it by design ?

@vnmakarov
Copy link
Member

Sorry, I did not understand your question. There are a few parsers in this code base.

If it is a question about MSTA. I should check it. -t should only add debugging print. If some code is not generated. It is probably a bug.

For Dino -t prints call stack at the exit. This stack might be not accurate because of call-tail optimization.

There is a test in dino.tst.in implementing tiny language called GRIP. The GRIP interpreter has also option -t. But I did not write this code (somebody else wrote it). So I can not answer the question if it is about GRIP.

@akakima
Copy link
Author

akakima commented Nov 26, 2016 via email

@vnmakarov
Copy link
Member

I see. I think it is possible to add printing about some reduces. But it will be not full information. MSTA makes a lot of optimizations. For example, if there is not action, the corresponding reduce might be part of another reduce (chain reduces). Even if there is an action, several reduces can be combined as their actions.

Also MSTA for regular language can actually generate DFA where there are no reduces at all. So I can add debugging prints about reduces which have actions. But probably it is not what people would expect.

@akakima
Copy link
Author

akakima commented Nov 30, 2016 via email

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

2 participants