Chapter 25. Embedded Translation

Embed output production code into the parser, so that the output is produced gradually as the parse runs.

image

In Syntax-Directed Translation, a pure parser merely creates an internal parse tree, so you need to do more to populate a Semantic Model.

Embedded Translation populates the Semantic Model by embedding code into the parser that populates the Semantic Model at appropriate points in the parse.

25.1 How It Works

Syntactic analyzers are all about recognizing syntactic structures. Using Embedded Translation, we place code to populate a Semantic Model into the parser, so that we gradually populate the Semantic ...

Get Domain Specific Languages now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.