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

Reverting to BCSL Original Syntax: Implementing "::" #99

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

mopichalova
Copy link
Collaborator

To align with the original BCSL syntax, I replaced : with :: in the abstract syntax.

This also required switching the parser from LALR to Earley to handle the introduced ambiguity. This change comes with a trade-off resulting in slower parsing speeds. Adjustments were also made to tests and models to accommodate this change.

Close #98

@xtrojak
Copy link
Collaborator

xtrojak commented Mar 13, 2024

Can you try to somehow quantify the slower parsing speeds?

@mopichalova
Copy link
Collaborator Author

Can you try to somehow quantify the slower parsing speeds?

I reviewed the last tests and the difference in parsing speeds is minimal. Unfortunately I cannot quantify the difference precisely.
But I believe that in our case the difference does not have to be so severe. The grammar was initially designed for LALR parser so there was no ambiguity. By switching to the Earley parser to manage the :: ambiguity, I introduced only one ambiguity and the grammar remained otherwise unchanged so the Earley's performance should remain close to that of the LALR parser.
Earley accepts ambiguity by exploring multiple parsing paths and the sole change should result in minimal increase in potential parse trees, therefore result in only a slight overhead with the Earley parser.

Copy link
Collaborator

@xtrojak xtrojak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, looks good to me and good job!

@xtrojak xtrojak merged commit 0caa5e5 into sybila:improve-parsing Mar 14, 2024
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants