src/Pure/PIDE/isabelle_markup.scala
author wenzelm
Tue Nov 29 19:49:36 2011 +0100 (2011-11-29 ago)
changeset 45670 b84170538043
parent 45666 src/Pure/General/isabelle_markup.scala@d83797ef0d2d
child 45674 eb65c9d17e2f
permissions -rw-r--r--
rearranged files;
wenzelm@45670
     1
/*  Title:      Pure/PIDE/isabelle_markup.scala
wenzelm@27958
     2
    Author:     Makarius
wenzelm@27958
     3
wenzelm@45666
     4
Isabelle markup elements.
wenzelm@27958
     5
*/
wenzelm@27958
     6
wenzelm@27958
     7
package isabelle
wenzelm@27958
     8
wenzelm@27970
     9
wenzelm@45666
    10
object Isabelle_Markup
wenzelm@32450
    11
{
wenzelm@33088
    12
  /* formal entities */
wenzelm@33088
    13
wenzelm@38887
    14
  val BINDING = "binding"
wenzelm@33088
    15
  val ENTITY = "entity"
wenzelm@33088
    16
  val DEF = "def"
wenzelm@33088
    17
  val REF = "ref"
wenzelm@33088
    18
wenzelm@42202
    19
  object Entity
wenzelm@42202
    20
  {
wenzelm@42202
    21
    def unapply(markup: Markup): Option[(String, String)] =
wenzelm@42202
    22
      markup match {
wenzelm@45666
    23
        case Markup(ENTITY, props @ Markup.Kind(kind)) =>
wenzelm@42202
    24
          props match {
wenzelm@45666
    25
            case Markup.Name(name) => Some(kind, name)
wenzelm@42202
    26
            case _ => None
wenzelm@42202
    27
          }
wenzelm@42202
    28
        case _ => None
wenzelm@42202
    29
      }
wenzelm@42202
    30
  }
wenzelm@42202
    31
wenzelm@33088
    32
wenzelm@27970
    33
  /* position */
wenzelm@27970
    34
wenzelm@27970
    35
  val LINE = "line"
wenzelm@27970
    36
  val OFFSET = "offset"
wenzelm@27970
    37
  val END_OFFSET = "end_offset"
wenzelm@27970
    38
  val FILE = "file"
wenzelm@27970
    39
  val ID = "id"
wenzelm@27970
    40
wenzelm@42327
    41
  val DEF_LINE = "def_line"
wenzelm@42327
    42
  val DEF_OFFSET = "def_offset"
wenzelm@42327
    43
  val DEF_END_OFFSET = "def_end_offset"
wenzelm@42327
    44
  val DEF_FILE = "def_file"
wenzelm@42327
    45
  val DEF_ID = "def_id"
wenzelm@42327
    46
wenzelm@43710
    47
  val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)
wenzelm@43593
    48
  val POSITION = "position"
wenzelm@29205
    49
wenzelm@43593
    50
wenzelm@43593
    51
  /* path */
wenzelm@43593
    52
wenzelm@43593
    53
  val PATH = "path"
wenzelm@43593
    54
wenzelm@43593
    55
  object Path
wenzelm@43593
    56
  {
wenzelm@43593
    57
    def unapply(markup: Markup): Option[String] =
wenzelm@43593
    58
      markup match {
wenzelm@45666
    59
        case Markup(PATH, Markup.Name(name)) => Some(name)
wenzelm@43593
    60
        case _ => None
wenzelm@43593
    61
      }
wenzelm@43593
    62
  }
wenzelm@29184
    63
wenzelm@29184
    64
wenzelm@36683
    65
  /* pretty printing */
wenzelm@36683
    66
wenzelm@43780
    67
  val Indent = new Properties.Int("indent")
wenzelm@36683
    68
  val BLOCK = "block"
wenzelm@43780
    69
  val Width = new Properties.Int("width")
wenzelm@36683
    70
  val BREAK = "break"
wenzelm@36683
    71
wenzelm@36683
    72
wenzelm@33985
    73
  /* hidden text */
wenzelm@33985
    74
wenzelm@33985
    75
  val HIDDEN = "hidden"
wenzelm@33985
    76
wenzelm@33985
    77
wenzelm@29184
    78
  /* logical entities */
wenzelm@29184
    79
wenzelm@43551
    80
  val CLASS = "class"
wenzelm@43552
    81
  val TYPE = "type"
wenzelm@29184
    82
  val FIXED = "fixed"
wenzelm@43552
    83
  val CONSTANT = "constant"
wenzelm@43552
    84
wenzelm@29184
    85
  val DYNAMIC_FACT = "dynamic_fact"
wenzelm@29184
    86
wenzelm@29184
    87
wenzelm@29184
    88
  /* inner syntax */
wenzelm@29184
    89
wenzelm@29184
    90
  val TFREE = "tfree"
wenzelm@29184
    91
  val TVAR = "tvar"
wenzelm@29184
    92
  val FREE = "free"
wenzelm@29184
    93
  val SKOLEM = "skolem"
wenzelm@29184
    94
  val BOUND = "bound"
wenzelm@29184
    95
  val VAR = "var"
wenzelm@29184
    96
  val NUM = "num"
wenzelm@29184
    97
  val FLOAT = "float"
wenzelm@29184
    98
  val XNUM = "xnum"
wenzelm@29184
    99
  val XSTR = "xstr"
wenzelm@29184
   100
  val LITERAL = "literal"
wenzelm@43432
   101
  val DELIMITER = "delimiter"
wenzelm@43386
   102
  val INNER_STRING = "inner_string"
wenzelm@29184
   103
  val INNER_COMMENT = "inner_comment"
wenzelm@29184
   104
wenzelm@39168
   105
  val TOKEN_RANGE = "token_range"
wenzelm@39168
   106
wenzelm@29184
   107
  val SORT = "sort"
wenzelm@29184
   108
  val TYP = "typ"
wenzelm@29184
   109
  val TERM = "term"
wenzelm@29184
   110
  val PROP = "prop"
wenzelm@29184
   111
wenzelm@45445
   112
  val TYPING = "typing"
wenzelm@45445
   113
wenzelm@29184
   114
  val ATTRIBUTE = "attribute"
wenzelm@29184
   115
  val METHOD = "method"
wenzelm@29184
   116
wenzelm@29184
   117
wenzelm@29184
   118
  /* embedded source text */
wenzelm@29184
   119
wenzelm@29184
   120
  val ML_SOURCE = "ML_source"
wenzelm@29184
   121
  val DOC_SOURCE = "doc_source"
wenzelm@29184
   122
wenzelm@29184
   123
  val ANTIQ = "antiq"
wenzelm@43560
   124
  val ML_ANTIQUOTATION = "ML antiquotation"
wenzelm@43564
   125
  val DOCUMENT_ANTIQUOTATION = "document antiquotation"
wenzelm@43564
   126
  val DOCUMENT_ANTIQUOTATION_OPTION = "document antiquotation option"
wenzelm@29184
   127
wenzelm@29184
   128
wenzelm@30615
   129
  /* ML syntax */
wenzelm@30615
   130
wenzelm@30615
   131
  val ML_KEYWORD = "ML_keyword"
wenzelm@37195
   132
  val ML_DELIMITER = "ML_delimiter"
wenzelm@30615
   133
  val ML_TVAR = "ML_tvar"
wenzelm@30615
   134
  val ML_NUMERAL = "ML_numeral"
wenzelm@30615
   135
  val ML_CHAR = "ML_char"
wenzelm@30615
   136
  val ML_STRING = "ML_string"
wenzelm@30615
   137
  val ML_COMMENT = "ML_comment"
wenzelm@30615
   138
  val ML_MALFORMED = "ML_malformed"
wenzelm@30615
   139
wenzelm@30702
   140
  val ML_DEF = "ML_def"
wenzelm@31472
   141
  val ML_OPEN = "ML_open"
wenzelm@31472
   142
  val ML_STRUCT = "ML_struct"
wenzelm@30702
   143
  val ML_TYPING = "ML_typing"
wenzelm@30702
   144
wenzelm@30615
   145
wenzelm@29184
   146
  /* outer syntax */
wenzelm@29184
   147
wenzelm@29184
   148
  val KEYWORD_DECL = "keyword_decl"
wenzelm@29184
   149
  val COMMAND_DECL = "command_decl"
wenzelm@29184
   150
wenzelm@29184
   151
  val KEYWORD = "keyword"
wenzelm@37194
   152
  val OPERATOR = "operator"
wenzelm@29184
   153
  val COMMAND = "command"
wenzelm@29184
   154
  val STRING = "string"
wenzelm@29184
   155
  val ALTSTRING = "altstring"
wenzelm@29184
   156
  val VERBATIM = "verbatim"
wenzelm@29184
   157
  val COMMENT = "comment"
wenzelm@29184
   158
  val CONTROL = "control"
wenzelm@29184
   159
  val MALFORMED = "malformed"
wenzelm@29184
   160
wenzelm@29185
   161
  val COMMAND_SPAN = "command_span"
wenzelm@29185
   162
  val IGNORED_SPAN = "ignored_span"
wenzelm@29185
   163
  val MALFORMED_SPAN = "malformed_span"
wenzelm@29185
   164
wenzelm@29184
   165
wenzelm@43673
   166
  /* theory loader */
wenzelm@43673
   167
wenzelm@43673
   168
  val LOADED_THEORY = "loaded_theory"
wenzelm@43673
   169
wenzelm@43673
   170
wenzelm@29184
   171
  /* toplevel */
wenzelm@29184
   172
wenzelm@38721
   173
  val SUBGOALS = "subgoals"
wenzelm@38721
   174
  val PROOF_STATE = "proof_state"
wenzelm@38721
   175
wenzelm@29184
   176
  val STATE = "state"
wenzelm@29184
   177
  val SUBGOAL = "subgoal"
wenzelm@29184
   178
  val SENDBACK = "sendback"
wenzelm@29184
   179
  val HILITE = "hilite"
wenzelm@29184
   180
wenzelm@29184
   181
wenzelm@29184
   182
  /* command status */
wenzelm@29184
   183
wenzelm@29417
   184
  val TASK = "task"
wenzelm@29417
   185
wenzelm@37186
   186
  val FORKED = "forked"
wenzelm@37186
   187
  val JOINED = "joined"
wenzelm@29184
   188
  val FAILED = "failed"
wenzelm@29184
   189
  val FINISHED = "finished"
wenzelm@29488
   190
wenzelm@29488
   191
wenzelm@29488
   192
  /* interactive documents */
wenzelm@29488
   193
wenzelm@38414
   194
  val VERSION = "version"
wenzelm@38414
   195
  val ASSIGN = "assign"
wenzelm@29184
   196
wenzelm@27970
   197
wenzelm@43721
   198
  /* prover process */
wenzelm@43721
   199
wenzelm@43721
   200
  val PROVER_COMMAND = "prover_command"
wenzelm@43721
   201
  val PROVER_ARG = "prover_arg"
wenzelm@43721
   202
wenzelm@43721
   203
wenzelm@27970
   204
  /* messages */
wenzelm@27970
   205
wenzelm@43780
   206
  val Serial = new Properties.Long("serial")
wenzelm@27970
   207
wenzelm@29195
   208
  val MESSAGE = "message"
wenzelm@29522
   209
wenzelm@29522
   210
  val INIT = "init"
wenzelm@29522
   211
  val STATUS = "status"
wenzelm@39525
   212
  val REPORT = "report"
wenzelm@29522
   213
  val WRITELN = "writeln"
wenzelm@29522
   214
  val TRACING = "tracing"
wenzelm@29522
   215
  val WARNING = "warning"
wenzelm@29522
   216
  val ERROR = "error"
wenzelm@43746
   217
  val RAW = "raw"
wenzelm@29522
   218
  val SYSTEM = "system"
wenzelm@29522
   219
  val STDOUT = "stdout"
wenzelm@45633
   220
  val STDERR = "stderr"
wenzelm@29522
   221
  val EXIT = "exit"
wenzelm@29195
   222
wenzelm@44549
   223
  val LEGACY = "legacy"
wenzelm@44549
   224
wenzelm@39439
   225
  val NO_REPORT = "no_report"
wenzelm@39439
   226
wenzelm@39171
   227
  val BAD = "bad"
wenzelm@39171
   228
wenzelm@39591
   229
  val READY = "ready"
wenzelm@31384
   230
wenzelm@27970
   231
wenzelm@43748
   232
  /* raw message functions */
wenzelm@43748
   233
wenzelm@43748
   234
  val FUNCTION = "function"
wenzelm@43780
   235
  val Function = new Properties.String(FUNCTION)
wenzelm@43748
   236
wenzelm@44661
   237
  val Assign_Execs: Properties.T = List((FUNCTION, "assign_execs"))
wenzelm@44676
   238
  val Removed_Versions: Properties.T = List((FUNCTION, "removed_versions"))
wenzelm@44661
   239
wenzelm@43748
   240
  val INVOKE_SCALA = "invoke_scala"
wenzelm@43748
   241
  object Invoke_Scala
wenzelm@43748
   242
  {
wenzelm@43780
   243
    def unapply(props: Properties.T): Option[(String, String)] =
wenzelm@43748
   244
      props match {
wenzelm@45666
   245
        case List((FUNCTION, INVOKE_SCALA), (Markup.NAME, name), (ID, id)) => Some((name, id))
wenzelm@43748
   246
        case _ => None
wenzelm@43748
   247
      }
wenzelm@43748
   248
  }
wenzelm@43748
   249
wenzelm@44298
   250
  val CANCEL_SCALA = "cancel_scala"
wenzelm@44298
   251
  object Cancel_Scala
wenzelm@44298
   252
  {
wenzelm@44298
   253
    def unapply(props: Properties.T): Option[String] =
wenzelm@44298
   254
      props match {
wenzelm@44298
   255
        case List((FUNCTION, CANCEL_SCALA), (ID, id)) => Some(id)
wenzelm@44298
   256
        case _ => None
wenzelm@44298
   257
      }
wenzelm@44298
   258
  }
wenzelm@27958
   259
}
wenzelm@38230
   260