previous | index | next

The process Procedure

     (define process
       (lambda (rest-of-expr)
	 (let ((next-token (car rest-of-expr)))
	   (cond ((accept? expr-stack next-token)
		  (top-minus expr-stack 0))
		 ((reduce? expr-stack next-token)
		  (reduce! expr-stack)
		  (process rest-of-expr))
		 ((shift? expr-stack next-token)
		  (push! expr-stack next-token)
		  (process (cdr rest-of-expr)))
		 (else
		  (error "EVALUATE: syntax error"
			 expr-stack
			 rest-of-expr))))))

previous | index | next