lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.81k stars 409 forks source link

documentation: epsilon rules #535

Closed marxsk closed 3 years ago

marxsk commented 4 years ago

Hi, thanks for a great piece of software. Is there a way how to define epsilon (empty) rules ? The only mention that I find was in CYK parser :/

erezsh commented 4 years ago

Yes, it's implicit in the grammar.

empty:

sometimes_empty: "a"?

sometimes_empty2: "a"
                |

Maybe slightly confusing, I admit.