src/Pure/PIDE/isabelle_markup.scala
changeset 45670 b84170538043
parent 45666 d83797ef0d2d
child 45674 eb65c9d17e2f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Pure/PIDE/isabelle_markup.scala	Tue Nov 29 19:49:36 2011 +0100
     1.3 @@ -0,0 +1,260 @@
     1.4 +/*  Title:      Pure/PIDE/isabelle_markup.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +Isabelle markup elements.
     1.8 +*/
     1.9 +
    1.10 +package isabelle
    1.11 +
    1.12 +
    1.13 +object Isabelle_Markup
    1.14 +{
    1.15 +  /* formal entities */
    1.16 +
    1.17 +  val BINDING = "binding"
    1.18 +  val ENTITY = "entity"
    1.19 +  val DEF = "def"
    1.20 +  val REF = "ref"
    1.21 +
    1.22 +  object Entity
    1.23 +  {
    1.24 +    def unapply(markup: Markup): Option[(String, String)] =
    1.25 +      markup match {
    1.26 +        case Markup(ENTITY, props @ Markup.Kind(kind)) =>
    1.27 +          props match {
    1.28 +            case Markup.Name(name) => Some(kind, name)
    1.29 +            case _ => None
    1.30 +          }
    1.31 +        case _ => None
    1.32 +      }
    1.33 +  }
    1.34 +
    1.35 +
    1.36 +  /* position */
    1.37 +
    1.38 +  val LINE = "line"
    1.39 +  val OFFSET = "offset"
    1.40 +  val END_OFFSET = "end_offset"
    1.41 +  val FILE = "file"
    1.42 +  val ID = "id"
    1.43 +
    1.44 +  val DEF_LINE = "def_line"
    1.45 +  val DEF_OFFSET = "def_offset"
    1.46 +  val DEF_END_OFFSET = "def_end_offset"
    1.47 +  val DEF_FILE = "def_file"
    1.48 +  val DEF_ID = "def_id"
    1.49 +
    1.50 +  val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)
    1.51 +  val POSITION = "position"
    1.52 +
    1.53 +
    1.54 +  /* path */
    1.55 +
    1.56 +  val PATH = "path"
    1.57 +
    1.58 +  object Path
    1.59 +  {
    1.60 +    def unapply(markup: Markup): Option[String] =
    1.61 +      markup match {
    1.62 +        case Markup(PATH, Markup.Name(name)) => Some(name)
    1.63 +        case _ => None
    1.64 +      }
    1.65 +  }
    1.66 +
    1.67 +
    1.68 +  /* pretty printing */
    1.69 +
    1.70 +  val Indent = new Properties.Int("indent")
    1.71 +  val BLOCK = "block"
    1.72 +  val Width = new Properties.Int("width")
    1.73 +  val BREAK = "break"
    1.74 +
    1.75 +
    1.76 +  /* hidden text */
    1.77 +
    1.78 +  val HIDDEN = "hidden"
    1.79 +
    1.80 +
    1.81 +  /* logical entities */
    1.82 +
    1.83 +  val CLASS = "class"
    1.84 +  val TYPE = "type"
    1.85 +  val FIXED = "fixed"
    1.86 +  val CONSTANT = "constant"
    1.87 +
    1.88 +  val DYNAMIC_FACT = "dynamic_fact"
    1.89 +
    1.90 +
    1.91 +  /* inner syntax */
    1.92 +
    1.93 +  val TFREE = "tfree"
    1.94 +  val TVAR = "tvar"
    1.95 +  val FREE = "free"
    1.96 +  val SKOLEM = "skolem"
    1.97 +  val BOUND = "bound"
    1.98 +  val VAR = "var"
    1.99 +  val NUM = "num"
   1.100 +  val FLOAT = "float"
   1.101 +  val XNUM = "xnum"
   1.102 +  val XSTR = "xstr"
   1.103 +  val LITERAL = "literal"
   1.104 +  val DELIMITER = "delimiter"
   1.105 +  val INNER_STRING = "inner_string"
   1.106 +  val INNER_COMMENT = "inner_comment"
   1.107 +
   1.108 +  val TOKEN_RANGE = "token_range"
   1.109 +
   1.110 +  val SORT = "sort"
   1.111 +  val TYP = "typ"
   1.112 +  val TERM = "term"
   1.113 +  val PROP = "prop"
   1.114 +
   1.115 +  val TYPING = "typing"
   1.116 +
   1.117 +  val ATTRIBUTE = "attribute"
   1.118 +  val METHOD = "method"
   1.119 +
   1.120 +
   1.121 +  /* embedded source text */
   1.122 +
   1.123 +  val ML_SOURCE = "ML_source"
   1.124 +  val DOC_SOURCE = "doc_source"
   1.125 +
   1.126 +  val ANTIQ = "antiq"
   1.127 +  val ML_ANTIQUOTATION = "ML antiquotation"
   1.128 +  val DOCUMENT_ANTIQUOTATION = "document antiquotation"
   1.129 +  val DOCUMENT_ANTIQUOTATION_OPTION = "document antiquotation option"
   1.130 +
   1.131 +
   1.132 +  /* ML syntax */
   1.133 +
   1.134 +  val ML_KEYWORD = "ML_keyword"
   1.135 +  val ML_DELIMITER = "ML_delimiter"
   1.136 +  val ML_TVAR = "ML_tvar"
   1.137 +  val ML_NUMERAL = "ML_numeral"
   1.138 +  val ML_CHAR = "ML_char"
   1.139 +  val ML_STRING = "ML_string"
   1.140 +  val ML_COMMENT = "ML_comment"
   1.141 +  val ML_MALFORMED = "ML_malformed"
   1.142 +
   1.143 +  val ML_DEF = "ML_def"
   1.144 +  val ML_OPEN = "ML_open"
   1.145 +  val ML_STRUCT = "ML_struct"
   1.146 +  val ML_TYPING = "ML_typing"
   1.147 +
   1.148 +
   1.149 +  /* outer syntax */
   1.150 +
   1.151 +  val KEYWORD_DECL = "keyword_decl"
   1.152 +  val COMMAND_DECL = "command_decl"
   1.153 +
   1.154 +  val KEYWORD = "keyword"
   1.155 +  val OPERATOR = "operator"
   1.156 +  val COMMAND = "command"
   1.157 +  val STRING = "string"
   1.158 +  val ALTSTRING = "altstring"
   1.159 +  val VERBATIM = "verbatim"
   1.160 +  val COMMENT = "comment"
   1.161 +  val CONTROL = "control"
   1.162 +  val MALFORMED = "malformed"
   1.163 +
   1.164 +  val COMMAND_SPAN = "command_span"
   1.165 +  val IGNORED_SPAN = "ignored_span"
   1.166 +  val MALFORMED_SPAN = "malformed_span"
   1.167 +
   1.168 +
   1.169 +  /* theory loader */
   1.170 +
   1.171 +  val LOADED_THEORY = "loaded_theory"
   1.172 +
   1.173 +
   1.174 +  /* toplevel */
   1.175 +
   1.176 +  val SUBGOALS = "subgoals"
   1.177 +  val PROOF_STATE = "proof_state"
   1.178 +
   1.179 +  val STATE = "state"
   1.180 +  val SUBGOAL = "subgoal"
   1.181 +  val SENDBACK = "sendback"
   1.182 +  val HILITE = "hilite"
   1.183 +
   1.184 +
   1.185 +  /* command status */
   1.186 +
   1.187 +  val TASK = "task"
   1.188 +
   1.189 +  val FORKED = "forked"
   1.190 +  val JOINED = "joined"
   1.191 +  val FAILED = "failed"
   1.192 +  val FINISHED = "finished"
   1.193 +
   1.194 +
   1.195 +  /* interactive documents */
   1.196 +
   1.197 +  val VERSION = "version"
   1.198 +  val ASSIGN = "assign"
   1.199 +
   1.200 +
   1.201 +  /* prover process */
   1.202 +
   1.203 +  val PROVER_COMMAND = "prover_command"
   1.204 +  val PROVER_ARG = "prover_arg"
   1.205 +
   1.206 +
   1.207 +  /* messages */
   1.208 +
   1.209 +  val Serial = new Properties.Long("serial")
   1.210 +
   1.211 +  val MESSAGE = "message"
   1.212 +
   1.213 +  val INIT = "init"
   1.214 +  val STATUS = "status"
   1.215 +  val REPORT = "report"
   1.216 +  val WRITELN = "writeln"
   1.217 +  val TRACING = "tracing"
   1.218 +  val WARNING = "warning"
   1.219 +  val ERROR = "error"
   1.220 +  val RAW = "raw"
   1.221 +  val SYSTEM = "system"
   1.222 +  val STDOUT = "stdout"
   1.223 +  val STDERR = "stderr"
   1.224 +  val EXIT = "exit"
   1.225 +
   1.226 +  val LEGACY = "legacy"
   1.227 +
   1.228 +  val NO_REPORT = "no_report"
   1.229 +
   1.230 +  val BAD = "bad"
   1.231 +
   1.232 +  val READY = "ready"
   1.233 +
   1.234 +
   1.235 +  /* raw message functions */
   1.236 +
   1.237 +  val FUNCTION = "function"
   1.238 +  val Function = new Properties.String(FUNCTION)
   1.239 +
   1.240 +  val Assign_Execs: Properties.T = List((FUNCTION, "assign_execs"))
   1.241 +  val Removed_Versions: Properties.T = List((FUNCTION, "removed_versions"))
   1.242 +
   1.243 +  val INVOKE_SCALA = "invoke_scala"
   1.244 +  object Invoke_Scala
   1.245 +  {
   1.246 +    def unapply(props: Properties.T): Option[(String, String)] =
   1.247 +      props match {
   1.248 +        case List((FUNCTION, INVOKE_SCALA), (Markup.NAME, name), (ID, id)) => Some((name, id))
   1.249 +        case _ => None
   1.250 +      }
   1.251 +  }
   1.252 +
   1.253 +  val CANCEL_SCALA = "cancel_scala"
   1.254 +  object Cancel_Scala
   1.255 +  {
   1.256 +    def unapply(props: Properties.T): Option[String] =
   1.257 +      props match {
   1.258 +        case List((FUNCTION, CANCEL_SCALA), (ID, id)) => Some(id)
   1.259 +        case _ => None
   1.260 +      }
   1.261 +  }
   1.262 +}
   1.263 +