Prof Avery's weblog
overgrown spite trellis


CSU Fullerton Perl Powered Python vi Hacker

Geek News

del.icio.us bookmarks


Wed, Apr 13, 2005

For Windows people
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.

/var/spool/courses/csuf/2005/spring/cpsc423 #

Test Generator
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.

/var/spool/courses/csuf/2005/spring/cpsc423 #

I give up
I've updated the examples yet again. Sigh.

/var/spool/courses/csuf/2005/spring/cpsc423 #

Yet another syntax error
Turns out that the WHILE loop in the factorial example program is missing parentheses:

WHILE i < 9 OR i = 9 DO
should be
WHILE (i < 9) OR (i = 9) DO
You're only allowed to leave off the parentheses if there's a single expression (as in the fibonacci program). What can I can say? Writing programs without a parser to check them isn't easy.

/var/spool/courses/csuf/2005/spring/cpsc423 #



December 2018
Sun Mon Tue Wed Thu Fri Sat