#lang plai
;; You have to install the PLAI language before you can run this.
;; In DrScheme's File menu, select "Install .plt File..." and enter this URL:
;; http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/plai-4.plt

(define-type Binding
  [binding (name symbol?) (named-expr WAE?)])

(define-type WAE
  [num (n number?)]
  [binop (op procedure?) (lhs WAE?) (rhs WAE?)]
  [with (lob (listof Binding?)) (body WAE?)]
  [id (name symbol?)])

(define wae-keywords (list 'with))

;; wae-keyword? : symbol -> boolean
;; true only if the symbol is a syntactic keyword of this language
(define (wae-keyword? sym)
  (error "not implemented"))

;; wae-op? : symbol -> boolean
;; true only if the symbol is an operator name
(define (wae-op? sym)
  (error "not implemented"))

;; wae-reserved? : symbol -> boolean
;; true only if the symbol is a keyword or operator name
(define (wae-reserved? sym)
  (error "not implemented"))

;; parse : s-exp -> WAE
;; Consumes an s-expression and produces the corresponding WAE
;; Indicates parsing errors using (error "appropriate message")
(define (parse sexp)
  (error "not implemented"))

;; calc : WAE -> number
;; Consumes a WAE representation of an expression and computes
;;   the corresponding numerical result
;; Indicates evaluation errors using (error "appropriate message")
(define (calc expr)
  (error "not implemented"))
