Archive for April, 2005

Static models

Saturday, April 30th, 2005

To help you get started on Assignment 5, click here for a C version of the cup object. If you want to try other models, you can download the Perl script.

Assignment 3

Saturday, April 30th, 2005

Click here for Assignment 3 and here for the 3AC syntax.

No class tonight

Saturday, April 30th, 2005

Class is canceled tonight. I apologize for the short notice, but at least you’ll have Friday evening free. Please start reading Chapter 6 for next week, and check back here in a few hours for Assignment 3.

Assignment 5

Thursday, April 28th, 2005

Assignment 5 is available. I will post some code to help you get started this weekend.

Today’s Lab Exercises

Monday, April 25th, 2005

Click here for the Function Point Estimation Exercise and here for details about today’s project meeting.

Optical Illusions

Wednesday, April 20th, 2005

The optical illusion I mentioned in class is here, you’ll probably want to collect the whole set.

Example Lexical Analyzer

Tuesday, April 19th, 2005

As you finish up working on the parser, if you’re feeling shaky about your own scanner, you can grab lexer.zip.

This is a scanner generated by Flex, the GNU Fast Lexical Analyzer generator. You need the .c and .h files to compile a working program.

The file example.l is the Flex source file; you won’t need this unless you want to change the scanner. The file lex.yy.c was generated with the command flex -l example.l.

Take a look at main.c to see how the lexical analyzer works. Call yylex() to get the next token. The value returned by yylex() will be one of the token types defined in y.tab.h. When yylex() finishes, the variable yytext will contain the corresponding lexeme.

Lab Exercises

Monday, April 18th, 2005

Click here for the Code Coverage Testing exercise and here for notes on the next project meeting.

For Windows people

Thursday, April 14th, 2005

I used py2exe to generate Windows executable that you can run without installing a Python interpreter. Download generate.zip and unzip it, then run generate.exe. If this doesn’t work (and it may not — I haven’t written a Python program for Windows in nearly five years), go over to ActiveState and download ActivePython.

Test Generator

Thursday, April 14th, 2005

If you want to torture-test your parser, download this Test Generator written in Python.

While the code is a little complicated by the need to keep track of declared variables and indentation, really all it does is use the grammar the way Chomsky intended, in “reverse”, to generate new programs.

Note too that while the programs are syntactically correct and obey the rules that I set down in the assignment for the use of identifiers, they’re completely meaningless.