previous | index | next

Deciding When to Accept

An expression is accepted when its end has been reached and there is only a number on the stack.
     (define accept?
       (lambda (expr-stack next-token)
	 (if (and (number? (top-minus expr-stack 0))
		  (equal? next-token '$))
	     (equal? (top-minus expr-stack 1) '$)
	     #F)))

previous | index | next