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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.