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="#M000057">new</a>
|
98
|
+
<a href="#M000058">translate_string</a>
|
99
99
|
</div>
|
100
100
|
</div>
|
101
101
|
|
@@ -130,21 +130,21 @@ translator for php
|
|
130
130
|
<div id="methods">
|
131
131
|
<h3 class="section-bar">Public Class methods</h3>
|
132
132
|
|
133
|
-
<div id="method-
|
134
|
-
<a name="
|
133
|
+
<div id="method-M000057" class="method-detail">
|
134
|
+
<a name="M000057"></a>
|
135
135
|
|
136
136
|
<div class="method-heading">
|
137
|
-
<a href="#
|
137
|
+
<a href="#M000057" class="method-signature">
|
138
138
|
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
139
139
|
</a>
|
140
140
|
</div>
|
141
141
|
|
142
142
|
<div class="method-description">
|
143
143
|
<p><a class="source-toggle" href="#"
|
144
|
-
onclick="toggleCode('
|
145
|
-
<div class="method-source-code" id="
|
144
|
+
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
145
|
+
<div class="method-source-code" id="M000057-source">
|
146
146
|
<pre>
|
147
|
-
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line
|
147
|
+
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 170</span>
|
148
148
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
149
149
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-constant">PHP_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
|
150
150
|
<span class="ruby-keyword kw">end</span>
|
@@ -155,21 +155,21 @@ translator for php
|
|
155
155
|
|
156
156
|
<h3 class="section-bar">Public Instance methods</h3>
|
157
157
|
|
158
|
-
<div id="method-
|
159
|
-
<a name="
|
158
|
+
<div id="method-M000058" class="method-detail">
|
159
|
+
<a name="M000058"></a>
|
160
160
|
|
161
161
|
<div class="method-heading">
|
162
|
-
<a href="#
|
162
|
+
<a href="#M000058" class="method-signature">
|
163
163
|
<span class="method-name">translate_string</span><span class="method-args">(str)</span>
|
164
164
|
</a>
|
165
165
|
</div>
|
166
166
|
|
167
167
|
<div class="method-description">
|
168
168
|
<p><a class="source-toggle" href="#"
|
169
|
-
onclick="toggleCode('
|
170
|
-
<div class="method-source-code" id="
|
169
|
+
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
170
|
+
<div class="method-source-code" id="M000058-source">
|
171
171
|
<pre>
|
172
|
-
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line
|
172
|
+
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 175</span>
|
173
173
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate_string</span>(<span class="ruby-identifier">str</span>)
|
174
174
|
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/<\?xml/</span>, <span class="ruby-value str">'<<?php ?>?xml'</span>)
|
175
175
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">str</span>)
|
@@ -92,24 +92,24 @@
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
95
|
+
<a href="#M000182">_parse_block</a>
|
96
|
+
<a href="#M000169">escape?</a>
|
97
|
+
<a href="#M000184">get_class</a>
|
98
|
+
<a href="#M000170">getch</a>
|
99
|
+
<a href="#M000176">keywords</a>
|
100
|
+
<a href="#M000167">new</a>
|
101
|
+
<a href="#M000181">parse</a>
|
102
|
+
<a href="#M000180">parse_error</a>
|
103
|
+
<a href="#M000183">register_class</a>
|
104
|
+
<a href="#M000168">reset</a>
|
105
|
+
<a href="#M000177">scan</a>
|
106
|
+
<a href="#M000178">scan_block</a>
|
107
|
+
<a href="#M000175">scan_hook</a>
|
108
|
+
<a href="#M000171">scan_ident</a>
|
109
|
+
<a href="#M000179">scan_line</a>
|
110
|
+
<a href="#M000173">scan_string</a>
|
111
|
+
<a href="#M000172">scan_string_dquoted</a>
|
112
|
+
<a href="#M000174">scan_string_quoted</a>
|
113
113
|
</div>
|
114
114
|
</div>
|
115
115
|
|
@@ -195,21 +195,21 @@
|
|
195
195
|
<div id="methods">
|
196
196
|
<h3 class="section-bar">Public Class methods</h3>
|
197
197
|
|
198
|
-
<div id="method-
|
199
|
-
<a name="
|
198
|
+
<div id="method-M000184" class="method-detail">
|
199
|
+
<a name="M000184"></a>
|
200
200
|
|
201
201
|
<div class="method-heading">
|
202
|
-
<a href="#
|
202
|
+
<a href="#M000184" class="method-signature">
|
203
203
|
<span class="method-name">get_class</span><span class="method-args">(css)</span>
|
204
204
|
</a>
|
205
205
|
</div>
|
206
206
|
|
207
207
|
<div class="method-description">
|
208
208
|
<p><a class="source-toggle" href="#"
|
209
|
-
onclick="toggleCode('
|
210
|
-
<div class="method-source-code" id="
|
209
|
+
onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
|
210
|
+
<div class="method-source-code" id="M000184-source">
|
211
211
|
<pre>
|
212
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
212
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 374</span>
|
213
213
|
<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">css</span>)
|
214
214
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">css</span>]
|
215
215
|
<span class="ruby-keyword kw">end</span>
|
@@ -218,19 +218,19 @@
|
|
218
218
|
</div>
|
219
219
|
</div>
|
220
220
|
|
221
|
-
<div id="method-
|
222
|
-
<a name="
|
221
|
+
<div id="method-M000167" class="method-detail">
|
222
|
+
<a name="M000167"></a>
|
223
223
|
|
224
224
|
<div class="method-heading">
|
225
|
-
<a href="#
|
225
|
+
<a href="#M000167" class="method-signature">
|
226
226
|
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
227
227
|
</a>
|
228
228
|
</div>
|
229
229
|
|
230
230
|
<div class="method-description">
|
231
231
|
<p><a class="source-toggle" href="#"
|
232
|
-
onclick="toggleCode('
|
233
|
-
<div class="method-source-code" id="
|
232
|
+
onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
|
233
|
+
<div class="method-source-code" id="M000167-source">
|
234
234
|
<pre>
|
235
235
|
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 65</span>
|
236
236
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
@@ -241,21 +241,21 @@
|
|
241
241
|
</div>
|
242
242
|
</div>
|
243
243
|
|
244
|
-
<div id="method-
|
245
|
-
<a name="
|
244
|
+
<div id="method-M000183" class="method-detail">
|
245
|
+
<a name="M000183"></a>
|
246
246
|
|
247
247
|
<div class="method-heading">
|
248
|
-
<a href="#
|
248
|
+
<a href="#M000183" class="method-signature">
|
249
249
|
<span class="method-name">register_class</span><span class="method-args">(css, klass)</span>
|
250
250
|
</a>
|
251
251
|
</div>
|
252
252
|
|
253
253
|
<div class="method-description">
|
254
254
|
<p><a class="source-toggle" href="#"
|
255
|
-
onclick="toggleCode('
|
256
|
-
<div class="method-source-code" id="
|
255
|
+
onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000183-source">
|
257
257
|
<pre>
|
258
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
258
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 369</span>
|
259
259
|
<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">css</span>, <span class="ruby-identifier">klass</span>)
|
260
260
|
<span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">css</span>] = <span class="ruby-identifier">klass</span>
|
261
261
|
<span class="ruby-keyword kw">end</span>
|
@@ -266,21 +266,21 @@
|
|
266
266
|
|
267
267
|
<h3 class="section-bar">Public Instance methods</h3>
|
268
268
|
|
269
|
-
<div id="method-
|
270
|
-
<a name="
|
269
|
+
<div id="method-M000182" class="method-detail">
|
270
|
+
<a name="M000182"></a>
|
271
271
|
|
272
272
|
<div class="method-heading">
|
273
|
-
<a href="#
|
273
|
+
<a href="#M000182" class="method-signature">
|
274
274
|
<span class="method-name">_parse_block</span><span class="method-args">()</span>
|
275
275
|
</a>
|
276
276
|
</div>
|
277
277
|
|
278
278
|
<div class="method-description">
|
279
279
|
<p><a class="source-toggle" href="#"
|
280
|
-
onclick="toggleCode('
|
281
|
-
<div class="method-source-code" id="
|
280
|
+
onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
|
281
|
+
<div class="method-source-code" id="M000182-source">
|
282
282
|
<pre>
|
283
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
283
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 346</span>
|
284
284
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_block</span>
|
285
285
|
<span class="ruby-identifier">scan</span>()
|
286
286
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'{'</span><span class="ruby-value str">'{'</span>
|
@@ -295,8 +295,8 @@
|
|
295
295
|
<span class="ruby-identifier">assert</span>(<span class="ruby-node">"@error=#{@error}"</span>)
|
296
296
|
<span class="ruby-keyword kw">end</span>
|
297
297
|
<span class="ruby-keyword kw">end</span>
|
298
|
-
<span class="ruby-ivar">@value</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/\A\
|
299
|
-
<span class="ruby-ivar">@value</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re"
|
298
|
+
<span class="ruby-ivar">@value</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/\A[ \t]*\n/</span>, <span class="ruby-value str">''</span>)
|
299
|
+
<span class="ruby-ivar">@value</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/^[ \t]+\z/</span>, <span class="ruby-value str">''</span>)
|
300
300
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@value</span>
|
301
301
|
<span class="ruby-keyword kw">end</span>
|
302
302
|
</pre>
|
@@ -304,21 +304,21 @@
|
|
304
304
|
</div>
|
305
305
|
</div>
|
306
306
|
|
307
|
-
<div id="method-
|
308
|
-
<a name="
|
307
|
+
<div id="method-M000169" class="method-detail">
|
308
|
+
<a name="M000169"></a>
|
309
309
|
|
310
310
|
<div class="method-heading">
|
311
|
-
<a href="#
|
311
|
+
<a href="#M000169" class="method-signature">
|
312
312
|
<span class="method-name">escape?</span><span class="method-args">(value)</span>
|
313
313
|
</a>
|
314
314
|
</div>
|
315
315
|
|
316
316
|
<div class="method-description">
|
317
317
|
<p><a class="source-toggle" href="#"
|
318
|
-
onclick="toggleCode('
|
319
|
-
<div class="method-source-code" id="
|
318
|
+
onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
|
319
|
+
<div class="method-source-code" id="M000169-source">
|
320
320
|
<pre>
|
321
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
321
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 113</span>
|
322
322
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape?</span>(<span class="ruby-identifier">value</span>)
|
323
323
|
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">ESCAPE_FLAG_TABLE</span>[<span class="ruby-identifier">value</span>]
|
324
324
|
<span class="ruby-keyword kw">end</span>
|
@@ -327,11 +327,11 @@
|
|
327
327
|
</div>
|
328
328
|
</div>
|
329
329
|
|
330
|
-
<div id="method-
|
331
|
-
<a name="
|
330
|
+
<div id="method-M000170" class="method-detail">
|
331
|
+
<a name="M000170"></a>
|
332
332
|
|
333
333
|
<div class="method-heading">
|
334
|
-
<a href="#
|
334
|
+
<a href="#M000170" class="method-signature">
|
335
335
|
<span class="method-name">getch</span><span class="method-args">()</span>
|
336
336
|
</a>
|
337
337
|
</div>
|
@@ -341,10 +341,10 @@
|
|
341
341
|
scanner
|
342
342
|
</p>
|
343
343
|
<p><a class="source-toggle" href="#"
|
344
|
-
onclick="toggleCode('
|
345
|
-
<div class="method-source-code" id="
|
344
|
+
onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
|
345
|
+
<div class="method-source-code" id="M000170-source">
|
346
346
|
<pre>
|
347
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
347
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 120</span>
|
348
348
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">getch</span>
|
349
349
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ch</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@pos</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@max_pos</span>
|
350
350
|
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
@@ -361,11 +361,11 @@ scanner
|
|
361
361
|
</div>
|
362
362
|
</div>
|
363
363
|
|
364
|
-
<div id="method-
|
365
|
-
<a name="
|
364
|
+
<div id="method-M000176" class="method-detail">
|
365
|
+
<a name="M000176"></a>
|
366
366
|
|
367
367
|
<div class="method-heading">
|
368
|
-
<a href="#
|
368
|
+
<a href="#M000176" class="method-signature">
|
369
369
|
<span class="method-name">keywords</span><span class="method-args">(keyword)</span>
|
370
370
|
</a>
|
371
371
|
</div>
|
@@ -378,10 +378,10 @@ scanner
|
|
378
378
|
return symbol if keyword is token, else return nil
|
379
379
|
</p>
|
380
380
|
<p><a class="source-toggle" href="#"
|
381
|
-
onclick="toggleCode('
|
382
|
-
<div class="method-source-code" id="
|
381
|
+
onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
|
382
|
+
<div class="method-source-code" id="M000176-source">
|
383
383
|
<pre>
|
384
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
384
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 224</span>
|
385
385
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keywords</span>(<span class="ruby-identifier">keyword</span>)
|
386
386
|
<span class="ruby-identifier">not_implemented</span>
|
387
387
|
<span class="ruby-keyword kw">end</span>
|
@@ -390,11 +390,11 @@ return symbol if keyword is token, else return nil
|
|
390
390
|
</div>
|
391
391
|
</div>
|
392
392
|
|
393
|
-
<div id="method-
|
394
|
-
<a name="
|
393
|
+
<div id="method-M000181" class="method-detail">
|
394
|
+
<a name="M000181"></a>
|
395
395
|
|
396
396
|
<div class="method-heading">
|
397
|
-
<a href="#
|
397
|
+
<a href="#M000181" class="method-signature">
|
398
398
|
<span class="method-name">parse</span><span class="method-args">(input, filename='')</span>
|
399
399
|
</a>
|
400
400
|
</div>
|
@@ -405,10 +405,10 @@ return symbol if keyword is token, else return nil
|
|
405
405
|
href="ElementRuleset.html">ElementRuleset</a>
|
406
406
|
</p>
|
407
407
|
<p><a class="source-toggle" href="#"
|
408
|
-
onclick="toggleCode('
|
409
|
-
<div class="method-source-code" id="
|
408
|
+
onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
|
409
|
+
<div class="method-source-code" id="M000181-source">
|
410
410
|
<pre>
|
411
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
411
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 341</span>
|
412
412
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">filename</span>=<span class="ruby-value str">''</span>)
|
413
413
|
<span class="ruby-identifier">not_implemented</span>
|
414
414
|
<span class="ruby-keyword kw">end</span>
|
@@ -417,11 +417,11 @@ href="ElementRuleset.html">ElementRuleset</a>
|
|
417
417
|
</div>
|
418
418
|
</div>
|
419
419
|
|
420
|
-
<div id="method-
|
421
|
-
<a name="
|
420
|
+
<div id="method-M000180" class="method-detail">
|
421
|
+
<a name="M000180"></a>
|
422
422
|
|
423
423
|
<div class="method-heading">
|
424
|
-
<a href="#
|
424
|
+
<a href="#M000180" class="method-signature">
|
425
425
|
<span class="method-name">parse_error</span><span class="method-args">(message, linenum=@linenum, column=@column)</span>
|
426
426
|
</a>
|
427
427
|
</div>
|
@@ -431,10 +431,10 @@ href="ElementRuleset.html">ElementRuleset</a>
|
|
431
431
|
parser
|
432
432
|
</p>
|
433
433
|
<p><a class="source-toggle" href="#"
|
434
|
-
onclick="toggleCode('
|
435
|
-
<div class="method-source-code" id="
|
434
|
+
onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
|
435
|
+
<div class="method-source-code" id="M000180-source">
|
436
436
|
<pre>
|
437
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
437
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 335</span>
|
438
438
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_error</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">linenum</span>=<span class="ruby-ivar">@linenum</span>, <span class="ruby-identifier">column</span>=<span class="ruby-ivar">@column</span>)
|
439
439
|
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">ParseError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-ivar">@filename</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
440
440
|
<span class="ruby-keyword kw">end</span>
|
@@ -443,11 +443,11 @@ parser
|
|
443
443
|
</div>
|
444
444
|
</div>
|
445
445
|
|
446
|
-
<div id="method-
|
447
|
-
<a name="
|
446
|
+
<div id="method-M000177" class="method-detail">
|
447
|
+
<a name="M000177"></a>
|
448
448
|
|
449
449
|
<div class="method-heading">
|
450
|
-
<a href="#
|
450
|
+
<a href="#M000177" class="method-signature">
|
451
451
|
<span class="method-name">scan</span><span class="method-args">()</span>
|
452
452
|
</a>
|
453
453
|
</div>
|
@@ -457,10 +457,10 @@ parser
|
|
457
457
|
scan token
|
458
458
|
</p>
|
459
459
|
<p><a class="source-toggle" href="#"
|
460
|
-
onclick="toggleCode('
|
461
|
-
<div class="method-source-code" id="
|
460
|
+
onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
|
461
|
+
<div class="method-source-code" id="M000177-source">
|
462
462
|
<pre>
|
463
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
463
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 229</span>
|
464
464
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan</span>
|
465
465
|
<span class="ruby-comment cmt">## skip whitespaces</span>
|
466
466
|
<span class="ruby-identifier">c</span> = <span class="ruby-ivar">@ch</span>
|
@@ -476,7 +476,7 @@ scan token
|
|
476
476
|
|
477
477
|
<span class="ruby-comment cmt">## scan hook</span>
|
478
478
|
<span class="ruby-identifier">ret</span> = <span class="ruby-identifier">scan_hook</span>() <span class="ruby-comment cmt"># scan_hook() is overrided in subclass</span>
|
479
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span>
|
479
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
|
480
480
|
|
481
481
|
<span class="ruby-comment cmt">## keyword or identifer</span>
|
482
482
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_identchar</span>(<span class="ruby-identifier">c</span>)
|
@@ -509,6 +509,13 @@ scan token
|
|
509
509
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@token</span> = <span class="ruby-value str">'}'</span><span class="ruby-value str">'}'</span>
|
510
510
|
<span class="ruby-keyword kw">end</span>
|
511
511
|
|
512
|
+
<span class="ruby-comment cmt">## ','</span>
|
513
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-value">?,</span>
|
514
|
+
<span class="ruby-ivar">@value</span> = <span class="ruby-value str">","</span>
|
515
|
+
<span class="ruby-identifier">getch</span>()
|
516
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@token</span> = <span class="ruby-value str">','</span><span class="ruby-value str">','</span>
|
517
|
+
<span class="ruby-keyword kw">end</span>
|
518
|
+
|
512
519
|
<span class="ruby-comment cmt">##</span>
|
513
520
|
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">c</span>.<span class="ruby-identifier">chr</span>
|
514
521
|
<span class="ruby-ivar">@error</span> = <span class="ruby-identifier">:invalid_char</span>
|
@@ -519,21 +526,21 @@ scan token
|
|
519
526
|
</div>
|
520
527
|
</div>
|
521
528
|
|
522
|
-
<div id="method-
|
523
|
-
<a name="
|
529
|
+
<div id="method-M000178" class="method-detail">
|
530
|
+
<a name="M000178"></a>
|
524
531
|
|
525
532
|
<div class="method-heading">
|
526
|
-
<a href="#
|
533
|
+
<a href="#M000178" class="method-signature">
|
527
534
|
<span class="method-name">scan_block</span><span class="method-args">(skip_open_curly=false)</span>
|
528
535
|
</a>
|
529
536
|
</div>
|
530
537
|
|
531
538
|
<div class="method-description">
|
532
539
|
<p><a class="source-toggle" href="#"
|
533
|
-
onclick="toggleCode('
|
534
|
-
<div class="method-source-code" id="
|
540
|
+
onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
|
541
|
+
<div class="method-source-code" id="M000178-source">
|
535
542
|
<pre>
|
536
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
543
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 291</span>
|
537
544
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_block</span>(<span class="ruby-identifier">skip_open_curly</span>=<span class="ruby-keyword kw">false</span>)
|
538
545
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">skip_open_curly</span>
|
539
546
|
<span class="ruby-identifier">token</span> = <span class="ruby-identifier">scan</span>()
|
@@ -567,24 +574,24 @@ scan token
|
|
567
574
|
</div>
|
568
575
|
</div>
|
569
576
|
|
570
|
-
<div id="method-
|
571
|
-
<a name="
|
577
|
+
<div id="method-M000175" class="method-detail">
|
578
|
+
<a name="M000175"></a>
|
572
579
|
|
573
580
|
<div class="method-heading">
|
574
|
-
<a href="#
|
581
|
+
<a href="#M000175" class="method-signature">
|
575
582
|
<span class="method-name">scan_hook</span><span class="method-args">()</span>
|
576
583
|
</a>
|
577
584
|
</div>
|
578
585
|
|
579
586
|
<div class="method-description">
|
580
587
|
<p>
|
581
|
-
called from scan()
|
588
|
+
called from scan(), return false when not hooked
|
582
589
|
</p>
|
583
590
|
<p><a class="source-toggle" href="#"
|
584
|
-
onclick="toggleCode('
|
585
|
-
<div class="method-source-code" id="
|
591
|
+
onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
|
592
|
+
<div class="method-source-code" id="M000175-source">
|
586
593
|
<pre>
|
587
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
594
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 217</span>
|
588
595
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_hook</span>
|
589
596
|
<span class="ruby-comment cmt">#not_implemented</span>
|
590
597
|
<span class="ruby-keyword kw">end</span>
|
@@ -593,21 +600,21 @@ called from scan()
|
|
593
600
|
</div>
|
594
601
|
</div>
|
595
602
|
|
596
|
-
<div id="method-
|
597
|
-
<a name="
|
603
|
+
<div id="method-M000171" class="method-detail">
|
604
|
+
<a name="M000171"></a>
|
598
605
|
|
599
606
|
<div class="method-heading">
|
600
|
-
<a href="#
|
607
|
+
<a href="#M000171" class="method-signature">
|
601
608
|
<span class="method-name">scan_ident</span><span class="method-args">()</span>
|
602
609
|
</a>
|
603
610
|
</div>
|
604
611
|
|
605
612
|
<div class="method-description">
|
606
613
|
<p><a class="source-toggle" href="#"
|
607
|
-
onclick="toggleCode('
|
608
|
-
<div class="method-source-code" id="
|
614
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
615
|
+
<div class="method-source-code" id="M000171-source">
|
609
616
|
<pre>
|
610
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
617
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 133</span>
|
611
618
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_ident</span>
|
612
619
|
<span class="ruby-comment cmt">## identifer</span>
|
613
620
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_identchar</span>(<span class="ruby-ivar">@ch</span>)
|
@@ -625,21 +632,21 @@ called from scan()
|
|
625
632
|
</div>
|
626
633
|
</div>
|
627
634
|
|
628
|
-
<div id="method-
|
629
|
-
<a name="
|
635
|
+
<div id="method-M000179" class="method-detail">
|
636
|
+
<a name="M000179"></a>
|
630
637
|
|
631
638
|
<div class="method-heading">
|
632
|
-
<a href="#
|
639
|
+
<a href="#M000179" class="method-signature">
|
633
640
|
<span class="method-name">scan_line</span><span class="method-args">()</span>
|
634
641
|
</a>
|
635
642
|
</div>
|
636
643
|
|
637
644
|
<div class="method-description">
|
638
645
|
<p><a class="source-toggle" href="#"
|
639
|
-
onclick="toggleCode('
|
640
|
-
<div class="method-source-code" id="
|
646
|
+
onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
|
647
|
+
<div class="method-source-code" id="M000179-source">
|
641
648
|
<pre>
|
642
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
649
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 321</span>
|
643
650
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_line</span>
|
644
651
|
<span class="ruby-identifier">sb</span> = <span class="ruby-ivar">@ch</span>.<span class="ruby-identifier">chr</span>
|
645
652
|
<span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">c</span> = <span class="ruby-identifier">getch</span>()) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">!=</span> <span class="ruby-value">?\n</span>
|
@@ -654,21 +661,21 @@ called from scan()
|
|
654
661
|
</div>
|
655
662
|
</div>
|
656
663
|
|
657
|
-
<div id="method-
|
658
|
-
<a name="
|
664
|
+
<div id="method-M000173" class="method-detail">
|
665
|
+
<a name="M000173"></a>
|
659
666
|
|
660
667
|
<div class="method-heading">
|
661
|
-
<a href="#
|
668
|
+
<a href="#M000173" class="method-signature">
|
662
669
|
<span class="method-name">scan_string</span><span class="method-args">()</span>
|
663
670
|
</a>
|
664
671
|
</div>
|
665
672
|
|
666
673
|
<div class="method-description">
|
667
674
|
<p><a class="source-toggle" href="#"
|
668
|
-
onclick="toggleCode('
|
669
|
-
<div class="method-source-code" id="
|
675
|
+
onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
|
676
|
+
<div class="method-source-code" id="M000173-source">
|
670
677
|
<pre>
|
671
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
678
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 178</span>
|
672
679
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_string</span>
|
673
680
|
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?'</span>
|
674
681
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">scan_string_quoted</span>()
|
@@ -683,21 +690,21 @@ called from scan()
|
|
683
690
|
</div>
|
684
691
|
</div>
|
685
692
|
|
686
|
-
<div id="method-
|
687
|
-
<a name="
|
693
|
+
<div id="method-M000172" class="method-detail">
|
694
|
+
<a name="M000172"></a>
|
688
695
|
|
689
696
|
<div class="method-heading">
|
690
|
-
<a href="#
|
697
|
+
<a href="#M000172" class="method-signature">
|
691
698
|
<span class="method-name">scan_string_dquoted</span><span class="method-args">()</span>
|
692
699
|
</a>
|
693
700
|
</div>
|
694
701
|
|
695
702
|
<div class="method-description">
|
696
703
|
<p><a class="source-toggle" href="#"
|
697
|
-
onclick="toggleCode('
|
698
|
-
<div class="method-source-code" id="
|
704
|
+
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
705
|
+
<div class="method-source-code" id="M000172-source">
|
699
706
|
<pre>
|
700
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
707
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 147</span>
|
701
708
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_string_dquoted</span>
|
702
709
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?"</span>
|
703
710
|
<span class="ruby-identifier">s</span> = <span class="ruby-value str">''</span>
|
@@ -732,21 +739,21 @@ called from scan()
|
|
732
739
|
</div>
|
733
740
|
</div>
|
734
741
|
|
735
|
-
<div id="method-
|
736
|
-
<a name="
|
742
|
+
<div id="method-M000174" class="method-detail">
|
743
|
+
<a name="M000174"></a>
|
737
744
|
|
738
745
|
<div class="method-heading">
|
739
|
-
<a href="#
|
746
|
+
<a href="#M000174" class="method-signature">
|
740
747
|
<span class="method-name">scan_string_quoted</span><span class="method-args">()</span>
|
741
748
|
</a>
|
742
749
|
</div>
|
743
750
|
|
744
751
|
<div class="method-description">
|
745
752
|
<p><a class="source-toggle" href="#"
|
746
|
-
onclick="toggleCode('
|
747
|
-
<div class="method-source-code" id="
|
753
|
+
onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
|
754
|
+
<div class="method-source-code" id="M000174-source">
|
748
755
|
<pre>
|
749
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
756
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 189</span>
|
750
757
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_string_quoted</span>
|
751
758
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?'</span>
|
752
759
|
<span class="ruby-identifier">s</span> = <span class="ruby-value str">''</span>
|
@@ -779,11 +786,11 @@ called from scan()
|
|
779
786
|
|
780
787
|
<h3 class="section-bar">Protected Instance methods</h3>
|
781
788
|
|
782
|
-
<div id="method-
|
783
|
-
<a name="
|
789
|
+
<div id="method-M000168" class="method-detail">
|
790
|
+
<a name="M000168"></a>
|
784
791
|
|
785
792
|
<div class="method-heading">
|
786
|
-
<a href="#
|
793
|
+
<a href="#M000168" class="method-signature">
|
787
794
|
<span class="method-name">reset</span><span class="method-args">(input, filename='')</span>
|
788
795
|
</a>
|
789
796
|
</div>
|
@@ -793,11 +800,12 @@ called from scan()
|
|
793
800
|
called from parse() and initialize parser object
|
794
801
|
</p>
|
795
802
|
<p><a class="source-toggle" href="#"
|
796
|
-
onclick="toggleCode('
|
797
|
-
<div class="method-source-code" id="
|
803
|
+
onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
|
804
|
+
<div class="method-source-code" id="M000168-source">
|
798
805
|
<pre>
|
799
806
|
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 71</span>
|
800
807
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">filename</span>=<span class="ruby-value str">''</span>)
|
808
|
+
<span class="ruby-identifier">input</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{self.class.name}#reset() requires string argument."</span>)
|
801
809
|
<span class="ruby-ivar">@input</span> = <span class="ruby-identifier">input</span>
|
802
810
|
<span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">filename</span>
|
803
811
|
<span class="ruby-ivar">@linenum</span> = <span class="ruby-value">1</span> <span class="ruby-comment cmt"># 1 start</span>
|