| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | |
|---|
| 183 | |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | |
|---|
| 207 | |
|---|
| 208 | |
|---|
| 209 | |
|---|
| 210 | |
|---|
| 211 | |
|---|
| 212 | |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | |
|---|
| 220 | |
|---|
| 221 | |
|---|
| 222 | |
|---|
| 223 | |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | |
|---|
| 238 | |
|---|
| 239 | |
|---|
| 240 | |
|---|
| 241 | |
|---|
| 242 | |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | |
|---|
| 246 | |
|---|
| 247 | |
|---|
| 248 | |
|---|
| 249 | |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | |
|---|
| 255 | |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | |
|---|
| 260 | |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | |
|---|
| 264 | |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | |
|---|
| 270 | |
|---|
| 271 | |
|---|
| 272 | |
|---|
| 273 | |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | |
|---|
| 277 | |
|---|
| 278 | |
|---|
| 279 | |
|---|
| 280 | |
|---|
| 281 | |
|---|
| 282 | |
|---|
| 283 | |
|---|
| 284 | |
|---|
| 285 | |
|---|
| 286 | |
|---|
| 287 | |
|---|
| 288 | |
|---|
| 289 | |
|---|
| 290 | |
|---|
| 291 | |
|---|
| 292 | |
|---|
| 293 | |
|---|
| 294 | |
|---|
| 295 | |
|---|
| 296 | |
|---|
| 297 | |
|---|
| 298 | (eval-and-compile |
|---|
| 299 | (autoload 'tdtd-make-regexp "tdtd-make-regexp")) |
|---|
| 300 | (eval-and-compile |
|---|
| 301 | (autoload 'tdtd-make-regexps "tdtd-make-regexp")) |
|---|
| 302 | |
|---|
| 303 | |
|---|
| 304 | |
|---|
| 305 | |
|---|
| 306 | |
|---|
| 307 | |
|---|
| 308 | |
|---|
| 309 | |
|---|
| 310 | |
|---|
| 311 | |
|---|
| 312 | |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | |
|---|
| 316 | |
|---|
| 317 | |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | |
|---|
| 323 | |
|---|
| 324 | |
|---|
| 325 | |
|---|
| 326 | |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | |
|---|
| 330 | |
|---|
| 331 | |
|---|
| 332 | |
|---|
| 333 | |
|---|
| 334 | (defconst dtd-public-text-class-keywords |
|---|
| 335 | (list |
|---|
| 336 | "CAPACITY" "CHARSET" "DOCUMENT" "DTD" "ELEMENTS" "ENTITIES" "LPD" |
|---|
| 337 | "NONSGML" "NOTATION" "SHORTREF" "SUBDOC" "SYNTAX" "TEXT") |
|---|
| 338 | "Reserved names for Public Text Class in a Formal Public Identifier.") |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | (defconst dtd-xml-keyword-list-1 |
|---|
| 343 | (list |
|---|
| 344 | "-//" "\+//" "//" "\+//IDN" |
|---|
| 345 | ) |
|---|
| 346 | "XML reserved names strings that don't start with word character.") |
|---|
| 347 | |
|---|
| 348 | (defconst dtd-xml-keyword-list-1-pound |
|---|
| 349 | (list |
|---|
| 350 | "DEFAULT" "FIXED" "IMPLIED" "NOTATION" |
|---|
| 351 | "PCDATA" "REQUIRED" |
|---|
| 352 | ) |
|---|
| 353 | "XML reserved names strings that don't start with word character.") |
|---|
| 354 | |
|---|
| 355 | (defconst dtd-xml-keyword-list-2 |
|---|
| 356 | (list |
|---|
| 357 | "xml:lang" "xml:link" "xml:space" |
|---|
| 358 | ) |
|---|
| 359 | "XML reserved names containing non-word characters.") |
|---|
| 360 | |
|---|
| 361 | (defconst dtd-xml-keyword-list-3 |
|---|
| 362 | (append |
|---|
| 363 | dtd-public-text-class-keywords |
|---|
| 364 | (list |
|---|
| 365 | "ANY" "ATTLIST" "CDATA" "DOCTYPE" "DTD" "ELEMENT" "EMPTY" |
|---|
| 366 | "ENTITIES" "ENTITY" "ID" "IDREF" "IDREFS" "INCLUDE" "IGNORE" |
|---|
| 367 | "NDATA" "NMTOKEN" "NMTOKENS" "NOTATION" "NUTOKEN" "NUTOKENS" |
|---|
| 368 | "PUBLIC" "SYSTEM" "XML" "xml" |
|---|
| 369 | ) |
|---|
| 370 | ) |
|---|
| 371 | "Reserved names significant in XML.") |
|---|
| 372 | |
|---|
| 373 | |
|---|
| 374 | |
|---|
| 375 | (defconst dtd-sgml-keyword-list-1 |
|---|
| 376 | (list |
|---|
| 377 | "-//" "\+//" "//" "\+//IDN" |
|---|
| 378 | "#ALL" "#CONREF" "#CURRENT" "#DEFAULT" |
|---|
| 379 | "#FIXED" "#IMPLICIT" "#IMPLIED" "#INITIAL" "#NOTATION" "#PCDATA" |
|---|
| 380 | "#POSTLINK" "#REQUIRED" "#RESTORE" "#SIMPLE" "#USELINK" |
|---|
| 381 | ) |
|---|
| 382 | "SGML reserved names and strings beginning with a non-word character.") |
|---|
| 383 | |
|---|
| 384 | |
|---|
| 385 | (defconst dtd-sgml-keyword-list-2 |
|---|
| 386 | (list |
|---|
| 387 | "ANY" "ATTLIST" "CDATA" "DATA" "DOCTYPE" "DTD" "ELEMENT" "EMPTY" |
|---|
| 388 | "ENTITIES" "ENTITY" "EXPLICIT" "ID" "IDLINK" "IDREF" "IDREFS" |
|---|
| 389 | "IMPLICIT" "LINKTYPE" "LINK" "NAME" "NAMECHAR" "NAMES" "NDATA" |
|---|
| 390 | "NMTOKEN" "NMTOKENS" "NOTATION" "NUMBER" "NUMBERS" "NUTOKEN" |
|---|
| 391 | "NUTOKENS" "POSTLINK" "PUBLIC" "RCDATA" "SDATA" "SHORTREF" "SIMPLE" |
|---|
| 392 | "SUBDOC" "SYSTEM" "TEMP" "USELINK" "USEMAP") |
|---|
| 393 | "SGML reserved names that do not contain any non-word characters.") |
|---|
| 394 | |
|---|
| 395 | |
|---|
| 396 | |
|---|
| 397 | (defconst dtd-sgml-declaration-minimum-literal-keywords |
|---|
| 398 | (list |
|---|
| 399 | "ISO 8879:1986" "ISO 8879-1986" "ISO 8879:1986(ENR)" |
|---|
| 400 | "ISO 8879:1986(WWW)") |
|---|
| 401 | "Minimum literals at the start of an SGML Declaration.") |
|---|
| 402 | |
|---|
| 403 | (defconst dtd-delimiter-set-keywords |
|---|
| 404 | (append |
|---|
| 405 | |
|---|
| 406 | (list |
|---|
| 407 | "AND" "COM" "CRO" "DSC" "DSO" "DTGC" "DTGO" "ERO" "ETAGO" "GRPC" |
|---|
| 408 | "GRPO" "LIT" "LITA" "MDC" "MDO" "MINUS" "MSC" "NET" "OPT" "OR" |
|---|
| 409 | "PERO" "PIC" "PIO" "PLUS" "REFC" "REP" "RNI" "SEQ" |
|---|
| 410 | "STAGO" "TAGC" "VI") |
|---|
| 411 | |
|---|
| 412 | (list "BB") |
|---|
| 413 | |
|---|
| 414 | (list "HCRO" "NESTC")) |
|---|
| 415 | "Reserved names for specifying delimiter set, including shortrefs." |
|---|
| 416 | ) |
|---|
| 417 | |
|---|
| 418 | (defconst dtd-redefinable-reserved-name-keywords |
|---|
| 419 | (list |
|---|
| 420 | "ALL" "ANY" "ATTLIST" "CDATA" "CONREF" "CURRENT" "DEFAULT" |
|---|
| 421 | "DOCTYPE" "ELEMENT" "EMPTY" "ENDTAG" "ENTITIES" "ENTITY" "FIXED" |
|---|
| 422 | "ID" "IDLINK" "IDREF" "IDREFS" "IGNORE" "IMPLICIT" "IMPLIED" |
|---|
| 423 | "INCLUDE" "INITIAL" "LINK" "LINKTYPE" "MD" "MS" "NAME" "NAMES" |
|---|
| 424 | "NDATA" "NMTOKEN" "NMTOKENS" "NOTATION" "NUMBER" "NUMBERS" |
|---|
| 425 | "NUTOKEN" "NUTOKENS" "O" "PCDATA" "PI" "POSTLINK" "PUBLIC" "RCDATA" |
|---|
| 426 | "RE" "REQUIRED" "RESTORE" "RS" "SDATA" "SHORTREF" "SIMPLE" "SPACE" |
|---|
| 427 | "STARTTAG" "SUBDOC" "SYSTEM" "TEMP" "USELINK" "USEMAP") |
|---|
| 428 | "Reserved names that can be modified in NAMES portion of SGML Declaration.") |
|---|
| 429 | |
|---|
| 430 | (defconst dtd-quantity-set-keywords |
|---|
| 431 | (list |
|---|
| 432 | "ATTCNT" "ATTSPLEN" "BSEQLEN" "DTAGLEN" "DTEMPLEN" "ENTLVL" |
|---|
| 433 | "GRPCNT" "GRPGTCNT" "GRPLVL" "LITLEN" "NAMELEN" "NORMSEP" |
|---|
| 434 | "PILEN" "TAGLEN" "TAGLVL") |
|---|
| 435 | "Reserved names for specifying quantity set.") |
|---|
| 436 | |
|---|
| 437 | (defconst dtd-common-sgml-declaration-keywords |
|---|
| 438 | (list |
|---|
| 439 | "SGMLREF" "PUBLIC" "NONE" "NO" "YES") |
|---|
| 440 | "Reserved names common to multiple parts of an SGML Declaration.") |
|---|
| 441 | |
|---|
| 442 | (defconst dtd-charset-keywords |
|---|
| 443 | (list |
|---|
| 444 | "CHARSET" "BASESET" "DESCSET" "UNUSED") |
|---|
| 445 | "Reserved names used in describing the document character set.") |
|---|
| 446 | |
|---|
| 447 | (defconst dtd-capacity-set-keywords |
|---|
| 448 | (list |
|---|
| 449 | "CAPACITY" "TOTALCAP" "ENTCAP" "ENTCHCAP" "ELEMCAP" "GRPCAP" |
|---|
| 450 | "EXGRPCAP" "EXNMCAP" "ATTCAP" "ATTCHCAP" "AVGRPCAP" "NOTCAP" |
|---|
| 451 | "NOTCHCAP" "IDCAP" "IDREFCAP" "MAPCAP" "LKSETCAP" "LKNMCAP") |
|---|
| 452 | "Reserved names for specifying capacities.") |
|---|
| 453 | |
|---|
| 454 | (defconst dtd-concrete-syntax-scope-keywords |
|---|
| 455 | (list |
|---|
| 456 | "SCOPE" "DOCUMENT" "INSTANCE") |
|---|
| 457 | "Reserved names for specifying concrete syntax scope.") |
|---|
| 458 | |
|---|
| 459 | (defconst dtd-concrete-syntax-keywords |
|---|
| 460 | (append |
|---|
| 461 | (list |
|---|
| 462 | "SYNTAX" "SWITCHES") |
|---|
| 463 | (list |
|---|
| 464 | "SHUNCHAR" "CONTROLS") |
|---|
| 465 | (list |
|---|
| 466 | "FUNCTION" "RE" "RS" "SPACE" "FUNCHAR" "MSICHAR" "MSOCHAR" |
|---|
| 467 | "MSSCHAR" "SEPCHAR" "TAB") |
|---|
| 468 | (list |
|---|
| 469 | "NAMING" "LCNMSTRT" "UCNMSTRT" "NAMESTRT" "LCNMCHAR" "UCNMCHAR" |
|---|
| 470 | "NAMECHAR" "NAMECASE" "GENERAL" "ENTITY") |
|---|
| 471 | (append |
|---|
| 472 | (list |
|---|
| 473 | "DELIM" "GENERAL" "SHORTREF") |
|---|
| 474 | dtd-delimiter-set-keywords) |
|---|
| 475 | (append |
|---|
| 476 | (list |
|---|
| 477 | "NAMES") |
|---|
| 478 | dtd-redefinable-reserved-name-keywords) |
|---|
| 479 | (append |
|---|
| 480 | (list |
|---|
| 481 | "QUANTITY") |
|---|
| 482 | dtd-quantity-set-keywords)) |
|---|
| 483 | "Reserved names in specifying a concrete syntax.") |
|---|
| 484 | |
|---|
| 485 | (defconst dtd-features-keywords |
|---|
| 486 | (append |
|---|
| 487 | (list |
|---|
| 488 | "FEATURES" "MINIMIZE" "DATATAG" "OMITTAG" "RANK" "SHORTTAG" |
|---|
| 489 | "LINK" "SIMPLE" "IMPLICIT" "EXPLICIT" |
|---|
| 490 | "OTHER" "CONCUR" "SUBDOC" "FORMAL") |
|---|
| 491 | |
|---|
| 492 | (list |
|---|
| 493 | "NETENABL" "IMMEDNET" "UNCLOSED" "ATTRIB" "OMITNAME" "VALUE" |
|---|
| 494 | "EMPTYNRM" "IMPLYDEF" "URN" "KEEPRSRE" "VALIDITY" "NOASSERT" "TYPE" |
|---|
| 495 | "REF" "INTERNAL" "INTEGRAL" "SEEALSO")) |
|---|
| 496 | "Reserved names in specifying SGML feature use.") |
|---|
| 497 | |
|---|
| 498 | (defconst dtd-appinfo-keywords |
|---|
| 499 | (list |
|---|
| 500 | "APPINFO") |
|---|
| 501 | "Reserved names in specifying application-specific information.") |
|---|
| 502 | |
|---|
| 503 | |
|---|
| 504 | |
|---|
| 505 | (defconst dtd-system-declaration-keyword-list-1 |
|---|
| 506 | (list |
|---|
| 507 | "-//" "\+//" "//" "\+//IDN") |
|---|
| 508 | "System Declaration reserved names beginning with a non-word character.") |
|---|
| 509 | |
|---|
| 510 | (defconst dtd-concrete-syntax-changes-keywords |
|---|
| 511 | (list |
|---|
| 512 | "CHANGES" "SWITCES" "DELIMLEN" "SEQUENCE" "SRCNT" "SRLEN") |
|---|
| 513 | "Reserved names for concrete syntax changes in System Declaration.") |
|---|
| 514 | |
|---|
| 515 | (defconst dtd-validation-services-keywords |
|---|
| 516 | (list |
|---|
| 517 | "VALIDATE" "GENERAL" "MODEL" "EXCLUDE" "CAPACITY" "NONSGML" "SGML" |
|---|
| 518 | "FORMAL") |
|---|
| 519 | "Reserved names for validation services in System Declaration.") |
|---|
| 520 | |
|---|
| 521 | (defconst dtd-sdif-support-keywords |
|---|
| 522 | (list |
|---|
| 523 | "ASN1" "PACK" "SDIF" "UNPACK") |
|---|
| 524 | "Reserved names for SDIF support in System Declaration.") |
|---|
| 525 | |
|---|
| 526 | |
|---|
| 527 | |
|---|
| 528 | |
|---|
| 529 | |
|---|
| 530 | |
|---|
| 531 | |
|---|
| 532 | (defvar dtd-comment-declaration-keywords |
|---|
| 533 | (list |
|---|
| 534 | |
|---|
| 535 | |
|---|
| 536 | |
|---|
| 537 | |
|---|
| 538 | |
|---|
| 539 | |
|---|
| 540 | |
|---|
| 541 | |
|---|
| 542 | |
|---|
| 543 | |
|---|
| 544 | '("<!--[^-]*\\(-[^-]+\\)*-->" . font-lock-comment-face) |
|---|
| 545 | ) |
|---|
| 546 | "XML comment and one style of SGML comment keywords.") |
|---|
| 547 | |
|---|
| 548 | (defvar dtd-comment-in-declaration-keywords |
|---|
| 549 | (list |
|---|
| 550 | |
|---|
| 551 | |
|---|
| 552 | |
|---|
| 553 | '("--[^-]*\\(-[^-]+\\)*--" . font-lock-comment-face) |
|---|
| 554 | ) |
|---|
| 555 | "SGML-only comment within a declaration keywords.") |
|---|
| 556 | |
|---|
| 557 | (defvar dtd-entity-reference-keywords |
|---|
| 558 | (list |
|---|
| 559 | |
|---|
| 560 | |
|---|
| 561 | |
|---|
| 562 | |
|---|
| 563 | |
|---|
| 564 | |
|---|
| 565 | |
|---|
| 566 | '("[%&][^; \t]+;" . font-lock-reference-face) |
|---|
| 567 | ) |
|---|
| 568 | "Font lock keywords pattern matching an entity reference.") |
|---|
| 569 | |
|---|
| 570 | (defvar dtd-common-font-lock-keywords-1 |
|---|
| 571 | (append |
|---|
| 572 | dtd-comment-declaration-keywords |
|---|
| 573 | dtd-entity-reference-keywords |
|---|
| 574 | (list |
|---|
| 575 | |
|---|
| 576 | |
|---|
| 577 | |
|---|
| 578 | '("\\(<!\\(ATTLIST\\|ENTITY\\(\\s-+%\\|\\)\\|NOTATION\\)\\)\\s-+\\(\\S-+\\)[^>]+\\(>\\)" |
|---|
| 579 | (1 font-lock-keyword-face) |
|---|
| 580 | (4 font-lock-variable-name-face) |
|---|
| 581 | (5 font-lock-keyword-face)) |
|---|
| 582 | |
|---|
| 583 | |
|---|
| 584 | |
|---|
| 585 | '("\\(<!DOCTYPE\\)\\s-+\\([^[]+\\)\\s-+\\(\\[\\)" |
|---|
| 586 | (1 font-lock-keyword-face) |
|---|
| 587 | (2 font-lock-variable-name-face) |
|---|
| 588 | (3 font-lock-keyword-face)) |
|---|
| 589 | |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | |
|---|
| 593 | '("\\(<!ELEMENT\\)\\s-+\\([^ \t()|]+\\)\\s-+[^>]+\\(>\\)" |
|---|
| 594 | (1 font-lock-keyword-face) |
|---|
| 595 | (2 font-lock-variable-name-face) |
|---|
| 596 | (3 font-lock-keyword-face)) |
|---|
| 597 | |
|---|
| 598 | |
|---|
| 599 | |
|---|
| 600 | '("\\(<!\\[\\)[^[]*\\(\\[\\)" |
|---|
| 601 | (1 font-lock-keyword-face) |
|---|
| 602 | (2 font-lock-keyword-face)) |
|---|
| 603 | ) |
|---|
| 604 | ) |
|---|
| 605 | "Font lock keyword patterns common to XML and SGML DTDs to apply first.") |
|---|
| 606 | |
|---|
| 607 | (defvar dtd-common-font-lock-keywords-2 |
|---|
| 608 | (list |
|---|
| 609 | |
|---|
| 610 | |
|---|
| 611 | |
|---|
| 612 | '("\\(\\]?\\]\\)\\s-*\\(>\\)" |
|---|
| 613 | (1 font-lock-keyword-face) |
|---|
| 614 | (2 font-lock-keyword-face)) |
|---|
| 615 | |
|---|
| 616 | |
|---|
| 617 | |
|---|
| 618 | |
|---|
| 619 | '("\\('\\)[^']*\\('\\)" |
|---|
| 620 | (1 font-lock-string-face) |
|---|
| 621 | (2 font-lock-string-face)) |
|---|
| 622 | '("\\(\"\\)[^\"]*\\(\"\\)" |
|---|
| 623 | (1 font-lock-string-face) |
|---|
| 624 | (2 font-lock-string-face)) |
|---|
| 625 | |
|---|
| 626 | |
|---|
| 627 | |
|---|
| 628 | '("[,()|&]" . font-lock-function-name-face) |
|---|
| 629 | |
|---|
| 630 | |
|---|
| 631 | |
|---|
| 632 | '("[+*?]" . font-lock-string-face) |
|---|
| 633 | |
|---|
| 634 | ) |
|---|
| 635 | "Common DTD font lock keyword patterns to apply last.") |
|---|
| 636 | |
|---|
| 637 | (defvar dtd-sgml-dtd-keywords |
|---|
| 638 | (list |
|---|
| 639 | |
|---|
| 640 | |
|---|
| 641 | |
|---|
| 642 | '("\\(<!\\(SHORTREF\\|USEMAP\\)\\)\\s-+\\(\\S-+\\)[^>]+\\(>\\)" |
|---|
| 643 | (1 font-lock-keyword-face) |
|---|
| 644 | (3 font-lock-variable-name-face) |
|---|
| 645 | (4 font-lock-keyword-face)) |
|---|
| 646 | |
|---|
| 647 | |
|---|
| 648 | |
|---|
| 649 | |
|---|
| 650 | |
|---|
| 651 | |
|---|
| 652 | '("\\(<!ELEMENT\\)\\s-+\\([^ \t()|]+\\)\\s-+\\(o\\s-+o\\|O\\s-+O\\|-\\s-+[oO]\\|[oO]\\s-+-\\)\\s-+[^>]+\\(>\\)" |
|---|
| 653 | (1 font-lock-keyword-face) |
|---|
| 654 | (2 font-lock-variable-name-face) |
|---|
| 655 | (3 font-lock-keyword-face) |
|---|
| 656 | (4 font-lock-keyword-face)) |
|---|
| 657 | |
|---|
| 658 | |
|---|
| 659 | |
|---|
| 660 | '("\\(\\(-\\|+\\)(\\)[^)]*\\()\\)" |
|---|
| 661 | (1 font-lock-variable-name-face) |
|---|
| 662 | (3 font-lock-variable-name-face)) |
|---|
| 663 | |
|---|
| 664 | |
|---|
| 665 | |
|---|
| 666 | '("\\(<!LINKTYPE\\)\\s-+\\([^ \t]+\\)\\s-+\\([^ \t]+\\)\\s-+\\(\\#IMPLIED\\)[ \t\n]*\\(\\[\\)" |
|---|
| 667 | (1 font-lock-keyword-face) |
|---|
| 668 | (2 font-lock-variable-name-face) |
|---|
| 669 | (3 font-lock-variable-name-face) |
|---|
| 670 | (4 font-lock-keyword-face) |
|---|
| 671 | (5 font-lock-keyword-face)) |
|---|
| 672 | |
|---|
| 673 | |
|---|
| 674 | |
|---|
| 675 | '("\\(<!LINKTYPE\\)\\s-+\\([^ \t]+\\)\\s-+\\([^ \t]+\\)\\s-+\\([^ \t]+\\)\\s-*\\(\\[\\)" |
|---|
| 676 | (1 font-lock-keyword-face) |
|---|
| 677 | (2 font-lock-variable-name-face) |
|---|
| 678 | (3 font-lock-variable-name-face) |
|---|
| 679 | (4 font-lock-type-face) |
|---|
| 680 | (5 font-lock-keyword-face)) |
|---|
| 681 | |
|---|
| 682 | |
|---|
| 683 | |
|---|
| 684 | |
|---|
| 685 | '("\\(<!IDLINK\\)\\b[^>]+\\(>\\)" |
|---|
| 686 | (1 font-lock-keyword-face) |
|---|
| 687 | (2 font-lock-keyword-face)) |
|---|
| 688 | |
|---|
| 689 | |
|---|
| 690 | |
|---|
| 691 | '("\\(<\\?\\)\\([^ \t>]+\\)\\s-*[^>]*\\(>\\)" |
|---|
| 692 | (1 font-lock-keyword-face) |
|---|
| 693 | (2 font-lock-variable-name-face) |
|---|
| 694 | (3 font-lock-keyword-face)) |
|---|
| 695 | ) |
|---|
| 696 | "Font lock keyword patterns for declarations specific to SGML DTDs.") |
|---|
| 697 | |
|---|
| 698 | |
|---|
| 699 | |
|---|
| 700 | |
|---|
| 701 | |
|---|
| 702 | (defvar dtd-xml-font-lock-keywords |
|---|
| 703 | (append |
|---|
| 704 | dtd-common-font-lock-keywords-1 |
|---|
| 705 | (list |
|---|
| 706 | |
|---|
| 707 | |
|---|
| 708 | |
|---|
| 709 | |
|---|
| 710 | |
|---|
| 711 | |
|---|
| 712 | '( |
|---|
| 713 | "\\(<\\?\\)\\(xml\\)\\(\\s-+version\\s-*=\\s-*\\('[^']+'\\|\"[^\"]+\"\\)\\)?\\(\\s-+encoding\\s-*=\\s-*\\('[^']+'\\|\"[^\"]+\"\\)\\)?\\(\\s-+standalone\\s-*=\\s-*\\('\\(yes\\|no\\)'\\|\"\\(yes\\|no\\)\"\\)\\)?\\s-*\\(\\?>\\)" |
|---|
| 714 | (1 font-lock-keyword-face) |
|---|
| 715 | (2 font-lock-type-face nil) |
|---|
| 716 | (3 font-lock-type-face nil t) |
|---|
| 717 | (5 font-lock-type-face nil t) |
|---|
| 718 | (7 font-lock-type-face nil t) |
|---|
| 719 | (11 font-lock-keyword-face)) |
|---|
| 720 | |
|---|
| 721 | |
|---|
| 722 | |
|---|
| 723 | |
|---|
| 724 | '( |
|---|
| 725 | "\\(<\\?\\)\\([^ \t?>]+\\)\\s-*\\([^?>]\\|\\?[^>]\\|>[^\n\r]\\)*\\(\\?>\\)" |
|---|
| 726 | (1 font-lock-keyword-face) |
|---|
| 727 | (2 font-lock-variable-name-face) |
|---|
| 728 | (4 font-lock-keyword-face)) |
|---|
| 729 | |
|---|
| 730 | |
|---|
| 731 | |
|---|
| 732 | (list |
|---|
| 733 | (concat |
|---|
| 734 | (regexp-opt |
|---|
| 735 | dtd-xml-keyword-list-1 |
|---|
| 736 | t) |
|---|
| 737 | "\\b") |
|---|
| 738 | (list 1 font-lock-type-face)) |
|---|
| 739 | |
|---|
| 740 | (list |
|---|
| 741 | (concat |
|---|
| 742 | "\\(#" |
|---|
| 743 | (regexp-opt |
|---|
| 744 | dtd-xml-keyword-list-1-pound |
|---|
| 745 | t) |
|---|
| 746 | "\\)\\b") |
|---|
| 747 | (list 1 font-lock-type-face)) |
|---|
| 748 | |
|---|
| 749 | |
|---|
| 750 | |
|---|
| 751 | |
|---|
| 752 | |
|---|
| 753 | |
|---|
| 754 | |
|---|
| 755 | |
|---|
| 756 | (list |
|---|
| 757 | (concat |
|---|
| 758 | "\\b" |
|---|
| 759 | (regexp-opt dtd-xml-keyword-list-2 t) |
|---|
| 760 | "\\b") |
|---|
| 761 | (list 1 font-lock-type-face)) |
|---|
| 762 | |
|---|
| 763 | (list |
|---|
| 764 | (concat |
|---|
| 765 | "\\b" |
|---|
| 766 | (regexp-opt dtd-xml-keyword-list-3 t) |
|---|
| 767 | "\\b") |
|---|
| 768 | (list 1 font-lock-type-face)) |
|---|
| 769 | ) |
|---|
| 770 | dtd-common-font-lock-keywords-2 |
|---|
| 771 | ) |
|---|
| 772 | "Font lock keywords for use in XML DTDs.") |
|---|
| 773 | |
|---|
| 774 | |
|---|
| 775 | (defvar dtd-sgml-font-lock-keywords |
|---|
| 776 | (append |
|---|
| 777 | dtd-comment-declaration-keywords |
|---|
| 778 | dtd-comment-in-declaration-keywords |
|---|
| 779 | dtd-common-font-lock-keywords-1 |
|---|
| 780 | dtd-sgml-dtd-keywords |
|---|
| 781 | (list |
|---|
| 782 | |
|---|
| 783 | |
|---|
| 784 | (tdtd-make-regexps |
|---|
| 785 | (list dtd-sgml-keyword-list-1 |
|---|
| 786 | font-lock-type-face) |
|---|
| 787 | "\\b") |
|---|
| 788 | |
|---|
| 789 | (tdtd-make-regexps "\\b" |
|---|
| 790 | (list dtd-sgml-keyword-list-2 |
|---|
| 791 | font-lock-type-face) |
|---|
| 792 | "\\b") |
|---|
| 793 | ) |
|---|
| 794 | dtd-common-font-lock-keywords-2 |
|---|
| 795 | ) |
|---|
| 796 | "Font lock keywords for SGML DTDs.") |
|---|
| 797 | |
|---|
| 798 | |
|---|
| 799 | (defvar dtd-decl-font-lock-keywords |
|---|
| 800 | (append |
|---|
| 801 | dtd-comment-in-declaration-keywords |
|---|
| 802 | dtd-common-font-lock-keywords-1 |
|---|
| 803 | (list |
|---|
| 804 | |
|---|
| 805 | |
|---|
| 806 | |
|---|
| 807 | '("\\(<!SGML\\)\\s-+\\([^>]\\|>[^$]\\)+\\(>$\\)" |
|---|
| 808 | (1 font-lock-keyword-face) |
|---|
| 809 | (3 font-lock-keyword-face)) |
|---|
| 810 | |
|---|
| 811 | |
|---|
| 812 | (tdtd-make-regexps "\\b" |
|---|
| 813 | (list |
|---|
| 814 | (append |
|---|
| 815 | dtd-common-sgml-declaration-keywords |
|---|
| 816 | dtd-charset-keywords |
|---|
| 817 | dtd-capacity-set-keywords |
|---|
| 818 | dtd-concrete-syntax-scope-keywords |
|---|
| 819 | dtd-concrete-syntax-keywords |
|---|
| 820 | dtd-features-keywords |
|---|
| 821 | dtd-appinfo-keywords |
|---|
| 822 | dtd-public-text-class-keywords) |
|---|
| 823 | font-lock-type-face) |
|---|
| 824 | "\\b") |
|---|
| 825 | |
|---|
| 826 | |
|---|
| 827 | |
|---|
| 828 | (tdtd-make-regexps (list |
|---|
| 829 | dtd-sgml-declaration-minimum-literal-keywords |
|---|
| 830 | font-lock-type-face)) |
|---|
| 831 | |
|---|
| 832 | |
|---|
| 833 | |
|---|
| 834 | (tdtd-make-regexps |
|---|
| 835 | (list dtd-xml-keyword-list-1 |
|---|
| 836 | font-lock-type-face) |
|---|
| 837 | "\\b") |
|---|
| 838 | ) |
|---|
| 839 | dtd-common-font-lock-keywords-2 |
|---|
| 840 | ) |
|---|
| 841 | "Font lock keywords for SGML Declarations.") |
|---|
| 842 | |
|---|
| 843 | |
|---|
| 844 | (defvar dtd-sys-decl-font-lock-keywords |
|---|
| 845 | (append |
|---|
| 846 | dtd-comment-in-declaration-keywords |
|---|
| 847 | dtd-entity-reference-keywords |
|---|
| 848 | (list |
|---|
| 849 | |
|---|
| 850 | |
|---|
| 851 | |
|---|
| 852 | '("\\(<!SYSTEM\\)\\([^>]\\|>[^$]\\)+\\(>$\\)" |
|---|
| 853 | (1 font-lock-keyword-face) |
|---|
| 854 | (3 font-lock-keyword-face)) |
|---|
| 855 | |
|---|
| 856 | |
|---|
| 857 | |
|---|
| 858 | |
|---|
| 859 | |
|---|
| 860 | (tdtd-make-regexps |
|---|
| 861 | (list dtd-system-declaration-keyword-list-1 |
|---|
| 862 | font-lock-type-face) |
|---|
| 863 | "\\b") |
|---|
| 864 | |
|---|
| 865 | |
|---|
| 866 | |
|---|
| 867 | (tdtd-make-regexps "\\b" |
|---|
| 868 | (list |
|---|
| 869 | (append |
|---|
| 870 | dtd-common-sgml-declaration-keywords |
|---|
| 871 | dtd-charset-keywords |
|---|
| 872 | dtd-capacity-set-keywords |
|---|
| 873 | dtd-concrete-syntax-scope-keywords |
|---|
| 874 | dtd-concrete-syntax-changes-keywords |
|---|
| 875 | dtd-concrete-syntax-keywords |
|---|
| 876 | dtd-features-keywords |
|---|
| 877 | dtd-validation-services-keywords |
|---|
| 878 | dtd-sdif-support-keywords |
|---|
| 879 | dtd-public-text-class-keywords) |
|---|
| 880 | font-lock-type-face) |
|---|
| 881 | "\\b") |
|---|
| 882 | |
|---|
| 883 | |
|---|
| 884 | |
|---|
| 885 | (tdtd-make-regexps (list |
|---|
| 886 | dtd-sgml-declaration-minimum-literal-keywords |
|---|
| 887 | font-lock-type-face)) |
|---|
| 888 | |
|---|
| 889 | ) |
|---|
| 890 | dtd-common-font-lock-keywords-2 |
|---|
| 891 | ) |
|---|
| 892 | "Font lock keywords for System Declarations.") |
|---|
| 893 | |
|---|
| 894 | (defun dtd-make-tdtd-font () |
|---|
| 895 | "Generate the file \"tdtd-font.el\"." |
|---|
| 896 | (interactive) |
|---|
| 897 | (find-file "tdtd-font.el") |
|---|
| 898 | (kill-region (point-min) (point-max)) |
|---|
| 899 | (insert ";;;; tdtd-font.el --- Font-lock keywords for Tony's DTD mode\n") |
|---|
| 900 | (insert ";; $\Id$\n") |
|---|
| 901 | (insert ";; $\Name$\n") |
|---|
| 902 | (insert ";;\n") |
|---|
| 903 | (insert ";; Copyright (C) 1999, 2001 Tony Graham\n") |
|---|
| 904 | (insert ";;\n") |
|---|
| 905 | (insert ";; Author: Tony Graham <tkg@menteith.com>\n") |
|---|
| 906 | (insert "\n") |
|---|
| 907 | (insert ";; Generated by tdtd-font-maker.el\n") |
|---|
| 908 | (insert ";; Do not modify this file. Make changes in tdtd-font-maker.el\n") |
|---|
| 909 | (insert ";; and regenerate.\n") |
|---|
| 910 | (insert "\n") |
|---|
| 911 | (insert ";;; This file is not part of GNU Emacs.\n") |
|---|
| 912 | (insert "\n") |
|---|
| 913 | (insert ";; This program is free software; you can redistribute it and/or\n") |
|---|
| 914 | (insert ";; modify it under the terms of the GNU General Public License\n") |
|---|
| 915 | (insert ";; as published by the Free Software Foundation; either version 2\n") |
|---|
| 916 | (insert ";; of the License, or (at your option) any later version.\n") |
|---|
| 917 | (insert ";;\n") |
|---|
| 918 | (insert ";; This program is distributed in the hope that it will be useful,\n") |
|---|
| 919 | (insert ";; but WITHOUT ANY WARRANTY; without even the implied warranty of\n") |
|---|
| 920 | (insert ";; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n") |
|---|
| 921 | (insert ";; GNU General Public License for more details.\n") |
|---|
| 922 | (insert ";;\n") |
|---|
| 923 | (insert ";; You should have received a copy of the GNU General Public License\n") |
|---|
| 924 | (insert ";; along with this program; if not, write to the Free Software\n") |
|---|
| 925 | (insert ";; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n") |
|---|
| 926 | (insert "\n") |
|---|
| 927 | (insert ";; Send bugs to tdtd-bug@menteith.com\n") |
|---|
| 928 | (insert "\n\n") |
|---|
| 929 | (insert (format "(defvar dtd-sgml-font-lock-keywords\n '%s)\n\n" |
|---|
| 930 | (dtd-make-safe-var-def dtd-sgml-font-lock-keywords))) |
|---|
| 931 | (insert (format "(defvar dtd-xml-font-lock-keywords\n '%s)\n\n" |
|---|
| 932 | (dtd-make-safe-var-def dtd-xml-font-lock-keywords))) |
|---|
| 933 | (insert (format "(defvar dtd-decl-font-lock-keywords\n '%s)\n\n" |
|---|
| 934 | (dtd-make-safe-var-def dtd-decl-font-lock-keywords))) |
|---|
| 935 | (insert (format "(defvar dtd-sys-decl-font-lock-keywords\n '%s)\n\n" |
|---|
| 936 | (dtd-make-safe-var-def dtd-sys-decl-font-lock-keywords))) |
|---|
| 937 | (insert "(provide 'tdtd-font)\n") |
|---|
| 938 | |
|---|
| 939 | (setq backup-inhibited t) |
|---|
| 940 | (save-buffer) |
|---|
| 941 | (kill-buffer (current-buffer))) |
|---|
| 942 | |
|---|
| 943 | (defun dtd-make-safe-var-def (var) |
|---|
| 944 | "Tidy up a variable's definition so it's safe to output in a defun." |
|---|
| 945 | (let ((var-string (format "%S" var))) |
|---|
| 946 | (while (string-match "\t" var-string) |
|---|
| 947 | (setq var-string (replace-match "\\t" nil t var-string))) |
|---|
| 948 | (while (string-match "\n" var-string) |
|---|
| 949 | (setq var-string (replace-match "\\n" nil t var-string))) |
|---|
| 950 | (while (string-match "\r" var-string) |
|---|
| 951 | (setq var-string (replace-match "\\r" nil t var-string))) |
|---|
| 952 | (format "%s" var-string))) |
|---|
| 953 | |
|---|
| 954 | (provide 'tdtd-font-maker) |
|---|