Skip to content

Parsing and analyzing code #2

Description

@Francisco-Galindo

For implementing any useful feature in the Language Server, we need a parser so that analyze the code and serve completions lists or go to definitions.

We could use something like ANTRL, so we can generate a parser using only the grammar, which is already specified. The parser could be used with Typescript and Go, so we can choose the language we prefer.

Hare uses an LL(1) grammar, so ANTLR seems to be a good fit.

While ANTLR is written in Java, once a parser is generated we only need a runtime library and the generated code, so no hard dependency in Java is needed.

Once we have a working prototype for the whole Language Server, we can work towards using our own implementation or even switch languages entirely to Hare itself. That's in the future, though.

What do you think?

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions