Function: semantic-lex-c-if

semantic-lex-c-if is a byte-compiled function defined in c.el.gz.

Signature

(semantic-lex-c-if)

Documentation

Code blocks wrapped up in #if, or #ifdef.

Uses known macro tables in SPP to determine what block to skip.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/bovine/c.el.gz
;; (defadvice hif-defined (around semantic-c activate)
;;   "Is the variable defined?"
;;   (if semantic-c-takeover-hideif
;;       (setq ad-return-value
;;          (semantic-c-hideif-defined (ad-get-arg 0)))
;;     ad-do-it))

;; (defadvice hif-lookup (around semantic-c activate)
;;   "Is the argument defined?  Return true or false."
;;   (let ((ans nil))
;;     (when semantic-c-takeover-hideif
;;       (setq ans (semantic-c-hideif-lookup (ad-get-arg 0))))
;;     (if (null ans)
;;      ad-do-it
;;       (setq ad-return-value ans))))

;;; #if macros
;;
;; Support #if macros by evaluating the values via use of hideif
;; logic.  See above for hacks to make this work.
(define-lex-regex-analyzer semantic-lex-c-if
  "Code blocks wrapped up in #if, or #ifdef.
Uses known macro tables in SPP to determine what block to skip."
  "^\\s-*#\\s-*\\(if\\|elif\\).*$"
  (semantic-c-do-lex-if))