From d354c17e240a5adde788e326e0a67363fee5b1e7 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 25 Aug 2010 15:09:34 +0000 Subject: Renamed file obsolete/plastic/plastic-syntax.el, formerly plastic/plastic-syntax.el --- obsolete/plastic/plastic-syntax.el | 119 +++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 obsolete/plastic/plastic-syntax.el (limited to 'obsolete') diff --git a/obsolete/plastic/plastic-syntax.el b/obsolete/plastic/plastic-syntax.el new file mode 100644 index 00000000..c259a3b7 --- /dev/null +++ b/obsolete/plastic/plastic-syntax.el @@ -0,0 +1,119 @@ +;; plastic-syntax.el - Syntax of Plastic +;; Author: Paul Callaghan +;; Maintainer: +;; plastic-syntax.el,v 6.0 2001/09/03 12:11:56 da Exp + +;; adapted from the following, by Paul Callaghan +;; ;; lego-syntax.el Syntax of LEGO +;; ;; Copyright (C) 1994 - 1998 LFCS Edinburgh. +;; ;; Author: Thomas Kleymann and Dilip Sequeira +;; ;; Maintainer: Paul Callaghan +;; ;; lego-syntax.el,v 2.10 1998/11/06 16:18:55 tms Exp + + +(require 'proof-syntax) + +;; ----- keywords for font-lock. + +(defconst plastic-keywords-goal '("$?Goal")) + +(defconst plastic-keywords-save '("$?Save" "SaveFrozen" "SaveUnfrozen")) + +(defconst plastic-commands + (append plastic-keywords-goal plastic-keywords-save + '("allE" "allI" "andE" "andI" "Assumption" "Claim" "Coercion" + "Cut" "Discharge" "DischargeKeep" + "echo" "exE" "exI" "Expand" "ExpAll" + "ExportState" "Equiv" "For" "Freeze" "Hnf" "Immed" + "impE" "impI" "Induction" "Inductive" + "Invert" "Init" "intros" "Intros" "Module" "Next" + "Normal" "notE" "notI" "orE" "orIL" "orIR" "qnify" "Qnify" + "Qrepl" "Record" "Refine" "Repeat" "Return" "ReturnAll" + "Try" "Unfreeze")) + "Subset of Plastic keywords and tacticals which are terminated by a \?;") + +(defconst plastic-keywords + (append plastic-commands + '("Constructors" "Double" "ElimOver" "Fields" "Import" "Inversion" + "NoReductions" "Parameters" "Relation" "Theorems"))) + +(defconst plastic-tacticals '("Then" "Else" "Try" "Repeat" "For")) + +;; ----- regular expressions for font-lock +(defconst plastic-error-regexp "^\\(FAIL\\)" + "A regular expression indicating that the Plastic process has identified an error.") + +(defvar plastic-id proof-id) + +(defvar plastic-ids (concat plastic-id "\\(\\s *,\\s *" plastic-id "\\)*") + "*For font-lock, we treat \",\" separated identifiers as one identifier + and refontify commata using \\{plastic-fixup-change}.") + +(defconst plastic-arg-list-regexp "\\s *\\(\\[[^]]+\\]\\s *\\)*" + "Regular expression maching a list of arguments.") + +(defun plastic-decl-defn-regexp (char) + (concat "\\[\\s *\\(" plastic-ids "\\)" plastic-arg-list-regexp char)) +; Examples +; ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +; [ sort = +; [ sort [n:nat] = +; [ sort [abbrev=...][n:nat] = + +(defconst plastic-definiendum-alternative-regexp + (concat "\\(" plastic-id "\\)" plastic-arg-list-regexp "\\s * ==") + "Regular expression where the first match identifies the definiendum.") + +(defvar plastic-font-lock-terms + (list + + ; lambda binders + (list (plastic-decl-defn-regexp "[:|?]") 1 + 'proof-declaration-name-face) + + ; let binders + (list plastic-definiendum-alternative-regexp 1 'font-lock-function-name-face) + (list (plastic-decl-defn-regexp "=") 1 'font-lock-function-name-face) + + ; Pi and Sigma binders + (list (concat "[{<]\\s *\\(" plastic-ids "\\)") 1 + 'proof-declaration-name-face) + + ;; Kinds + (cons (concat "\\\\|\\