Function: semantic-lex-spp-simple-macro-to-macro-stream
semantic-lex-spp-simple-macro-to-macro-stream is a byte-compiled
function defined in lex-spp.el.gz.
Signature
(semantic-lex-spp-simple-macro-to-macro-stream VAL BEG END ARGVALUES)
Documentation
Convert lexical macro contents VAL into a macro expansion stream.
These are for simple macro expansions that a user may have typed in directly. As such, we need to analyze the input text, to figure out what kind of real lexical token we should be inserting in its place.
Argument VAL is the value of some macro to be converted into a stream. BEG and END are the token bounds of the macro to be expanded that will somehow gain a much longer token stream. ARGVALUES are values for any arg list, or nil.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex-spp.el.gz
(defun semantic-lex-spp-simple-macro-to-macro-stream (val beg end _argvalues)
"Convert lexical macro contents VAL into a macro expansion stream.
These are for simple macro expansions that a user may have typed in directly.
As such, we need to analyze the input text, to figure out what kind of real
lexical token we should be inserting in its place.
Argument VAL is the value of some macro to be converted into a stream.
BEG and END are the token bounds of the macro to be expanded
that will somehow gain a much longer token stream.
ARGVALUES are values for any arg list, or nil."
(cond
;; We perform a replacement. Technically, this should
;; be a full lexical step over the "val" string, but take
;; a guess that its just a keyword or existing symbol.
;;
;; Probably a really bad idea. See how it goes.
((semantic-lex-spp-extract-regex-and-compare
semantic-lex-symbol-or-keyword val)
(semantic-lex-push-token
(semantic-lex-token (or (semantic-lex-keyword-p val) 'symbol)
beg end
val)))
;; Ok, the rest of these are various types of syntax.
;; Conveniences for users that type in their symbol table.
((semantic-lex-spp-extract-regex-and-compare
semantic-lex-punctuation val)
(semantic-lex-token 'punctuation beg end val))
((semantic-lex-spp-extract-regex-and-compare
semantic-lex-number val)
(semantic-lex-token 'number beg end val))
((semantic-lex-spp-extract-regex-and-compare
semantic-lex-paren-or-list val)
(semantic-lex-token 'semantic-list beg end val))
((semantic-lex-spp-extract-regex-and-compare
semantic-lex-string val)
(semantic-lex-token 'string beg end val))
(t nil)
))