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