1. Homepage
  2. Programming
  3. CS380I Programming Assignment 2: LiveOak - 2 to SaM Compiler

CS380I Programming Assignment 2: LiveOak - 2 to SaM Compiler

Engage in a Conversation
UTexasCS380ILiveOakCompilerJavaSaMrecursive-descent parser

CS380I Programming Assignment 2: LiveOak - 2 to SaM Compiler

1. Assignment Overview

1.1 Task

Create a handwritten recursive-descent parser and SaM code generator for levels 0, 1, and 2 of the LiveOak language. Use the provided SaMTokenizer class for lexical analysis. The compiler should take a file containing a LiveOak program as input and produce an output file containing a SaM program that is a correct translation of the input program. The assignment aims to help understand recursive-descent parsing and what it means to implement a compiler. Related lecture videos include LiveOak, stack machines and SaM, recursive-descent parsing, and code generation. CourseNana.COM

1.2 Score and Due Date

The score is 100 points. The due date is October 20th at 11:59 pm. You can use up to 2 late (extension) days. CourseNana.COM

1.3 Submission Method

All submissions are electronic. You can do the assignment on any machine. The submission testing is automated on Gradescope. You need to submit compiler.jar (a runnable.jar file of your project) and source.zip (a.zip file containing all your source files). CourseNana.COM

2. Preparation Materials

2.1 Required Materials

  • The SaM library (v2.6.3) containing the lexer (obtained from Programming Assignment 1). Compile your code with this.jar file. If you use an IDE, you need to add this.jar file as an external library to your project. CourseNana.COM

  • A collection of public test cases (still being expanded). CourseNana.COM

2.2 Optional Materials

3. Assignment Details

3.1 Grammar Related

  • There will always be a main method in the input program. The program starts executing from the main method. The main method takes no parameters. CourseNana.COM

  • There will always be a return statement at the end of a method in the input program. CourseNana.COM

  • Comments in the input program are automatically handled by the SamTokenizer class. CourseNana.COM

  • There is no overloading of methods. CourseNana.COM

  • The definition of a method can occur either before or after calls to it. Each method needs a symbol table. CourseNana.COM

  • A break statement must be lexically nested within one or more loops. When executed, it terminates the execution of the innermost loop in which it is nested. You are required to handle illegal break statements. CourseNana.COM

  • If a program does not satisfy the grammar or the textual description of the language, the compiler should print a short error message and/or exit with a non-zero exit status. CourseNana.COM

3.2 Compiler Related

The compiler should be in the Java class assignment2.LiveOak2Compiler. It should take two command-line arguments. The first is an input file containing a LiveOak program. The second is an output file that will contain the generated SaM code. It is recommended to handle complexity by working up through the levels of the source language. CourseNana.COM

4. Evaluation

4.1 Evaluation Commands

  • Compiling a LiveOak - 2 program: java -jar compiler.jar test1.lo output.sam CourseNana.COM

  • Running a SaM program: java -cp SaM - 2.6.3.jar edu.utexas.cs.sam.ui.SamText output.sam CourseNana.COM

4.2 Evaluation Criteria

The compiler's correctness is evaluated based on the program's exit status. The public test cases are not exhaustive. It is highly recommended to create more test cases for testing. Before submitting the.jar file, make sure the exit status matches the expected output on all test cases. CourseNana.COM

5. Resources

The assignment counts for 30% of your course grade and is auto-graded using Gradescope. The names of the test cases indicate the level of the language they are testing. Grading is based only on the LiveOak - 2 test cases. Both public and private test cases will be used. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UTexas代写,CS380I代写,LiveOak代写,Compiler代写,Java代写,SaM代写,recursive-descent parser代写,UTexas代编,CS380I代编,LiveOak代编,Compiler代编,Java代编,SaM代编,recursive-descent parser代编,UTexas代考,CS380I代考,LiveOak代考,Compiler代考,Java代考,SaM代考,recursive-descent parser代考,UTexashelp,CS380Ihelp,LiveOakhelp,Compilerhelp,Javahelp,SaMhelp,recursive-descent parserhelp,UTexas作业代写,CS380I作业代写,LiveOak作业代写,Compiler作业代写,Java作业代写,SaM作业代写,recursive-descent parser作业代写,UTexas编程代写,CS380I编程代写,LiveOak编程代写,Compiler编程代写,Java编程代写,SaM编程代写,recursive-descent parser编程代写,UTexasprogramming help,CS380Iprogramming help,LiveOakprogramming help,Compilerprogramming help,Javaprogramming help,SaMprogramming help,recursive-descent parserprogramming help,UTexasassignment help,CS380Iassignment help,LiveOakassignment help,Compilerassignment help,Javaassignment help,SaMassignment help,recursive-descent parserassignment help,UTexassolution,CS380Isolution,LiveOaksolution,Compilersolution,Javasolution,SaMsolution,recursive-descent parsersolution,