Function: semantic-lex-token
semantic-lex-token is a macro defined in lex.el.gz.
Signature
(semantic-lex-token SYMBOL START END &optional STR)
Documentation
Create a lexical token.
SYMBOL is a symbol representing the class of syntax found. START and END define the bounds of the token in the current buffer. Optional STR is the string for the token only if the bounds in the buffer do not cover the string they represent. (As from macro expansion.)
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex.el.gz
;;; Lexical token API
;;
;; Functions for accessing parts of a token. Use these functions
;; instead of accessing the list structure directly because the
;; contents of the lexical may change.
;;
(defmacro semantic-lex-token (symbol start end &optional str)
"Create a lexical token.
SYMBOL is a symbol representing the class of syntax found.
START and END define the bounds of the token in the current buffer.
Optional STR is the string for the token only if the bounds in
the buffer do not cover the string they represent. (As from
macro expansion.)"
;; This if statement checks the existence of a STR argument at
;; compile time, where STR is some symbol or constant. If the
;; variable STr (runtime) is nil, this will make an incorrect decision.
;;
;; It is like this to maintain the original speed of the compiled
;; code.
(if str
`(cons ,symbol (cons ,str (cons ,start ,end)))
`(cons ,symbol (cons ,start ,end))))