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

Implement basic Parser #103

Closed
rengolin opened this issue May 7, 2020 · 5 comments
Closed

Implement basic Parser #103

rengolin opened this issue May 7, 2020 · 5 comments

Comments

@rengolin
Copy link
Contributor

rengolin commented May 7, 2020

With the token tree in hand, produce an AST from it. If writing it in opaque MLIR is a good idea (see #101), then output opaque MLIR in a recognisable shape.

Acceptance criteria:

  • Can parse the existing Verona examples (write more examples if necessary)
  • Can dump the AST in text form
  • Has tests that show the expected AST from given source
  • Test coverage is 100% of what's exposed in existing examples

Not included:

  • Support for the full language
  • Type inference, validation
  • MLIR lowering
@rengolin
Copy link
Contributor Author

rengolin commented May 8, 2020

@plietar I think we should reuse, or at least heavily borrow from your prototype.

@davidchisnall
Copy link
Contributor

The prototype uses Pegmatites, which is designed for teaching and for rapid prototyping. We should not aim to reuse any of the Pegmatite code for a production compiler.

@mjp41
Copy link
Member

mjp41 commented May 11, 2020

@sylvanc has a prototype parser in a private repo he was working on that might be a useful starting point.

The current parser has some quirks, that I don't think need replicating. It tries to accept a mix of ML like syntax, and only requires parenthesis where necessary

   if true {..} else {..}

versus

   if (true) {..} else {..}

I think we should just enforce parens as it makes the syntax more regular.

@rengolin
Copy link
Contributor Author

I agree. Fuzzy syntax creates complications for the compiler for no additional benefits to the user. We may want to re-think this later, by adding syntactic sugar to the language (and its own parsing rules), but that has to be a conscious act for real benefit, not premature laziness.

@rengolin
Copy link
Contributor Author

Superseeded by #111

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

No branches or pull requests

3 participants