Revision 35 now includes more set/array/list processing functionality, including function applicators map and select, array builtins sort, shuffle, reverse, and set operations among arrays using +, -, <, <=, ==, >=, >, &&, and ||. Details to come in the A.M….
Aggregate Structures: Arrays
February 18, 2007 7:14 pm
Revision 34 adds support for dynamically resizable arrays. They are scoped as variables are, support indexing for assignment and dereferencing, and are nestable. An array literal syntax is supported as
aryliteral: '[' ( expr*/ ',' ) ']';
Scoping rules
February 17, 2007 11:28 pm
Checked in a code sample nested-scoping.lang to demonstrate the scoping rules. If a previously defined variable is redefined, its value will be updated in the existing scope. If a variable is newly defined, it will be bound to the tightest scope. See how x survives the inner block’s close, while y is descoped:
{
x = 1;
print x; # 1
{
x = 2;
y = 3;
print x; # 2
print y; # 3
}
print x; # 2
print y; # Undefined
}
Functions and scoping
February 17, 2007 11:25 pm
Revision 32 in svn brings function definitions, function calls, and lexically scoped variables for kicks. svn up and make clean build eval as before to see it in action.
def gen() { 5; }
def print2(arg0, arg1) {
print arg0;
print arg1;
}
print2( gen(), print2(1, 2) ); # 1 2 5 2
Quick updates
January 24, 2007 10:43 am
The project has taken a slightly different direction, and I will be implementing it with oops3 in Java. I’ve updated the syntax slightly, and added an Interpreting Visitor. The following make targets will build the parser and run the interpreter over a test Fibonacci file:
make clean
make build
make eval
Current todo status should be available at http://svn.jayunit.net/lp/todo.txt. Updates to the packaging and documentation are forthcoming, and then the project should be rolling again!
User Manual
December 11, 2006 10:08 am
A user manual, containing an explanation of syntax and examples of each language feature, has been added to svn at http://svn.jayunit.net/lp/manual.txt.
Subversion Repository
December 11, 2006 9:47 am
A publicly accessible Subversion repository for our project code is available at http://svn.jayunit.net/lp/.
Introduction
December 11, 2006 9:40 am
This is the project website of Alexander Pita and Jason Morrison for the winter 2006 course 4003.580.01/4005.711.01/70 - Language Processors/Compiler Construction Lab.
We plan to create a C-like language with a bytecode compiler targeting MSIL to run on .NET and are currently using oops3 as our parser generator.