340proj1

340proj1 - Arizona State University Scholl of Computing and...

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

View Full Document Right Arrow Icon
Arizona State University Scholl of Computing and Informatics Computer Science and Engineering CSE 340 Spring 2007 Programming Assignment #1 Instructor: Rida Bazzi DUE: MARCH 25 2007 The goal of this project is to give you some hands-on experience with recursive descent parsing and symbol table. You will write a basic type checker for a simple language whose specification follows. After the specification of the language, I list the requirements for type checking. I start by giving an example program BEGIN TYPE A: integer; B, C: Boolean VAR a : A; b, c : B; d : C; ASSIGN b = c; a = d; b = c/d; BEGIN TYPE A : boolean; B : inetegr; VAR a : A; b, c : B; d : C; ASSIGN b = c; a = d; END b = c/d; BEGIN TYPE A : real; B : ; VAR a : A; b, c : B; d : real; ASSIGN b = c/d; a = d; END END
Background image of page 1

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

View Full DocumentRight Arrow Icon
BLOCKS A block consists of three optional parts 1. Type declaration: new names for types are introduced suing basic types. The basic types are int , real , char , and Boolean. Types names are single characters. They are declared in a comma separated list of type names followed by a column followed by a type name, which can be a previously declared type name or a basic type. If the right hand side of a type declaration is a name that has not been previously declared, there is an undeclared type name error . 2. Variable Declaration: variable names are single characters. They are declared in a comma separated list of variables followed by a column which is followed by a
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

340proj1 - Arizona State University Scholl of Computing and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online