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

Rewrite parser/lexer #30

Closed
michaelmacinnis opened this issue Jul 1, 2018 · 3 comments
Closed

Rewrite parser/lexer #30

michaelmacinnis opened this issue Jul 1, 2018 · 3 comments

Comments

@michaelmacinnis
Copy link
Owner

The current parser is generated using ohyacc, a version of goyacc that has been modified to allow:

  • The lexer to trigger the parser to exit abnormally (Ctrl-C pressed).
  • The parser to restart with a clear state for each command.

Additionally the lexer/parser have been hacked at to allow a partial parse in order to generate better completion candidates.

This works but a hand-written parser and a lexer that doesn't have to work around the constraints imposed by yacc would allow for more fine-grained control and, hopefully, less convoluted code.

@rain-1
Copy link

rain-1 commented Aug 4, 2018

perhaps this parser library would be useful https://github.com/yhirose/go-peg

@netixen
Copy link

netixen commented Jan 16, 2019

Or this one https://github.com/alecthomas/participle

@michaelmacinnis
Copy link
Owner Author

Working on a new hand-written lexer and recursive descent parser.

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