16 lines
549 B
Common Lisp
16 lines
549 B
Common Lisp
(in-package #:user-side-compiler)
|
|
|
|
(defvar *asm-functions* (make-hash-table :test #'equalp))
|
|
|
|
(defclass asm-function ()
|
|
((%name :accessor name :initarg :name)
|
|
(%address :accessor address :initarg :address
|
|
:initform #xFEC0)))
|
|
|
|
(define-transformation (token (token-name asm-function))
|
|
(multiple-value-bind (asm-function existsp)
|
|
(gethash (name token) *asm-functions*)
|
|
(if existsp
|
|
asm-function
|
|
(setf (gethash (name token) *asm-functions*)
|
|
(make-instance 'asm-function :name (name token))))))
|