rgen 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/CHANGELOG +20 -1
  2. data/MIT-LICENSE +1 -1
  3. data/README +12 -9
  4. data/lib/instantiators/ea_instantiator.rb +36 -0
  5. data/lib/metamodels/uml13_metamodel.rb +559 -0
  6. data/lib/metamodels/uml13_metamodel_ext.rb +26 -0
  7. data/lib/mmgen/metamodel_generator.rb +5 -5
  8. data/lib/mmgen/mm_ext/ecore_ext.rb +95 -0
  9. data/lib/mmgen/mmgen.rb +6 -4
  10. data/lib/mmgen/templates/annotations.tpl +37 -0
  11. data/lib/mmgen/templates/metamodel_generator.tpl +171 -0
  12. data/lib/rgen/ecore/ecore.rb +190 -0
  13. data/lib/rgen/ecore/ecore_instantiator.rb +25 -0
  14. data/lib/rgen/ecore/ecore_transformer.rb +85 -0
  15. data/lib/rgen/environment.rb +9 -24
  16. data/lib/rgen/find_helper.rb +68 -0
  17. data/lib/rgen/{instantiator.rb → instantiator/abstract_instantiator.rb} +6 -2
  18. data/lib/rgen/instantiator/abstract_xml_instantiator.rb +59 -0
  19. data/lib/rgen/instantiator/default_xml_instantiator.rb +117 -0
  20. data/lib/rgen/instantiator/ecore_xml_instantiator.rb +144 -0
  21. data/lib/rgen/instantiator/nodebased_xml_instantiator.rb +157 -0
  22. data/lib/rgen/instantiator/xmi11_instantiator.rb +164 -0
  23. data/lib/rgen/metamodel_builder.rb +103 -9
  24. data/lib/rgen/metamodel_builder/build_helper.rb +26 -4
  25. data/lib/rgen/metamodel_builder/builder_extensions.rb +285 -88
  26. data/lib/rgen/metamodel_builder/builder_runtime.rb +7 -1
  27. data/lib/rgen/metamodel_builder/data_types.rb +67 -0
  28. data/lib/rgen/metamodel_builder/intermediate/annotation.rb +30 -0
  29. data/lib/rgen/metamodel_builder/metamodel_description.rb +232 -0
  30. data/lib/rgen/metamodel_builder/mm_multiple.rb +23 -0
  31. data/lib/rgen/metamodel_builder/module_extension.rb +33 -0
  32. data/lib/rgen/model_comparator.rb +56 -0
  33. data/lib/rgen/model_dumper.rb +5 -5
  34. data/lib/rgen/name_helper.rb +17 -1
  35. data/lib/rgen/template_language.rb +148 -28
  36. data/lib/rgen/template_language/directory_template_container.rb +56 -38
  37. data/lib/rgen/template_language/output_handler.rb +93 -77
  38. data/lib/rgen/template_language/template_container.rb +186 -143
  39. data/lib/rgen/transformer.rb +19 -14
  40. data/lib/transformers/uml13_to_ecore.rb +75 -0
  41. data/redist/xmlscan/ChangeLog +1301 -0
  42. data/redist/xmlscan/README +34 -0
  43. data/redist/xmlscan/THANKS +11 -0
  44. data/redist/xmlscan/doc/changes.html +74 -0
  45. data/redist/xmlscan/doc/changes.rd +80 -0
  46. data/redist/xmlscan/doc/en/conformance.html +136 -0
  47. data/redist/xmlscan/doc/en/conformance.rd +152 -0
  48. data/redist/xmlscan/doc/en/manual.html +356 -0
  49. data/redist/xmlscan/doc/en/manual.rd +402 -0
  50. data/redist/xmlscan/doc/ja/conformance.ja.html +118 -0
  51. data/redist/xmlscan/doc/ja/conformance.ja.rd +134 -0
  52. data/redist/xmlscan/doc/ja/manual.ja.html +325 -0
  53. data/redist/xmlscan/doc/ja/manual.ja.rd +370 -0
  54. data/redist/xmlscan/doc/src/Makefile +41 -0
  55. data/redist/xmlscan/doc/src/conformance.rd.src +256 -0
  56. data/redist/xmlscan/doc/src/langsplit.rb +110 -0
  57. data/redist/xmlscan/doc/src/manual.rd.src +614 -0
  58. data/redist/xmlscan/install.rb +41 -0
  59. data/redist/xmlscan/lib/xmlscan/encoding.rb +311 -0
  60. data/redist/xmlscan/lib/xmlscan/htmlscan.rb +289 -0
  61. data/redist/xmlscan/lib/xmlscan/namespace.rb +352 -0
  62. data/redist/xmlscan/lib/xmlscan/parser.rb +299 -0
  63. data/redist/xmlscan/lib/xmlscan/scanner.rb +1109 -0
  64. data/redist/xmlscan/lib/xmlscan/version.rb +22 -0
  65. data/redist/xmlscan/lib/xmlscan/visitor.rb +158 -0
  66. data/redist/xmlscan/lib/xmlscan/xmlchar.rb +441 -0
  67. data/redist/xmlscan/memo/CONFORMANCE +1249 -0
  68. data/redist/xmlscan/memo/PRODUCTIONS +195 -0
  69. data/redist/xmlscan/memo/contentspec.ry +335 -0
  70. data/redist/xmlscan/samples/chibixml.rb +105 -0
  71. data/redist/xmlscan/samples/getxmlchar.rb +122 -0
  72. data/redist/xmlscan/samples/rexml.rb +159 -0
  73. data/redist/xmlscan/samples/xmlbench.rb +88 -0
  74. data/redist/xmlscan/samples/xmlbench/parser/chibixml.rb +22 -0
  75. data/redist/xmlscan/samples/xmlbench/parser/nqxml.rb +29 -0
  76. data/redist/xmlscan/samples/xmlbench/parser/rexml.rb +62 -0
  77. data/redist/xmlscan/samples/xmlbench/parser/xmlparser.rb +22 -0
  78. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-0.0.10.rb +62 -0
  79. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-chibixml.rb +22 -0
  80. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-rexml.rb +22 -0
  81. data/redist/xmlscan/samples/xmlbench/parser/xmlscan.rb +99 -0
  82. data/redist/xmlscan/samples/xmlbench/xmlbench-lib.rb +116 -0
  83. data/redist/xmlscan/samples/xmlconftest.rb +200 -0
  84. data/redist/xmlscan/test.rb +7 -0
  85. data/redist/xmlscan/tests/deftestcase.rb +73 -0
  86. data/redist/xmlscan/tests/runtest.rb +47 -0
  87. data/redist/xmlscan/tests/testall.rb +14 -0
  88. data/redist/xmlscan/tests/testencoding.rb +438 -0
  89. data/redist/xmlscan/tests/testhtmlscan.rb +752 -0
  90. data/redist/xmlscan/tests/testnamespace.rb +457 -0
  91. data/redist/xmlscan/tests/testparser.rb +591 -0
  92. data/redist/xmlscan/tests/testscanner.rb +1749 -0
  93. data/redist/xmlscan/tests/testxmlchar.rb +143 -0
  94. data/redist/xmlscan/tests/visitor.rb +34 -0
  95. data/test/array_extensions_test.rb +2 -2
  96. data/test/ea_instantiator_test.rb +41 -0
  97. data/test/ecore_self_test.rb +53 -0
  98. data/test/environment_test.rb +11 -6
  99. data/test/metamodel_builder_test.rb +404 -245
  100. data/test/metamodel_roundtrip_test.rb +52 -0
  101. data/test/metamodel_roundtrip_test/TestModel.rb +65 -0
  102. data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +64 -0
  103. data/test/metamodel_roundtrip_test/houseMetamodel.ecore +32 -0
  104. data/test/metamodel_roundtrip_test/houseMetamodel_from_ecore.rb +39 -0
  105. data/test/rgen_test.rb +3 -3
  106. data/test/template_language_test.rb +65 -39
  107. data/test/template_language_test/expected_result.txt +24 -3
  108. data/test/template_language_test/templates/code/array.tpl +11 -0
  109. data/test/template_language_test/templates/content/author.tpl +7 -0
  110. data/test/template_language_test/templates/content/chapter.tpl +1 -1
  111. data/test/template_language_test/templates/root.tpl +17 -8
  112. data/test/template_language_test/testout.txt +24 -3
  113. data/test/testmodel/class_model_checker.rb +119 -0
  114. data/test/{xmi_instantiator_test/testmodel.eap → testmodel/ea_testmodel.eap} +0 -0
  115. data/test/{xmi_instantiator_test/testmodel.xml → testmodel/ea_testmodel.xml} +81 -14
  116. data/test/testmodel/ea_testmodel_partial.xml +317 -0
  117. data/test/testmodel/ecore_model_checker.rb +101 -0
  118. data/test/testmodel/manual_testmodel.xml +22 -0
  119. data/test/testmodel/object_model_checker.rb +67 -0
  120. data/test/transformer_test.rb +18 -10
  121. data/test/xml_instantiator_test.rb +81 -8
  122. data/test/xml_instantiator_test/simple_ecore_model_checker.rb +94 -0
  123. data/test/xml_instantiator_test/simple_xmi_ecore_instantiator.rb +53 -0
  124. data/test/xml_instantiator_test/simple_xmi_metamodel.rb +49 -0
  125. data/test/xml_instantiator_test/simple_xmi_to_ecore.rb +75 -0
  126. metadata +126 -28
  127. data/lib/ea/xmi_class_instantiator.rb +0 -46
  128. data/lib/ea/xmi_helper.rb +0 -26
  129. data/lib/ea/xmi_metamodel.rb +0 -34
  130. data/lib/ea/xmi_object_instantiator.rb +0 -46
  131. data/lib/ea/xmi_to_classmodel.rb +0 -78
  132. data/lib/ea/xmi_to_objectmodel.rb +0 -92
  133. data/lib/mmgen/mm_ext/uml_classmodel_ext.rb +0 -71
  134. data/lib/mmgen/templates/uml_classmodel.tpl +0 -63
  135. data/lib/rgen/xml_instantiator.rb +0 -132
  136. data/lib/uml/objectmodel_instantiator.rb +0 -53
  137. data/lib/uml/uml_classmodel.rb +0 -92
  138. data/lib/uml/uml_objectmodel.rb +0 -65
  139. data/test/metamodel_generator_test.rb +0 -44
  140. data/test/metamodel_generator_test/TestModel.rb +0 -40
  141. data/test/metamodel_generator_test/expected_result.txt +0 -40
  142. data/test/xmi_class_instantiator_test.rb +0 -24
  143. data/test/xmi_instantiator_test/class_model_checker.rb +0 -97
  144. data/test/xmi_object_instantiator_test.rb +0 -65
  145. data/test/xml_instantiator_test/testmodel.xml +0 -7
@@ -0,0 +1,370 @@
1
+ =begin
2
+ # $Id: manual.rd.src,v 1.1 2003/01/22 16:41:45 katsu Exp $
3
+
4
+ = xmlscan version 0.2 ��ե���󥹥ޥ˥奢��
5
+
6
+ == ����
7
+
8
+ xmlscan �� Ruby �����ǽ񤫤줿 non-validating XML parser �Ǥ���
9
+
10
+ ���Τ褦����Ĺ������ޤ���
11
+
12
+ : 100% pure Ruby
13
+ ��ĥ�饤�֥������ɬ�פȤ��ʤ��Τǡ�1.6 �ʾ�� Ruby ���󥿥ץ꥿����
14
+ ����д�����ư��ޤ���(ɸ��ź�դγ�ĥ�饤�֥���ɬ�פȤ��ޤ���)
15
+
16
+ : ���ʤؤ�Ŭ����
17
+ xmlscan �ϡ�XML 1.0 Specification �ǽҤ٤��Ƥ��롢�������򸡾ڤ��ʤ�
18
+ �ץ������˵��������Ƥξ������������Ȥ���ɸ�˳�ȯ���ʤ����
19
+ ���ޤ���
20
+
21
+ : ��®
22
+ xmlscan �β��Ϥ�®���ϡ������餯����¸���� Ruby �ǽ񤫤줿
23
+ XML/HTML parser ����Ǻ�®�Ǥ���
24
+
25
+ : �͡���CES���б�
26
+ xmlscan �Ͼ��ʤ��Ȥ� iso-8859-*, EUC-*, Shift_JIS, UTF-8 �ǽ񤫤줿
27
+ XMLʸ��򤽤Τޤ޲��ϤǤ��ޤ��������� UTF-16 �ϰ����ޤ���
28
+
29
+ : ���Ϥ������
30
+ xmlscan �����ϡ�����XMLʸ�����Ϥ��뤳�Ȥ����Ǥ���XMLʸ���
31
+ ���ؤ˼�갷������ι��٥�ʵ�ǽ���󶡤��ޤ���xmlscan ��
32
+ ���Τ褦�ʵ�ǽ���󶡤���饤�֥��Υ�����ʬ�Ȥ��ƻȤ��뤳�Ȥ�
33
+ ���ꤷ�Ƥ��ޤ���
34
+
35
+ : HTML
36
+ ���ޥ��� HTML ��ʸ���Ϥ��� htmlscan ���դ��Ƥ��ޤ���
37
+
38
+
39
+ == ʸ�����󥳡��ǥ��󥰤ˤĤ���
40
+
41
+ �ǥե���ȤǤϡ�xmlscan ���ɤ� CES (Character Encoding Scheme) ��
42
+ XMLʸ�����Ϥ��뤫�ϥ������Х��ѿ� $KCODE ���ͤˤ�äƷ�ޤ�ޤ���
43
+ EUC-*, Shift_JIS, UTF-8 �ǽ񤫤줿XMLʸ�����Ϥ���ˤ� $KCODE ��
44
+ ((<XMLScan::XMLScanner#kcode=>)) ��Ŭ�ڤ��ͤ����ꤹ��ɬ�פ�����ޤ���
45
+
46
+ UTF-16 ��ľ�ܥ��ݡ��Ȥ��Ƥ��ޤ��󡣲������˰�ö UTF-8 ���Ѵ�����
47
+ ɬ�פ�����ޤ���
48
+
49
+
50
+ == XML̾�����֤ˤĤ���
51
+
52
+ XML̾�����֤� xmlscan/namespace.rb �Ǽ�������Ƥ��ޤ��������󥿡��ե�������
53
+ �礭���ѹ�����ͽ�꤬���뤿�� undocumented �Ȥ��ޤ���
54
+
55
+
56
+
57
+ == ���饹��ե����
58
+
59
+
60
+ === XMLScan::Error
61
+
62
+ xmlscan �˴ؤ������Ƥ��㳰�Υ����ѡ����饹��
63
+
64
+ �������㳰�ϡ�XMLScan::Visitor �Υ��󥹥��󥹤���XMLScan::XMLScanner ��
65
+ XMLScan::XMLParser ���饨�顼���������ä��Ȥ��ˡ��ǥե���Ȥ�ȯ��������
66
+ ��ΤǤ����ƥѡ�����ľ�ܤ������㳰���ꤲ�뤳�ȤϤ���ޤ���
67
+
68
+ #�����㳰�� xmlscan/scanner.rb ���������Ƥ��ޤ���
69
+
70
+ : XMLScan::ParseError
71
+
72
+ ������§�˥ޥå����ʤ����������ȿ�ʳ��Υ��顼��
73
+
74
+ : XMLScan::NotWellFormedError
75
+
76
+ ����������˰�ȿ���Ƥ��롣
77
+
78
+ : XMLScan::NotValidError
79
+
80
+ ����������˰�ȿ���Ƥ��롣
81
+
82
+
83
+ === XMLScan::Visitor
84
+
85
+ XMLʸ��β��Ϸ�̤������뤿��� Mix-in �Ǥ���
86
+
87
+ xmlscan �˴ޤޤ��� parser �ϡ�ʸ�����Ƭ���鹽ʸ���Ϥ�Ԥ�����������
88
+ ��ʸ���Ǥ򸫤Ĥ��뤿�Ӥˡ��ѡ�����Ϳ����줿 XMLScan::Visitor ��
89
+ ���󥹥��󥹤�����Υ᥽�åɤ�ƤӽФ��ޤ������θƤӽФ��ϡ�ɬ��ʸ���
90
+ ��Ƭ������֤˹Ԥ��ޤ���
91
+
92
+ ==== �᥽�å�:
93
+
94
+ �ä˵��Ҥ�̵���¤ꡢ�ƥ᥽�åɤϥǥե���ȤǤϲ��⤷�ޤ���
95
+
96
+ --- XMLScan::Visitor#parse_error(msg)
97
+
98
+ ������§�˥ޥå����ʤ����������ȿ�ʳ��Υ��顼��ȯ����������
99
+ �ƤӽФ���ޤ����ǥե���ȤǤ� ((<XMLScan::ParseError>))�㳰��
100
+ ȯ�������ޤ����㳰�����������æ�Ф�Ԥ鷺�����̤������
101
+ �ѡ������֤��ȡ��ѡ����ϥ��顼��������Ʋ��Ϥ�³���ޤ���
102
+
103
+ --- XMLScan::Visitor#wellformed_error(msg)
104
+
105
+ �����������ȿ��ȯ���������˸ƤӽФ���ޤ����ǥե���ȤǤ�
106
+ ((<XMLScan::NotWellFormedError>))�㳰��ȯ�������ޤ����㳰��������
107
+ ���æ�Ф�Ԥ鷺�����̤������ѡ������֤��ȡ��ѡ����ϥ��顼��
108
+ �������Ʋ��Ϥ�³���ޤ���
109
+
110
+ --- XMLScan::Visitor#valid_error(msg)
111
+
112
+ �����������ȿ��ȯ���������˸ƤӽФ���ޤ����ǥե���ȤǤ�
113
+ ((<XMLScan::NotValidError>))�㳰��ȯ�������ޤ����㳰��������
114
+ ���æ�Ф�Ԥ鷺�����̤������ѡ������֤��ȡ��ѡ����ϥ��顼��
115
+ �������Ʋ��Ϥ�³���ޤ���
116
+
117
+ �ʤ������ߤ� xmlscan �ˤ��������򸡾ڤ���XML�ץ�������
118
+ �ޤޤ�Ƥ��ޤ��󡣤��Υ᥽�åɤϾ�����ǤΤ����ͽ�󤵤�Ƥ��ޤ���
119
+
120
+ --- XMLScan::Visitor#warning(msg)
121
+
122
+ ���顼�ǤϤʤ����侩����ʤ������䡢xmlscan �ǤϽ�ʬ�˲��ϤǤ��ʤ�
123
+ ��ʸ��ȯ���������˸ƤӽФ���ޤ���
124
+
125
+ --- XMLScan::Visitor#on_start_document
126
+
127
+ XMLʸ��β��Ϥ�Ϥ��ľ���˸ƤӽФ���ޤ������Υ᥽�åɤ��ƤӽФ��줿
128
+ ��ˤ�ɬ�����б����� ((<XMLScan::Visitor#on_end_document>)) �᥽�åɤ�
129
+ �ƤӽФ���ޤ���
130
+
131
+ --- XMLScan::Visitor#on_end_document
132
+
133
+ XMLʸ��ν�ü�ޤDz��Ϥ����ä���˸ƤӽФ���ޤ���
134
+
135
+ --- XMLScan::Visitor#on_xmldecl
136
+ --- XMLScan::Visitor#on_xmldecl_version(str)
137
+ --- XMLScan::Visitor#on_xmldecl_encoding(str)
138
+ --- XMLScan::Visitor#on_xmldecl_standalone(str)
139
+ --- XMLScan::Visitor#on_xmldecl_other(name, value)
140
+ --- XMLScan::Visitor#on_xmldecl_end
141
+
142
+ XML�����ȯ���������˸ƤӽФ���ޤ���
143
+
144
+ <?xml version="1.0" encoding="euc-jp" standalone="yes" ?>
145
+ ^ ^ ^ ^ ^
146
+ 1 2 3 4 5
147
+
148
+ method argument
149
+ --------------------------------------
150
+ 1: on_xmldecl
151
+ 2: on_xmldecl_version ("1.0")
152
+ 3: on_xmldecl_encoding ("euc-jp")
153
+ 4: on_xmldecl_standalone ("yes")
154
+ 5: on_xmldecl_end
155
+
156
+ XML�����ȯ��������硢on_xmldecl �� on_xmldecl_end ��ɬ��
157
+ �ƤӽФ���ޤ���¾�Υ᥽�åɤ��б����빽ʸ��XML������
158
+ ����ʤ��ä����ϸƤӽФ���ޤ���
159
+
160
+ on_xmldecl_other �� version, encoding, standalone �ʳ��������
161
+ XML�������ˤ��ä����˸ƤӽФ���ޤ������Τ褦������Ϲ�ʸ��
162
+ ������Ƥ��ʤ����ᡢon_xmldecl_other ���ƤӽФ�������ˤ�ɬ��
163
+ ((<XMLScan::Visitor#parse_error>)) �᥽�åɤ��ƤӽФ���뤳�Ȥ�
164
+ ���դ��Ʋ�������
165
+
166
+ --- XMLScan::Visitor#on_doctype(root, pubid, sysid)
167
+
168
+ ʸ�������ȯ���������˸ƤӽФ���ޤ���
169
+
170
+ document argument
171
+ --------------------------------------------------------------
172
+ 1: <!DOCTYPE foo> ('foo', nil, nil)
173
+ 2: <!DOCTYPE foo SYSTEM "bar"> ('foo', nil, 'bar')
174
+ 3: <!DOCTYPE foo PUBLIC "bar"> ('foo', 'bar', nil )
175
+ 4: <!DOCTYPE foo PUBLIC "bar" "baz"> ('foo', 'bar', 'baz')
176
+
177
+ --- XMLScan::Visitor#on_prolog_space(str)
178
+
179
+ ���񤭤���˶����ȯ���������˸ƤӽФ���ޤ���
180
+
181
+ --- XMLScan::Visitor#on_comment(str)
182
+
183
+ �����Ȥ�ȯ���������˸ƤӽФ���ޤ���
184
+
185
+ --- XMLScan::Visitor#on_pi(target, pi)
186
+
187
+ ����̿���ȯ���������˸ƤӽФ���ޤ���
188
+
189
+ --- XMLScan::Visitor#on_chardata(str)
190
+
191
+ ʸ���ǡ�����ȯ���������˸ƤӽФ���ޤ���
192
+
193
+ --- XMLScan::Visitor#on_cdata(str)
194
+
195
+ CDATA����������ȯ���������˸ƤӽФ���ޤ���
196
+
197
+ --- XMLScan::Visitor#on_entityref(ref)
198
+
199
+ °���ͤ���ʳ��ξ��ǰ��̼��λ��Ȥ�ȯ���������˸ƤӽФ���ޤ���
200
+
201
+ --- XMLScan::Visitor#on_charref(code)
202
+ --- XMLScan::Visitor#on_charref_hex(code)
203
+
204
+ °���ͤ���ʳ��ξ���ʸ�����Ȥ�ȯ���������˸ƤӽФ���ޤ���
205
+ ʸ�������ɤ�10�ʿ��ǻ��ꤵ��Ƥ������� on_charref��16�ʿ���
206
+ ���ꤵ��Ƥ������� on_charref_hex ���ƤӽФ���ޤ���
207
+ ((|code|))�������Ǥ���
208
+
209
+ --- XMLScan::Visitor#on_stag(name)
210
+ --- XMLScan::Visitor#on_attribute(name)
211
+ --- XMLScan::Visitor#on_attr_value(str)
212
+ --- XMLScan::Visitor#on_attr_entityref(ref)
213
+ --- XMLScan::Visitor#on_attr_charref(code)
214
+ --- XMLScan::Visitor#on_attr_charref_hex(code)
215
+ --- XMLScan::Visitor#on_attribute_end(name)
216
+ --- XMLScan::Visitor#on_stag_end_empty(name)
217
+ --- XMLScan::Visitor#on_stag_end(name)
218
+
219
+ ���ϥ�����ȯ���������˸ƤӽФ���ޤ���
220
+
221
+ <hoge fuga="foo&bar;&#38;&#x26;baz" >
222
+ ^ ^ ^ ^ ^ ^ ^ ^ ^
223
+ 1 2 3 4 5 6 7 8 9
224
+
225
+ method argument
226
+ ------------------------------------
227
+ 1: on_stag ('hoge')
228
+ 2: on_attribute ('fuga')
229
+ 3: on_attr_value ('foo')
230
+ 4: on_attr_entityref ('bar')
231
+ 5: on_attr_charref (38)
232
+ 6: on_attr_charref_hex (38)
233
+ 7: on_attr_value ('baz')
234
+ 8: on_attribute_end ('fuga')
235
+ 9: on_stag_end ('hoge')
236
+ or
237
+ on_stag_end_empty ('hoge')
238
+
239
+ ���ϥ�����ȯ��������硢on_stag �ȡ��б����� on_stag_end ����
240
+ on_stag_end_empty ��ɬ���ƤӽФ���ޤ���¾�Υ᥽�åɤϡ����ϥ�����
241
+ ���°��������ʤ��ä����ϸƤӽФ���ޤ���
242
+
243
+ °����ȯ��������硢on_attribute �� on_attribute_end ��ɬ��
244
+ �ƤӽФ���ޤ���°���ͤ��� (fuga="") �λ��ϡ�����2�ĤΥ᥽�åɤΤߤ�
245
+ �ƤӽФ���ޤ���
246
+
247
+ on_attr_entityref ��°���ͤ���ǰ��̼��λ��Ȥ�ȯ����������
248
+ �ƤӽФ���ޤ���on_charref �ڤ� on_charref_hex ��°���ͤ����
249
+ ʸ�����Ȥ�ȯ���������˸ƤӽФ���ޤ���
250
+
251
+ �����������ǥ������ä����ϡ�on_stag_end �᥽�åɤ������
252
+ on_stag_end_empty �᥽�åɤ��ƤӽФ���ޤ���
253
+
254
+ --- XMLScan::Visitor#on_etag(name)
255
+
256
+ ��λ������ȯ���������˸ƤӽФ���ޤ���
257
+
258
+
259
+
260
+ === XMLScan::XMLScanner
261
+
262
+ XMLʸ��������Ϥ�����������ǧ�����륹����ʤǤ���
263
+
264
+ XMLScan::XMLScanner �ε���Ŭ�����ˤĤ��Ƥϡ�¾��ʸ��ǽҤ٤Ƥ��ޤ���
265
+
266
+ ==== �����ѡ����饹:
267
+
268
+ * Object
269
+
270
+ ==== ���饹�᥽�å�:
271
+
272
+ --- XMLScan::XMLScanner.new(visitor[, option ...])
273
+
274
+ XMLScan::XMLScanner ���֥������Ȥ��������ޤ���((|visitor|))��
275
+ XMLScan::Visitor �Υ��󥹥��󥹤ǡ�XMLScan::XMLScanner ���֥������Ȥ���
276
+ ���Ϸ�̤�������ޤ���
277
+
278
+ ((|option|))��ʸ�������ϥ���ܥ�ǻ��ꤷ�ޤ���option�ˤ�
279
+ ���Τ�Τ�����ޤ���
280
+
281
+ : 'strict_char'
282
+
283
+ (({require 'xmlscan/xmlchar'})) ����Ȼ���Ǥ���褦�ˤʤ�ޤ���
284
+ ������ʸ�����Ȥ��Ƥ��ʤ����ɤ����Υ����å���Ԥ��ޤ���
285
+ �ѥե����ޥ󥹤��������㲼���ޤ���
286
+
287
+ ==== �᥽�å�:
288
+
289
+ --- XMLScan::XMLScanner#kcode= arg
290
+
291
+ CES����ꤷ�ޤ���((|arg|))�β��ϡ�nil ������� $KCODE ��Ʊ���Ǥ���
292
+ ((|arg|))�� nil �ΤȤ��ϡ��ɤ� CES �Dz��Ϥ�Ԥ����� $KCODE ���ͤˤ�ä�
293
+ ��ޤ�ޤ���
294
+
295
+ --- XMLScan::XMLScanner#kcode
296
+
297
+ �ɤ� CES �Dz��Ϥ�Ԥ����� Regexp#kcode ��Ʊ���������֤��ޤ���
298
+ nil�ΤȤ���$KCODE�˰�¸���뤳�Ȥ�ɽ���ޤ���
299
+
300
+ --- XMLScan::XMLScanner#parse(source)
301
+
302
+ ((|source|)) ��XMLʸ��Ȥ��Ʋ��Ϥ��ޤ���((|source|)) ��ʸ����
303
+ ʸ������������� IO#gets ��Ʊ�������񤤤򤹤� gets �᥽�åɤ����
304
+ ���֥������ȤǤʤ���Фʤ�ޤ���
305
+
306
+
307
+ === XMLScan::XMLParser
308
+
309
+ �������򸡾ڤ��ʤ� XML parser �Ǥ���
310
+
311
+ XMLScan::XMLParser �ε���Ŭ�����ˤĤ��Ƥϡ�¾��ʸ��ǽҤ٤Ƥ��ޤ���
312
+
313
+
314
+ ==== �����ѡ����饹:
315
+
316
+ * ((<XMLScan::XMLScanner>))
317
+
318
+ ==== ���饹�᥽�å�:
319
+
320
+ --- XMLScan::XMLParser.new(visitor[, option ...])
321
+
322
+ XMLScan::XMLParser ���֥������Ȥ�((|visitor|))�γƥ᥽�åɤˤĤ��ơ�
323
+ ���Τ��Ȥ��ݾڤ��ޤ���
324
+
325
+ : ((<XMLScan::Visitor#on_stag>))
326
+
327
+ ���Υ᥽�åɤ�ƤӽФ�����ˡ��б����� ((<XMLScan::Visitor#on_etag>))
328
+ �᥽�åɤ�ɬ���ƤӽФ��ޤ���
329
+
330
+ �ä��ơ����顼������Ԥ�ʤ���С���������XMLʸ��Ǥϵ��������ʤ�
331
+ �᥽�åɸƤӽФ���������������ޤ���
332
+
333
+
334
+ === XMLScan::HTMLScanner
335
+
336
+ ((<XMLScan::XMLScanner>)) �򸵤ˤ��� HTML �ѡ����Ǥ���
337
+
338
+ XMLScan::HTMLScanner �ε���Ŭ�����ˤĤ��Ƥϡ�¾��ʸ��ǽҤ٤Ƥ��ޤ���
339
+
340
+ ==== �����ѡ����饹:
341
+
342
+ * ((<XMLScan::XMLScanner>))
343
+
344
+ ==== ���饹�᥽�å�:
345
+
346
+ --- XMLScan::HTMLScanner.new(visitor[, option ...])
347
+
348
+ XMLScan::HTMLScanner ���֥������Ȥ�((|visitor|))�γƥ᥽�åɤˤĤ��ơ�
349
+ ���Τ��Ȥ��ݾڤ��ޤ���
350
+
351
+ : ((<XMLScan::Visitor#on_xmldecl>))
352
+ : ((<XMLScan::Visitor#on_xmldecl_version>))
353
+ : ((<XMLScan::Visitor#on_xmldecl_encoding>))
354
+ : ((<XMLScan::Visitor#on_xmldecl_standalone>))
355
+ : ((<XMLScan::Visitor#on_xmldecl_end>))
356
+
357
+ HTML �ˤ� XML�����¸�ߤ��ʤ��Τǡ������Υ᥽�åɤ�ƤӽФ����Ȥ�
358
+ ����ޤ���
359
+
360
+ : ((<XMLScan::Visitor#on_stag_end_empty>))
361
+
362
+ HTML �ˤ϶����ǥ�����¸�ߤ��ʤ��Τǡ����Υ᥽�åɤ�ƤӽФ����Ȥ�
363
+ ����ޤ��󡣶����ǥ����ϲ��ϥ��顼�ˤʤ�ޤ���
364
+
365
+ : ((<XMLScan::Visitor#wellformed_error>))
366
+
367
+ HTML �ˤ�����������¸�ߤ��ʤ��Τǡ����Υ᥽�åɤ�ƤӽФ����Ȥ�
368
+ ����ޤ���
369
+
370
+ =end
@@ -0,0 +1,41 @@
1
+ # Makefile
2
+ # $Id: Makefile,v 1.1 2003/01/22 16:42:12 katsu Exp $
3
+
4
+ RUBY = ruby
5
+ RD2 = rd2
6
+ LANGSPLIT = $(RUBY) src/langsplit.rb
7
+
8
+ SOURCES = src/manual.rd.src src/conformance.rd.src
9
+
10
+ TARGETS_en = $(SOURCES:.rd.src=.rd) $(SOURCES:.rd.src=.html)
11
+ TARGETS_ja = $(SOURCES:.rd.src=.ja.rd) $(SOURCES:.rd.src=.ja.html)
12
+
13
+ TARGETS = $(subst src/,en/,$(TARGETS_en)) \
14
+ $(subst src/,ja/,$(TARGETS_ja)) \
15
+ changes.html
16
+
17
+ all: $(TARGETS)
18
+
19
+ clean:
20
+ -rm -f $(TARGETS)
21
+
22
+ .SUFFIXES: .html .rd
23
+
24
+ .rd.html:
25
+ $(RD2) $< > $@
26
+
27
+ en/manual.rd: src/manual.rd.src
28
+ $(LANGSPLIT) -en $< > $@
29
+ ja/manual.ja.rd: src/manual.rd.src
30
+ $(LANGSPLIT) -ja $< > $@
31
+ en/conformance.rd: src/conformance.rd.src
32
+ $(LANGSPLIT) -en $< > $@
33
+ ja/conformance.ja.rd: src/conformance.rd.src
34
+ $(LANGSPLIT) -ja $< > $@
35
+
36
+ en/manual.html: en/manual.rd
37
+ ja/manual.ja.html: ja/manual.ja.rd
38
+ en/conformance.html: en/conformance.rd
39
+ ja/conformance.ja.html: ja/conformance.ja.rd
40
+
41
+ changes.html: changes.rd
@@ -0,0 +1,256 @@
1
+ =begin
2
+ # $Id: conformance.rd.src,v 1.1 2003/01/22 16:41:45 katsu Exp $
3
+
4
+ = xmlscan �ε��ʤؤ�Ŭ����
5
+
6
+ en| = Conformance of xmlscan to the specifications
7
+
8
+ ����ʸ��Ǥϡ�xmlscan �˴ޤޤ��ƥѡ����� XML ��Ϣ���ʤؤ�
9
+ Ŭ�����ˤĤ��ƽҤ٤ޤ���
10
+
11
+ en| This document describes the conformance of each parser
12
+ en| included in xmlscan for XML related specifications.
13
+
14
+ == ����
15
+
16
+ en| == Abstract
17
+
18
+ xmlscan �� XML 1.0 Sepcification ((<[XML]>)) �Ǥ����Ȥ�����
19
+ ���������򸡾ڤ��ʤ��ץ������פǤ����������򸡾ڤ��ʤ��ץ�������
20
+ ��������ΤۤȤ�ɤ��������Ƥ��ޤ������������Թ�塢���
21
+ ���Τ褦�����󤬤���ޤ����ܺ٤ϳƥ��饹��ε��Ҥ򻲾Ȥ��Ƥ���������
22
+
23
+ en| XMLscan is one of "non-validating XML processor" according to
24
+ en| XML 1.0 Specification ((<[XML]>)). XMLscan is satisfied with
25
+ en| almost conditions required for a non-validation XML processor,
26
+ en| though, for the limitations of implementations, there are mainly
27
+ en| the following restrictions. For detail, See the below
28
+ en| descriptions for each class.
29
+
30
+ * UTF-16 �ǽ񤫤줿XMLʸ���ľ�ܲ��ϤǤ��ޤ���
31
+ * �ǥե���ȤǤϡ�XMLʸ����ǡ����Ϥ���ʸ̮�ǻ��Ѥ�ǧ����ʤ�
32
+ ʸ�����ޤޤ�Ƥ��ʤ����Ȥ򸡺����ޤ���
33
+ * �����볰�����Τ��ɤ߹��ߤޤ��󡣳��������оݼ��Τ˴ؤ���
34
+ ����������ϥ����å�����ޤ���
35
+ * ����DTD���֥��åȤ��ɤ����Ф��ޤ� (����ΥС������ǥ��ݡ���ͽ��)��
36
+ DTD�˴ؤ�������������ϥ����å�����ޤ���
37
+
38
+ en| * It is impossible to parse an XML document encoded in UTF-16
39
+ en| directly.
40
+ en| * By default, it is not checked for illegal characters which
41
+ en| must not appear in an XML document or in a context.
42
+ en| * XMLscan doesn't read any external entities. Well-formedness
43
+ en| constraints for external entities are not checked.
44
+ en| * XMLscan skips an internal DTD subset. (it will be supported
45
+ en| in future version). Well-formedness constraints for an
46
+ en| internal DTD subset are not checked.
47
+
48
+
49
+ == XMLScan::XMLScanner �ε��ʤؤ�Ŭ����
50
+
51
+ en| == Conformance of XMLScan::XMLScanner
52
+
53
+ XMLScan::XMLScanner ��XMLʸ�����Ϥ���XML�����ʸ�����������̿�ᡢ
54
+ �����ȡ����ϥ�������λ�����������ǥ�����CDATA��������󡢰��̼��λ��ȡ�
55
+ �����ʸ�����Ȥ�ǧ�ΤΤߤ�Ԥ��ޤ����ʲ��˽Ҥ٤��������ơ�
56
+ ����餬����ƤϤʤ�ʤ�ʸ̮�Ǹ��줿�Ȥ��Ƥ⡢���顼�ˤʤ�ޤ���
57
+
58
+ en| XMLScan::XMLScanner tokenize an XML document and only recognize
59
+ en| each XML declaration, document type declaration, processing
60
+ en| instruction, comment, start tag, end tag, empty element tag,
61
+ en| CDATA section, general entity reference, and character reference.
62
+ en| It is NOT an error even that one of these parts appears in the
63
+ en| context which prohibits existence of it, except in the case
64
+ en| described below.
65
+
66
+ XML�����ʸ����� (����DTD���֥��åȤ����)������̿�ᡢ�����ȡ�
67
+ ���ϥ�������λ�����������ǥ�����CDATA��������󡢰��̼��λ��ȡ������
68
+ ʸ�����Ȥ� XML 1.0 Specification ((<[XML]>)) ������������§��
69
+ �ޥå����ʤ���硢���ϥ��顼�Ȥʤ�ޤ���
70
+
71
+ en| It is reported as an parse error that an XML declaration,
72
+ en| document type definition (except internal DTD subset),
73
+ en| processing instruction, comment, start tag, end tag, empty
74
+ en| element tag, CDATA section, general entity reference, or a
75
+ en| character reference is not matched with its production defined
76
+ en| in XML 1.0 Specification ((<[XML]>)).
77
+
78
+ ����Ū�ʽ���®�٤����뤿�ᡢstrict_char ���ץ���󤬻��ꤵ��Ƥ��ʤ�
79
+ ��硢̾����ʸ���ǡ������˻��Ѥ�ǧ����ʤ�ʸ�����ޤޤ�Ƥ��ʤ����Ȥ�
80
+ �������ޤ��󡣤���ʸ̮�Ƕ��ڤ�ҤȤ���ǧ�������٤�ʸ������������Ƥ�
81
+ ʸ������ǧ����ޤ�������Ū�ˤϡ�strict_char ���ץ���󤬻��ꤵ���
82
+ ���ʤ���С�������§ Char[2], Name[5], Nmtoken[7], EntityValue[9],
83
+ AttValue[10], SystemLiteral[11], PubidChar[13], CharData[14],
84
+ VersionNum[26], EncName[81] �ϸ�̩�˥����å�����ޤ���
85
+
86
+ en| For reasonably speed, if `strict_char' option is not specified,
87
+ en| XMLScan::XMLScanner doesn't check whether a name or character
88
+ en| data includes an illegal characters for it. All characters
89
+ en| except ones recognized as one of delimiters in that context
90
+ en| are allowed. To be more precise, without `strict_char' option,
91
+ en| the production Char[2], Name[5], Nmtoken[7], EntityValue[9],
92
+ en| AttValue[10], SystemLiteral[11], PubidChar[13], CharData[14],
93
+ en| VersionNum[26], and EncName[81] are not checked strictly.
94
+
95
+ ��������������Ԥ��ޤ���
96
+
97
+ en| XMLScan::XMLScanner doesn't normalize linebreaks.
98
+
99
+ Ruby ���Τ����ݡ��Ȥ��Ƥ��ʤ����ᡢUTF-16 �ǽ񤫤줿ʸ���
100
+ ľ�ܲ��Ϥ��뤳�ȤϤǤ��ޤ��󡣲������˰�ö UTF-8 ���Ѵ�����
101
+ ɬ�פ�����ޤ���
102
+
103
+ en| Since Ruby is not supported UTF-16, it is impossible to parse
104
+ en| an XML document encoded in UTF-16 as it is. You need to convert
105
+ en| it to UTF-8 before parsing.
106
+
107
+ ʸ�����Ƭ�ʳ��� `<?xml' �����줿���ϡ���������̿��Ȥߤʤ��ޤ���
108
+
109
+ en| `<?xml' in a place except the beginning of an XML document is
110
+ en| regarded as a processing instruction.
111
+
112
+ ������ɥ�����ʸ������� yes �ޤ��� no �Ǥ��뤫������å����ޤ���
113
+
114
+ en| It is not checked whether the value of a standalone document
115
+ en| documentation is either "yes" or "no".
116
+
117
+ ����̿��Υ������åȤ� xml �Ǥʤ����Ȥ�����å����ޤ���
118
+
119
+ en| It is not checked whether a target in a processing instruction
120
+ en| is not "xml" or like, which is a reserved target.
121
+
122
+ ʸ����������񤭰ʳ��˸��줿��硢�ޤ�2��ʾ帽�줿����
123
+ ���ϥ��顼�Ȥʤ�ޤ���
124
+
125
+ en| It is reported as a parse error in the case that a document type
126
+ en| declaration appears in a place except prolog, or two or more
127
+ en| document type declarations are found in one document.
128
+
129
+ °���ͤ���� `<' ��ʸ����ľ�ܸ��줿��硢�����������ȿ���顼��
130
+ �ʤ�ޤ���strict_char ���ץ���󤬻��ꤵ��Ƥ����硢����������
131
+ "Legal Character" ������å����ޤ�������ʳ�������������Ϥޤä���
132
+ �����å�����ޤ���
133
+
134
+ en| It is reported as a well-formedness constraint violation
135
+ en| that `<' appears directly in a attribute value. If strict_char
136
+ en| option is specified, XMLScan::XMLScanner checks
137
+ en| well-formedness constraint: Legal Character.
138
+ en| Any other well-formedness constraints are not checked.
139
+
140
+ ����DTD���֥��åȤ��ɤ����Ф��ޤ���
141
+
142
+ en| XMLScan::XMLScanner skips an internal DTD subset.
143
+
144
+
145
+ == XMLScan::XMLParser �ε��ʤؤ�Ŭ����
146
+
147
+ en| == Conformance of XMLScan::XMLParser
148
+
149
+ XMLScan::XMLParser �ϡ��������򸡾ڤ��ʤ�XML�ץ������Ȥ��Ƶ�����
150
+ ���ΤۤȤ�����Ƥ����������Ȥ���ɸ�ˤ��Ƥ��ޤ���
151
+
152
+ en| The goal of XMLScan::XMLParser is to satisfy almost all
153
+ en| conditions required to a non-validating XML parser.
154
+
155
+ XMLScan::XMLScanner �� strict_char ���ץ����˴ؤ��뵭�ҡ��ڤ�
156
+ UTF-16 �˴ؤ��뵭�Ҥϡ����Τޤ� XMLScan::XMLParser �ˤ����ƤϤޤ�ޤ���
157
+ ʸ�����Ȥ˴ؤ���ʲ�������ϡ�strict_char ���ץ���󤬻��ꤵ�줿
158
+ ���Τߥ����å�����ޤ���
159
+
160
+ en| The description for XMLScan::XMLScanner about `strict_char'
161
+ en| option and the description for UTF-16 are applicable to
162
+ en| XMLScan::XMLParser. The following well-formedness constraints
163
+ en| about a character reference are checked only if `strict_char'
164
+ en| option is specified;
165
+
166
+ * Well-formedness constraint: Legal Character
167
+
168
+ ��������������Ԥ��ޤ���
169
+
170
+ en| XMLScan::XMLScanner doesn't normalize linebreaks.
171
+
172
+ ����DTD���֥��åȤ��ɤ����Ф��ޤ�������DTD���֥��åȤ˴ؤ���ʲ���
173
+ ����������ϥ����å�����ޤ���
174
+
175
+ en| XMLScan::XMLParser skips an internal DTD subset. The following
176
+ en| well-formedness constraints about an internal DTD subset are
177
+ en| not checked;
178
+
179
+ * Well-formedness constraint: PEs in Internal Subset
180
+ * Well-formedness constraint: PE Between Declarations
181
+ * Well-formedness constraint: No External Entity References
182
+ * Well-formedness constraint: Entity Declared
183
+ * Well-formedness constraint: Parsed Entity
184
+ * Well-formedness constraint: No Recursion
185
+ * Well-formedness constraint: In DTD
186
+
187
+ ����Ѥ߼��� (lt,gt,amp,quot,apos) ��������Ƥΰ��̼��λ��Ȥϡ�
188
+ ������ɤ߹��ޤ�Ƥ��ʤ����Τؤλ��ȤȤ�����𤵤�ޤ���
189
+
190
+ en| All general entity references except ones to predefined entities
191
+ en| (lt,gt,amp,quot,apos) are reported as ones to undeclared entities.
192
+
193
+ ����DTD���֥��åȤϼ����ߤޤ��󡣳���DTD���֥��åȤ˴ؤ���ʲ���
194
+ ����������ϥ����å�����ޤ���
195
+
196
+ en| External DTD subsets are not read. The following well-formedness
197
+ en| constraints about an external DTD subset are not checked;
198
+
199
+ * Well-formedness constraint: External Subset
200
+
201
+ ������ɤ߹���Ǥ��ʤ����Τ��ִ��ƥ����Ȥ� < ���ޤޤ�Ƥ��뤳�Ȥ�
202
+ ��ǧ�Ǥ��ʤ����ᡢ�ʲ�������������ϥ����å�����ޤ���
203
+
204
+ en| Since XMLScan::XMLParser cannot check whether a replacement text
205
+ en| of an undeclared entity includes `<', the following
206
+ en| well-formedness constraints are not checked completely;
207
+
208
+ * Well-formedness constraint: No < in Attribute Values
209
+
210
+
211
+ == XMLScan::XMLNamespace �ε��ʤؤ�Ŭ����
212
+
213
+ en| == Conformance of XMLScan::XMLNamespace
214
+
215
+ XMLScan::XMLNamespace �� Namespaces in XML �ڤӤ��� errata ((<[Namespaces]>))
216
+ �����������Ƥ����������å����� XML ʸ��̾������������
217
+ (namespace-well-formed) �Ǥ��뤳�Ȥ��ǧ���ޤ���
218
+
219
+ en| XMLScan::XMLNamespace checks for all constraints specified in
220
+ en| ``Namespaces in XML'' and its errata ((<[Namespaces]>)), and
221
+ en| ensure that an XML document is namespace-well-formed.
222
+
223
+ XMLScan::XMLParser �˵����������¤ϡ����Τޤ� XMLScan::XMLNamespace
224
+ �ˤ�Ѿ�����ޤ���
225
+
226
+ en| All limitations for XMLScan::XMLParser are inherited to
227
+ en| XMLScan::XMLNamespace.
228
+
229
+
230
+ == ����ʸ��
231
+ en| == References
232
+
233
+ : [XML]
234
+ W3C (World Wide Web Consortium).
235
+ Extensible Markup Language (XML) 1.0 (Second Edition),
236
+ January 2000.
237
+ ((<URL:http://www.w3.org/TR/2000/REC-xml-20001006>))
238
+
239
+ : [Namespaces]
240
+ W3C (World Wide Web Consortium).
241
+ Namespaces in XML,
242
+ January 1999.
243
+ ((<URL:http://www.w3.org/TR/1999/REC-xml-names-19990114>)).
244
+ ���פ������� ((<URL:http://www.w3.org/XML/xml-names-19990114-errata>))
245
+ �˴ޤޤ�Ƥ���.
246
+
247
+ en| : [Namespaces]
248
+ en| W3C (World Wide Web Consortium).
249
+ en| Namespaces in XML,
250
+ en| January 1999.
251
+ en| ((<URL:http://www.w3.org/TR/1999/REC-xml-names-19990114>)).
252
+ en| Important corrections are found at
253
+ en| ((<URL:http://www.w3.org/XML/xml-names-19990114-errata>)).
254
+
255
+
256
+ =end