src/Pure/PIDE/markup.scala
author wenzelm
Wed Aug 27 14:54:32 2014 +0200 (2014-08-27 ago)
changeset 58048 aa6296d09e0e
parent 57598 e2305b9d1534
child 58464 5e7fc9974aba
permissions -rw-r--r--
more explicit Method.modifier with reported position;
wenzelm@45670
     1
/*  Title:      Pure/PIDE/markup.scala
wenzelm@45673
     2
    Module:     PIDE
wenzelm@27958
     3
    Author:     Makarius
wenzelm@27958
     4
wenzelm@56743
     5
Quasi-abstract markup elements.
wenzelm@27958
     6
*/
wenzelm@27958
     7
wenzelm@27958
     8
package isabelle
wenzelm@27958
     9
wenzelm@27970
    10
wenzelm@32450
    11
object Markup
wenzelm@32450
    12
{
wenzelm@56743
    13
  /* elements */
wenzelm@56743
    14
wenzelm@56743
    15
  object Elements
wenzelm@56743
    16
  {
wenzelm@56743
    17
    def apply(elems: Set[String]): Elements = new Elements(elems)
wenzelm@56743
    18
    def apply(elems: String*): Elements = apply(Set(elems: _*))
wenzelm@56743
    19
    val empty: Elements = apply()
wenzelm@56743
    20
    val full: Elements =
wenzelm@56743
    21
      new Elements(Set.empty)
wenzelm@56743
    22
      {
wenzelm@56743
    23
        override def apply(elem: String): Boolean = true
wenzelm@56743
    24
        override def toString: String = "Elements.full"
wenzelm@56743
    25
      }
wenzelm@56743
    26
  }
wenzelm@56743
    27
wenzelm@56743
    28
  sealed class Elements private[Markup](private val rep: Set[String])
wenzelm@56743
    29
  {
wenzelm@56743
    30
    def apply(elem: String): Boolean = rep.contains(elem)
wenzelm@56743
    31
    def + (elem: String): Elements = new Elements(rep + elem)
wenzelm@56743
    32
    def ++ (elems: Elements): Elements = new Elements(rep ++ elems.rep)
wenzelm@56743
    33
    override def toString: String = rep.mkString("Elements(", ",", ")")
wenzelm@56743
    34
  }
wenzelm@56743
    35
wenzelm@56743
    36
wenzelm@45666
    37
  /* properties */
wenzelm@29184
    38
wenzelm@29184
    39
  val NAME = "name"
wenzelm@43780
    40
  val Name = new Properties.String(NAME)
wenzelm@42136
    41
wenzelm@29184
    42
  val KIND = "kind"
wenzelm@43780
    43
  val Kind = new Properties.String(KIND)
wenzelm@29184
    44
wenzelm@52854
    45
  val INSTANCE = "instance"
wenzelm@52854
    46
  val Instance = new Properties.String(INSTANCE)
wenzelm@52854
    47
wenzelm@29184
    48
wenzelm@50201
    49
  /* basic markup */
wenzelm@29184
    50
wenzelm@45666
    51
  val Empty = Markup("", Nil)
wenzelm@45666
    52
  val Broken = Markup("broken", Nil)
wenzelm@50201
    53
wenzelm@55553
    54
  class Markup_String(val name: String, prop: String)
wenzelm@55553
    55
  {
wenzelm@55553
    56
    private val Prop = new Properties.String(prop)
wenzelm@55553
    57
wenzelm@55553
    58
    def apply(s: String): Markup = Markup(name, Prop(s))
wenzelm@55553
    59
    def unapply(markup: Markup): Option[String] =
wenzelm@55553
    60
      if (markup.name == name) Prop.unapply(markup.properties) else None
wenzelm@55553
    61
  }
wenzelm@55553
    62
wenzelm@55553
    63
  class Markup_Int(val name: String, prop: String)
wenzelm@55553
    64
  {
wenzelm@55553
    65
    private val Prop = new Properties.Int(prop)
wenzelm@55553
    66
wenzelm@55553
    67
    def apply(i: Int): Markup = Markup(name, Prop(i))
wenzelm@55553
    68
    def unapply(markup: Markup): Option[Int] =
wenzelm@55553
    69
      if (markup.name == name) Prop.unapply(markup.properties) else None
wenzelm@55553
    70
  }
wenzelm@55553
    71
wenzelm@50201
    72
wenzelm@50201
    73
  /* formal entities */
wenzelm@50201
    74
wenzelm@50201
    75
  val BINDING = "binding"
wenzelm@50201
    76
  val ENTITY = "entity"
wenzelm@50201
    77
  val DEF = "def"
wenzelm@50201
    78
  val REF = "ref"
wenzelm@50201
    79
wenzelm@50201
    80
  object Entity
wenzelm@50201
    81
  {
wenzelm@50201
    82
    def unapply(markup: Markup): Option[(String, String)] =
wenzelm@50201
    83
      markup match {
wenzelm@55553
    84
        case Markup(ENTITY, props) =>
wenzelm@55553
    85
          (props, props) match {
wenzelm@55615
    86
            case (Kind(kind), Name(name)) => Some((kind, name))
wenzelm@50201
    87
            case _ => None
wenzelm@50201
    88
          }
wenzelm@50201
    89
        case _ => None
wenzelm@50201
    90
      }
wenzelm@50201
    91
  }
wenzelm@50201
    92
wenzelm@50201
    93
wenzelm@55672
    94
  /* completion */
wenzelm@55672
    95
wenzelm@55672
    96
  val COMPLETION = "completion"
wenzelm@55914
    97
  val NO_COMPLETION = "no_completion"
wenzelm@55672
    98
wenzelm@55672
    99
wenzelm@50201
   100
  /* position */
wenzelm@50201
   101
wenzelm@50201
   102
  val LINE = "line"
wenzelm@50201
   103
  val OFFSET = "offset"
wenzelm@50201
   104
  val END_OFFSET = "end_offset"
wenzelm@50201
   105
  val FILE = "file"
wenzelm@50201
   106
  val ID = "id"
wenzelm@50201
   107
wenzelm@50201
   108
  val DEF_LINE = "def_line"
wenzelm@50201
   109
  val DEF_OFFSET = "def_offset"
wenzelm@50201
   110
  val DEF_END_OFFSET = "def_end_offset"
wenzelm@50201
   111
  val DEF_FILE = "def_file"
wenzelm@50201
   112
  val DEF_ID = "def_id"
wenzelm@50201
   113
wenzelm@50201
   114
  val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)
wenzelm@50201
   115
  val POSITION = "position"
wenzelm@50201
   116
wenzelm@50201
   117
wenzelm@55552
   118
  /* embedded languages */
wenzelm@55552
   119
wenzelm@55666
   120
  val Symbols = new Properties.Boolean("symbols")
wenzelm@55666
   121
  val Antiquotes = new Properties.Boolean("antiquotes")
wenzelm@55828
   122
  val Delimited = new Properties.Boolean("delimited")
wenzelm@55615
   123
wenzelm@55552
   124
  val LANGUAGE = "language"
wenzelm@55615
   125
  object Language
wenzelm@55615
   126
  {
wenzelm@55616
   127
    val ML = "ML"
wenzelm@56278
   128
    val SML = "SML"
wenzelm@56843
   129
    val PATH = "path"
wenzelm@55616
   130
    val UNKNOWN = "unknown"
wenzelm@55616
   131
wenzelm@55828
   132
    def unapply(markup: Markup): Option[(String, Boolean, Boolean, Boolean)] =
wenzelm@55615
   133
      markup match {
wenzelm@55615
   134
        case Markup(LANGUAGE, props) =>
wenzelm@55828
   135
          (props, props, props, props) match {
wenzelm@55828
   136
            case (Name(name), Symbols(symbols), Antiquotes(antiquotes), Delimited(delimited)) =>
wenzelm@55828
   137
              Some((name, symbols, antiquotes, delimited))
wenzelm@55615
   138
            case _ => None
wenzelm@55615
   139
          }
wenzelm@55615
   140
        case _ => None
wenzelm@55615
   141
      }
wenzelm@55615
   142
  }
wenzelm@55552
   143
wenzelm@55552
   144
wenzelm@54702
   145
  /* external resources */
wenzelm@50201
   146
wenzelm@50201
   147
  val PATH = "path"
wenzelm@55553
   148
  val Path = new Markup_String(PATH, NAME)
wenzelm@50201
   149
wenzelm@54702
   150
  val URL = "url"
wenzelm@55553
   151
  val Url = new Markup_String(URL, NAME)
wenzelm@54702
   152
wenzelm@50201
   153
wenzelm@50201
   154
  /* pretty printing */
wenzelm@50201
   155
wenzelm@55553
   156
  val Block = new Markup_Int("block", "indent")
wenzelm@55553
   157
  val Break = new Markup_Int("break", "width")
wenzelm@50201
   158
wenzelm@51570
   159
  val ITEM = "item"
wenzelm@51574
   160
  val BULLET = "bullet"
wenzelm@51570
   161
wenzelm@50201
   162
  val SEPARATOR = "separator"
wenzelm@50201
   163
wenzelm@50201
   164
wenzelm@56548
   165
  /* text properties */
wenzelm@56548
   166
wenzelm@56548
   167
  val WORDS = "words"
wenzelm@50201
   168
wenzelm@50201
   169
  val HIDDEN = "hidden"
wenzelm@50201
   170
wenzelm@50201
   171
wenzelm@58048
   172
  /* misc entities */
wenzelm@50201
   173
wenzelm@50201
   174
  val CLASS = "class"
wenzelm@50201
   175
  val TYPE_NAME = "type_name"
wenzelm@50201
   176
  val FIXED = "fixed"
wenzelm@53378
   177
  val CASE = "case"
wenzelm@50201
   178
  val CONSTANT = "constant"
wenzelm@50201
   179
  val DYNAMIC_FACT = "dynamic_fact"
wenzelm@50201
   180
wenzelm@50201
   181
wenzelm@50201
   182
  /* inner syntax */
wenzelm@50201
   183
wenzelm@50201
   184
  val TFREE = "tfree"
wenzelm@50201
   185
  val TVAR = "tvar"
wenzelm@50201
   186
  val FREE = "free"
wenzelm@50201
   187
  val SKOLEM = "skolem"
wenzelm@50201
   188
  val BOUND = "bound"
wenzelm@50201
   189
  val VAR = "var"
wenzelm@50201
   190
  val NUMERAL = "numeral"
wenzelm@50201
   191
  val LITERAL = "literal"
wenzelm@50201
   192
  val DELIMITER = "delimiter"
wenzelm@50201
   193
  val INNER_STRING = "inner_string"
wenzelm@55033
   194
  val INNER_CARTOUCHE = "inner_cartouche"
wenzelm@50201
   195
  val INNER_COMMENT = "inner_comment"
wenzelm@50201
   196
wenzelm@50201
   197
  val TOKEN_RANGE = "token_range"
wenzelm@50201
   198
wenzelm@50201
   199
  val SORTING = "sorting"
wenzelm@50201
   200
  val TYPING = "typing"
wenzelm@50201
   201
wenzelm@50201
   202
  val ATTRIBUTE = "attribute"
wenzelm@50201
   203
  val METHOD = "method"
wenzelm@50201
   204
wenzelm@50201
   205
wenzelm@55552
   206
  /* antiquotations */
wenzelm@50201
   207
wenzelm@55526
   208
  val ANTIQUOTED = "antiquoted"
wenzelm@55526
   209
  val ANTIQUOTE = "antiquote"
wenzelm@55526
   210
wenzelm@50201
   211
  val ML_ANTIQUOTATION = "ML_antiquotation"
wenzelm@50201
   212
  val DOCUMENT_ANTIQUOTATION = "document_antiquotation"
wenzelm@50201
   213
  val DOCUMENT_ANTIQUOTATION_OPTION = "document_antiquotation_option"
wenzelm@50201
   214
wenzelm@50201
   215
wenzelm@50201
   216
  /* text structure */
wenzelm@50201
   217
wenzelm@50201
   218
  val PARAGRAPH = "paragraph"
wenzelm@50545
   219
  val TEXT_FOLD = "text_fold"
wenzelm@50201
   220
wenzelm@50201
   221
wenzelm@50201
   222
  /* ML syntax */
wenzelm@50201
   223
wenzelm@55505
   224
  val ML_KEYWORD1 = "ML_keyword1"
wenzelm@55505
   225
  val ML_KEYWORD2 = "ML_keyword2"
wenzelm@55505
   226
  val ML_KEYWORD3 = "ML_keyword3"
wenzelm@50201
   227
  val ML_DELIMITER = "ML_delimiter"
wenzelm@50201
   228
  val ML_TVAR = "ML_tvar"
wenzelm@50201
   229
  val ML_NUMERAL = "ML_numeral"
wenzelm@50201
   230
  val ML_CHAR = "ML_char"
wenzelm@50201
   231
  val ML_STRING = "ML_string"
wenzelm@50201
   232
  val ML_COMMENT = "ML_comment"
wenzelm@56278
   233
  val SML_STRING = "SML_string"
wenzelm@56278
   234
  val SML_COMMENT = "SML_comment"
wenzelm@50201
   235
wenzelm@50201
   236
  val ML_DEF = "ML_def"
wenzelm@50201
   237
  val ML_OPEN = "ML_open"
wenzelm@55837
   238
  val ML_STRUCTURE = "ML_structure"
wenzelm@50201
   239
  val ML_TYPING = "ML_typing"
wenzelm@50201
   240
wenzelm@50201
   241
wenzelm@50201
   242
  /* outer syntax */
wenzelm@50201
   243
wenzelm@55744
   244
  val COMMAND = "command"
wenzelm@55744
   245
  val KEYWORD1 = "keyword1"
wenzelm@55744
   246
  val KEYWORD2 = "keyword2"
wenzelm@55765
   247
  val KEYWORD3 = "keyword3"
wenzelm@55919
   248
  val QUASI_KEYWORD = "quasi_keyword"
wenzelm@56202
   249
  val IMPROPER = "improper"
wenzelm@50201
   250
  val OPERATOR = "operator"
wenzelm@50201
   251
  val STRING = "string"
wenzelm@50201
   252
  val ALTSTRING = "altstring"
wenzelm@50201
   253
  val VERBATIM = "verbatim"
wenzelm@55033
   254
  val CARTOUCHE = "cartouche"
wenzelm@50201
   255
  val COMMENT = "comment"
wenzelm@50201
   256
  val CONTROL = "control"
wenzelm@50201
   257
wenzelm@50201
   258
wenzelm@50201
   259
  /* timing */
wenzelm@50201
   260
wenzelm@50781
   261
  val Elapsed = new Properties.Double("elapsed")
wenzelm@50781
   262
  val CPU = new Properties.Double("cpu")
wenzelm@50781
   263
  val GC = new Properties.Double("gc")
wenzelm@50781
   264
wenzelm@50781
   265
  object Timing_Properties
wenzelm@50781
   266
  {
wenzelm@50781
   267
    def apply(timing: isabelle.Timing): Properties.T =
wenzelm@50781
   268
      Elapsed(timing.elapsed.seconds) ::: CPU(timing.cpu.seconds) ::: GC(timing.gc.seconds)
wenzelm@51662
   269
wenzelm@50781
   270
    def unapply(props: Properties.T): Option[isabelle.Timing] =
wenzelm@50781
   271
      (props, props, props) match {
wenzelm@50781
   272
        case (Elapsed(elapsed), CPU(cpu), GC(gc)) =>
wenzelm@50781
   273
          Some(new isabelle.Timing(Time.seconds(elapsed), Time.seconds(cpu), Time.seconds(gc)))
wenzelm@50781
   274
        case _ => None
wenzelm@50781
   275
      }
wenzelm@50781
   276
  }
wenzelm@50781
   277
wenzelm@50201
   278
  val TIMING = "timing"
wenzelm@50201
   279
wenzelm@50201
   280
  object Timing
wenzelm@50201
   281
  {
wenzelm@50781
   282
    def apply(timing: isabelle.Timing): Markup = Markup(TIMING, Timing_Properties(timing))
wenzelm@51662
   283
wenzelm@50201
   284
    def unapply(markup: Markup): Option[isabelle.Timing] =
wenzelm@50201
   285
      markup match {
wenzelm@50781
   286
        case Markup(TIMING, Timing_Properties(timing)) => Some(timing)
wenzelm@50201
   287
        case _ => None
wenzelm@50201
   288
      }
wenzelm@50201
   289
  }
wenzelm@50201
   290
wenzelm@50201
   291
wenzelm@51662
   292
  /* command timing */
wenzelm@51662
   293
wenzelm@51818
   294
  val COMMAND_TIMING = "command_timing"
wenzelm@51662
   295
wenzelm@51662
   296
wenzelm@50201
   297
  /* toplevel */
wenzelm@50201
   298
wenzelm@50201
   299
  val SUBGOALS = "subgoals"
wenzelm@50201
   300
  val PROOF_STATE = "proof_state"
wenzelm@50201
   301
wenzelm@50201
   302
  val STATE = "state"
wenzelm@50543
   303
  val GOAL = "goal"
wenzelm@50201
   304
  val SUBGOAL = "subgoal"
wenzelm@50215
   305
wenzelm@50450
   306
wenzelm@50201
   307
  /* command status */
wenzelm@50201
   308
wenzelm@50201
   309
  val TASK = "task"
wenzelm@50201
   310
wenzelm@50201
   311
  val ACCEPTED = "accepted"
wenzelm@50201
   312
  val FORKED = "forked"
wenzelm@50201
   313
  val JOINED = "joined"
wenzelm@50201
   314
  val RUNNING = "running"
wenzelm@50201
   315
  val FINISHED = "finished"
wenzelm@50201
   316
  val FAILED = "failed"
wenzelm@50201
   317
wenzelm@50201
   318
wenzelm@50201
   319
  /* interactive documents */
wenzelm@50201
   320
wenzelm@50201
   321
  val VERSION = "version"
wenzelm@50201
   322
  val ASSIGN = "assign"
wenzelm@50201
   323
wenzelm@50201
   324
wenzelm@50201
   325
  /* prover process */
wenzelm@50201
   326
wenzelm@50201
   327
  val PROVER_COMMAND = "prover_command"
wenzelm@50201
   328
  val PROVER_ARG = "prover_arg"
wenzelm@50201
   329
wenzelm@50201
   330
wenzelm@50201
   331
  /* messages */
wenzelm@50201
   332
lars@55316
   333
  val SERIAL = "serial"
lars@55316
   334
  val Serial = new Properties.Long(SERIAL)
wenzelm@50201
   335
wenzelm@50201
   336
  val MESSAGE = "message"
wenzelm@50201
   337
wenzelm@50201
   338
  val INIT = "init"
wenzelm@50201
   339
  val STATUS = "status"
wenzelm@50201
   340
  val REPORT = "report"
wenzelm@50500
   341
  val RESULT = "result"
wenzelm@50201
   342
  val WRITELN = "writeln"
wenzelm@50201
   343
  val TRACING = "tracing"
wenzelm@50201
   344
  val WARNING = "warning"
wenzelm@50201
   345
  val ERROR = "error"
wenzelm@50201
   346
  val PROTOCOL = "protocol"
wenzelm@50201
   347
  val SYSTEM = "system"
wenzelm@50201
   348
  val STDOUT = "stdout"
wenzelm@50201
   349
  val STDERR = "stderr"
wenzelm@50201
   350
  val EXIT = "exit"
wenzelm@50201
   351
wenzelm@50201
   352
  val WRITELN_MESSAGE = "writeln_message"
wenzelm@50201
   353
  val TRACING_MESSAGE = "tracing_message"
wenzelm@50201
   354
  val WARNING_MESSAGE = "warning_message"
wenzelm@50201
   355
  val ERROR_MESSAGE = "error_message"
wenzelm@50201
   356
wenzelm@52876
   357
  val messages =
wenzelm@50201
   358
    Map(WRITELN -> WRITELN_MESSAGE, TRACING -> TRACING_MESSAGE,
wenzelm@52876
   359
        WARNING -> WARNING_MESSAGE, ERROR -> ERROR_MESSAGE)
wenzelm@52876
   360
  val message: String => String = messages.withDefault((s: String) => s)
wenzelm@50201
   361
wenzelm@50201
   362
  val Return_Code = new Properties.Int("return_code")
wenzelm@50201
   363
wenzelm@50201
   364
  val LEGACY = "legacy"
wenzelm@50201
   365
wenzelm@50201
   366
  val NO_REPORT = "no_report"
wenzelm@50201
   367
wenzelm@50201
   368
  val BAD = "bad"
wenzelm@50201
   369
wenzelm@50500
   370
  val INTENSIFY = "intensify"
wenzelm@52643
   371
  val INFORMATION = "information"
wenzelm@50500
   372
wenzelm@50500
   373
wenzelm@50500
   374
  /* active areas */
wenzelm@50500
   375
wenzelm@50715
   376
  val BROWSER = "browser"
wenzelm@50500
   377
  val GRAPHVIEW = "graphview"
wenzelm@50500
   378
wenzelm@50500
   379
  val SENDBACK = "sendback"
wenzelm@50500
   380
  val PADDING = "padding"
wenzelm@52697
   381
  val PADDING_LINE = (PADDING, "line")
wenzelm@52697
   382
  val PADDING_COMMAND = (PADDING, "command")
wenzelm@50500
   383
wenzelm@50500
   384
  val DIALOG = "dialog"
wenzelm@50503
   385
  val Result = new Properties.String(RESULT)
wenzelm@50500
   386
wenzelm@50201
   387
wenzelm@50201
   388
  /* protocol message functions */
wenzelm@50201
   389
wenzelm@50201
   390
  val FUNCTION = "function"
wenzelm@50201
   391
  val Function = new Properties.String(FUNCTION)
wenzelm@50201
   392
wenzelm@52563
   393
  val Assign_Update: Properties.T = List((FUNCTION, "assign_update"))
wenzelm@50201
   394
  val Removed_Versions: Properties.T = List((FUNCTION, "removed_versions"))
wenzelm@50201
   395
wenzelm@52111
   396
  object Protocol_Handler
wenzelm@52111
   397
  {
wenzelm@52111
   398
    def unapply(props: Properties.T): Option[(String)] =
wenzelm@52111
   399
      props match {
wenzelm@52111
   400
        case List((FUNCTION, "protocol_handler"), (NAME, name)) => Some(name)
wenzelm@52111
   401
        case _ => None
wenzelm@52111
   402
      }
wenzelm@52111
   403
  }
wenzelm@52111
   404
wenzelm@52111
   405
  val INVOKE_SCALA = "invoke_scala"
wenzelm@50201
   406
  object Invoke_Scala
wenzelm@50201
   407
  {
wenzelm@50201
   408
    def unapply(props: Properties.T): Option[(String, String)] =
wenzelm@50201
   409
      props match {
wenzelm@52111
   410
        case List((FUNCTION, INVOKE_SCALA), (NAME, name), (ID, id)) => Some((name, id))
wenzelm@50201
   411
        case _ => None
wenzelm@50201
   412
      }
wenzelm@50201
   413
  }
wenzelm@52111
   414
wenzelm@52111
   415
  val CANCEL_SCALA = "cancel_scala"
wenzelm@50201
   416
  object Cancel_Scala
wenzelm@50201
   417
  {
wenzelm@50201
   418
    def unapply(props: Properties.T): Option[String] =
wenzelm@50201
   419
      props match {
wenzelm@52111
   420
        case List((FUNCTION, CANCEL_SCALA), (ID, id)) => Some(id)
wenzelm@50201
   421
        case _ => None
wenzelm@50201
   422
      }
wenzelm@50201
   423
  }
wenzelm@50255
   424
wenzelm@50255
   425
  object ML_Statistics
wenzelm@50255
   426
  {
wenzelm@50255
   427
    def unapply(props: Properties.T): Option[Properties.T] =
wenzelm@50255
   428
      props match {
wenzelm@50255
   429
        case (FUNCTION, "ML_statistics") :: stats => Some(stats)
wenzelm@50255
   430
        case _ => None
wenzelm@50255
   431
      }
wenzelm@50255
   432
  }
wenzelm@50975
   433
wenzelm@50975
   434
  object Task_Statistics
wenzelm@50975
   435
  {
wenzelm@50975
   436
    def unapply(props: Properties.T): Option[Properties.T] =
wenzelm@50975
   437
      props match {
wenzelm@50975
   438
        case (FUNCTION, "task_statistics") :: stats => Some(stats)
wenzelm@50975
   439
        case _ => None
wenzelm@50975
   440
      }
wenzelm@50975
   441
  }
lars@55316
   442
wenzelm@56616
   443
  object Loading_Theory
wenzelm@56616
   444
  {
wenzelm@56616
   445
    def unapply(props: Properties.T): Option[String] =
wenzelm@56616
   446
      props match {
wenzelm@56616
   447
        case List((FUNCTION, "loading_theory"), (NAME, name)) => Some(name)
wenzelm@56616
   448
        case _ => None
wenzelm@56616
   449
      }
wenzelm@56616
   450
  }
wenzelm@56616
   451
wenzelm@56616
   452
  object Use_Theories_Result
wenzelm@56616
   453
  {
wenzelm@56616
   454
    def unapply(props: Properties.T): Option[(String, Boolean)] =
wenzelm@56616
   455
      props match {
wenzelm@56616
   456
        case List((FUNCTION, "use_theories_result"),
wenzelm@56616
   457
          ("id", id), ("ok", Properties.Value.Boolean(ok))) => Some((id, ok))
wenzelm@56616
   458
        case _ => None
wenzelm@56616
   459
      }
wenzelm@56616
   460
  }
wenzelm@56616
   461
wenzelm@56864
   462
  val PRINT_OPERATIONS = "print_operations"
wenzelm@56864
   463
wenzelm@55555
   464
lars@55316
   465
  /* simplifier trace */
lars@55316
   466
wenzelm@57597
   467
  val SIMP_TRACE_PANEL = "simp_trace_panel"
lars@55316
   468
wenzelm@55555
   469
  val SIMP_TRACE_LOG = "simp_trace_log"
wenzelm@55555
   470
  val SIMP_TRACE_STEP = "simp_trace_step"
wenzelm@55555
   471
  val SIMP_TRACE_RECURSE = "simp_trace_recurse"
wenzelm@55555
   472
  val SIMP_TRACE_HINT = "simp_trace_hint"
wenzelm@55555
   473
  val SIMP_TRACE_IGNORE = "simp_trace_ignore"
lars@55316
   474
wenzelm@55555
   475
  val SIMP_TRACE_CANCEL = "simp_trace_cancel"
wenzelm@55555
   476
  object Simp_Trace_Cancel
lars@55316
   477
  {
lars@55316
   478
    def unapply(props: Properties.T): Option[Long] =
lars@55316
   479
      props match {
wenzelm@55555
   480
        case (FUNCTION, SIMP_TRACE_CANCEL) :: Serial(i) => Some(i)
lars@55316
   481
        case _ => None
lars@55316
   482
      }
lars@55316
   483
  }
wenzelm@45666
   484
}
wenzelm@43721
   485
wenzelm@43721
   486
wenzelm@45666
   487
sealed case class Markup(name: String, properties: Properties.T)
wenzelm@43748
   488