Semantics




CS152

Chris Pollett

Oct 18, 2021

Outline

Introduction

Semantic Analyzer

Dynamics Checks

Static Analysis

Quiz

Which of the following statements is true?

  1. The keyword free is used to deallocate heap storage in Rust.
  2. A given value in Rust can have at most one owner at a time.
  3. All Rust projects must be in a single file.

Attribute Grammars

More on attribute grammars

Decorating a Parse Tree According to an Attribute Grammar

Expression Tree Decoration

Inherited Attributes

Inherited Attribute Example