-
Notifications
You must be signed in to change notification settings - Fork 0
/
clast-bq-elements.lisp
76 lines (50 loc) · 1.62 KB
/
clast-bq-elements.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
;;;; -*- Mode: Lisp -*-
;;;; clast-bq-elements.lisp --
;;;;
;;;; Definitons related to backquotes; which are very implementation
;;;; dependent.
;;;; Some code lifted from IT.BESE.ARNESI and CL-WALKER.
;;;; See file COPYING in main folder for licensing and copyright information.
(in-package "CLAST")
;;; bq-form
(defclass bq-form (form)
((expr :initarg :expr
:reader bq-form-expr
)
)
(:documentation "The BQ Form Class.
The forms that represent \"backquote\" expressions.
Notes:
The actual forms are very implementation dependent.")
)
(defun bq-form-p (x) (typep x 'bq-form))
;;; bq-comma
(defclass bq-comma (form)
((kind :initarg :kind
:reader bq-comma-kind
:type (member :value ; Expressions like ,EXPR.
:splice ; Expressions like ,@EXPR
:nconc ; Expressions like ,.EXPR
)
)
(expr :initarg :expr
:reader bq-comma-expr)
)
(:default-initargs :kind :value)
(:documentation "The BQ Comma Class.
The \"comma\" expressions in a backquote structure.
Notes:
These elements are patterned after SBCL. In fact, the introduction of
these classes was made necessary to handle SBCL backquote constructs.
Cfr., the implementation dependent code.")
)
(defun bq-comma-p (x) (typep x 'bq-comma))
;;;;---------------------------------------------------------------------------
;;;; Subform extraction.
(defmethod clast-element-subforms ((bqf bq-form))
(bq-form-expr bqf)
)
(defmethod clast-element-subforms ((bqc bq-comma))
(bq-comma-expr bqc)
)
;;;; end of file -- clast-bq-elements.lisp --