Aarohi’s Status Update for February 29

Aarohi’s Status Update for February 29

Progress

This week I mostly focused on specing out the rest of the interpreter, and on the design presentation. 

Functions 

We decided to add an additional functionality to the spec of the interpreter: functions. This involves function definition (fn), functions and return statements.

Functions will be declared as follows: 

Code: 

fun foo(int x) {

    return x + x;

}

fun bar(int x) {

return foo(x);

}

CodeBlox:

v1 = fn of v2

return v2 + v2

v3 = fn of v4

return v1.v4

In practice, functions will not be checked (compiled) unless they are called. When functions are called, they will be executed line by line. 

Therefore the functionality can be compared to that of python, where error checking is done at runtime. 

Schedule

Because of the design presentation and work from other classes, I am falling behind schedule. I should have gotten command sequences working for this week, but this week I focused on specing out the entire pattern and preparing it for the design presentation. Since I have kept spring break as slack time, and I will not be needing access to the arduino platform on the lab computer, I will be able to catch up on work during spring break remotely. 

Goals for next week (same as last week)

  1. Finish eval_expression (recursive function) 
  2. Finish handling command sequences
  3. Begin working on handling conditional sequences 
  4. Begin working on implementing error checking (mark where error checking needs to be done)

Leave a Reply

Your email address will not be published. Required fields are marked *