Function: define-lex-keyword-type-analyzer
define-lex-keyword-type-analyzer is a macro defined in lex.el.gz.
Signature
(define-lex-keyword-type-analyzer NAME DOC SYNTAX)
Documentation
Define a keyword type analyzer NAME with DOC string.
SYNTAX is the regexp that matches a keyword syntactic expression.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex.el.gz
;;; Analyzers generated from grammar.
;;
;; Some analyzers are hand written. Analyzers created with these
;; functions are generated from the grammar files.
(defmacro define-lex-keyword-type-analyzer (name doc syntax)
"Define a keyword type analyzer NAME with DOC string.
SYNTAX is the regexp that matches a keyword syntactic expression."
(declare (indent 1))
(let ((key (make-symbol "key")))
`(define-lex-analyzer ,name
,doc
(and (looking-at ,syntax)
(let ((,key (semantic-lex-keyword-p (match-string 0))))
(when ,key
(semantic-lex-push-token
(semantic-lex-token
,key (match-beginning 0) (match-end 0)))))))
))