annotate lisp/progmodes/ebnf-dtd.el @ 112445:93fcbcb698b0

Improve configuration of makeinfo. * Makefile.in (MAKEINFO): Now controlled by `configure'. (MAKEINFO_OPTS): New variable. Use it where appropriate. (ENVADD): Updated.
author Werner Lemberg <wl@gnu.org>
date Sun, 23 Jan 2011 11:38:14 +0100
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1 ;;; ebnf-dtd.el --- parser for DTD (Data Type Description for XML)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
2
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74417
diff changeset
4 ;; Free Software Foundation, Inc.
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
5
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
8 ;; Keywords: wp, ebnf, PostScript
82143
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
9 ;; Version: 1.1
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
10 ;; Package: ebnf2ps
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
11
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
13
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
17 ;; (at your option) any later version.
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
18
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
22 ;; GNU General Public License for more details.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
23
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
26
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
27 ;;; Commentary:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
28
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
29 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
30 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
31 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
32 ;; This is part of ebnf2ps package.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
33 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
34 ;; This package defines a parser for DTD (Data Type Description for XML).
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
35 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
36 ;; See ebnf2ps.el for documentation.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
37 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
38 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
39 ;; DTD Syntax
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
40 ;; ----------
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
41 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
42 ;; See the URLs:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
43 ;; `http://www.w3.org/TR/2004/REC-xml-20040204/'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
44 ;; (Extensible Markup Language (XML) 1.0 (Third Edition))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
45 ;; `http://www.w3.org/TR/html40/'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
46 ;; (HTML 4.01 Specification)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
47 ;; `http://www.w3.org/TR/NOTE-html-970421'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
48 ;; (HTML DTD with support for Style Sheets)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
49 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
50 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
51 ;; /* Document */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
52 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
53 ;; document ::= prolog element Misc*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
54 ;; /* Note that *only* the prolog will be parsed */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
55 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
56 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
57 ;; /* Characters */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
58 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
59 ;; Char ::= #x9 | #xA | #xD
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
60 ;; | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
61 ;; /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
62 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
63 ;; /* NOTE:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
64 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
65 ;; Document authors are encouraged to avoid "compatibility characters", as
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
66 ;; defined in section 6.8 of [Unicode] (see also D21 in section 3.6 of
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
67 ;; [Unicode3]). The characters defined in the following ranges are also
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
68 ;; discouraged. They are either control characters or permanently undefined
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
69 ;; Unicode characters:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
70 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
71 ;; [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
72 ;; [#1FFFE-#x1FFFF], [#2FFFE-#x2FFFF], [#3FFFE-#x3FFFF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
73 ;; [#4FFFE-#x4FFFF], [#5FFFE-#x5FFFF], [#6FFFE-#x6FFFF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
74 ;; [#7FFFE-#x7FFFF], [#8FFFE-#x8FFFF], [#9FFFE-#x9FFFF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
75 ;; [#AFFFE-#xAFFFF], [#BFFFE-#xBFFFF], [#CFFFE-#xCFFFF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
76 ;; [#DFFFE-#xDFFFF], [#EFFFE-#xEFFFF], [#FFFFE-#xFFFFF],
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
77 ;; [#10FFFE-#x10FFFF]. */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
78 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
79 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
80 ;; /* White Space */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
81 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
82 ;; S ::= (#x20 | #x9 | #xD | #xA)+
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
83 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
84 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
85 ;; /* Names and Tokens */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
86 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
87 ;; NameChar ::= Letter | Digit | '.' | '-' | '_' | ':'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
88 ;; | CombiningChar | Extender
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
89 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
90 ;; Name ::= (Letter | '_' | ':') (NameChar)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
91 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
92 ;; Names ::= Name (#x20 Name)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
93 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
94 ;; Nmtoken ::= (NameChar)+
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
95 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
96 ;; Nmtokens ::= Nmtoken (#x20 Nmtoken)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
97 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
98 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
99 ;; /* Literals */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
100 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
101 ;; EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
102 ;; | "'" ([^%&'] | PEReference | Reference)* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
103 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
104 ;; AttValue ::= '"' ([^<&"] | Reference)* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
105 ;; | "'" ([^<&'] | Reference)* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
106 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
107 ;; SystemLiteral ::= ('"' [^"]* '"')
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
108 ;; | ("'" [^']* "'")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
109 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
110 ;; PubidLiteral ::= '"' PubidChar* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
111 ;; | "'" (PubidChar - "'")* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
112 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
113 ;; PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
114 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
115 ;; /* NOTE:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
116 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
117 ;; Although the EntityValue production allows the definition of a general
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
118 ;; entity consisting of a single explicit < in the literal (e.g., <!ENTITY
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
119 ;; mylt "<">), it is strongly advised to avoid this practice since any
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
120 ;; reference to that entity will cause a well-formedness error. */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
121 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
122 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
123 ;; /* Character Data */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
124 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
125 ;; CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
126 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
127 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
128 ;; /* Comments */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
129 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
130 ;; Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
131 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
132 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
133 ;; /* Processing Instructions */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
134 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
135 ;; PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
136 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
137 ;; PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
138 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
139 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
140 ;; /* CDATA Sections */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
141 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
142 ;; CDSect ::= CDStart CData CDEnd
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
143 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
144 ;; CDStart ::= '<![CDATA['
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
145 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
146 ;; CData ::= (Char* - (Char* ']]>' Char*))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
147 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
148 ;; CDEnd ::= ']]>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
149 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
150 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
151 ;; /* Prolog */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
152 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
153 ;; prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
154 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
155 ;; XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
156 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
157 ;; VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
158 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
159 ;; Eq ::= S? '=' S?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
160 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
161 ;; VersionNum ::= '1.0'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
162 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
163 ;; Misc ::= Comment | PI | S
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
164 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
165 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
166 ;; /* Document Type Definition */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
167 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
168 ;; doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
169 ;; ('[' intSubset ']' S?)? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
170 ;; [VC: Root Element Type]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
171 ;; [WFC: External Subset]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
172 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
173 ;; DeclSep ::= PEReference | S
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
174 ;; [WFC: PE Between Declarations]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
175 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
176 ;; intSubset ::= (markupdecl | DeclSep)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
177 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
178 ;; markupdecl ::= elementdecl | AttlistDecl | EntityDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
179 ;; | NotationDecl | PI | Comment
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
180 ;; [VC: Proper Declaration/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
181 ;; [WFC: PEs in Internal Subset]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
182 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
183 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
184 ;; /* External Subset */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
185 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
186 ;; extSubset ::= TextDecl? extSubsetDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
187 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
188 ;; extSubsetDecl ::= ( markupdecl | conditionalSect | DeclSep)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
189 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
190 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
191 ;; /* Standalone Document Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
192 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
193 ;; SDDecl ::= S 'standalone' Eq
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
194 ;; (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
195 ;; [VC: Standalone Document Declaration]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
196 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
197 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
198 ;; /* Element */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
199 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
200 ;; element ::= EmptyElemTag | STag content ETag
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
201 ;; [WFC: Element Type Match]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
202 ;; [VC: Element Valid]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
203 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
204 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
205 ;; /* Start-tag */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
206 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
207 ;; STag ::= '<' Name (S Attribute)* S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
208 ;; [WFC: Unique Att Spec]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
209 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
210 ;; Attribute ::= Name Eq AttValue
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
211 ;; [VC: Attribute Value Type]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
212 ;; [WFC: No External Entity References]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
213 ;; [WFC: No < in Attribute Values]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
214 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
215 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
216 ;; /* End-tag */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
217 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
218 ;; ETag ::= '</' Name S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
219 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
220 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
221 ;; /* Content of Elements */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
222 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
223 ;; content ::= CharData?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
224 ;; ((element | Reference | CDSect | PI | Comment) CharData?)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
225 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
226 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
227 ;; /* Tags for Empty Elements */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
228 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
229 ;; EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
230 ;; [WFC: Unique Att Spec]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
231 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
232 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
233 ;; /* Element Type Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
234 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
235 ;; elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
236 ;; [VC: Unique Element Type Declaration]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
237 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
238 ;; contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
239 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
240 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
241 ;; /* Element-content Models */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
242 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
243 ;; children ::= (choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
244 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
245 ;; cp ::= (Name | choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
246 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
247 ;; choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
248 ;; [VC: Proper Group/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
249 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
250 ;; seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
251 ;; [VC: Proper Group/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
252 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
253 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
254 ;; /* Mixed-content Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
255 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
256 ;; Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
257 ;; | '(' S? '#PCDATA' S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
258 ;; [VC: Proper Group/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
259 ;; [VC: No Duplicate Types]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
260 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
261 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
262 ;; /* Attribute-list Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
263 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
264 ;; AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
265 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
266 ;; AttDef ::= S Name S AttType S DefaultDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
267 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
268 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
269 ;; /* Attribute Types */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
270 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
271 ;; AttType ::= StringType | TokenizedType | EnumeratedType
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
272 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
273 ;; StringType ::= 'CDATA'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
274 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
275 ;; TokenizedType ::= 'ID' [VC: ID]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
276 ;; [VC: One ID per Element Type]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
277 ;; [VC: ID Attribute Default]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
278 ;; | 'IDREF' [VC: IDREF]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
279 ;; | 'IDREFS' [VC: IDREF]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
280 ;; | 'ENTITY' [VC: Entity Name]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
281 ;; | 'ENTITIES' [VC: Entity Name]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
282 ;; | 'NMTOKEN' [VC: Name Token]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
283 ;; | 'NMTOKENS' [VC: Name Token]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
284 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
285 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
286 ;; /* Enumerated Attribute Types */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
287 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
288 ;; EnumeratedType ::= NotationType | Enumeration
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
289 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
290 ;; NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
291 ;; [VC: Notation Attributes]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
292 ;; [VC: One Notation Per Element Type]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
293 ;; [VC: No Notation on Empty Element]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
294 ;; [VC: No Duplicate Tokens]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
295 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
296 ;; Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
297 ;; [VC: Enumeration]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
298 ;; [VC: No Duplicate Tokens]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
299 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
300 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
301 ;; /* Attribute Defaults */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
302 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
303 ;; DefaultDecl ::= '#REQUIRED' | '#IMPLIED'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
304 ;; | (('#FIXED' S)? AttValue)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
305 ;; [VC: Required Attribute]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
306 ;; [VC: Attribute Default Value Syntactically Correct]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
307 ;; [WFC: No < in Attribute Values]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
308 ;; [VC: Fixed Attribute Default]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
309 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
310 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
311 ;; /* Conditional Section */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
312 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
313 ;; conditionalSect ::= includeSect | ignoreSect
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
314 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
315 ;; includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
316 ;; [VC: Proper Conditional Section/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
317 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
318 ;; ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
319 ;; [VC: Proper Conditional Section/PE Nesting]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
320 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
321 ;; ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
322 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
323 ;; Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
324 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
325 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
326 ;; /* Character Reference */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
327 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
328 ;; CharRef ::= '&#' [0-9]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
329 ;; | '&#x' [0-9a-fA-F]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
330 ;; [WFC: Legal Character]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
331 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
332 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
333 ;; /* Entity Reference */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
334 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
335 ;; Reference ::= EntityRef | CharRef
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
336 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
337 ;; EntityRef ::= '&' Name ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
338 ;; [WFC: Entity Declared]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
339 ;; [VC: Entity Declared]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
340 ;; [WFC: Parsed Entity]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
341 ;; [WFC: No Recursion]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
342 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
343 ;; PEReference ::= '%' Name ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
344 ;; [VC: Entity Declared]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
345 ;; [WFC: No Recursion]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
346 ;; [WFC: In DTD]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
347 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
348 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
349 ;; /* Entity Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
350 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
351 ;; EntityDecl ::= GEDecl | PEDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
352 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
353 ;; GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
354 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
355 ;; PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
356 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
357 ;; EntityDef ::= EntityValue | (ExternalID NDataDecl?)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
358 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
359 ;; PEDef ::= EntityValue | ExternalID
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
360 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
361 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
362 ;; /* External Entity Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
363 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
364 ;; ExternalID ::= 'SYSTEM' S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
365 ;; | 'PUBLIC' S PubidLiteral S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
366 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
367 ;; NDataDecl ::= S 'NDATA' S Name
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
368 ;; [VC: Notation Declared]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
369 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
370 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
371 ;; /* Text Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
372 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
373 ;; TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
374 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
375 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
376 ;; /* Well-Formed External Parsed Entity */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
377 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
378 ;; extParsedEnt ::= TextDecl? content
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
379 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
380 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
381 ;; /* Encoding Declaration */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
382 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
383 ;; EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
384 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
385 ;; EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
386 ;; /* Encoding name contains only Latin characters */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
387 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
388 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
389 ;; /* Notation Declarations */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
390 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
391 ;; NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
392 ;; [VC: Unique Notation Name]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
393 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
394 ;; PublicID ::= 'PUBLIC' S PubidLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
395 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
396 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
397 ;; /* Characters */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
398 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
399 ;; Letter ::= BaseChar | Ideographic
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
400 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
401 ;; BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
402 ;; | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
403 ;; | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
404 ;; | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
405 ;; | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
406 ;; | #x0386 | [#x0388-#x038A] | #x038C
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
407 ;; | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
408 ;; | #x03DA | #x03DC | #x03DE
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
409 ;; | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
410 ;; | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
411 ;; | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
412 ;; | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
413 ;; | [#x0531-#x0556] | #x0559 | [#x0561-#x0586]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
414 ;; | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
415 ;; | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
416 ;; | [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
417 ;; | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
418 ;; | [#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
419 ;; | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
420 ;; | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
421 ;; | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
422 ;; | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
423 ;; | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
424 ;; | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
425 ;; | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
426 ;; | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
427 ;; | #x0ABD | #x0AE0 | [#x0B05-#x0B0C]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
428 ;; | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
429 ;; | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
430 ;; | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
431 ;; | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
432 ;; | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
433 ;; | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
434 ;; | [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
435 ;; | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
436 ;; | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
437 ;; | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
438 ;; | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
439 ;; | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
440 ;; | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
441 ;; | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
442 ;; | [#x0E87-#x0E88] | #x0E8A | #x0E8D
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
443 ;; | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
444 ;; | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
445 ;; | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
446 ;; | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
447 ;; | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
448 ;; | #x1100 | [#x1102-#x1103] | [#x1105-#x1107]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
449 ;; | #x1109 | [#x110B-#x110C] | [#x110E-#x1112]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
450 ;; | #x113C | #x113E | #x1140
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
451 ;; | #x114C | #x114E | #x1150
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
452 ;; | [#x1154-#x1155] | #x1159 | [#x115F-#x1161]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
453 ;; | #x1163 | #x1165 | #x1167
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
454 ;; | #x1169 | [#x116D-#x116E] | [#x1172-#x1173]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
455 ;; | #x1175 | #x119E | #x11A8
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
456 ;; | #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
457 ;; | #x11BA | [#x11BC-#x11C2] | #x11EB
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
458 ;; | #x11F0 | #x11F9 | [#x1E00-#x1E9B]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
459 ;; | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
460 ;; | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
461 ;; | #x1F59 | #x1F5B | #x1F5D
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
462 ;; | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
463 ;; | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
464 ;; | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
465 ;; | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
466 ;; | [#x212A-#x212B] | #x212E | [#x2180-#x2182]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
467 ;; | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
468 ;; | [#xAC00-#xD7A3]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
469 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
470 ;; Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
471 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
472 ;; CombiningChar ::= [#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
473 ;; | [#x0591-#x05A1] | [#x05A3-#x05B9] | [#x05BB-#x05BD]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
474 ;; | #x05BF | [#x05C1-#x05C2] | #x05C4
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
475 ;; | [#x064B-#x0652] | #x0670 | [#x06D6-#x06DC]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
476 ;; | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
477 ;; | [#x06EA-#x06ED] | [#x0901-#x0903] | #x093C
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
478 ;; | [#x093E-#x094C] | #x094D | [#x0951-#x0954]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
479 ;; | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
480 ;; | #x09BE | #x09BF | [#x09C0-#x09C4]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
481 ;; | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
482 ;; | [#x09E2-#x09E3] | #x0A02 | #x0A3C
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
483 ;; | #x0A3E | #x0A3F | [#x0A40-#x0A42]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
484 ;; | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
485 ;; | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
486 ;; | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
487 ;; | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
488 ;; | [#x0B4B-#x0B4D] | [#x0B56-#x0B57] | [#x0B82-#x0B83]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
489 ;; | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCD]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
490 ;; | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
491 ;; | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
492 ;; | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
493 ;; | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
494 ;; | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
495 ;; | #x0D57 | #x0E31 | [#x0E34-#x0E3A]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
496 ;; | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
497 ;; | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
498 ;; | #x0F35 | #x0F37 | #x0F39
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
499 ;; | #x0F3E | #x0F3F | [#x0F71-#x0F84]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
500 ;; | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
501 ;; | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
502 ;; | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
503 ;; | #x3099 | #x309A
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
504 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
505 ;; Digit ::= [#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
506 ;; | [#x0966-#x096F] | [#x09E6-#x09EF] | [#x0A66-#x0A6F]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
507 ;; | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] | [#x0BE7-#x0BEF]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
508 ;; | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
509 ;; | [#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
510 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
511 ;; Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
512 ;; | #x3005 | [#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
513 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
514 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
515 ;; NOTES
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
516 ;; -----
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
517 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
518 ;; At moment, only the `<!ELEMENT' generates a syntactic chart. The
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
519 ;; `<!ATTLIST', `<!NOTATION' and `<!ENTITY' are syntacticly checked but they
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
520 ;; don't generate a syntactic chart.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
521 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
522 ;; Besides the syntax above, ebnf-dtd also accepts a `pure' dtd file. An
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
523 ;; example of a `pure' dtd file is:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
524 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
525 ;; <?xml version="1.0" encoding="UTF-8"?>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
526 ;; <!--
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
527 ;; The main element.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
528 ;; -->
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
529 ;; <!ELEMENT workflow (registers?, trigger-functions?, initial-actions,
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
530 ;; steps, splits?, joins?)>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
531 ;; <!--
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
532 ;; An action that can be executed (id must be unique among actions for
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
533 ;; the enclosing step).
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
534 ;; Used in: actions
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
535 ;; -->
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
536 ;; <!ELEMENT action (restrict-to, validators?, pre-functions?, results,
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
537 ;; post-functions?)>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
538 ;; <!ATTLIST action
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
539 ;; id CDATA #REQUIRED
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
540 ;; name CDATA #REQUIRED
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
541 ;; >
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
542 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
543 ;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
544 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
545
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
546 ;;; Code:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
547
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
548
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
549 (require 'ebnf-otz)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
550
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
551
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
552 (defvar ebnf-dtd-lex nil
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
553 "Value returned by `ebnf-dtd-lex' function.")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
554
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
555
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
556 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
557 ;; Syntactic analyzer
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
558
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
559
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
560 ;;; document ::= prolog element Misc*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
561 ;;; /* Note that *only* the prolog will be parsed */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
562
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
563 (defun ebnf-dtd-parser (start)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
564 "DTD parser."
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
565 (let ((total (+ (- ebnf-limit start) 1))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
566 (bias (1- start))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
567 (origin (point))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
568 rule-list token rule the-end)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
569 (goto-char start)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
570 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
571 (and (eq token 'end-of-input)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
572 (error "Empty DTD file"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
573 (setq token (ebnf-dtd-prolog token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
574 (unless (eq (car token) 'end-prolog)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
575 (setq the-end (cdr token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
576 token (car token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
577 (while (not (eq token the-end))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
578 (ebnf-message-float
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
579 "Parsing...%s%%"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
580 (/ (* (- (point) bias) 100.0) total))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
581 (setq token (ebnf-dtd-intsubset token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
582 rule (cdr token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
583 token (car token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
584 (or (null rule)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
585 (ebnf-add-empty-rule-list rule)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
586 (setq rule-list (cons rule rule-list))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
587 (or (eq the-end 'end-of-input)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
588 (eq (ebnf-dtd-lex) 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
589 (error "Missing end of DOCTYPE"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
590 ;; adjust message, 'cause *only* prolog will be parsed
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
591 (ebnf-message-float "Parsing...%s%%" 100.0))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
592 (goto-char origin)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
593 rule-list))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
594
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
595
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
596 ;;; prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
597 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
598 ;;; XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
599 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
600 ;;; VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
601 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
602 ;;; Eq ::= S? '=' S?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
603 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
604 ;;; VersionNum ::= '1.0'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
605 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
606 ;;; Misc ::= Comment | PI | S
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
607 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
608 ;;; EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
609 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
610 ;;; EncName ::= [A-Za-z] ([-A-Za-z0-9._])*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
611 ;;; /* Encoding name contains only Latin characters */
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
612 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
613 ;;; SDDecl ::= S 'standalone' Eq
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
614 ;;; (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
615 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
616 ;;; doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
617 ;;; ('[' intSubset ']' S?)? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
618
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
619
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
620 (defun ebnf-dtd-prolog (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
621 (when (and (eq token 'begin-pi) (string= ebnf-dtd-lex "xml"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
622 ;; version = "1.0"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
623 (setq token (ebnf-dtd-attribute (ebnf-dtd-lex) 'version-attr
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
624 "^1\\.0$" "XML version"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
625 ;; ( encoding = "encoding name" )?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
626 (setq token (ebnf-dtd-attribute-optional
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
627 token 'encoding-attr
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
628 "^[A-Za-z][-A-Za-z0-9._]*$" "XML encoding"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
629 ;; ( standalone = ( "yes" | "no" ) )?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
630 (setq token (ebnf-dtd-attribute-optional
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
631 token 'standalone-attr
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
632 "^yes|no$" "XML standalone"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
633 (or (eq token 'end-pi)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
634 (error "Missing end of XML processing instruction")))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
635 ;; processing instructions
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
636 (setq token (ebnf-dtd-pi (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
637 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
638 ;; DOCTYPE
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
639 ((eq token 'doctype-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
640 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
641 (error "Document type name is missing"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
642 (cons (if (eq (ebnf-dtd-externalid) 'begin-subset)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
643 (ebnf-dtd-lex)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
644 'end-prolog)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
645 'end-subset))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
646 ((memq token '(element-decl attlist-decl entity-decl notation-decl))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
647 (cons token 'end-of-input))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
648 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
649 '(end-prolog . end-subset))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
650 ))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
651
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
652
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
653 (defun ebnf-dtd-attribute (token attr match attr-name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
654 (or (eq token attr)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
655 (error "%s attribute is missing" attr-name))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
656 (ebnf-dtd-attribute-optional token attr match attr-name))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
657
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
658
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
659 (defun ebnf-dtd-attribute-optional (token attr match attr-name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
660 (when (eq token attr)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
661 (or (and (eq (ebnf-dtd-lex) 'equal)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
662 (eq (ebnf-dtd-lex) 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
663 (string-match match ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
664 (error "XML %s attribute is invalid" attr-name))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
665 (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
666 token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
667
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
668
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
669 ;;; ExternalID ::= 'SYSTEM' S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
670 ;;; | 'PUBLIC' S PubidLiteral S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
671
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
672
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
673 (defun ebnf-dtd-externalid (&optional token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
674 (let ((must-have token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
675 (or token (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
676 (cond ((eq token 'system)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
677 (ebnf-dtd-systemliteral))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
678 ((eq token 'public)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
679 (ebnf-dtd-pubidliteral)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
680 (ebnf-dtd-systemliteral))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
681 (must-have
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
682 (error "Missing `SYSTEM' or `PUBLIC' in external id"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
683 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
684 token))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
685
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
686
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
687 ;;; SystemLiteral ::= ('"' [^"]* '"')
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
688 ;;; | ("'" [^']* "'")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
689
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
690
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
691 (defun ebnf-dtd-systemliteral ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
692 (or (eq (ebnf-dtd-lex) 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
693 (error "System identifier is invalid"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
694 (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
695
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
696
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
697 ;;; PubidLiteral ::= '"' PubidChar* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
698 ;;; | "'" (PubidChar - "'")* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
699 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
700 ;;; PubidChar ::= [-'()+,./:=?;!*#@$_%\n\r a-zA-Z0-9]
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
701
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
702
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
703 (defun ebnf-dtd-pubidliteral ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
704 (or (and (eq (ebnf-dtd-lex) 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
705 (string-match "^[-'()+,./:=?;!*#@$_%\n\r a-zA-Z0-9]*$"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
706 ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
707 (error "Public identifier is invalid")))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
708
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
709
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
710 ;;; PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
711 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
712 ;;; PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
713
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
714
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
715 (defun ebnf-dtd-pi (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
716 (while (eq token 'begin-pi)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
717 (and (string-match "^[xX][mM][lL]$" ebnf-dtd-lex)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
718 (error "Processing instruction name can not be `XML'"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
719 (while (not (eq (ebnf-dtd-lex) 'end-pi)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
720 (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
721 token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
722
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
723
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
724 ;;; doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
725 ;;; ('[' intSubset ']' S?)? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
726 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
727 ;;; intSubset ::= (markupdecl | DeclSep)*
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
728 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
729 ;;; DeclSep ::= PEReference | S
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
730 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
731 ;;; markupdecl ::= elementdecl | AttlistDecl | EntityDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
732 ;;; | NotationDecl | PI | Comment
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
733
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
734
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
735 (defun ebnf-dtd-intsubset (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
736 ;; PI - Processing Instruction
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
737 (and (eq token 'begin-pi)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
738 (setq token (ebnf-dtd-pi token)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
739 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
740 ((memq token '(end-subset end-of-input))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
741 (cons token nil))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
742 ((eq token 'pe-ref)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
743 (cons (ebnf-dtd-lex) nil)) ; annotation
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
744 ((eq token 'element-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
745 (ebnf-dtd-elementdecl)) ; rule
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
746 ((eq token 'attlist-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
747 (ebnf-dtd-attlistdecl)) ; annotation
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
748 ((eq token 'entity-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
749 (ebnf-dtd-entitydecl)) ; annotation
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
750 ((eq token 'notation-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
751 (ebnf-dtd-notationdecl)) ; annotation
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
752 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
753 (error "Invalid DOCTYPE element"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
754 ))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
755
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
756
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
757 ;;; elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
758 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
759 ;;; contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
760 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
761 ;;; Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
762 ;;; | '(' S? '#PCDATA' S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
763 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
764 ;;; children ::= (choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
765 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
766 ;;; choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
767 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
768 ;;; seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
769 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
770 ;;; cp ::= (Name | choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
771
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
772
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
773 (defun ebnf-dtd-elementdecl ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
774 (let ((action ebnf-action)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
775 name token body)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
776 (setq ebnf-action nil)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
777 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
778 (error "Invalid ELEMENT name"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
779 (setq name ebnf-dtd-lex
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
780 token (ebnf-dtd-lex)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
781 body (cond ((memq token '(empty any))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
782 (let ((term (ebnf-make-terminal ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
783 (cons (ebnf-dtd-lex) term)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
784 ((eq token 'begin-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
785 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
786 (if (eq token 'pcdata)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
787 (ebnf-dtd-mixed)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
788 (ebnf-dtd-children token)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
789 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
790 (error "Invalid ELEMENT content"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
791 ))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
792 (or (eq (car body) 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
793 (error "Missing `>' in ELEMENT declaration"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
794 (ebnf-eps-add-production name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
795 (cons (ebnf-dtd-lex)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
796 (ebnf-make-production name (cdr body) action))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
797
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
798
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
799 ;;; Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
800 ;;; | '(' S? '#PCDATA' S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
801
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
802
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
803 (defun ebnf-dtd-mixed ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
804 (let* ((alt (cons (ebnf-make-terminal ebnf-dtd-lex) nil))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
805 (token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
806 (has-alternative (eq token 'alternative)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
807 (while (eq token 'alternative)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
808 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
809 (error "Invalid name"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
810 (setq alt (cons ebnf-dtd-lex alt)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
811 token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
812 (or (eq token 'end-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
813 (error "Missing `)'"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
814 (and has-alternative
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
815 (or (eq (ebnf-dtd-lex) 'zero-or-more)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
816 (error "Missing `*'")))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
817 (ebnf-token-alternative alt (cons (ebnf-dtd-lex) nil))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
818
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
819
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
820 ;;; children ::= (choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
821
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
822
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
823 (defun ebnf-dtd-children (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
824 (ebnf-dtd-operators (ebnf-dtd-choice-seq token)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
825
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
826
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
827 ;;; choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
828 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
829 ;;; seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
830
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
831
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
832 (defun ebnf-dtd-choice-seq (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
833 (setq token (ebnf-dtd-cp token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
834 (let (elist)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
835 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
836 ;; choice
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
837 ((eq (car token) 'alternative)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
838 (while (eq (car token) 'alternative)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
839 (setq elist (cons (cdr token) elist)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
840 token (ebnf-dtd-cp (ebnf-dtd-lex))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
841 (setq elist (ebnf-token-alternative elist token)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
842 ;; seq
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
843 ((eq (car token) 'comma)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
844 (while (eq (car token) 'comma)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
845 (setq elist (cons (cdr token) elist)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
846 token (ebnf-dtd-cp (ebnf-dtd-lex))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
847 (setq elist (ebnf-token-sequence (cons (cdr token) elist))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
848 ;; only one element
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
849 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
850 (setq elist (cdr token))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
851 (or (eq (car token) 'end-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
852 (error "Missing `)' in ELEMENT content"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
853 elist))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
854
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
855
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
856 ;;; cp ::= (Name | choice | seq) ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
857
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
858
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
859 (defun ebnf-dtd-cp (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
860 (ebnf-dtd-operators (cond ((eq token 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
861 (ebnf-make-terminal ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
862 ((eq token 'begin-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
863 (ebnf-dtd-choice-seq (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
864 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
865 (error "Invalid element"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
866 )))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
867
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
868
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
869 ;;; elm ('?' | '*' | '+')?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
870
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
871
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
872 (defun ebnf-dtd-operators (elm)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
873 (let ((token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
874 (cond ((eq token 'optional) ; ? - optional
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
875 (cons (ebnf-dtd-lex) (ebnf-token-optional elm)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
876 ((eq token 'zero-or-more) ; * - zero or more
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
877 (cons (ebnf-dtd-lex) (ebnf-make-zero-or-more elm)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
878 ((eq token 'one-or-more) ; + - one or more
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
879 (cons (ebnf-dtd-lex) (ebnf-make-one-or-more elm)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
880 (t ; only element
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
881 (cons token elm))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
882 )))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
883
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
884
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
885 ;;; AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
886 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
887 ;;; AttDef ::= S Name S AttType S DefaultDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
888 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
889 ;;; AttType ::= StringType | TokenizedType | EnumeratedType
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
890 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
891 ;;; StringType ::= 'CDATA'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
892 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
893 ;;; TokenizedType ::= 'ID'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
894 ;;; | 'IDREF'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
895 ;;; | 'IDREFS'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
896 ;;; | 'ENTITY'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
897 ;;; | 'ENTITIES'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
898 ;;; | 'NMTOKEN'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
899 ;;; | 'NMTOKENS'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
900 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
901 ;;; EnumeratedType ::= NotationType | Enumeration
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
902 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
903 ;;; NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
904 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
905 ;;; Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
906 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
907 ;;; DefaultDecl ::= '#REQUIRED'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
908 ;;; | '#IMPLIED'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
909 ;;; | (('#FIXED' S)? AttValue)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
910 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
911 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
912 ;;; AttValue ::= '"' ([^<&"] | Reference)* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
913 ;;; | "'" ([^<&'] | Reference)* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
914 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
915 ;;; Reference ::= EntityRef | CharRef
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
916 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
917 ;;; EntityRef ::= '&' Name ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
918 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
919 ;;; CharRef ::= '&#' [0-9]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
920 ;;; | '&#x' [0-9a-fA-F]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
921
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
922 ;;; "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
923
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
924
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
925 (defun ebnf-dtd-attlistdecl ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
926 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
927 (error "Invalid ATTLIST name"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
928 (let (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
929 (while (eq (setq token (ebnf-dtd-lex)) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
930 ;; type
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
931 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
932 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
933 ((eq token 'notation)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
934 (or (eq (ebnf-dtd-lex) 'begin-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
935 (error "Missing `(' in NOTATION type in ATTLIST declaration"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
936 (ebnf-dtd-namelist "NOTATION" '(name)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
937 ((eq token 'begin-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
938 (ebnf-dtd-namelist "enumeration" '(name name-char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
939 ((memq token
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
940 '(cdata id idref idrefs entity entities nmtoken nmtokens)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
941 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
942 (error "Invalid type in ATTLIST declaration")))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
943 ;; default value
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
944 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
945 (unless (memq token '(required implied))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
946 (and (eq token 'fixed)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
947 (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
948 (or (and (eq token 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
949 (string-match
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
950 "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
951 ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
952 (error "Invalid default value in ATTLIST declaration"))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
953 (or (eq token 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
954 (error "Missing `>' in end of ATTLIST"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
955 (cons (ebnf-dtd-lex) nil)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
956
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
957
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
958 (defun ebnf-dtd-namelist (type name-list)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
959 (let (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
960 (while (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
961 (or (memq (ebnf-dtd-lex) name-list)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
962 (error "Invalid name in %s type in ATTLIST declaration" type))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
963 (eq (setq token (ebnf-dtd-lex)) 'alternative)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
964 (or (eq token 'end-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
965 (error "Missing `)' in %s type in ATTLIST declaration" type))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
966
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
967
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
968 ;;; EntityDecl ::= GEDecl | PEDecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
969 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
970 ;;; GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
971 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
972 ;;; PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
973 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
974 ;;; EntityDef ::= EntityValue | (ExternalID NDataDecl?)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
975 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
976 ;;; PEDef ::= EntityValue | ExternalID
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
977 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
978 ;;; NDataDecl ::= S 'NDATA' S Name
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
979 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
980 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
981 ;;; EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
982 ;;; | "'" ([^%&'] | PEReference | Reference)* "'"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
983 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
984 ;;; PEReference ::= '%' Name ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
985 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
986 ;;; Reference ::= EntityRef | CharRef
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
987 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
988 ;;; EntityRef ::= '&' Name ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
989 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
990 ;;; CharRef ::= '&#' [0-9]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
991 ;;; | '&#x' [0-9a-fA-F]+ ';'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
992
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
993 ;;; "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
994
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
995
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
996 (defun ebnf-dtd-entitydecl ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
997 (let* ((token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
998 (pedecl (eq token 'percent)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
999 (and pedecl
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1000 (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1001 (or (eq token 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1002 (error "Invalid name of ENTITY"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1003 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1004 (if (eq token 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1005 (if (string-match
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1006 "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1007 ebnf-dtd-lex)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1008 (setq token (ebnf-dtd-lex))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1009 (error "Invalid ENTITY definition"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1010 (setq token (ebnf-dtd-externalid token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1011 (when (and (not pedecl) (eq token 'ndata))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1012 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1013 (error "Invalid NDATA name"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1014 (setq token (ebnf-dtd-lex))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1015 (or (eq token 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1016 (error "Missing `>' in end of ENTITY"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1017 (cons (ebnf-dtd-lex) nil)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1018
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1019
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1020 ;;; NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1021 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1022 ;;; PublicID ::= 'PUBLIC' S PubidLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1023
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1024
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1025 (defun ebnf-dtd-notationdecl ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1026 (or (eq (ebnf-dtd-lex) 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1027 (error "Invalid name NOTATION"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1028 (or (eq (ebnf-dtd-externalid-or-publicid) 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1029 (error "Missing `>' in end of NOTATION"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1030 (cons (ebnf-dtd-lex) nil))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1031
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1032
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1033 ;;; ExternalID ::= 'SYSTEM' S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1034 ;;; | 'PUBLIC' S PubidLiteral S SystemLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1035 ;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1036 ;;; PublicID ::= 'PUBLIC' S PubidLiteral
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1037
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1038
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1039 (defun ebnf-dtd-externalid-or-publicid ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1040 (let ((token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1041 (cond ((eq token 'system)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1042 (ebnf-dtd-systemliteral))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1043 ((eq token 'public)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1044 (ebnf-dtd-pubidliteral)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1045 (and (eq (setq token (ebnf-dtd-lex)) 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1046 (setq token (ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1047 token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1048 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1049 (error "Missing `SYSTEM' or `PUBLIC'")))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1050
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1051
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1052 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1053 ;; Lexical analyzer
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1054
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1055
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1056 (defconst ebnf-dtd-token-table (make-vector 256 'error)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1057 "Vector used to map characters to a lexical token.")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1058
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1059
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1060 (defun ebnf-dtd-initialize ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1061 "Initialize EBNF token table."
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1062 ;; control character & control 8-bit character are set to `error'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1063 (let ((char ?\060))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1064 ;; digits: 0-9
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1065 (while (< char ?\072)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1066 (aset ebnf-dtd-token-table char 'name-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1067 (setq char (1+ char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1068 ;; printable character: A-Z
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1069 (setq char ?\101)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1070 (while (< char ?\133)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1071 (aset ebnf-dtd-token-table char 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1072 (setq char (1+ char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1073 ;; printable character: a-z
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1074 (setq char ?\141)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1075 (while (< char ?\173)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1076 (aset ebnf-dtd-token-table char 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1077 (setq char (1+ char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1078 ;; European 8-bit accentuated characters:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1079 (setq char ?\240)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1080 (while (< char ?\400)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1081 (aset ebnf-dtd-token-table char 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1082 (setq char (1+ char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1083 ;; Override name characters:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1084 (aset ebnf-dtd-token-table ?_ 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1085 (aset ebnf-dtd-token-table ?: 'name)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1086 (aset ebnf-dtd-token-table ?. 'name-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1087 (aset ebnf-dtd-token-table ?- 'name-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1088 ;; Override space characters:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1089 (aset ebnf-dtd-token-table ?\n 'space) ; [NL] linefeed
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1090 (aset ebnf-dtd-token-table ?\r 'space) ; [CR] carriage return
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1091 (aset ebnf-dtd-token-table ?\t 'space) ; [HT] horizontal tab
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1092 (aset ebnf-dtd-token-table ?\ 'space) ; [SP] space
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1093 ;; Override other lexical characters:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1094 (aset ebnf-dtd-token-table ?= 'equal)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1095 (aset ebnf-dtd-token-table ?, 'comma)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1096 (aset ebnf-dtd-token-table ?* 'zero-or-more)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1097 (aset ebnf-dtd-token-table ?+ 'one-or-more)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1098 (aset ebnf-dtd-token-table ?| 'alternative)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1099 (aset ebnf-dtd-token-table ?% 'percent)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1100 (aset ebnf-dtd-token-table ?& 'ampersand)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1101 (aset ebnf-dtd-token-table ?# 'hash)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1102 (aset ebnf-dtd-token-table ?\? 'interrogation)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1103 (aset ebnf-dtd-token-table ?\" 'double-quote)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1104 (aset ebnf-dtd-token-table ?\' 'single-quote)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1105 (aset ebnf-dtd-token-table ?< 'less-than)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1106 (aset ebnf-dtd-token-table ?> 'end-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1107 (aset ebnf-dtd-token-table ?\( 'begin-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1108 (aset ebnf-dtd-token-table ?\) 'end-group)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1109 (aset ebnf-dtd-token-table ?\[ 'begin-subset)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1110 (aset ebnf-dtd-token-table ?\] 'end-subset)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1111
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1112
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1113 ;; replace the range "\240-\377" (see `ebnf-range-regexp').
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1114 (defconst ebnf-dtd-name-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1115 (ebnf-range-regexp "-._:0-9A-Za-z" ?\240 ?\377))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1116
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1117
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1118 (defconst ebnf-dtd-decl-alist
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1119 '(("ATTLIST" . attlist-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1120 ("DOCTYPE" . doctype-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1121 ("ELEMENT" . element-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1122 ("ENTITY" . entity-decl)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1123 ("NOTATION" . notation-decl)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1124
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1125
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1126 (defconst ebnf-dtd-element-alist
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1127 '(("#FIXED" . fixed)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1128 ("#IMPLIED" . implied)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1129 ("#PCDATA" . pcdata)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1130 ("#REQUIRED" . required)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1131
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1132
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1133 (defconst ebnf-dtd-name-alist
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1134 '(("ANY" . any)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1135 ("CDATA" . cdata)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1136 ("EMPTY" . empty)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1137 ("ENTITIES" . entities)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1138 ("ENTITY" . entity)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1139 ("ID" . id)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1140 ("IDREF" . idref)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1141 ("IDREFS" . idrefs)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1142 ("NDATA" . ndata)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1143 ("NMTOKEN" . nmtoken)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1144 ("NMTOKENS" . nmtokens)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1145 ("NOTATION" . notation)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1146 ("PUBLIC" . public)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1147 ("SYSTEM" . system)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1148 ("encoding" . encoding-attr)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1149 ("standalone" . standalone-attr)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1150 ("version" . version-attr)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1151
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1152
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1153 (defun ebnf-dtd-lex ()
63630
feac886f9929 (ebnf-dtd-lex): Fix spellings.
Juanma Barranquero <lekktu@gmail.com>
parents: 60917
diff changeset
1154 "Lexical analyzer for DTD.
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1155
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1156 Return a lexical token.
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1157
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1158 See documentation for variable `ebnf-dtd-lex'."
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1159 (if (>= (point) ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1160 'end-of-input
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1161 (let (token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1162 ;; skip spaces and comments
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1163 (while (if (> (following-char) 255)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1164 (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1165 (setq token 'error)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1166 nil)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1167 (setq token (aref ebnf-dtd-token-table (following-char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1168 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1169 ((eq token 'space)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1170 (skip-chars-forward " \n\r\t" ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1171 (< (point) ebnf-limit))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1172 ((and (eq token 'less-than)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1173 (looking-at "<!--"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1174 (ebnf-dtd-skip-comment))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1175 (t nil)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1176 )))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1177 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1178 ;; end of input
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1179 ((>= (point) ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1180 'end-of-input)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1181 ;; error
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1182 ((eq token 'error)
60917
87f9bb9d3718 * progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el,
Werner LEMBERG <wl@gnu.org>
parents: 54713
diff changeset
1183 (error "Invalid character"))
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1184 ;; beginning of declaration:
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1185 ;; <?name, <!ATTLIST, <!DOCTYPE, <!ELEMENT, <!ENTITY, <!NOTATION
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1186 ((eq token 'less-than)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1187 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1188 (let ((char (following-char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1189 (cond ((= char ?\?) ; <?
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1190 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1191 (setq ebnf-dtd-lex (ebnf-buffer-substring ebnf-dtd-name-chars))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1192 'begin-pi)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1193 ((= char ?!) ; <!
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1194 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1195 (let ((decl (ebnf-buffer-substring ebnf-dtd-name-chars)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1196 (or (cdr (assoc decl ebnf-dtd-decl-alist))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1197 (error "Invalid declaration name `%s'" decl))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1198 (t ; <x
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1199 (error "Invalid declaration `<%c'" char)))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1200 ;; name, namechar
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1201 ((memq token '(name name-char))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1202 (setq ebnf-dtd-lex (ebnf-buffer-substring ebnf-dtd-name-chars))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1203 (or (cdr (assoc ebnf-dtd-lex ebnf-dtd-name-alist))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1204 token))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1205 ;; ?, ?>
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1206 ((eq token 'interrogation)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1207 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1208 (if (/= (following-char) ?>)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1209 'optional
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1210 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1211 'end-pi))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1212 ;; #FIXED, #IMPLIED, #PCDATA, #REQUIRED
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1213 ((eq token 'hash)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1214 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1215 (setq ebnf-dtd-lex
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1216 (concat "#" (ebnf-buffer-substring ebnf-dtd-name-chars)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1217 (or (cdr (assoc ebnf-dtd-lex ebnf-dtd-element-alist))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1218 (error "Invalid element `%s'" ebnf-dtd-lex)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1219 ;; "string"
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1220 ((eq token 'double-quote)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1221 (setq ebnf-dtd-lex (ebnf-dtd-string ?\"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1222 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1223 ;; 'string'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1224 ((eq token 'single-quote)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1225 (setq ebnf-dtd-lex (ebnf-dtd-string ?\'))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1226 'string)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1227 ;; %, %name;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1228 ((eq token 'percent)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1229 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1230 (if (looking-at "[ \n\r\t]")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1231 'percent
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1232 (setq ebnf-dtd-lex (ebnf-dtd-name-ref "%"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1233 'pe-ref))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1234 ;; &#...;, &#x...;, &name;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1235 ((eq token 'ampersand)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1236 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1237 (if (/= (following-char) ?#)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1238 (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1239 ;; &name;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1240 (setq ebnf-dtd-lex (ebnf-dtd-name-ref "&"))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1241 'entity-ref)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1242 ;; &#...;, &#x...;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1243 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1244 (setq ebnf-dtd-lex (if (/= (following-char) ?x)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1245 (ebnf-dtd-char-ref "&#" "0-9")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1246 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1247 (ebnf-dtd-char-ref "&#x" "0-9a-fA-F")))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1248 'char-ref))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1249 ;; miscellaneous: (, ), [, ], =, |, *, +, >, `,'
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1250 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1251 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1252 token)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1253 ))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1254
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1255
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1256 (defun ebnf-dtd-name-ref (start)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1257 (ebnf-dtd-char-ref start ebnf-dtd-name-chars))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1258
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1259
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1260 (defun ebnf-dtd-char-ref (start chars)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1261 (let ((char (ebnf-buffer-substring chars)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1262 (or (= (following-char) ?\;)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1263 (error "Invalid element `%s%s%c'" start char (following-char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1264 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1265 (format "%s%s;" start char)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1266
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1267
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1268 ;; replace the range "\240-\377" (see `ebnf-range-regexp').
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1269 (defconst ebnf-dtd-double-string-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1270 (ebnf-range-regexp "\t -!#-~" ?\240 ?\377))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1271 (defconst ebnf-dtd-single-string-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1272 (ebnf-range-regexp "\t -&(-~" ?\240 ?\377))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1273
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1274
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1275 (defun ebnf-dtd-string (delim)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1276 (buffer-substring-no-properties
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1277 (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1278 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1279 (point))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1280 (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1281 (skip-chars-forward (if (= delim ?\")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1282 ebnf-dtd-double-string-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1283 ebnf-dtd-single-string-chars)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1284 ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1285 (or (= (following-char) delim)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1286 (error "Missing string delimiter `%c'" delim))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1287 (prog1
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1288 (point)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1289 (forward-char)))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1290
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1291
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1292 ;; replace the range "\177-\237" (see `ebnf-range-regexp').
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1293 (defconst ebnf-dtd-comment-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1294 (ebnf-range-regexp "^-\000-\010\013\014\016-\037" ?\177 ?\237))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1295 (defconst ebnf-dtd-filename-chars
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1296 (ebnf-range-regexp "^-\000-\037" ?\177 ?\237))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1297
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1298
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1299 (defun ebnf-dtd-skip-comment ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1300 (forward-char 4) ; <!--
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1301 (cond
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1302 ;; open EPS file
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1303 ((and ebnf-eps-executing (= (following-char) ?\[))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1304 (ebnf-eps-add-context (ebnf-dtd-eps-filename)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1305 ;; close EPS file
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1306 ((and ebnf-eps-executing (= (following-char) ?\]))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1307 (ebnf-eps-remove-context (ebnf-dtd-eps-filename)))
82143
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1308 ;; EPS header
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1309 ((and ebnf-eps-executing (= (following-char) ?H))
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1310 (ebnf-eps-header-comment (ebnf-dtd-eps-filename)))
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1311 ;; EPS footer
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1312 ((and ebnf-eps-executing (= (following-char) ?F))
81c81019e0c6 New: Header/Footer comment & Log messages
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 78234
diff changeset
1313 (ebnf-eps-footer-comment (ebnf-dtd-eps-filename)))
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1314 ;; any other action in comment
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1315 (t
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1316 (setq ebnf-action (aref ebnf-comment-table (following-char))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1317 )
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1318 (while (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1319 (skip-chars-forward ebnf-dtd-comment-chars ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1320 (and (< (point) ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1321 (not (looking-at "-->"))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1322 (skip-chars-forward "-" ebnf-limit))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1323 ;; check for a valid end of comment
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1324 (cond ((>= (point) ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1325 nil)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1326 ((looking-at "-->")
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1327 (forward-char 3)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1328 t)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1329 (t
60917
87f9bb9d3718 * progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el,
Werner LEMBERG <wl@gnu.org>
parents: 54713
diff changeset
1330 (error "Invalid character"))
54712
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1331 ))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1332
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1333
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1334 (defun ebnf-dtd-eps-filename ()
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1335 (forward-char)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1336 (let (fname)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1337 (while (progn
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1338 (setq fname
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1339 (concat fname
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1340 (ebnf-buffer-substring ebnf-dtd-filename-chars)))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1341 (and (< (point) ebnf-limit)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1342 (= (following-char) ?-) ; may be \n, \t, \r
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1343 (not (looking-at "-->"))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1344 (setq fname (concat fname (ebnf-buffer-substring "-"))))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1345 fname))
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1346
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1347
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1349
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1350
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1351 (provide 'ebnf-dtd)
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1352
9b9f2e6accd0 Parser for DTD (Data Type Definition for XML).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1353 ;;; ebnf-dtd.el ends here