Closed ptal closed 9 years ago
We can achieve a similar result with our notion of semantic actions:
rule_1 = digit* > Digit
/ letter > Letter
In a first time, we expect the variants Letter and Digit to be declared by the programmer himself. We close this for the moment because it might not be easy or a good idea to generate it by default, furthermore this syntax would generate ambiguities if we generate the AST.
Note: the main difficulty is to name things (notably sum types).
We can automatically derived an AST from a grammar without semantic action.
derive an AST that looks like: