Lecture 06a: Simple Semantic Analysis

Scopes of Symbols

Implementation: Symbol Tables and Error Reporting

Type Checking Rules for a Simple Language

Type Rules: local rules that say how types should agree on each syntax tree node. Can be used to derive type checking algorithms:

  • bottom-up: constants have types, variables have types (from declarations), so propagate through operators
  • top-down: resulting expressions have types, deduce the types of argument operators
  • combination

Rules are declarative specifications, they do not directly say in which direction to propagate