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
|
||||
|
||||
(defclass token-end-of-statement (token) ())
|
||||
(defclass token-comma (token) ())
|
||||
(defclass token-plus (token) ())
|
||||
(defclass token-open-paren (token) ())
|
||||
(defclass token-close-paren (token) ())
|
||||
(defclass token-less-than (token) ())
|
||||
(defclass token-greater-than (token) ())
|
||||
(defmacro define-atomic-token (name)
|
||||
`(defclass ,name (token) ()))
|
||||
|
||||
(define-atomic-token token-end-of-statement)
|
||||
|
||||
(define-atomic-token token-open-paren)
|
||||
(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
|
||||
|
||||
|
@ -48,10 +64,16 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
|
|||
(";" token-end-of-statement)
|
||||
("," token-comma)
|
||||
("+" token-plus)
|
||||
("-" token-minus)
|
||||
("*" token-star)
|
||||
("/" token-slash)
|
||||
("(" token-open-paren)
|
||||
(")" token-close-paren)
|
||||
("<" token-less-than)
|
||||
(">" token-greater-than)))
|
||||
(">" token-greater-than)
|
||||
("=" token-equal)
|
||||
("==" token-equal-equal)
|
||||
("!=" token-not-equal)))
|
||||
|
||||
;;; Keyword tokens
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue