;; Class definition.
(defclass lexer ()
- ((stream :initarg :stream
- :type stream
- :reader lexer-stream)
- (char :initform nil
- :type (or character null)
- :reader lexer-char)
- (pushback-chars :initform nil
- :type list)
- (token-type :initform nil
- :accessor token-type)
- (token-value :initform nil
- :accessor token-value)
- (pushback-tokens :initform nil
- :type list))
+ ((stream :initarg :stream :type stream :reader lexer-stream)
+ (char :initform nil :type (or character null) :reader lexer-char)
+ (pushback-chars :initform nil :type list)
+ (token-type :initform nil :accessor token-type)
+ (token-value :initform nil :accessor token-value)
+ (pushback-tokens :initform nil :type list))
(:documentation
"Base class for lexical analysers.
"struct" "union" "enum"))
(defclass sod-lexer (lexer)
- ((keywords :initarg :keywords
- :initform *sod-keywords*
- :type hash-table
- :reader lexer-keywords))
+ ((keywords :initarg :keywords :initform *sod-keywords*
+ :type hash-table :reader lexer-keywords))
(:documentation
"Lexical analyser for the SOD lanuage.
;;; C fragments.
(defclass c-fragment ()
- ((location :initarg :location
- :type file-location
+ ((location :initarg :location :type file-location
:accessor c-fragment-location)
- (text :initarg :text
- :type string
- :accessor c-fragment-text))
+ (text :initarg :text :type string :accessor c-fragment-text))
(:documentation
"Represents a fragment of C code to be written to an output file.