-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph-defs.lisp
30 lines (23 loc) · 958 Bytes
/
graph-defs.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(defclass dotable ()
((dot-name :initform (gensym "V") :reader dot-name))
(:documentation "Something that can be turned into a GraphViz node"))
(defclass gnode (dotable)
()
(:documentation "Node in the graph representation"))
(defclass gref (dotable)
((node :initarg :node :accessor gderef))
(:documentation "Pointer in the graph representation"))
(defun make-gref (gnode)
(make-instance 'gref :node gnode))
(defclass cons-gnode (gnode)
((cons :initarg :cons :reader gnode-cons)
(args :initarg :args :initform nil :accessor gnode-args)))
(defclass param-gnode (gnode)
((var :initarg :var :reader gnode-var)))
(defclass apply-gnode (gnode)
((fun :initarg :fun :accessor gnode-fun)
(args :initarg :args :accessor gnode-args)))
(defclass fun-gnode (gnode)
((fun-name :initarg :fun-name :reader gnode-fun-name)
(arity :initarg :arity :reader gnode-fun-arity)
(args :initarg :args :initform (list) :accessor gnode-args)))