kwartz 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +36 -1
- data/LGPL +504 -0
- data/README.txt +16 -2
- data/bin/kwartz +1 -1
- data/doc-api/classes/Kwartz.html +47 -1
- data/doc-api/classes/Kwartz/Assertion.html +6 -6
- data/doc-api/classes/Kwartz/AssertionError.html +6 -6
- data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
- data/doc-api/classes/Kwartz/BaseError.html +12 -12
- data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
- data/doc-api/classes/Kwartz/CharacterType.html +24 -24
- data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
- data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
- data/doc-api/classes/Kwartz/Config.html +6 -1
- data/doc-api/classes/Kwartz/ConvertError.html +14 -14
- data/doc-api/classes/Kwartz/Converter.html +31 -30
- data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
- data/doc-api/classes/Kwartz/Defun.html +313 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
- data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
- data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
- data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
- data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
- data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
- data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
- data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
- data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
- data/doc-api/classes/Kwartz/Handler.html +122 -117
- data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
- data/doc-api/classes/Kwartz/Helper.html +112 -0
- data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
- data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
- data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
- data/doc-api/classes/Kwartz/KwartzError.html +6 -6
- data/doc-api/classes/Kwartz/Main.html +39 -23
- data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
- data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
- data/doc-api/classes/Kwartz/Node.html +6 -6
- data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
- data/doc-api/classes/Kwartz/ParseError.html +6 -6
- data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
- data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
- data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
- data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
- data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
- data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
- data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
- data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
- data/doc-api/classes/Kwartz/TagInfo.html +28 -28
- data/doc-api/classes/Kwartz/TextConverter.html +28 -28
- data/doc-api/classes/Kwartz/Translator.html +42 -42
- data/doc-api/classes/Kwartz/Util.html +284 -0
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +30 -3
- data/doc-api/files/kwartz/assert_rb.html +1 -1
- data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
- data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
- data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/php_rb.html +2 -2
- data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
- data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
- data/doc-api/files/kwartz/config_rb.html +2 -2
- data/doc-api/files/kwartz/converter_rb.html +3 -2
- data/doc-api/files/kwartz/defun_rb.html +116 -0
- data/doc-api/files/kwartz/error_rb.html +1 -1
- data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
- data/doc-api/files/kwartz/main_rb.html +5 -2
- data/doc-api/files/kwartz/node_rb.html +2 -2
- data/doc-api/files/kwartz/parser_rb.html +2 -2
- data/doc-api/files/kwartz/translator_rb.html +2 -2
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwartz/util_rb.html +107 -0
- data/doc-api/files/kwartz_rb.html +3 -2
- data/doc-api/fr_class_index.html +11 -0
- data/doc-api/fr_file_index.html +5 -0
- data/doc-api/fr_method_index.html +242 -190
- data/doc/p-pattern.html +94 -94
- data/doc/reference.html +847 -612
- data/doc/users-guide.html +744 -241
- data/examples/rails1/README +2 -2
- data/examples/rails1/application_helper.rb +2 -27
- data/examples/rails1/link_to.plogic +5 -5
- data/examples/rails1/list.plogic +2 -2
- data/examples/rails2/app/controllers/application.rb +14 -0
- data/examples/rails2/app/controllers/groups_controller.rb +47 -0
- data/examples/rails2/app/controllers/members_controller.rb +56 -0
- data/examples/rails2/app/helpers/application_helper.rb +6 -0
- data/examples/rails2/app/helpers/groups_helper.rb +2 -0
- data/examples/rails2/app/helpers/members_helper.rb +2 -0
- data/examples/rails2/app/models/group.rb +2 -0
- data/examples/rails2/app/models/member.rb +3 -0
- data/examples/rails2/app/views/groups/_form.html +30 -0
- data/examples/rails2/app/views/groups/_form.plogic +11 -0
- data/examples/rails2/app/views/groups/_link.plogic +19 -0
- data/examples/rails2/app/views/groups/_read.plogic +7 -0
- data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/edit.html +26 -0
- data/examples/rails2/app/views/groups/edit.plogic +9 -0
- data/examples/rails2/app/views/groups/list.html +48 -0
- data/examples/rails2/app/views/groups/list.plogic +32 -0
- data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/new.html +27 -0
- data/examples/rails2/app/views/groups/new.plogic +9 -0
- data/examples/rails2/app/views/groups/show.html +27 -0
- data/examples/rails2/app/views/groups/show.plogic +2 -0
- data/examples/rails2/app/views/layouts/groups.html +23 -0
- data/examples/rails2/app/views/layouts/groups.plogic +11 -0
- data/examples/rails2/app/views/layouts/members.html +23 -0
- data/examples/rails2/app/views/layouts/members.plogic +11 -0
- data/examples/rails2/app/views/layouts/members2.html +24 -0
- data/examples/rails2/app/views/layouts/members2.plogic +11 -0
- data/examples/rails2/app/views/members/_form.plogic +27 -0
- data/examples/rails2/app/views/members/_link.plogic +19 -0
- data/examples/rails2/app/views/members/_read.plogic +29 -0
- data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
- data/examples/rails2/app/views/members/edit.html +27 -0
- data/examples/rails2/app/views/members/edit.plogic +10 -0
- data/examples/rails2/app/views/members/list.html +53 -0
- data/examples/rails2/app/views/members/list.plogic +32 -0
- data/examples/rails2/app/views/members/new.html +61 -0
- data/examples/rails2/app/views/members/new.plogic +17 -0
- data/examples/rails2/app/views/members/show.html +41 -0
- data/examples/rails2/app/views/members/show.plogic +3 -0
- data/examples/rails2/db/create-tables.mysql.sql +27 -0
- data/examples/rails2/db/create-tables.pgsql.sql +27 -0
- data/examples/rails2/db/insert-data.sql +21 -0
- data/examples/rails2/db/tabledef.yaml +51 -0
- data/kwartz.gemspec +4 -4
- data/lib/kwartz.rb +10 -2
- data/lib/kwartz/assert.rb +1 -1
- data/lib/kwartz/binding/eperl.rb +85 -61
- data/lib/kwartz/binding/erubis.rb +6 -8
- data/lib/kwartz/binding/eruby.rb +5 -120
- data/lib/kwartz/binding/jstl.rb +116 -101
- data/lib/kwartz/binding/php.rb +79 -60
- data/lib/kwartz/binding/pierubis.rb +58 -0
- data/lib/kwartz/binding/rails.rb +45 -42
- data/lib/kwartz/binding/ruby.rb +193 -0
- data/lib/kwartz/binding/struts.rb +1 -1
- data/lib/kwartz/config.rb +4 -3
- data/lib/kwartz/converter.rb +231 -68
- data/lib/kwartz/defun.rb +126 -0
- data/lib/kwartz/error.rb +1 -1
- data/lib/kwartz/helper/rails.rb +437 -0
- data/lib/kwartz/main.rb +30 -38
- data/lib/kwartz/node.rb +46 -31
- data/lib/kwartz/parser.rb +43 -15
- data/lib/kwartz/translator.rb +104 -6
- data/lib/kwartz/util.rb +113 -0
- data/lib/kwartz/util/assert-text-equal.rb +1 -1
- data/lib/kwartz/util/testcase-helper.rb +26 -8
- data/test/test-compile.rb +3 -3
- data/test/test-compile.yaml +135 -5
- data/test/test-converter.rb +16 -8
- data/test/test-converter.yaml +307 -76
- data/test/test-directives.rb +1 -1
- data/test/test-directives.yaml +964 -979
- data/test/test-main.rb +61 -146
- data/test/test-main.yaml +235 -0
- data/test/test-parser.rb +10 -12
- data/test/test-parser.yaml +484 -326
- data/test/test-rails.rb +1 -1
- data/test/test-rails.yaml +37 -37
- data/test/test-ruleset.rb +1 -1
- data/test/test-ruleset.yaml +34 -40
- data/test/test.rb +1 -1
- metadata +82 -3
- 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="#
|
98
|
-
<a href="#
|
97
|
+
<a href="#M000224">new</a>
|
98
|
+
<a href="#M000225">translate_native_expr</a>
|
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-
|
139
|
-
<a name="
|
138
|
+
<div id="method-M000224" class="method-detail">
|
139
|
+
<a name="M000224"></a>
|
140
140
|
|
141
141
|
<div class="method-heading">
|
142
|
-
<a href="#
|
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('
|
150
|
-
<div class="method-source-code" id="
|
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
|
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-
|
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"><</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-
|
181
|
-
<a name="
|
180
|
+
<div id="method-M000225" class="method-detail">
|
181
|
+
<a name="M000225"></a>
|
182
182
|
|
183
183
|
<div class="method-heading">
|
184
|
-
<a href="#
|
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('
|
192
|
-
<div class="method-source-code" id="
|
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
|
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"(.*)"\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="#
|
89
|
+
<a href="#M000203">new</a>
|
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-
|
112
|
-
<a name="
|
111
|
+
<div id="method-M000203" class="method-detail">
|
112
|
+
<a name="M000203"></a>
|
113
113
|
|
114
114
|
<div class="method-heading">
|
115
|
-
<a href="#
|
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('
|
123
|
-
<div class="method-source-code" id="
|
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="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
102
|
+
<a href="#M000118">execute</a>
|
103
|
+
<a href="#M000117">main</a>
|
104
|
+
<a href="#M000116">new</a>
|
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-
|
127
|
-
<a name="
|
126
|
+
<div id="method-M000117" class="method-detail">
|
127
|
+
<a name="M000117"></a>
|
128
128
|
|
129
129
|
<div class="method-heading">
|
130
|
-
<a href="#
|
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('
|
138
|
-
<div class="method-source-code" id="
|
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
|
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-
|
160
|
-
<a name="
|
159
|
+
<div id="method-M000116" class="method-detail">
|
160
|
+
<a name="M000116"></a>
|
161
161
|
|
162
162
|
<div class="method-heading">
|
163
|
-
<a href="#
|
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('
|
171
|
-
<div class="method-source-code" id="
|
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
|
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-
|
186
|
-
<a name="
|
185
|
+
<div id="method-M000118" class="method-detail">
|
186
|
+
<a name="M000118"></a>
|
187
187
|
|
188
188
|
<div class="method-heading">
|
189
|
-
<a href="#
|
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('
|
197
|
-
<div class="method-source-code" id="
|
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
|
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">"\r\n"</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">"-#{options.chr(:action)} #{options.aciton}: invalid action."</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">"#{s}: file not found."</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">"-#{options.chr(:yamlfile)} #{options.yamlfile}"</span>
|
353
369
|
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">option_error</span>(<span class="ruby-node">"#{s}: not a mapping."</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">"@#{key}"</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="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
97
|
+
<a href="#M000189">_inspect</a>
|
98
|
+
<a href="#M000190">accept</a>
|
99
|
+
<a href="#M000188">new</a>
|
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-
|
153
|
-
<a name="
|
152
|
+
<div id="method-M000188" class="method-detail">
|
153
|
+
<a name="M000188"></a>
|
154
154
|
|
155
155
|
<div class="method-heading">
|
156
|
-
<a href="#
|
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('
|
164
|
-
<div class="method-source-code" id="
|
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-
|
179
|
-
<a name="
|
178
|
+
<div id="method-M000189" class="method-detail">
|
179
|
+
<a name="M000189"></a>
|
180
180
|
|
181
181
|
<div class="method-heading">
|
182
|
-
<a href="#
|
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('
|
190
|
-
<div class="method-source-code" id="
|
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-
|
202
|
-
<a name="
|
201
|
+
<div id="method-M000190" class="method-detail">
|
202
|
+
<a name="M000190"></a>
|
203
203
|
|
204
204
|
<div class="method-heading">
|
205
|
-
<a href="#
|
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('
|
213
|
-
<div class="method-source-code" id="
|
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="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
97
|
+
<a href="#M000164">_inspect</a>
|
98
|
+
<a href="#M000165">accept</a>
|
99
|
+
<a href="#M000162">new</a>
|
100
|
+
<a href="#M000163">new_without_newline</a>
|
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-
|
146
|
-
<a name="
|
145
|
+
<div id="method-M000162" class="method-detail">
|
146
|
+
<a name="M000162"></a>
|
147
147
|
|
148
148
|
<div class="method-heading">
|
149
|
-
<a href="#
|
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('
|
157
|
-
<div class="method-source-code" id="
|
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-
|
170
|
-
<a name="
|
169
|
+
<div id="method-M000163" class="method-detail">
|
170
|
+
<a name="M000163"></a>
|
171
171
|
|
172
172
|
<div class="method-heading">
|
173
|
-
<a href="#
|
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('
|
181
|
-
<div class="method-source-code" id="
|
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-
|
197
|
-
<a name="
|
196
|
+
<div id="method-M000164" class="method-detail">
|
197
|
+
<a name="M000164"></a>
|
198
198
|
|
199
199
|
<div class="method-heading">
|
200
|
-
<a href="#
|
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('
|
208
|
-
<div class="method-source-code" id="
|
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-
|
212
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"<%#{@code}%>\n"</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-
|
220
|
-
<a name="
|
219
|
+
<div id="method-M000165" class="method-detail">
|
220
|
+
<a name="M000165"></a>
|
221
221
|
|
222
222
|
<div class="method-heading">
|
223
|
-
<a href="#
|
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('
|
231
|
-
<div class="method-source-code" id="
|
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="#
|
96
|
+
<a href="#M000084">accept</a>
|
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-
|
119
|
-
<a name="
|
118
|
+
<div id="method-M000084" class="method-detail">
|
119
|
+
<a name="M000084"></a>
|
120
120
|
|
121
121
|
<div class="method-heading">
|
122
|
-
<a href="#
|
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('
|
133
|
-
<div class="method-source-code" id="
|
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>)
|