Tree for a (non-restricted) keyword.
(jkeyword-tree keyword) → tree
This is used in grammar-jkeywordp-when-jkeywordp.
Function:
(defun jkeyword-tree (keyword) (declare (xargs :guard (jkeywordp keyword))) (let ((__function__ 'jkeyword-tree)) (declare (ignorable __function__)) (let ((keyword (mbe :logic (if (jkeywordp keyword) keyword (string=>unicode "_")) :exec keyword))) (abnf::tree-nonleaf (abnf::rulename "keyword") (list (list (abnf::tree-leafterm keyword)))))))
Theorem:
(defthm return-type-of-jkeyword-tree (b* ((tree (jkeyword-tree keyword))) (abnf-tree-with-root-p tree "keyword")) :rule-classes :rewrite)
Theorem:
(defthm tree->string-of-keyword-tree (equal (abnf::tree->string (jkeyword-tree keyword)) (if (jkeywordp keyword) keyword (string=>unicode "_"))))