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

Configure parser lookahead #202

Closed
spoenemann opened this issue Sep 3, 2021 · 3 comments · Fixed by #248 or #755
Closed

Configure parser lookahead #202

spoenemann opened this issue Sep 3, 2021 · 3 comments · Fixed by #248 or #755
Assignees
Labels
cli CLI related issue grammar Grammar language related issue
Milestone

Comments

@spoenemann
Copy link
Contributor

Chevrotain allows to configure a maximum lookahead number globally or per alternative:
https://chevrotain.io/docs/guide/initialization_performance.html#use-a-smaller-global-maxlookahead

We should try to compute a required lookahead for every alternative. Ideally this would happen statically when the CLI runs, so we need to store the information somehow. For example, we could add a property to Alternatives in the grammar and put a value for that property in the CLI. Then the property would be included in the serialized grammar.

We should also allow to configure Chevrotain's IParserConfig, for example as part of our LangiumConfig, so users can change the global maxLookahead.

@spoenemann spoenemann added cli CLI related issue grammar Grammar language related issue labels Sep 3, 2021
@spoenemann spoenemann added this to the v0.2.0 milestone Sep 15, 2021
@spoenemann
Copy link
Contributor Author

Global config > v0.2.0, fine-grained config > v0.3.0

@spoenemann
Copy link
Contributor Author

Reopening for the fine-grained config.

@spoenemann spoenemann reopened this Sep 30, 2021
@spoenemann spoenemann removed this from the v0.3.0 milestone Nov 16, 2021
@spoenemann
Copy link
Contributor Author

We should wait for the result of Chevrotain/chevrotain#1714: maybe we won't need any fixed lookahead anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI related issue grammar Grammar language related issue
Projects
None yet
2 participants