![]() |
![]() |
|
home—lectures—recipe—exams—hws—D2L—breeze (snow day)
Expr ::= Num | ParenExpr | BinExpr | WhenZExpr ParenExpr ::= < Expr > BinExpr ::= (: Expr BinOp Expr :) WhenZExpr ::= whenz Expr then Expr otherwise Expr ! BinOp ::= +++ | --- | *** |
Here is
a Racket interpreter for P0
along with
a scanner for racket (with an a scanner demo)
and
expr-test-P0.rkt (which requires the latest student-extras.rkt).
Here is
a java interpreter for P0
(P0-java.jar or browse);
it includes unit tests,
and
helpful Java parsing functions.
This is so we can just use our language's built-in number-parsing functions,
without getting bogged down in tokening input.
So racket implementations will allow exactly those strings recognized by
Similarly, if using Java, the semantics of P0's arithmetic will be similar to IEEE floating point arithmetic (rather than perfectly-correct arithmetic).
Don't confuse P0's class
home—lectures—recipe—exams—hws—D2L—breeze (snow day)
©2014, Ian Barland, Radford University Last modified 2014.Nov.09 (Sun) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |