I want to generate example string for testing #1286
-
My grammar includes indentation defined tokens (right now is My idea is to get the already solved grammar (ready to build the parser) and use the info there to generate the shortest possible string for every production. I'm looking at code and for now I think that this Line 1408 in 7043c3e Lark(grammar_as_str).grammar ? I don't know in what state the grammar is stored (after EBNF->BNF ?)
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I would suggest you read the hypotheses implementation, it's IMO pretty understandable. You can also look at |
Beta Was this translation helpful? Give feedback.
-
Right, I forgot they should have a example of how to extract the grammar. also, I going to check hyposmith, sounds like I was looking for it! thanks! |
Beta Was this translation helpful? Give feedback.
-
At the end I follow the hypotesis script and modify the state to be a Thanks for the help. |
Beta Was this translation helpful? Give feedback.
I would suggest you read the hypotheses implementation, it's IMO pretty understandable.
You can also look at
hyposmith
, which uses hypothesis.lark to implement the python grammar including the indentation.