{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

dis6 - CMPSC 160 Translation of Programming Languages...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPSC 160 Translation of Programming Languages Project 4 Type Checking
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Introduction Projects Calculator (10%) Lexical and Syntax Analysis (20%) Abstract Syntax Tree (20%) Type Checking and Semantic Analysis (25%) Code Generation (25%) Environment Linux C/C++ Lex and Yacc
Background image of page 2
Project Goal To analyze semantic properties of a Simple program To perform type checking Undefined / Duplicated ID Unmatched Operands No or more than two main func
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Tour of the Code
Background image of page 4
Steps to Solve the Challenge Understand how to traverse an AST using the visitor pattern As an example look at ast2dot.cpp Also look at the slides from lecture 10 about the AST implementation Understand what/when/where to check For each AST node, you need to figure out what to check. Should you check before or after visiting children? Most of the time you check conditions about a node after visiting its children.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}