[antlr-interest] two new interpreter labs posted

Terence Parr parrt at jguru.com
Thu Apr 24 10:15:29 PDT 2003


Folks,

I have posted some really useful labs; all students were able to 
complete them in about 2 hours for the first one and about an hour for 
the second (postscript) lab.

The first lab gets you to fill in the important parts of an assembler 
and interpreter.  Everything is very well defined so you can get things 
done in a hurry while learning the important stuff.  It lets you 
execute stuff like:

	.decl a
	.decl x
main:
; x = foo(20)
	const 20
	call foo
	store x
; print x
	load x
	print
	halt

The link to the lab is:

http://www.cs.usfca.edu/~parrt/course/652/labs/interp.html

The second lab introduces a completely different kind of interpreter 
like Forth: PostScript.  The students build the simple grammar that 
reads postscript (I provide the lexer actually) that invokes two simple 
methods in the interpreter: push() and execute(), which is all 
postscript knows how to do really.  I have provided the infrastructure 
to do the graphics part and so on.  Amazingly you can display the 
nozzle image shown in the lab write up:

http://www.cs.usfca.edu/~parrt/course/652/labs/postscript.html

All solutions are provided.  Very useful introduction to the two most 
common kinds of interpreter.

Enjoy!

Terence
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Co-founder, http://www.peerscope.com link sharing, pure-n-simple
Lecturer in Comp. Sci., University of San Francisco


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list