-
Notifications
You must be signed in to change notification settings - Fork 151
Description
I know there's a ticket open for generating strings which conform to a grammar, but it'd be awesome if there was a way to take a tree (as if parsed from a grammar & transformed remaining legal within that grammar) and a grammar, then generate a (the?) string which would parse the same way.
This would make it super easy to write source to source transformation tools, because you just parse a tree in, manipulate it, emit another tree in the same language and get re-encoding of the new expression tree "for free". Obviously for a whitespace sensitive grammar or a rewriting tool which cares about newlines/whitespace the parsing and manipulation language would have to encode those features as such but for simple expression oriented languages I'd think this is straightforwards.