Theory, examples of reversible parsers?

前端 未结 11 1175
滥情空心
滥情空心 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:14

    Such thing is called a Visitor. Is traverses the tree and does whatever has to be done, for example optimize or generate code.

提交回复
热议问题