Parse
(vl-parse-dpi-spec-string &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
SystemVerilog-2012:
dpi_spec_string ::= '"DPI-C"' | '"DPI"'
Function:
(defun vl-parse-dpi-spec-string-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-dpi-spec-string)) (declare (ignorable __function__)) (seq tokstream (when (vl-is-dpi-spec-string?) (tok := (vl-match)) (return (vl-interpret-dpi-spec-token tok))) (return-raw (vl-parse-error "Expected \"DPI\" or \"DPI-C\".")))))
Theorem:
(defthm vl-parse-dpi-spec-string-fails-gracefully (implies (mv-nth 0 (vl-parse-dpi-spec-string)) (not (mv-nth 1 (vl-parse-dpi-spec-string)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-dpi-spec-string (iff (vl-warning-p (mv-nth 0 (vl-parse-dpi-spec-string))) (mv-nth 0 (vl-parse-dpi-spec-string))))
Theorem:
(defthm vl-parse-dpi-spec-string-result (implies (and t) (equal (vl-dpispec-p (mv-nth 1 (vl-parse-dpi-spec-string))) (not (mv-nth 0 (vl-parse-dpi-spec-string))))))
Theorem:
(defthm vl-parse-dpi-spec-string-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-dpi-spec-string))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-dpi-spec-string))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-dpi-spec-string))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))