User Tools

Site Tools


cs330_f2016:labpaint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs330_f2016:labpaint [2018/01/31 19:04]
morse
cs330_f2016:labpaint [2021/06/30 23:42] (current)
Line 1: Line 1:
-**This is a draft version of the assignment and may change until the due date of the preceding assignment. 
-** 
- 
 ====Objective:​==== ====Objective:​====
  
Line 9: Line 6:
 ====Pre-requisite:​==== ====Pre-requisite:​====
  
-For this lab, you should have Julia 0.installed, the same as for the rudimentary interpreter. ​ You will need both the Lexer and Error modules, and you will need your code from the Extended Interpreter.+For this lab, you should ​again have Julia 1.installed, the same as for the rudimentary interpreter. ​ You will need both the Lexer and Error modules, and you will need your code from the Extended Interpreter.
  
 ---- ----
Line 20: Line 17:
 Your module should be able to do everything that your simple interpreter could do and everything that your extended interpreter can do.  However, you will use program analysis to both eliminate ''​With''​ nodes, and to add two new simple features. Your module should be able to do everything that your simple interpreter could do and everything that your extended interpreter can do.  However, you will use program analysis to both eliminate ''​With''​ nodes, and to add two new simple features.
  
-The ''​CI6.jl''​ module is available ​on Dropbox.+The ''​CI4.jl''​ module is available ​in the Content section in Learning Suite.
  
 Please name your module TransInt. Please name your module TransInt.
Line 42: Line 39:
  
 <code BNF> <code BNF>
-<OWL> ::= number +<AE> ::= number 
-          | (+ <OWL> <OWL> <OWL>​*) ​  # at least two parameters, possibly infinity. ​ note extra star! +          | (+ <AE> <AE> <AE>​*) ​  # at least two parameters, possibly infinity. ​ note extra star! 
-          | (- <OWL> <OWL>) +          | (- <AE> <AE>) 
-          | (* <OWL> <OWL>) +          | (* <AE> <AE>) 
-          | (/ <OWL> <OWL>) +          | (/ <AE> <AE>) 
-          | (mod <OWL> <OWL>) +          | (mod <AE> <AE>) 
-          | (collatz <OWL>) +          | (collatz <AE>) 
-          | (- <OWL>)      ​+          | (- <AE>)      ​
           | id           | id
-          | (if0 <OWL> <OWL> <OWL>) +          | (if0 <AE> <AE> <AE>) 
-          | (with ( (id <OWL>)* ) <OWL>) +          | (with ( (id <AE>)* ) <AE>) 
-          | (lambda (id*) <OWL>) +          | (lambda (id*) <AE>) 
-          | (and <OWL> <OWL> <OWL>​*) ​ # new operation '​and'​ +          | (and <AE> <AE> <AE>​*) ​ # new operation '​and'​ 
-          | (<OWL> <OWL>​*) ​        +          | (<AE> <AE>​*) ​        
 </​code>​ </​code>​
  
Line 79: Line 76:
 </​code>​ </​code>​
  
-Your code should make a similar transformation for multiple-identifier ''​with''​ expressions to applying multiple-parameter ''​lambda''​ expressions.+Your code should make a similar transformation for multiple-identifier ''​with''​ expressions to applying multiple-parameter ''​lambda''​ expressions. ​For example, 
 + 
 +<code lisp> 
 +(with ((x 5) (y 6)) (+ x y)) 
 +</​code>​ 
 + 
 +becomes 
 + 
 +<code lisp> 
 +((lambda (x y) (+ x y)) 5 6) 
 +</​code>​
  
-No changes to the grammar are necessary to support this change, and therefore, no changes to your parser from the Extended Interpreter are necessary to implement this under-the-hood syntactic rewrite. The transformation should happen in the ''​analyze''​ function.+No changes to the grammar are necessary to support this change, and therefore, no changes to your parser from the Extended Interpreter are necessary to implement this under-the-hood syntactic rewrite. ​**The transformation should happen in the ''​analyze''​ function.**
  
 **Part 2: Addition operation with arbitrary number of parameters** **Part 2: Addition operation with arbitrary number of parameters**
cs330_f2016/labpaint.1517425443.txt.gz · Last modified: 2021/06/30 23:40 (external edit)