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

Refactor structure and API #12

Merged
merged 31 commits into from
Dec 23, 2018
Merged

Refactor structure and API #12

merged 31 commits into from
Dec 23, 2018

Conversation

timsueberkrueb
Copy link
Owner

See #9.

* Nonterminal struct is now generated internally
* Start rule is now generated internally
* Reduce the number of required attributes
* Rename LALR{Parser, Lexer} to Parser, Lexer
@timsueberkrueb timsueberkrueb changed the title WIP: Refactore structure and API WIP: Refactor structure and API Dec 15, 2018
Not quite happy with this one, but I'm fine sacrificing that for
consistency in this case.
Don't know what's going on here, yet, but this is a blocker
Make generated code independent from ParseTable.
Now that codegen doesn't rely on converting core types to tokens
anymore, we can safely drop this.
Return results instead of using panic!() in codegen's parse mod
This decouples yalr and therefore parsers generated using the
procedural macro from yalr_core.
@timsueberkrueb
Copy link
Owner Author

timsueberkrueb commented Dec 22, 2018

TODOs for this one:

  • remove lowercase requirement for terminals in rules (e.g. terminals in rules being lowercase vs. uppercase enum variants is too confusing)
  • Consider making terminal_type and start_symbol parameters of lalr

Upstream:

@timsueberkrueb timsueberkrueb changed the title WIP: Refactor structure and API Refactor structure and API Dec 23, 2018
It is possible that not all possible terminals are handled here because
codegen only knows about the terminals that are part of the rules.
Therefore, we need to behave as if we have encountered unexpected input
in this case.
@timsueberkrueb
Copy link
Owner Author

Don't merge yet, test case is coming.

@DanielBicek DanielBicek merged commit 2f9dc2f into develop Dec 23, 2018
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