Lecture

Syntax Trees: Parse vs AST

Description

This lecture covers the concept of syntax trees, distinguishing between parse trees and abstract syntax trees (AST). It explains how a pretty printer can take an AST and output the leaves of a concrete parse tree. The lecture also delves into the syntax of a while language given by a context-free grammar, detailing the structure of programs, statements, and expressions. Additionally, it explores the creation of AST classes for statements and expressions, providing examples of different grammar rules and AST nodes. The lecture concludes with discussions on ambiguous grammars, expression grammar ambiguities, grammar layering by priorities, left associativity, and left vs. right associativity in expressions.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.