Theory, examples of reversible parsers?

前端 未结 11 1256
滥情空心
滥情空心 2021-01-13 22:50

Does anyone out there know about examples and the theory behind parsers that will take (maybe) an abstract syntax tree and produce code, instead of vice-versa. Mathematicall

11条回答
  •  耶瑟儿~
    2021-01-13 23:35

    I rather like lewap's response:

    find a mathematical way to express a visitor and you have a dual to the parser

    But you asked for a sample, so try this on for size: Visual Studio contains a UML editor with excellent symmetry. The way both it and the editors are implemented, all constitute views of the model, and editing either modifies the model resulting in all remaining in synch.

提交回复
热议问题