To make the question a little more specific. I was wondering if I could generate Rascal parseable code from the built-in grammar datastructure, which in turn is parsed rascal code of course. I would like this since it is easier readable and also a nice feature to have since it would make this part of parsing conversable.
so from an instance of this:
data Grammar = \grammar(set[Symbol] starts, map[Symbol sort, Production def] rules);
To something like this:
start syntax E
= E "+" T
| T
;
syntax T
= T "*" F
| F
;
syntax F
= "(" E ")"
| "a"
;