Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Elkhound ever run action routines on parses that are not part of a complete parse tree?

0
Posted

Does Elkhound ever run action routines on parses that are not part of a complete parse tree?

0

Yes, it does. The question of whether a given reduction can be part of a complete parse tree can, in general, only be answered by seeing all of the input. So the two choices are to reduce as you go, which is what Elkhound does, or to build a parse tree/forest and then run all reductions after parsing is complete. Elkhound does not do the latter because building a parse tree slows parsing by a large (~10) constant factor. In certain circumstances, Elkhound can determine that an action corresponds to a parse that is going to fail before processing of the current token is finished (see glr.cc, GLR::canMakeProgress()). In such cases, the action is preempted, but this is just a quick hack that can slightly improve performance.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123