michaelmacinnis / oh

A new Unix shell.
MIT License
1.36k stars 55 forks source link

Rewrite parser/lexer #30

Closed michaelmacinnis closed 3 years ago

michaelmacinnis commented 6 years ago

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

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 commented 6 years ago

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

netixen commented 5 years ago

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

michaelmacinnis commented 5 years ago

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