(defpackage #:cparse (:use #:common-lisp #:cutil #:clex #:cabs-syn) (:export #:parse)) (in-package #:cparse) (defclass () () (:metaclass )) (defclass () ((exp :accessor exp))) (defclass () ((bin-op :accessor bin-op))) (defclass () ((unr-op :accessor unr-op))) (defclass (") 'great))) (defun parse (str) (let* ((cl (init-lex str)) (tok (lexer cl))) (cond ((instancep tok (find-class ')) (make-instance (find-class ') 'n n 'c (parse-cmd cl))) ((instancep tok (find-class ')) (cond ((string= (ident tok) "LIST") (make-instance (find-class '))) ((string= (ident tok) "RUN") (make-instance (find-class '))) ((string= (ident tok) "END") (make-instance (find-class '))) (t (error "Parse error")))) (t (error "Parse error")))))