kwartz 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/COPYING +340 -0
  2. data/ChangeLog +103 -0
  3. data/README.txt +37 -0
  4. data/bin/kwartz +12 -0
  5. data/doc-api/classes/Kwartz.html +218 -0
  6. data/doc-api/classes/Kwartz/Assertion.html +140 -0
  7. data/doc-api/classes/Kwartz/AssertionError.html +148 -0
  8. data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
  9. data/doc-api/classes/Kwartz/BaseError.html +206 -0
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
  11. data/doc-api/classes/Kwartz/CharacterType.html +212 -0
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
  13. data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
  14. data/doc-api/classes/Kwartz/Config.html +150 -0
  15. data/doc-api/classes/Kwartz/ConvertError.html +191 -0
  16. data/doc-api/classes/Kwartz/Converter.html +252 -0
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
  18. data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
  19. data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
  20. data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
  21. data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
  22. data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
  23. data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
  24. data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
  25. data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
  26. data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
  27. data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
  28. data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
  29. data/doc-api/classes/Kwartz/Expression.html +119 -0
  30. data/doc-api/classes/Kwartz/Handler.html +558 -0
  31. data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
  32. data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
  33. data/doc-api/classes/Kwartz/KwartzError.html +146 -0
  34. data/doc-api/classes/Kwartz/Main.html +384 -0
  35. data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
  36. data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
  37. data/doc-api/classes/Kwartz/Node.html +156 -0
  38. data/doc-api/classes/Kwartz/ParseError.html +148 -0
  39. data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
  40. data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
  41. data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
  42. data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
  43. data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
  44. data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
  45. data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
  46. data/doc-api/classes/Kwartz/Ruleset.html +117 -0
  47. data/doc-api/classes/Kwartz/Statement.html +119 -0
  48. data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
  49. data/doc-api/classes/Kwartz/TagInfo.html +314 -0
  50. data/doc-api/classes/Kwartz/TextConverter.html +270 -0
  51. data/doc-api/classes/Kwartz/Translator.html +318 -0
  52. data/doc-api/classes/Test.html +107 -0
  53. data/doc-api/classes/Test/Unit.html +101 -0
  54. data/doc-api/created.rid +1 -0
  55. data/doc-api/files/__/README_txt.html +150 -0
  56. data/doc-api/files/kwartz/assert_rb.html +114 -0
  57. data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
  58. data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
  59. data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
  60. data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
  61. data/doc-api/files/kwartz/binding/php_rb.html +116 -0
  62. data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
  63. data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
  64. data/doc-api/files/kwartz/config_rb.html +107 -0
  65. data/doc-api/files/kwartz/converter_rb.html +119 -0
  66. data/doc-api/files/kwartz/error_rb.html +107 -0
  67. data/doc-api/files/kwartz/main_rb.html +124 -0
  68. data/doc-api/files/kwartz/node_rb.html +114 -0
  69. data/doc-api/files/kwartz/parser_rb.html +117 -0
  70. data/doc-api/files/kwartz/translator_rb.html +115 -0
  71. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
  72. data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
  73. data/doc-api/files/kwartz_rb.html +120 -0
  74. data/doc-api/fr_class_index.html +75 -0
  75. data/doc-api/fr_file_index.html +45 -0
  76. data/doc-api/fr_method_index.html +216 -0
  77. data/doc-api/index.html +24 -0
  78. data/doc-api/rdoc-style.css +208 -0
  79. data/doc/docstyle.css +188 -0
  80. data/doc/p-pattern.html +1207 -0
  81. data/doc/reference.html +3396 -0
  82. data/doc/users-guide.html +1670 -0
  83. data/examples/breadcrumbs1/Makefile +15 -0
  84. data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
  85. data/examples/breadcrumbs1/breadcrumbs.html +12 -0
  86. data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
  87. data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
  88. data/examples/breadcrumbs1/main.php +12 -0
  89. data/examples/breadcrumbs1/main.rb +12 -0
  90. data/examples/breadcrumbs2/Makefile +15 -0
  91. data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
  92. data/examples/breadcrumbs2/breadcrumbs.html +14 -0
  93. data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
  94. data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
  95. data/examples/breadcrumbs2/main.php +12 -0
  96. data/examples/breadcrumbs2/main.rb +12 -0
  97. data/examples/pagelayout/Makefile +47 -0
  98. data/examples/pagelayout/content.eruby.plogic +44 -0
  99. data/examples/pagelayout/content.jstl.plogic +36 -0
  100. data/examples/pagelayout/content.php.plogic +37 -0
  101. data/examples/pagelayout/content1.html +36 -0
  102. data/examples/pagelayout/content2.html +29 -0
  103. data/examples/pagelayout/design.css +40 -0
  104. data/examples/pagelayout/layout.html +50 -0
  105. data/examples/pagelayout/main.php +55 -0
  106. data/examples/pagelayout/main.rb +77 -0
  107. data/examples/pagelayout/menu.eruby.plogic +14 -0
  108. data/examples/pagelayout/menu.html +13 -0
  109. data/examples/pagelayout/menu.jstl.plogic +14 -0
  110. data/examples/pagelayout/menu.php.plogic +14 -0
  111. data/examples/rails1/Makefile +36 -0
  112. data/examples/rails1/README +19 -0
  113. data/examples/rails1/application_helper.rb +31 -0
  114. data/examples/rails1/edit.html +28 -0
  115. data/examples/rails1/edit.plogic +10 -0
  116. data/examples/rails1/form.html +52 -0
  117. data/examples/rails1/form.plogic +33 -0
  118. data/examples/rails1/layout.plogic +15 -0
  119. data/examples/rails1/link_to.plogic +19 -0
  120. data/examples/rails1/list.html +48 -0
  121. data/examples/rails1/list.plogic +28 -0
  122. data/examples/rails1/new.html +27 -0
  123. data/examples/rails1/new.plogic +10 -0
  124. data/examples/rails1/reader.plogic +29 -0
  125. data/examples/rails1/show.html +40 -0
  126. data/examples/rails1/show.plogic +4 -0
  127. data/examples/rails1/writer.plogic +8 -0
  128. data/examples/table1/Makefile +15 -0
  129. data/examples/table1/main.php +11 -0
  130. data/examples/table1/main.rb +11 -0
  131. data/examples/table1/table1.eruby.plogic +21 -0
  132. data/examples/table1/table1.html +16 -0
  133. data/examples/table1/table1.jstl.plogic +21 -0
  134. data/examples/table1/table1.php.plogic +22 -0
  135. data/kwartz.gemspec +55 -0
  136. data/lib/kwartz.rb +13 -0
  137. data/lib/kwartz/assert.rb +31 -0
  138. data/lib/kwartz/binding/eperl.rb +166 -0
  139. data/lib/kwartz/binding/erubis.rb +61 -0
  140. data/lib/kwartz/binding/eruby.rb +164 -0
  141. data/lib/kwartz/binding/jstl.rb +334 -0
  142. data/lib/kwartz/binding/php.rb +167 -0
  143. data/lib/kwartz/binding/rails.rb +295 -0
  144. data/lib/kwartz/binding/struts.rb +109 -0
  145. data/lib/kwartz/config.rb +28 -0
  146. data/lib/kwartz/converter.rb +920 -0
  147. data/lib/kwartz/error.rb +41 -0
  148. data/lib/kwartz/main.rb +464 -0
  149. data/lib/kwartz/node.rb +454 -0
  150. data/lib/kwartz/parser.rb +903 -0
  151. data/lib/kwartz/translator.rb +153 -0
  152. data/lib/kwartz/util/assert-text-equal.rb +44 -0
  153. data/lib/kwartz/util/testcase-helper.rb +112 -0
  154. data/setup.rb +1331 -0
  155. data/test/test-compile.rb +36 -0
  156. data/test/test-compile.yaml +178 -0
  157. data/test/test-converter.rb +34 -0
  158. data/test/test-converter.yaml +127 -0
  159. data/test/test-directives.rb +32 -0
  160. data/test/test-directives.yaml +1411 -0
  161. data/test/test-main.rb +464 -0
  162. data/test/test-parser.rb +54 -0
  163. data/test/test-parser.yaml +394 -0
  164. data/test/test-rails.rb +28 -0
  165. data/test/test-rails.yaml +301 -0
  166. data/test/test-ruleset.rb +36 -0
  167. data/test/test-ruleset.yaml +804 -0
  168. data/test/test.rb +44 -0
  169. metadata +236 -0
@@ -0,0 +1,558 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Kwartz::Handler</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Kwartz::Handler</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/kwartz/converter_rb.html">
59
+ kwartz/converter.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ .[abstract] handle directives
84
+ </p>
85
+
86
+ </div>
87
+
88
+
89
+ </div>
90
+
91
+ <div id="method-list">
92
+ <h3 class="section-bar">Methods</h3>
93
+
94
+ <div class="name-list">
95
+ <a href="#M000180">directive_format</a>&nbsp;&nbsp;
96
+ <a href="#M000178">directive_pattern</a>&nbsp;&nbsp;
97
+ <a href="#M000182">extract</a>&nbsp;&nbsp;
98
+ <a href="#M000184">get_class</a>&nbsp;&nbsp;
99
+ <a href="#M000177">get_element_info</a>&nbsp;&nbsp;
100
+ <a href="#M000176">get_element_ruleset</a>&nbsp;&nbsp;
101
+ <a href="#M000181">handle</a>&nbsp;&nbsp;
102
+ <a href="#M000179">mapping_pattern</a>&nbsp;&nbsp;
103
+ <a href="#M000175">new</a>&nbsp;&nbsp;
104
+ <a href="#M000183">register_class</a>&nbsp;&nbsp;
105
+ </div>
106
+ </div>
107
+
108
+ </div>
109
+
110
+
111
+ <!-- if includes -->
112
+ <div id="includes">
113
+ <h3 class="section-bar">Included Modules</h3>
114
+
115
+ <div id="includes-list">
116
+ <span class="include-name"><a href="Assertion.html">Assertion</a></span>
117
+ <span class="include-name">ConverterHelper</span>
118
+ <span class="include-name"><a href="ElementExpander.html">ElementExpander</a></span>
119
+ </div>
120
+ </div>
121
+
122
+ <div id="section">
123
+
124
+
125
+
126
+
127
+
128
+ <div id="attribute-list">
129
+ <h3 class="section-bar">Attributes</h3>
130
+
131
+ <div class="name-list">
132
+ <table>
133
+ <tr class="top-aligned-row context-row">
134
+ <td class="context-item-name">converter</td>
135
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
136
+ <td class="context-item-desc"></td>
137
+ </tr>
138
+ <tr class="top-aligned-row context-row">
139
+ <td class="context-item-name">even</td>
140
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
141
+ <td class="context-item-desc"></td>
142
+ </tr>
143
+ <tr class="top-aligned-row context-row">
144
+ <td class="context-item-name">filename</td>
145
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
146
+ <td class="context-item-desc"></td>
147
+ </tr>
148
+ <tr class="top-aligned-row context-row">
149
+ <td class="context-item-name">odd</td>
150
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
151
+ <td class="context-item-desc"></td>
152
+ </tr>
153
+ </table>
154
+ </div>
155
+ </div>
156
+
157
+
158
+
159
+ <!-- if method_list -->
160
+ <div id="methods">
161
+ <h3 class="section-bar">Public Class methods</h3>
162
+
163
+ <div id="method-M000184" class="method-detail">
164
+ <a name="M000184"></a>
165
+
166
+ <div class="method-heading">
167
+ <a href="#M000184" class="method-signature">
168
+ <span class="method-name">get_class</span><span class="method-args">(lang)</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p><a class="source-toggle" href="#"
174
+ onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
175
+ <div class="method-source-code" id="M000184-source">
176
+ <pre>
177
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 641</span>
178
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_class</span>(<span class="ruby-identifier">lang</span>)
179
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">lang</span>]
180
+ <span class="ruby-keyword kw">end</span>
181
+ </pre>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <div id="method-M000175" class="method-detail">
187
+ <a name="M000175"></a>
188
+
189
+ <div class="method-heading">
190
+ <a href="#M000175" class="method-signature">
191
+ <span class="method-name">new</span><span class="method-args">(elem_rulesets=[], properties={})</span>
192
+ </a>
193
+ </div>
194
+
195
+ <div class="method-description">
196
+ <p><a class="source-toggle" href="#"
197
+ onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
198
+ <div class="method-source-code" id="M000175-source">
199
+ <pre>
200
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 448</span>
201
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">elem_rulesets</span>=[], <span class="ruby-identifier">properties</span>={})
202
+ <span class="ruby-ivar">@elem_rulesets</span> = <span class="ruby-identifier">elem_rulesets</span>
203
+ <span class="ruby-comment cmt">#@elem_ruleset_table = elem_rulesets.inject({}) { |table, ruleset| table[ruleset.name] = ruleset; table }</span>
204
+ <span class="ruby-ivar">@elem_ruleset_table</span> = {} ; <span class="ruby-identifier">elem_rulesets</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ruleset</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@elem_ruleset_table</span>[<span class="ruby-identifier">ruleset</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">ruleset</span> }
205
+ <span class="ruby-ivar">@elem_info_table</span> = {}
206
+ <span class="ruby-identifier">include_properties</span>(<span class="ruby-identifier">properties</span>) <span class="ruby-comment cmt"># @delspan and @dattr</span>
207
+ <span class="ruby-ivar">@odd</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:odd</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">PROPERTY_ODD</span> <span class="ruby-comment cmt"># &quot;'odd'&quot;</span>
208
+ <span class="ruby-ivar">@even</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:even</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">PROPERTY_EVEN</span> <span class="ruby-comment cmt"># &quot;'even'&quot;</span>
209
+ <span class="ruby-ivar">@filename</span> = <span class="ruby-keyword kw">nil</span>
210
+ <span class="ruby-keyword kw">end</span>
211
+ </pre>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <div id="method-M000183" class="method-detail">
217
+ <a name="M000183"></a>
218
+
219
+ <div class="method-heading">
220
+ <a href="#M000183" class="method-signature">
221
+ <span class="method-name">register_class</span><span class="method-args">(lang, klass)</span>
222
+ </a>
223
+ </div>
224
+
225
+ <div class="method-description">
226
+ <p><a class="source-toggle" href="#"
227
+ onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
228
+ <div class="method-source-code" id="M000183-source">
229
+ <pre>
230
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 636</span>
231
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_class</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">klass</span>)
232
+ <span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">lang</span>] = <span class="ruby-identifier">klass</span>
233
+ <span class="ruby-keyword kw">end</span>
234
+ </pre>
235
+ </div>
236
+ </div>
237
+ </div>
238
+
239
+ <h3 class="section-bar">Public Instance methods</h3>
240
+
241
+ <div id="method-M000182" class="method-detail">
242
+ <a name="M000182"></a>
243
+
244
+ <div class="method-heading">
245
+ <a href="#M000182" class="method-signature">
246
+ <span class="method-name">extract</span><span class="method-args">(elem_name, content_only=false)</span>
247
+ </a>
248
+ </div>
249
+
250
+ <div class="method-description">
251
+ <p><a class="source-toggle" href="#"
252
+ onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
253
+ <div class="method-source-code" id="M000182-source">
254
+ <pre>
255
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 623</span>
256
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract</span>(<span class="ruby-identifier">elem_name</span>, <span class="ruby-identifier">content_only</span>=<span class="ruby-keyword kw">false</span>)
257
+ <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">elem_name</span>]
258
+ <span class="ruby-identifier">elem_info</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;element '#{elem_name}' not found.&quot;</span>, <span class="ruby-keyword kw">nil</span>)
259
+ <span class="ruby-identifier">stmt_list</span> = []
260
+ <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">content_only</span>)
261
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; build_print_stmt(etag_info, nil, nil)</span>
262
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">stmt_list</span>
263
+ <span class="ruby-keyword kw">end</span>
264
+ </pre>
265
+ </div>
266
+ </div>
267
+ </div>
268
+
269
+ <div id="method-M000177" class="method-detail">
270
+ <a name="M000177"></a>
271
+
272
+ <div class="method-heading">
273
+ <a href="#M000177" class="method-signature">
274
+ <span class="method-name">get_element_info</span><span class="method-args">(name)</span>
275
+ </a>
276
+ </div>
277
+
278
+ <div class="method-description">
279
+ <p><a class="source-toggle" href="#"
280
+ onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
281
+ <div class="method-source-code" id="M000177-source">
282
+ <pre>
283
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 467</span>
284
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_element_info</span>(<span class="ruby-identifier">name</span>) <span class="ruby-comment cmt"># for ElementExpander module</span>
285
+ <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
286
+ <span class="ruby-keyword kw">end</span>
287
+ </pre>
288
+ </div>
289
+ </div>
290
+ </div>
291
+
292
+ <div id="method-M000176" class="method-detail">
293
+ <a name="M000176"></a>
294
+
295
+ <div class="method-heading">
296
+ <a href="#M000176" class="method-signature">
297
+ <span class="method-name">get_element_ruleset</span><span class="method-args">(name)</span>
298
+ </a>
299
+ </div>
300
+
301
+ <div class="method-description">
302
+ <p><a class="source-toggle" href="#"
303
+ onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
304
+ <div class="method-source-code" id="M000176-source">
305
+ <pre>
306
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 462</span>
307
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_element_ruleset</span>(<span class="ruby-identifier">name</span>) <span class="ruby-comment cmt"># for ElementExpander module and Converter class</span>
308
+ <span class="ruby-ivar">@elem_ruleset_table</span>[<span class="ruby-identifier">name</span>]
309
+ <span class="ruby-keyword kw">end</span>
310
+ </pre>
311
+ </div>
312
+ </div>
313
+ </div>
314
+
315
+ <div id="method-M000181" class="method-detail">
316
+ <a name="M000181"></a>
317
+
318
+ <div class="method-heading">
319
+ <a href="#M000181" class="method-signature">
320
+ <span class="method-name">handle</span><span class="method-args">(directive_name, directive_arg, directive_str, stag_info, etag_info, cont_stmts, attr_info, append_exprs, stmt_list)</span>
321
+ </a>
322
+ </div>
323
+
324
+ <div class="method-description">
325
+ <p>
326
+ handle directives (&#8216;stag&#8217;, &#8216;etag&#8217;,
327
+ &#8216;elem&#8217;, &#8216;cont&#8217;(=&#8217;value&#8217;))
328
+ </p>
329
+ <p>
330
+ return true if directive name is one of &#8216;stag&#8217;,
331
+ &#8216;etag&#8217;, &#8216;elem&#8217;, &#8216;cont&#8217;, and
332
+ &#8216;value&#8217;, else return false.
333
+ </p>
334
+ <p><a class="source-toggle" href="#"
335
+ onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
336
+ <div class="method-source-code" id="M000181-source">
337
+ <pre>
338
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 503</span>
339
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">directive_name</span>, <span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">directive_str</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>, <span class="ruby-identifier">stmt_list</span>)
340
+ <span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">directive_name</span>
341
+ <span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">directive_arg</span>
342
+ <span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">directive_str</span>
343
+
344
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">directive_name</span>
345
+
346
+ <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
347
+ <span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-operator">!</span><span class="ruby-identifier">attr_info</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">append_exprs</span>.<span class="ruby-identifier">empty?</span>
348
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
349
+ <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
350
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">etag_info</span> <span class="ruby-comment cmt"># when empty-tag</span>
351
+
352
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:dummy</span>
353
+ <span class="ruby-comment cmt"># nothing</span>
354
+
355
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:id</span>, <span class="ruby-identifier">:mark</span>
356
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">directive_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)\z/</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">directive_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A'(\w+)'\z/</span>
357
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid marking name.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
358
+ <span class="ruby-keyword kw">end</span>
359
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">$1</span>
360
+ <span class="ruby-identifier">elem_info</span> = <span class="ruby-constant">ElementInfo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
361
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
362
+ <span class="ruby-comment cmt">#unless Config::ALLOW_DUPLICATE_ID</span>
363
+ <span class="ruby-identifier">previous_linenum</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>
364
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': id '#{name}' is already used at line #{previous_linenum}.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
365
+ <span class="ruby-comment cmt">#end</span>
366
+ <span class="ruby-keyword kw">else</span>
367
+ <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">elem_info</span>
368
+ <span class="ruby-keyword kw">end</span>
369
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; ExpandStatement.new(:element, name) # lazy expantion</span>
370
+ <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>)
371
+
372
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:stag</span>, <span class="ruby-identifier">:Stag</span>, <span class="ruby-identifier">:STAG</span>
373
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>)
374
+ <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:stag</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Stag</span>)
375
+ <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
376
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-keyword kw">nil</span>)
377
+ <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
378
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
379
+
380
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:etag</span>, <span class="ruby-identifier">:Etag</span>, <span class="ruby-identifier">:ETAG</span>
381
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>)
382
+ <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:etag</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Etag</span>)
383
+ <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
384
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
385
+ <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
386
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">etag_info</span>)
387
+
388
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elem</span>, <span class="ruby-identifier">:Elem</span>, <span class="ruby-identifier">:ELEM</span>
389
+ <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:elem</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Elem</span>)
390
+ <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
391
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>)
392
+
393
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:cont</span>, <span class="ruby-identifier">:Cont</span>, <span class="ruby-identifier">:CONT</span>, <span class="ruby-identifier">:value</span>, <span class="ruby-identifier">:Value</span>, <span class="ruby-identifier">:VALUE</span>
394
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>)
395
+ <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">tail_space</span> = <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">head_space</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># delete spaces</span>
396
+ <span class="ruby-identifier">args</span> = <span class="ruby-identifier">build_print_args</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
397
+ <span class="ruby-identifier">flag_escape</span> = (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:cont</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:value</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Cont</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Value</span>)
398
+ <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
399
+ <span class="ruby-comment cmt">#args &lt;&lt; etag_info.tag_text</span>
400
+ <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tag_text</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tagname</span>
401
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
402
+
403
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:attr</span>, <span class="ruby-identifier">:Attr</span>, <span class="ruby-identifier">:ATTR</span>
404
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mapping_pattern</span>() <span class="ruby-comment cmt"># ex. /\A'([-:\w]+)'\s+(.*)\z/</span>
405
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid attr pattern.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
406
+ <span class="ruby-keyword kw">end</span>
407
+ <span class="ruby-identifier">aname</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">avalue</span> = <span class="ruby-identifier">$2</span>
408
+ <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:attr</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Attr</span>)
409
+ <span class="ruby-identifier">attr_info</span>[<span class="ruby-identifier">aname</span>] = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">avalue</span>, <span class="ruby-identifier">flag_escape</span>)
410
+
411
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:append</span>, <span class="ruby-identifier">:Append</span>, <span class="ruby-identifier">:APPEND</span>
412
+ <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:append</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Append</span>)
413
+ <span class="ruby-identifier">append_exprs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
414
+
415
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:replace_element_with_element</span>, <span class="ruby-identifier">:replace_element_with_content</span>,
416
+ <span class="ruby-identifier">:replace_content_with_element</span>, <span class="ruby-identifier">:replace_content_with_content</span>
417
+ <span class="ruby-identifier">arr</span> = <span class="ruby-identifier">d_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/_/</span>)
418
+ <span class="ruby-identifier">replace_cont</span> = <span class="ruby-identifier">arr</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'content'</span>
419
+ <span class="ruby-identifier">with_content</span> = <span class="ruby-identifier">arr</span>[<span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'content'</span>
420
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">d_arg</span>
421
+ <span class="ruby-comment cmt">#</span>
422
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
423
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
424
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; ExpandStatement.new(:element, name)</span>
425
+ <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
426
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
427
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
428
+ <span class="ruby-keyword kw">end</span>
429
+ <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">with_content</span>)
430
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
431
+
432
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:replace_element_with</span>, <span class="ruby-identifier">:replace_content_with</span>, <span class="ruby-identifier">:replace</span>, <span class="ruby-identifier">:placeholder</span>
433
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A_?(element|content)\([&quot;']?(\w+)[&quot;']?\)\z/</span>
434
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid #{d_name} format.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
435
+ <span class="ruby-keyword kw">end</span>
436
+ <span class="ruby-identifier">kind</span> = <span class="ruby-identifier">$1</span>
437
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">$2</span>
438
+ <span class="ruby-identifier">replace_cont</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:replace_content_with</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:placeholder</span>
439
+ <span class="ruby-identifier">with_content</span> = <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'content'</span>
440
+ <span class="ruby-comment cmt">#</span>
441
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
442
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
443
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; ExpandStatement.new(:element, name)</span>
444
+ <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
445
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
446
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
447
+ <span class="ruby-keyword kw">end</span>
448
+ <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">with_content</span>)
449
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
450
+ <span class="ruby-keyword kw">else</span>
451
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
452
+ <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
453
+
454
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
455
+
456
+ <span class="ruby-keyword kw">end</span>
457
+ </pre>
458
+ </div>
459
+ </div>
460
+ </div>
461
+
462
+ <h3 class="section-bar">Protected Instance methods</h3>
463
+
464
+ <div id="method-M000180" class="method-detail">
465
+ <a name="M000180"></a>
466
+
467
+ <div class="method-heading">
468
+ <a href="#M000180" class="method-signature">
469
+ <span class="method-name">directive_format</span><span class="method-args">()</span>
470
+ </a>
471
+ </div>
472
+
473
+ <div class="method-description">
474
+ <p>
475
+ .[abstract] directive format, which is used at has_directive?() method
476
+ </p>
477
+ <p><a class="source-toggle" href="#"
478
+ onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
479
+ <div class="method-source-code" id="M000180-source">
480
+ <pre>
481
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 490</span>
482
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
483
+ <span class="ruby-identifier">not_implemented</span>
484
+ <span class="ruby-comment cmt">#return '%s: %s'</span>
485
+ <span class="ruby-keyword kw">end</span>
486
+ </pre>
487
+ </div>
488
+ </div>
489
+ </div>
490
+
491
+ <div id="method-M000178" class="method-detail">
492
+ <a name="M000178"></a>
493
+
494
+ <div class="method-heading">
495
+ <a href="#M000178" class="method-signature">
496
+ <span class="method-name">directive_pattern</span><span class="method-args">()</span>
497
+ </a>
498
+ </div>
499
+
500
+ <div class="method-description">
501
+ <p>
502
+ .[abstract] directive pattern, which is used to detect directives.
503
+ </p>
504
+ <p><a class="source-toggle" href="#"
505
+ onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
506
+ <div class="method-source-code" id="M000178-source">
507
+ <pre>
508
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 476</span>
509
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
510
+ <span class="ruby-identifier">not_implemented</span>
511
+ <span class="ruby-comment cmt">#return /\A(\w+):\s*(.*)/</span>
512
+ <span class="ruby-keyword kw">end</span>
513
+ </pre>
514
+ </div>
515
+ </div>
516
+ </div>
517
+
518
+ <div id="method-M000179" class="method-detail">
519
+ <a name="M000179"></a>
520
+
521
+ <div class="method-heading">
522
+ <a href="#M000179" class="method-signature">
523
+ <span class="method-name">mapping_pattern</span><span class="method-args">()</span>
524
+ </a>
525
+ </div>
526
+
527
+ <div class="method-description">
528
+ <p>
529
+ .[abstract] mapping pattern, which is used to parse &#8216;attr&#8217;
530
+ directive.
531
+ </p>
532
+ <p><a class="source-toggle" href="#"
533
+ onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
534
+ <div class="method-source-code" id="M000179-source">
535
+ <pre>
536
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 483</span>
537
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
538
+ <span class="ruby-identifier">not_implemented</span>
539
+ <span class="ruby-comment cmt">#return /\A'([-:\w]+)'\s+(.*)/</span>
540
+ <span class="ruby-keyword kw">end</span>
541
+ </pre>
542
+ </div>
543
+ </div>
544
+ </div>
545
+
546
+
547
+ </div>
548
+
549
+
550
+ </div>
551
+
552
+
553
+ <div id="validator-badges">
554
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
555
+ </div>
556
+
557
+ </body>
558
+ </html>