Cs 433 assignment - lalr parser construction using cup


Assignment - LALR parser construction, using CUP

Assuming you have the latest build.xml update from Assignment 1, you shouldn't need to install anything for this project, since CUP was already installed with the first project distribution.

Your Job

Complete the skeleton CUP specification for the Tiger programming language. Refer to the language manual for details of the syntax. Your grammar should correctly reflect all precedence and associativity rules.

It is possible (indeed likely) that you will encounter one or more shift/reduce conflicts. By default, CUP resolves such conflicts in favor of shifting. If this is the correct choice for the conflict, you should add a directive to CUP, telling it to expect this conflict. Specifically, in the build.xml file, there is a task, genParse:

   

        destdir="${src_root}/"

        interface="true"

        package="syntax.parse"

        parser="TigerParse"

        symbols="TigerSyms" 

        expect="0"/>

Change the value of the expect attribute to reflect the number of acceptable shift/reduce conflicts in your grammar.

All reduce/reduce conflicts should be considered errors in your grammar, and they must be eliminated. Similarly, if you have any shift/reduce conflicts that should resolve in favor of reduction, you will need to eliminate them by rewriting that part of your grammar.

Attachment:- Assignment Files.rar

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Cs 433 assignment - lalr parser construction using cup
Reference No:- TGS02657462

Expected delivery within 24 Hours