In the context of adding a means to convert YAML to JSON, this PR adds some new constructs to Trieste.
A Reader is a generalized code construct which a language implementer can expose that parses a Source and returns an AST.
A Writer is the same but for taking an AST and writing it to a Destination (also added in this PR)
A Rewriter converts one AST to another AST via one or more rewrite passes.
In all three cases the implementer controls the activity of the construct via a series of rewrite passes. As part of this work, Driver was rewritten to optionally use a Reader, and the Process classes was refactored to make it a bit more flexible and easy to use.
Additionally, the YAML language implementation exposes a to_json converter, as well as a event_writer (for the existing event stream output) and a writer which emits YAML. All three are validated against the test suite. Both YAML and JSON expose Reader objects, and JSON exposes a Writer as well (a refactoring of its emitter).
In the context of adding a means to convert YAML to JSON, this PR adds some new constructs to Trieste.
In all three cases the implementer controls the activity of the construct via a series of rewrite passes. As part of this work, Driver was rewritten to optionally use a Reader, and the Process classes was refactored to make it a bit more flexible and easy to use.
Additionally, the YAML language implementation exposes a
to_json
converter, as well as aevent_writer
(for the existing event stream output) and awriter
which emits YAML. All three are validated against the test suite. Both YAML and JSON expose Reader objects, and JSON exposes a Writer as well (a refactoring of its emitter).