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

Add support for context-flags #359

Open
nbp opened this issue Mar 6, 2020 · 1 comment
Open

Add support for context-flags #359

nbp opened this issue Mar 6, 2020 · 1 comment

Comments

@nbp
Copy link
Collaborator

@nbp nbp commented Mar 6, 2020

Context flags is a feature of the JavaScript grammar, named parametrized production, which accept or reject productions of the grammar, based on the context in which each production is used.

In the case of the parser generator this can be implemented as runtime flag which are controlled by the parse table actions. Actions such as PushFlag, FilterFlag and PopFlag would be added as a way to implement these context-flags.

Among things to be verified, we should ensure that these flags are well scoped. This means that a push action is guaranteed to be popped exactly once. One way to handle this property is to attach each PushFlag action to a predecessor state (measured in number of shifted terms), and verify that any Reduce action which pops this state no longer has any flag stacked. Note, that when solving inconsistencies of the grammar, a PushFlag might no longer appear as part of the production which pops it.

@nbp

This comment has been minimized.

Copy link
Collaborator Author

@nbp nbp commented Mar 6, 2020

Adding context flag should fix #79.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.