Function: semantic-gcc-fields
semantic-gcc-fields is a byte-compiled function defined in gcc.el.gz.
Signature
(semantic-gcc-fields STR)
Documentation
Convert GCC output STR into an alist of fields.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/bovine/gcc.el.gz
(defun semantic-gcc-fields (str)
"Convert GCC output STR into an alist of fields."
(let ((fields nil)
(lines (split-string str "\n"))
)
(dolist (L lines)
;; For any line, what do we do with it?
(cond ((or (string-match "Configured with\\(:\\)" L)
(string-match "\\(:\\)\\s-*[^ ]*configure " L))
(let* ((parts (substring L (match-end 1)))
(opts (split-string parts " " t))
)
(dolist (O (cdr opts))
(let* ((data (split-string O "="))
(sym (intern (car data)))
(val (car (cdr data))))
(push (cons sym val) fields)
))
))
((string-match "gcc[ -][vV]ersion" L)
(let* ((vline (substring L (match-end 0)))
(parts (split-string vline " ")))
(push (cons 'version (nth 1 parts)) fields)))
((string-match "Target: " L)
(let ((parts (split-string L " ")))
(push (cons 'target (nth 1 parts)) fields)))
))
fields))