alexandru-dinu / synx

Generate random strings given a BNF grammar.
MIT License
0 stars 0 forks source link

Annotate rules with probability metadata #11

Open alexandru-dinu opened 1 year ago

alexandru-dinu commented 1 year ago

E.g., weights:

<foo> ::= "foo" [2] | <bar> [1] | <baz> [3]

meaning that

Pr(<baz> | <foo>) = 3 / (2 + 1 + 3) = 1/2

Default: uniform distribution.