RU beehive logo ITEC dept promo banner
ITEC 380
2016fall
ibarland

homelecturesrecipeexamshwsD2Lbreeze (snow day; distance)

R0
Interpreting R

The language R0

  Expr   ::= Num | Paren | BinOp | Parity
  Paren  ::= < Expr >
  BinOp  ::= | Expr Expr Op |
  Parity ::= / Expr Expr Expr \
  Op     ::= ;) | ;( | xD
where Num is any numeric literal (as written in either Java or Racket, your choice). For the provided parsers to work, whitespace is required between all terminals with the exception of punctuation.

Semantics:


Discussion


Where we're headed

R0 Implementations


1This 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 number?, (including +nan.0, -inf.0, and 2+3i).

Similarly, if using Java, the semantics of R0's arithmetic will be similar to IEEE floating point arithmetic (rather than perfectly-correct arithmetic).

Don't confuse R0's class Num (which extends Expr) with the existing java.lang.Number, which doesn't extend Expr.

     

homelecturesrecipeexamshwsD2Lbreeze (snow day; distance)


©2016, Ian Barland, Radford University
Last modified 2016.Nov.14 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.