Function: verilog-read-signals

verilog-read-signals is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-read-signals &optional START END)

Documentation

Return a simple list of all possible signals in the file.

Bounded by optional region from START to END. Overly aggressive but fast. Some macros and such are also found and included. For dinotrace.el.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-read-signals (&optional start end)
  "Return a simple list of all possible signals in the file.
Bounded by optional region from START to END.  Overly aggressive but fast.
Some macros and such are also found and included.  For dinotrace.el."
  (let (sigs-all keywd)
    (progn;save-excursion
      (goto-char (or start (point-min)))
      (setq end (or end (point-max)))
      (while (re-search-forward "[\"/a-zA-Z_.%`]" end t)
	(forward-char -1)
	(cond
	 ((looking-at "//")
	  (search-forward "\n"))
	 ((looking-at "/\\*")
	  (search-forward "*/"))
	 ((looking-at "(\\*")
          (or (looking-at "(\\*\\s-*)")  ; It's an "always @ (*)"
	      (search-forward "*)")))
	 ((eq ?\" (following-char))
          (re-search-forward "[^\\]\""))  ; don't forward-char first, since we look for a non backslash first
	 ((looking-at "\\s-*\\([a-zA-Z0-9$_.%`]+\\)")
	  (goto-char (match-end 0))
	  (setq keywd (match-string-no-properties 1))
	  (or (member keywd verilog-keywords)
	      (member keywd sigs-all)
	      (setq sigs-all (cons keywd sigs-all))))
	 (t (forward-char 1))))
      ;; Return list
      sigs-all)))