docopt / docopts

Shell interpreter for docopt, the command-line interface description language.
Other
494 stars 53 forks source link

Reactoring introduce new docopt grammar parser #69

Open Sylvain303 opened 1 year ago

Sylvain303 commented 1 year ago

More to come and to be edited in this issue / tracking discussion.

See grammar branch

The docopt parent project is stalled so mostly all parser improvement. I love parsing, as most of the couple of parser developer around the world. They are very few, search bison / yacc / GNU Lex / grammar generator / Abstract Syntax Tree and such topic.

I'm in the process of a total rewrite the grammar parser of docopt so removing dependencies of also stalled go-docopt lib.

The main goal is error handling while building the docopts definition. Error handling is difficult in parsing and should be done with care.

I did spend a couple of hundred hours experiencing grammar code generator for this purpose but: generator are not so well flexible on error handling and docopt grammar is quite complex to describe with standard tool.

So I decided, for fun too, to rewrite a grammar parser from scratch hand crafted!

More to come.