kwartz 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/ChangeLog +36 -1
  2. data/LGPL +504 -0
  3. data/README.txt +16 -2
  4. data/bin/kwartz +1 -1
  5. data/doc-api/classes/Kwartz.html +47 -1
  6. data/doc-api/classes/Kwartz/Assertion.html +6 -6
  7. data/doc-api/classes/Kwartz/AssertionError.html +6 -6
  8. data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
  9. data/doc-api/classes/Kwartz/BaseError.html +12 -12
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
  11. data/doc-api/classes/Kwartz/CharacterType.html +24 -24
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
  13. data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
  14. data/doc-api/classes/Kwartz/Config.html +6 -1
  15. data/doc-api/classes/Kwartz/ConvertError.html +14 -14
  16. data/doc-api/classes/Kwartz/Converter.html +31 -30
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
  18. data/doc-api/classes/Kwartz/Defun.html +313 -0
  19. data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
  20. data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
  21. data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
  22. data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
  23. data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
  24. data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
  25. data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
  26. data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
  27. data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
  28. data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
  29. data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
  30. data/doc-api/classes/Kwartz/Handler.html +122 -117
  31. data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
  32. data/doc-api/classes/Kwartz/Helper.html +112 -0
  33. data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
  34. data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
  35. data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
  36. data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
  37. data/doc-api/classes/Kwartz/KwartzError.html +6 -6
  38. data/doc-api/classes/Kwartz/Main.html +39 -23
  39. data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
  40. data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
  41. data/doc-api/classes/Kwartz/Node.html +6 -6
  42. data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
  43. data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
  44. data/doc-api/classes/Kwartz/ParseError.html +6 -6
  45. data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
  46. data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
  47. data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
  48. data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
  49. data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
  50. data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
  51. data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
  52. data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
  53. data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
  54. data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
  55. data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
  56. data/doc-api/classes/Kwartz/TagInfo.html +28 -28
  57. data/doc-api/classes/Kwartz/TextConverter.html +28 -28
  58. data/doc-api/classes/Kwartz/Translator.html +42 -42
  59. data/doc-api/classes/Kwartz/Util.html +284 -0
  60. data/doc-api/created.rid +1 -1
  61. data/doc-api/files/__/README_txt.html +30 -3
  62. data/doc-api/files/kwartz/assert_rb.html +1 -1
  63. data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
  64. data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
  65. data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
  66. data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
  67. data/doc-api/files/kwartz/binding/php_rb.html +2 -2
  68. data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
  69. data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
  70. data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
  71. data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
  72. data/doc-api/files/kwartz/config_rb.html +2 -2
  73. data/doc-api/files/kwartz/converter_rb.html +3 -2
  74. data/doc-api/files/kwartz/defun_rb.html +116 -0
  75. data/doc-api/files/kwartz/error_rb.html +1 -1
  76. data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
  77. data/doc-api/files/kwartz/main_rb.html +5 -2
  78. data/doc-api/files/kwartz/node_rb.html +2 -2
  79. data/doc-api/files/kwartz/parser_rb.html +2 -2
  80. data/doc-api/files/kwartz/translator_rb.html +2 -2
  81. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
  82. data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
  83. data/doc-api/files/kwartz/util_rb.html +107 -0
  84. data/doc-api/files/kwartz_rb.html +3 -2
  85. data/doc-api/fr_class_index.html +11 -0
  86. data/doc-api/fr_file_index.html +5 -0
  87. data/doc-api/fr_method_index.html +242 -190
  88. data/doc/p-pattern.html +94 -94
  89. data/doc/reference.html +847 -612
  90. data/doc/users-guide.html +744 -241
  91. data/examples/rails1/README +2 -2
  92. data/examples/rails1/application_helper.rb +2 -27
  93. data/examples/rails1/link_to.plogic +5 -5
  94. data/examples/rails1/list.plogic +2 -2
  95. data/examples/rails2/app/controllers/application.rb +14 -0
  96. data/examples/rails2/app/controllers/groups_controller.rb +47 -0
  97. data/examples/rails2/app/controllers/members_controller.rb +56 -0
  98. data/examples/rails2/app/helpers/application_helper.rb +6 -0
  99. data/examples/rails2/app/helpers/groups_helper.rb +2 -0
  100. data/examples/rails2/app/helpers/members_helper.rb +2 -0
  101. data/examples/rails2/app/models/group.rb +2 -0
  102. data/examples/rails2/app/models/member.rb +3 -0
  103. data/examples/rails2/app/views/groups/_form.html +30 -0
  104. data/examples/rails2/app/views/groups/_form.plogic +11 -0
  105. data/examples/rails2/app/views/groups/_link.plogic +19 -0
  106. data/examples/rails2/app/views/groups/_read.plogic +7 -0
  107. data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
  108. data/examples/rails2/app/views/groups/edit.html +26 -0
  109. data/examples/rails2/app/views/groups/edit.plogic +9 -0
  110. data/examples/rails2/app/views/groups/list.html +48 -0
  111. data/examples/rails2/app/views/groups/list.plogic +32 -0
  112. data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
  113. data/examples/rails2/app/views/groups/new.html +27 -0
  114. data/examples/rails2/app/views/groups/new.plogic +9 -0
  115. data/examples/rails2/app/views/groups/show.html +27 -0
  116. data/examples/rails2/app/views/groups/show.plogic +2 -0
  117. data/examples/rails2/app/views/layouts/groups.html +23 -0
  118. data/examples/rails2/app/views/layouts/groups.plogic +11 -0
  119. data/examples/rails2/app/views/layouts/members.html +23 -0
  120. data/examples/rails2/app/views/layouts/members.plogic +11 -0
  121. data/examples/rails2/app/views/layouts/members2.html +24 -0
  122. data/examples/rails2/app/views/layouts/members2.plogic +11 -0
  123. data/examples/rails2/app/views/members/_form.plogic +27 -0
  124. data/examples/rails2/app/views/members/_link.plogic +19 -0
  125. data/examples/rails2/app/views/members/_read.plogic +29 -0
  126. data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
  127. data/examples/rails2/app/views/members/edit.html +27 -0
  128. data/examples/rails2/app/views/members/edit.plogic +10 -0
  129. data/examples/rails2/app/views/members/list.html +53 -0
  130. data/examples/rails2/app/views/members/list.plogic +32 -0
  131. data/examples/rails2/app/views/members/new.html +61 -0
  132. data/examples/rails2/app/views/members/new.plogic +17 -0
  133. data/examples/rails2/app/views/members/show.html +41 -0
  134. data/examples/rails2/app/views/members/show.plogic +3 -0
  135. data/examples/rails2/db/create-tables.mysql.sql +27 -0
  136. data/examples/rails2/db/create-tables.pgsql.sql +27 -0
  137. data/examples/rails2/db/insert-data.sql +21 -0
  138. data/examples/rails2/db/tabledef.yaml +51 -0
  139. data/kwartz.gemspec +4 -4
  140. data/lib/kwartz.rb +10 -2
  141. data/lib/kwartz/assert.rb +1 -1
  142. data/lib/kwartz/binding/eperl.rb +85 -61
  143. data/lib/kwartz/binding/erubis.rb +6 -8
  144. data/lib/kwartz/binding/eruby.rb +5 -120
  145. data/lib/kwartz/binding/jstl.rb +116 -101
  146. data/lib/kwartz/binding/php.rb +79 -60
  147. data/lib/kwartz/binding/pierubis.rb +58 -0
  148. data/lib/kwartz/binding/rails.rb +45 -42
  149. data/lib/kwartz/binding/ruby.rb +193 -0
  150. data/lib/kwartz/binding/struts.rb +1 -1
  151. data/lib/kwartz/config.rb +4 -3
  152. data/lib/kwartz/converter.rb +231 -68
  153. data/lib/kwartz/defun.rb +126 -0
  154. data/lib/kwartz/error.rb +1 -1
  155. data/lib/kwartz/helper/rails.rb +437 -0
  156. data/lib/kwartz/main.rb +30 -38
  157. data/lib/kwartz/node.rb +46 -31
  158. data/lib/kwartz/parser.rb +43 -15
  159. data/lib/kwartz/translator.rb +104 -6
  160. data/lib/kwartz/util.rb +113 -0
  161. data/lib/kwartz/util/assert-text-equal.rb +1 -1
  162. data/lib/kwartz/util/testcase-helper.rb +26 -8
  163. data/test/test-compile.rb +3 -3
  164. data/test/test-compile.yaml +135 -5
  165. data/test/test-converter.rb +16 -8
  166. data/test/test-converter.yaml +307 -76
  167. data/test/test-directives.rb +1 -1
  168. data/test/test-directives.yaml +964 -979
  169. data/test/test-main.rb +61 -146
  170. data/test/test-main.yaml +235 -0
  171. data/test/test-parser.rb +10 -12
  172. data/test/test-parser.yaml +484 -326
  173. data/test/test-rails.rb +1 -1
  174. data/test/test-rails.yaml +37 -37
  175. data/test/test-ruleset.rb +1 -1
  176. data/test/test-ruleset.yaml +34 -40
  177. data/test/test.rb +1 -1
  178. metadata +82 -3
  179. data/COPYING +0 -340
@@ -94,8 +94,8 @@ translator for php
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000172">new</a>&nbsp;&nbsp;
98
- <a href="#M000173">translate_native_expr</a>&nbsp;&nbsp;
97
+ <a href="#M000224">new</a>&nbsp;&nbsp;
98
+ <a href="#M000225">translate_native_expr</a>&nbsp;&nbsp;
99
99
  </div>
100
100
  </div>
101
101
 
@@ -135,23 +135,23 @@ translator for php
135
135
  <div id="methods">
136
136
  <h3 class="section-bar">Public Class methods</h3>
137
137
 
138
- <div id="method-M000172" class="method-detail">
139
- <a name="M000172"></a>
138
+ <div id="method-M000224" class="method-detail">
139
+ <a name="M000224"></a>
140
140
 
141
141
  <div class="method-heading">
142
- <a href="#M000172" class="method-signature">
142
+ <a href="#M000224" class="method-signature">
143
143
  <span class="method-name">new</span><span class="method-args">(properties={})</span>
144
144
  </a>
145
145
  </div>
146
146
 
147
147
  <div class="method-description">
148
148
  <p><a class="source-toggle" href="#"
149
- onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
150
- <div class="method-source-code" id="M000172-source">
149
+ onclick="toggleCode('M000224-source');return false;">[Source]</a></p>
150
+ <div class="method-source-code" id="M000224-source">
151
151
  <pre>
152
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 291</span>
152
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 306</span>
153
153
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
154
- <span class="ruby-identifier">jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1.2</span>
154
+ <span class="ruby-identifier">jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">PROPERTY_JSTL</span>
155
155
  <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">jstl_ver</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1.2</span> <span class="ruby-operator">?</span> <span class="ruby-constant">JSTL11_EMBED_PATTERNS</span> <span class="ruby-operator">:</span> <span class="ruby-constant">JSTL12_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
156
156
  <span class="ruby-ivar">@jstl_ver</span> = <span class="ruby-identifier">jstl_ver</span>
157
157
  <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">header</span>
@@ -177,21 +177,21 @@ translator for php
177
177
 
178
178
  <h3 class="section-bar">Public Instance methods</h3>
179
179
 
180
- <div id="method-M000173" class="method-detail">
181
- <a name="M000173"></a>
180
+ <div id="method-M000225" class="method-detail">
181
+ <a name="M000225"></a>
182
182
 
183
183
  <div class="method-heading">
184
- <a href="#M000173" class="method-signature">
184
+ <a href="#M000225" class="method-signature">
185
185
  <span class="method-name">translate_native_expr</span><span class="method-args">(expr)</span>
186
186
  </a>
187
187
  </div>
188
188
 
189
189
  <div class="method-description">
190
190
  <p><a class="source-toggle" href="#"
191
- onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
192
- <div class="method-source-code" id="M000173-source">
191
+ onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
192
+ <div class="method-source-code" id="M000225-source">
193
193
  <pre>
194
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 313</span>
194
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 328</span>
195
195
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate_native_expr</span>(<span class="ruby-identifier">expr</span>)
196
196
  <span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
197
197
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A&quot;(.*)&quot;\z/</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">code</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A'(.*)'\z/</span>
@@ -86,7 +86,7 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000154">new</a>&nbsp;&nbsp;
89
+ <a href="#M000203">new</a>&nbsp;&nbsp;
90
90
  </div>
91
91
  </div>
92
92
 
@@ -108,19 +108,19 @@
108
108
  <div id="methods">
109
109
  <h3 class="section-bar">Public Class methods</h3>
110
110
 
111
- <div id="method-M000154" class="method-detail">
112
- <a name="M000154"></a>
111
+ <div id="method-M000203" class="method-detail">
112
+ <a name="M000203"></a>
113
113
 
114
114
  <div class="method-heading">
115
- <a href="#M000154" class="method-signature">
115
+ <a href="#M000203" class="method-signature">
116
116
  <span class="method-name">new</span><span class="method-args">(message)</span>
117
117
  </a>
118
118
  </div>
119
119
 
120
120
  <div class="method-description">
121
121
  <p><a class="source-toggle" href="#"
122
- onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
123
- <div class="method-source-code" id="M000154-source">
122
+ onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
123
+ <div class="method-source-code" id="M000203-source">
124
124
  <pre>
125
125
  <span class="ruby-comment cmt"># File kwartz/error.rb, line 11</span>
126
126
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>)
@@ -99,9 +99,9 @@ ex.
99
99
  <h3 class="section-bar">Methods</h3>
100
100
 
101
101
  <div class="name-list">
102
- <a href="#M000081">execute</a>&nbsp;&nbsp;
103
- <a href="#M000080">main</a>&nbsp;&nbsp;
104
- <a href="#M000079">new</a>&nbsp;&nbsp;
102
+ <a href="#M000118">execute</a>&nbsp;&nbsp;
103
+ <a href="#M000117">main</a>&nbsp;&nbsp;
104
+ <a href="#M000116">new</a>&nbsp;&nbsp;
105
105
  </div>
106
106
  </div>
107
107
 
@@ -123,21 +123,21 @@ ex.
123
123
  <div id="methods">
124
124
  <h3 class="section-bar">Public Class methods</h3>
125
125
 
126
- <div id="method-M000080" class="method-detail">
127
- <a name="M000080"></a>
126
+ <div id="method-M000117" class="method-detail">
127
+ <a name="M000117"></a>
128
128
 
129
129
  <div class="method-heading">
130
- <a href="#M000080" class="method-signature">
130
+ <a href="#M000117" class="method-signature">
131
131
  <span class="method-name">main</span><span class="method-args">(argv=ARGV)</span>
132
132
  </a>
133
133
  </div>
134
134
 
135
135
  <div class="method-description">
136
136
  <p><a class="source-toggle" href="#"
137
- onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
138
- <div class="method-source-code" id="M000080-source">
137
+ onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
138
+ <div class="method-source-code" id="M000117-source">
139
139
  <pre>
140
- <span class="ruby-comment cmt"># File kwartz/main.rb, line 171</span>
140
+ <span class="ruby-comment cmt"># File kwartz/main.rb, line 174</span>
141
141
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">main</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
142
142
  <span class="ruby-identifier">status</span> = <span class="ruby-value">0</span>
143
143
  <span class="ruby-keyword kw">begin</span>
@@ -156,21 +156,21 @@ ex.
156
156
  </div>
157
157
  </div>
158
158
 
159
- <div id="method-M000079" class="method-detail">
160
- <a name="M000079"></a>
159
+ <div id="method-M000116" class="method-detail">
160
+ <a name="M000116"></a>
161
161
 
162
162
  <div class="method-heading">
163
- <a href="#M000079" class="method-signature">
163
+ <a href="#M000116" class="method-signature">
164
164
  <span class="method-name">new</span><span class="method-args">(argv=ARGV)</span>
165
165
  </a>
166
166
  </div>
167
167
 
168
168
  <div class="method-description">
169
169
  <p><a class="source-toggle" href="#"
170
- onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
171
- <div class="method-source-code" id="M000079-source">
170
+ onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
171
+ <div class="method-source-code" id="M000116-source">
172
172
  <pre>
173
- <span class="ruby-comment cmt"># File kwartz/main.rb, line 165</span>
173
+ <span class="ruby-comment cmt"># File kwartz/main.rb, line 168</span>
174
174
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-constant">ARGV</span>)
175
175
  <span class="ruby-ivar">@argv</span> = <span class="ruby-identifier">argv</span>
176
176
  <span class="ruby-ivar">@command</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">$0</span>)
@@ -182,21 +182,21 @@ ex.
182
182
 
183
183
  <h3 class="section-bar">Public Instance methods</h3>
184
184
 
185
- <div id="method-M000081" class="method-detail">
186
- <a name="M000081"></a>
185
+ <div id="method-M000118" class="method-detail">
186
+ <a name="M000118"></a>
187
187
 
188
188
  <div class="method-heading">
189
- <a href="#M000081" class="method-signature">
189
+ <a href="#M000118" class="method-signature">
190
190
  <span class="method-name">execute</span><span class="method-args">(argv=@argv)</span>
191
191
  </a>
192
192
  </div>
193
193
 
194
194
  <div class="method-description">
195
195
  <p><a class="source-toggle" href="#"
196
- onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
197
- <div class="method-source-code" id="M000081-source">
196
+ onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
197
+ <div class="method-source-code" id="M000118-source">
198
198
  <pre>
199
- <span class="ruby-comment cmt"># File kwartz/main.rb, line 206</span>
199
+ <span class="ruby-comment cmt"># File kwartz/main.rb, line 211</span>
200
200
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">argv</span>=<span class="ruby-ivar">@argv</span>)
201
201
 
202
202
  <span class="ruby-comment cmt">## parse command-line options</span>
@@ -321,8 +321,24 @@ ex.
321
321
  <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:nl</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;\r\n&quot;</span>
322
322
  <span class="ruby-keyword kw">end</span>
323
323
  <span class="ruby-identifier">translator</span> = <span class="ruby-identifier">translator_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">properties</span>)
324
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">notext</span>
325
+ <span class="ruby-identifier">translator</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">Kwartz</span><span class="ruby-operator">::</span><span class="ruby-constant">NoTextEnhancer</span>)
326
+ <span class="ruby-keyword kw">end</span>
324
327
  <span class="ruby-identifier">output</span> = <span class="ruby-identifier">translator</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">stmt_list</span>)
325
328
 
329
+ <span class="ruby-comment cmt">## action</span>
330
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">action</span>
331
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">action</span>
332
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'compile'</span>
333
+ <span class="ruby-comment cmt"># nothing</span>
334
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'defun'</span>
335
+ <span class="ruby-identifier">basename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">pdata_filenames</span>.<span class="ruby-identifier">first</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\.\w+/</span>, <span class="ruby-value str">''</span>)
336
+ <span class="ruby-identifier">output</span> = <span class="ruby-constant">Kwartz</span><span class="ruby-operator">::</span><span class="ruby-constant">Defun</span>.<span class="ruby-identifier">defun</span>(<span class="ruby-identifier">basename</span>, <span class="ruby-identifier">output</span>, <span class="ruby-identifier">lang</span>, <span class="ruby-identifier">properties</span>)
337
+ <span class="ruby-keyword kw">else</span>
338
+ <span class="ruby-identifier">option_error</span>(<span class="ruby-node">&quot;-#{options.chr(:action)} #{options.aciton}: invalid action.&quot;</span>)
339
+ <span class="ruby-keyword kw">end</span>
340
+ <span class="ruby-keyword kw">end</span>
341
+
326
342
  <span class="ruby-comment cmt">## load YAML file and evaluate eRuby script</span>
327
343
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">yamlfile</span>
328
344
  <span class="ruby-identifier">eruby_script</span> = <span class="ruby-identifier">output</span>
@@ -345,14 +361,14 @@ ex.
345
361
  <span class="ruby-identifier">raise</span> <span class="ruby-identifier">option_error</span>(<span class="ruby-node">&quot;#{s}: file not found.&quot;</span>)
346
362
  <span class="ruby-keyword kw">end</span>
347
363
  <span class="ruby-identifier">str</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">yamlfile</span>)
348
- <span class="ruby-identifier">str</span> = <span class="ruby-identifier">untabify</span>(<span class="ruby-identifier">str</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">untabify</span>
364
+ <span class="ruby-identifier">str</span> = <span class="ruby-constant">Kwartz</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">untabify</span>(<span class="ruby-identifier">str</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">untabify</span>
349
365
  <span class="ruby-identifier">require</span> <span class="ruby-value str">'yaml'</span>
350
366
  <span class="ruby-identifier">ydoc</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">str</span>)
351
367
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ydoc</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
352
368
  <span class="ruby-identifier">s</span> = <span class="ruby-node">&quot;-#{options.chr(:yamlfile)} #{options.yamlfile}&quot;</span>
353
369
  <span class="ruby-identifier">raise</span> <span class="ruby-identifier">option_error</span>(<span class="ruby-node">&quot;#{s}: not a mapping.&quot;</span>)
354
370
  <span class="ruby-keyword kw">end</span>
355
- <span class="ruby-identifier">intern_hash_keys</span>(<span class="ruby-identifier">ydoc</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">intern</span>
371
+ <span class="ruby-constant">Kwartz</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">intern_hash_keys</span>(<span class="ruby-identifier">ydoc</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">intern</span>
356
372
  <span class="ruby-identifier">context</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>
357
373
  <span class="ruby-identifier">ydoc</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
358
374
  <span class="ruby-identifier">context</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{key}&quot;</span>, <span class="ruby-identifier">val</span>)
@@ -94,9 +94,9 @@ represents expression in target language code
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000140">_inspect</a>&nbsp;&nbsp;
98
- <a href="#M000141">accept</a>&nbsp;&nbsp;
99
- <a href="#M000139">new</a>&nbsp;&nbsp;
97
+ <a href="#M000189">_inspect</a>&nbsp;&nbsp;
98
+ <a href="#M000190">accept</a>&nbsp;&nbsp;
99
+ <a href="#M000188">new</a>&nbsp;&nbsp;
100
100
  </div>
101
101
  </div>
102
102
 
@@ -149,19 +149,19 @@ represents expression in target language code
149
149
  <div id="methods">
150
150
  <h3 class="section-bar">Public Class methods</h3>
151
151
 
152
- <div id="method-M000139" class="method-detail">
153
- <a name="M000139"></a>
152
+ <div id="method-M000188" class="method-detail">
153
+ <a name="M000188"></a>
154
154
 
155
155
  <div class="method-heading">
156
- <a href="#M000139" class="method-signature">
156
+ <a href="#M000188" class="method-signature">
157
157
  <span class="method-name">new</span><span class="method-args">(code, escape=nil)</span>
158
158
  </a>
159
159
  </div>
160
160
 
161
161
  <div class="method-description">
162
162
  <p><a class="source-toggle" href="#"
163
- onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
164
- <div class="method-source-code" id="M000139-source">
163
+ onclick="toggleCode('M000188-source');return false;">[Source]</a></p>
164
+ <div class="method-source-code" id="M000188-source">
165
165
  <pre>
166
166
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 46</span>
167
167
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">escape</span>=<span class="ruby-keyword kw">nil</span>)
@@ -175,19 +175,19 @@ represents expression in target language code
175
175
 
176
176
  <h3 class="section-bar">Public Instance methods</h3>
177
177
 
178
- <div id="method-M000140" class="method-detail">
179
- <a name="M000140"></a>
178
+ <div id="method-M000189" class="method-detail">
179
+ <a name="M000189"></a>
180
180
 
181
181
  <div class="method-heading">
182
- <a href="#M000140" class="method-signature">
182
+ <a href="#M000189" class="method-signature">
183
183
  <span class="method-name">_inspect</span><span class="method-args">(indent=0)</span>
184
184
  </a>
185
185
  </div>
186
186
 
187
187
  <div class="method-description">
188
188
  <p><a class="source-toggle" href="#"
189
- onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
190
- <div class="method-source-code" id="M000140-source">
189
+ onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
190
+ <div class="method-source-code" id="M000189-source">
191
191
  <pre>
192
192
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 56</span>
193
193
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_inspect</span>(<span class="ruby-identifier">indent</span>=<span class="ruby-value">0</span>)
@@ -198,19 +198,19 @@ represents expression in target language code
198
198
  </div>
199
199
  </div>
200
200
 
201
- <div id="method-M000141" class="method-detail">
202
- <a name="M000141"></a>
201
+ <div id="method-M000190" class="method-detail">
202
+ <a name="M000190"></a>
203
203
 
204
204
  <div class="method-heading">
205
- <a href="#M000141" class="method-signature">
205
+ <a href="#M000190" class="method-signature">
206
206
  <span class="method-name">accept</span><span class="method-args">(translator)</span>
207
207
  </a>
208
208
  </div>
209
209
 
210
210
  <div class="method-description">
211
211
  <p><a class="source-toggle" href="#"
212
- onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
213
- <div class="method-source-code" id="M000141-source">
212
+ onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
213
+ <div class="method-source-code" id="M000190-source">
214
214
  <pre>
215
215
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 61</span>
216
216
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)
@@ -94,10 +94,10 @@ represents statement in target language code
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000116">_inspect</a>&nbsp;&nbsp;
98
- <a href="#M000117">accept</a>&nbsp;&nbsp;
99
- <a href="#M000114">new</a>&nbsp;&nbsp;
100
- <a href="#M000115">new_without_newline</a>&nbsp;&nbsp;
97
+ <a href="#M000164">_inspect</a>&nbsp;&nbsp;
98
+ <a href="#M000165">accept</a>&nbsp;&nbsp;
99
+ <a href="#M000162">new</a>&nbsp;&nbsp;
100
+ <a href="#M000163">new_without_newline</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -142,19 +142,19 @@ represents statement in target language code
142
142
  <div id="methods">
143
143
  <h3 class="section-bar">Public Class methods</h3>
144
144
 
145
- <div id="method-M000114" class="method-detail">
146
- <a name="M000114"></a>
145
+ <div id="method-M000162" class="method-detail">
146
+ <a name="M000162"></a>
147
147
 
148
148
  <div class="method-heading">
149
- <a href="#M000114" class="method-signature">
149
+ <a href="#M000162" class="method-signature">
150
150
  <span class="method-name">new</span><span class="method-args">(code, kind=nil)</span>
151
151
  </a>
152
152
  </div>
153
153
 
154
154
  <div class="method-description">
155
155
  <p><a class="source-toggle" href="#"
156
- onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
157
- <div class="method-source-code" id="M000114-source">
156
+ onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
157
+ <div class="method-source-code" id="M000162-source">
158
158
  <pre>
159
159
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 112</span>
160
160
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">kind</span>=<span class="ruby-keyword kw">nil</span>)
@@ -166,19 +166,19 @@ represents statement in target language code
166
166
  </div>
167
167
  </div>
168
168
 
169
- <div id="method-M000115" class="method-detail">
170
- <a name="M000115"></a>
169
+ <div id="method-M000163" class="method-detail">
170
+ <a name="M000163"></a>
171
171
 
172
172
  <div class="method-heading">
173
- <a href="#M000115" class="method-signature">
173
+ <a href="#M000163" class="method-signature">
174
174
  <span class="method-name">new_without_newline</span><span class="method-args">(code, kind=nil)</span>
175
175
  </a>
176
176
  </div>
177
177
 
178
178
  <div class="method-description">
179
179
  <p><a class="source-toggle" href="#"
180
- onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
181
- <div class="method-source-code" id="M000115-source">
180
+ onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
181
+ <div class="method-source-code" id="M000163-source">
182
182
  <pre>
183
183
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 120</span>
184
184
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">kind</span>=<span class="ruby-keyword kw">nil</span>)
@@ -193,42 +193,42 @@ represents statement in target language code
193
193
 
194
194
  <h3 class="section-bar">Public Instance methods</h3>
195
195
 
196
- <div id="method-M000116" class="method-detail">
197
- <a name="M000116"></a>
196
+ <div id="method-M000164" class="method-detail">
197
+ <a name="M000164"></a>
198
198
 
199
199
  <div class="method-heading">
200
- <a href="#M000116" class="method-signature">
200
+ <a href="#M000164" class="method-signature">
201
201
  <span class="method-name">_inspect</span><span class="method-args">(indent=0)</span>
202
202
  </a>
203
203
  </div>
204
204
 
205
205
  <div class="method-description">
206
206
  <p><a class="source-toggle" href="#"
207
- onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
208
- <div class="method-source-code" id="M000116-source">
207
+ onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
208
+ <div class="method-source-code" id="M000164-source">
209
209
  <pre>
210
210
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 127</span>
211
211
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_inspect</span>(<span class="ruby-identifier">indent</span>=<span class="ruby-value">0</span>)
212
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@code</span>.<span class="ruby-identifier">inspect</span>
212
+ <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;&lt;%#{@code}%&gt;\n&quot;</span>
213
213
  <span class="ruby-keyword kw">end</span>
214
214
  </pre>
215
215
  </div>
216
216
  </div>
217
217
  </div>
218
218
 
219
- <div id="method-M000117" class="method-detail">
220
- <a name="M000117"></a>
219
+ <div id="method-M000165" class="method-detail">
220
+ <a name="M000165"></a>
221
221
 
222
222
  <div class="method-heading">
223
- <a href="#M000117" class="method-signature">
223
+ <a href="#M000165" class="method-signature">
224
224
  <span class="method-name">accept</span><span class="method-args">(translator)</span>
225
225
  </a>
226
226
  </div>
227
227
 
228
228
  <div class="method-description">
229
229
  <p><a class="source-toggle" href="#"
230
- onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
231
- <div class="method-source-code" id="M000117-source">
230
+ onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
231
+ <div class="method-source-code" id="M000165-source">
232
232
  <pre>
233
233
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 132</span>
234
234
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)
@@ -93,7 +93,7 @@
93
93
  <h3 class="section-bar">Methods</h3>
94
94
 
95
95
  <div class="name-list">
96
- <a href="#M000048">accept</a>&nbsp;&nbsp;
96
+ <a href="#M000084">accept</a>&nbsp;&nbsp;
97
97
  </div>
98
98
  </div>
99
99
 
@@ -115,11 +115,11 @@
115
115
  <div id="methods">
116
116
  <h3 class="section-bar">Public Instance methods</h3>
117
117
 
118
- <div id="method-M000048" class="method-detail">
119
- <a name="M000048"></a>
118
+ <div id="method-M000084" class="method-detail">
119
+ <a name="M000084"></a>
120
120
 
121
121
  <div class="method-heading">
122
- <a href="#M000048" class="method-signature">
122
+ <a href="#M000084" class="method-signature">
123
123
  <span class="method-name">accept</span><span class="method-args">(translator)</span>
124
124
  </a>
125
125
  </div>
@@ -129,8 +129,8 @@
129
129
  .[abstract] accept visitor
130
130
  </p>
131
131
  <p><a class="source-toggle" href="#"
132
- onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
133
- <div class="method-source-code" id="M000048-source">
132
+ onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
133
+ <div class="method-source-code" id="M000084-source">
134
134
  <pre>
135
135
  <span class="ruby-comment cmt"># File kwartz/node.rb, line 23</span>
136
136
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)