ChocoPy Compiler By Bill Sun
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Sanjar Ahmadov dddb026b51
Added student test cases
3 years ago
pa1-tests disclose hiden tests 3 years ago
src Added student test cases 3 years ago
.gitignore Initial commit 3 years ago
LICENSE Initial commit 3 years ago
README.md Initial commit 3 years ago
WORKLOG.md Added student test cases 3 years ago
build.sh Added test scripts to ease testing 3 years ago
chocopy-ref.jar Initial commit 3 years ago
full_test.sh Added test scripts 3 years ago
pom.xml Initial commit 3 years ago
test_py_file.sh Added student test cases 3 years ago
test_sample.sh Added test scripts 3 years ago
test_student_contributed.sh Added test scripts 3 years ago

README.md

NYU Compiler Construction CSCI-GA.2130/Spring 2021: Programming Assignment 2

This assignment is adapted from https://github.com/cs164berkeley/pa2-chocopy-semantic-analysis with the authors' permission.

See the PA2 document on Piazza for a detailed specification.

Quickstart

Run the following commands to compile your analyzer and run the tests:

mvn clean package
java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \
  --pass=.s --test --dir src/test/data/pa2/sample/

The dot in --pass makes the compiler skip parsing and go straight to semantic analysis. --pass=.s uses your (s for student) analyzer to perform semantic analysis on a preparsed input (in this case, the .ast files under src/test/data/pa2/sample/). With the starter code, only two tests should pass. Your main objective is to build an analyzer that passes all the provided tests.

--pass=.r uses the reference (r for reference) analyzer, which should pass all tests.

In addition to running in test mode with --test, you can also observe the actual output of your (or reference) analyzer with:

java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \
  --pass=.s src/test/data/pa2/sample/expr_unary.py.ast

You can also run both passes on the original .py file:

java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \
  --pass=rr src/test/data/pa2/sample/expr_unary.py

Once you merge your parser code from assignment 1, you should be able to use --pass=ss.