CS536 Programming Assignment 4 Solution: Name Analyzer for Wumbo AST

$30.00 $19.00
Category:

Description

5/5 – (2 votes)

For this assignment you will write a name analyzer for Wumbo programs represented as abstract-syntax trees. Your main task will be to write name analysis methods for the nodes of the AST. In addition you will need to:

  1. Modify the Sym class (by including some new fields and methods and/or by defining some subclasses).

  1. Modify the IdNode class in ast.java (by including a new Sym field and by modifying its unparse method).

  1. Modify P4.java (an extension of P3.java).

  1. Modify the ErrMsg class.

  1. Write two test inputs: nameErrors.wumbo and test.wumbo to test your new code.

Specifications

Getting Started

Name Analysis

struct Handling Issues

Error Reporting

Other Tasks

Extending the Sym Class

Modifying the IdNode Class

P4.java

Modifying the ErrMsg Class

Writing Test Inputs

Some Advice

Getting Started

The files are:

Sym.java

SymTable.java

DuplicateSymException.java

EmptySymTableException.java

ErrMsg.java

Wumbo.cup

Wumbo.jlex

ast.java

P4.java

Makefile

nameErrors.wumbo

test.wumbo

Here is p4.zip file. It is recommended to start your project with it.

Name Analysis

The name analyzer will perform the following tasks:

CS536 Programming Assignment 4

CS536 Programming Assignment 4

CS536 Programming Assignment 4

CS536 Programming Assignment 4

CS536 Programming Assignment 4

CS536 Programming Assignment 4

http://pages.cs.wisc.edu/~loris/cs536/asn/p4/p4.html Page 7 of 7

CS536 Programming Assignment 4 Solution: Name Analyzer for Wumbo AST
$30.00 $19.00