-
Notifications
You must be signed in to change notification settings - Fork 77
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
parse()
throws am ambiguity exception even after an action has eliminated the amb
node
#1210
Comments
good find. It may be the |
Ok, complex issue. The post-parse filtering only works if
|
So this interaction requires re-thinking of the design of three components. I'm parking this for now, since we're planning on integrating the data-dependent context-free grammar parsing framework Iguana this year, and we'll have to reconsider the post-parse actions in that regard anyway. Initial thoughts:
Ergo, this is something to think deeper about. |
Test
t1
fails and not because of an assertion failure. The example is a model of resolving ambiguities by a strict priority order (not, however, with a priority rule). ProductionA
is always preferred overB
; the example has no other possibilities, but that's an entailment of simplicity and not essential. The action rewrites the ambiguity set to be just theA
element.The defect is that parsing without allowing ambiguity still throws an Ambiguity, even though there's no ambiguity node in what would otherwise be the parse tree. If there were no defect,
t1
would pass. As it is now, the second parse, which allows ambiguity so that we get a parse tree to examine, returns a tree that does not contain an ambiguity node.A bit of time in the debugger shows that the action is being executed twice, once for each parse. Apparently the defect, therefore, arises from not considering the effect of an action that rewrites an ambiguity into an ordinary application.
The text was updated successfully, but these errors were encountered: