Define more atomic tokens, and add shortcut macro for doing it
This commit is contained in:
parent
ae39a48890
commit
8acbf2caec
1 changed files with 30 additions and 8 deletions
|
@ -33,13 +33,29 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
|
||||||
|
|
||||||
;; Special syntax tokens
|
;; Special syntax tokens
|
||||||
|
|
||||||
(defclass token-end-of-statement (token) ())
|
(defmacro define-atomic-token (name)
|
||||||
(defclass token-comma (token) ())
|
`(defclass ,name (token) ()))
|
||||||
(defclass token-plus (token) ())
|
|
||||||
(defclass token-open-paren (token) ())
|
(define-atomic-token token-end-of-statement)
|
||||||
(defclass token-close-paren (token) ())
|
|
||||||
(defclass token-less-than (token) ())
|
(define-atomic-token token-open-paren)
|
||||||
(defclass token-greater-than (token) ())
|
(define-atomic-token token-close-paren)
|
||||||
|
(define-atomic-token token-comma)
|
||||||
|
|
||||||
|
(define-atomic-token token-plus)
|
||||||
|
(define-atomic-token token-minus)
|
||||||
|
(define-atomic-token token-star)
|
||||||
|
(define-atomic-token token-slash)
|
||||||
|
|
||||||
|
(define-atomic-token token-less-than)
|
||||||
|
(define-atomic-token token-greater-than)
|
||||||
|
(define-atomic-token token-equal-equal)
|
||||||
|
(define-atomic-token token-not-equal)
|
||||||
|
|
||||||
|
(define-atomic-token token-not)
|
||||||
|
(define-atomic-token token-negate)
|
||||||
|
|
||||||
|
(define-atomic-token token-equal)
|
||||||
|
|
||||||
;;; String->class-name mappings for operator tokens
|
;;; String->class-name mappings for operator tokens
|
||||||
|
|
||||||
|
@ -48,10 +64,16 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
|
||||||
(";" token-end-of-statement)
|
(";" token-end-of-statement)
|
||||||
("," token-comma)
|
("," token-comma)
|
||||||
("+" token-plus)
|
("+" token-plus)
|
||||||
|
("-" token-minus)
|
||||||
|
("*" token-star)
|
||||||
|
("/" token-slash)
|
||||||
("(" token-open-paren)
|
("(" token-open-paren)
|
||||||
(")" token-close-paren)
|
(")" token-close-paren)
|
||||||
("<" token-less-than)
|
("<" token-less-than)
|
||||||
(">" token-greater-than)))
|
(">" token-greater-than)
|
||||||
|
("=" token-equal)
|
||||||
|
("==" token-equal-equal)
|
||||||
|
("!=" token-not-equal)))
|
||||||
|
|
||||||
;;; Keyword tokens
|
;;; Keyword tokens
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue