Chapter 4Building Intermediate Form Trees

Before interpreting or translating an input phrase, we have to fully understand that phrase. That means we have to verify its syntax and verify that it makes sense. In the previous part of this book, we learned how to check phrase syntax. In this part of the book, we’re going to explore the patterns that help us analyze input phrases.

Only the simplest language applications get away with reading input and directly generating output. Such applications are called syntax-directed applications because they can generate output as soon as they recognize a construct. For example, if we wanted to convert a wiki markup format to HTML, we could translate it almost character by character. The key characteristic ...

Get Language Implementation Patterns 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.