Skip to content

[FR] tree → string emitter #140

@arrdem

Description

@arrdem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions