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,7 +94,7 @@ translator for rails
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
97
|
+
<a href="#M000159">new</a>
|
98
98
|
</div>
|
99
99
|
</div>
|
100
100
|
|
@@ -129,21 +129,21 @@ translator for rails
|
|
129
129
|
<div id="methods">
|
130
130
|
<h3 class="section-bar">Public Class methods</h3>
|
131
131
|
|
132
|
-
<div id="method-
|
133
|
-
<a name="
|
132
|
+
<div id="method-M000159" class="method-detail">
|
133
|
+
<a name="M000159"></a>
|
134
134
|
|
135
135
|
<div class="method-heading">
|
136
|
-
<a href="#
|
136
|
+
<a href="#M000159" class="method-signature">
|
137
137
|
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
138
138
|
</a>
|
139
139
|
</div>
|
140
140
|
|
141
141
|
<div class="method-description">
|
142
142
|
<p><a class="source-toggle" href="#"
|
143
|
-
onclick="toggleCode('
|
144
|
-
<div class="method-source-code" id="
|
143
|
+
onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
|
144
|
+
<div class="method-source-code" id="M000159-source">
|
145
145
|
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
146
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 288</span>
|
147
147
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
148
148
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-constant">RAILS_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
|
149
149
|
<span class="ruby-keyword kw">end</span>
|
@@ -0,0 +1,349 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Kwartz::RubyHandler</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Kwartz::RubyHandler</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/binding/ruby_rb.html">
|
59
|
+
kwartz/binding/ruby.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Handler.html">
|
69
|
+
Handler
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
directive handler for Ruby
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000157">directive_format</a>
|
98
|
+
<a href="#M000155">directive_pattern</a>
|
99
|
+
<a href="#M000158">handle</a>
|
100
|
+
<a href="#M000156">mapping_pattern</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
<div id="constants-list">
|
113
|
+
<h3 class="section-bar">Constants</h3>
|
114
|
+
|
115
|
+
<div class="name-list">
|
116
|
+
<table summary="Constants">
|
117
|
+
<tr class="top-aligned-row context-row">
|
118
|
+
<td class="context-item-name">RUBY_DIRECTIVE_PATTERN</td>
|
119
|
+
<td>=</td>
|
120
|
+
<td class="context-item-value">/\A(\w+)(?:[:\s]\s*(.*))?\z/</td>
|
121
|
+
</tr>
|
122
|
+
<tr class="top-aligned-row context-row">
|
123
|
+
<td class="context-item-name">RUBY_MAPPING_PATTERN</td>
|
124
|
+
<td>=</td>
|
125
|
+
<td class="context-item-value">/\A'([-:\w]+)'\s+(.*)\z/</td>
|
126
|
+
</tr>
|
127
|
+
<tr class="top-aligned-row context-row">
|
128
|
+
<td class="context-item-name">RUBY_DIRECTIVE_FORMAT</td>
|
129
|
+
<td>=</td>
|
130
|
+
<td class="context-item-value">'%s: %s'</td>
|
131
|
+
</tr>
|
132
|
+
</table>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<!-- if method_list -->
|
142
|
+
<div id="methods">
|
143
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
144
|
+
|
145
|
+
<div id="method-M000157" class="method-detail">
|
146
|
+
<a name="M000157"></a>
|
147
|
+
|
148
|
+
<div class="method-heading">
|
149
|
+
<a href="#M000157" class="method-signature">
|
150
|
+
<span class="method-name">directive_format</span><span class="method-args">()</span>
|
151
|
+
</a>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="method-description">
|
155
|
+
<p><a class="source-toggle" href="#"
|
156
|
+
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
157
|
+
<div class="method-source-code" id="M000157-source">
|
158
|
+
<pre>
|
159
|
+
<span class="ruby-comment cmt"># File kwartz/binding/ruby.rb, line 38</span>
|
160
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
|
161
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBY_DIRECTIVE_FORMAT</span>
|
162
|
+
<span class="ruby-keyword kw">end</span>
|
163
|
+
</pre>
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div id="method-M000155" class="method-detail">
|
169
|
+
<a name="M000155"></a>
|
170
|
+
|
171
|
+
<div class="method-heading">
|
172
|
+
<a href="#M000155" class="method-signature">
|
173
|
+
<span class="method-name">directive_pattern</span><span class="method-args">()</span>
|
174
|
+
</a>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
<p><a class="source-toggle" href="#"
|
179
|
+
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
|
180
|
+
<div class="method-source-code" id="M000155-source">
|
181
|
+
<pre>
|
182
|
+
<span class="ruby-comment cmt"># File kwartz/binding/ruby.rb, line 24</span>
|
183
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
|
184
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBY_DIRECTIVE_PATTERN</span>
|
185
|
+
<span class="ruby-keyword kw">end</span>
|
186
|
+
</pre>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div id="method-M000158" class="method-detail">
|
192
|
+
<a name="M000158"></a>
|
193
|
+
|
194
|
+
<div class="method-heading">
|
195
|
+
<a href="#M000158" class="method-signature">
|
196
|
+
<span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
|
197
|
+
</a>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-description">
|
201
|
+
<p><a class="source-toggle" href="#"
|
202
|
+
onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000158-source">
|
204
|
+
<pre>
|
205
|
+
<span class="ruby-comment cmt"># File kwartz/binding/ruby.rb, line 43</span>
|
206
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">handler_arg</span>)
|
207
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
|
208
|
+
<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>
|
209
|
+
|
210
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
|
211
|
+
<span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
|
212
|
+
<span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
|
213
|
+
<span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
|
214
|
+
<span class="ruby-comment cmt">#stag_info = arg.stag_info</span>
|
215
|
+
<span class="ruby-comment cmt">#etag_info = arg.etag_info</span>
|
216
|
+
<span class="ruby-comment cmt">#cont_stmts = arg.cont_stmts</span>
|
217
|
+
|
218
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
|
219
|
+
|
220
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:for</span>, <span class="ruby-identifier">:For</span>, <span class="ruby-identifier">:FOR</span>, <span class="ruby-identifier">:list</span>, <span class="ruby-identifier">:List</span>, <span class="ruby-identifier">:LIST</span>
|
221
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)(?:,\s*(\w+))?\s+in\s+(.*)\z/</span> \
|
222
|
+
<span class="ruby-operator">||</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)(?:,(\w+))?\s*[:=]\s*(.*)\z/</span>
|
223
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
224
|
+
<span class="ruby-keyword kw">end</span>
|
225
|
+
<span class="ruby-identifier">loopvar</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">loopval</span> = <span class="ruby-identifier">$2</span> ; <span class="ruby-identifier">looplist</span> = <span class="ruby-identifier">$3</span>
|
226
|
+
<span class="ruby-identifier">is_foreach</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:For</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:FOR</span>
|
227
|
+
<span class="ruby-identifier">counter</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_ctr"</span>
|
228
|
+
<span class="ruby-identifier">toggle</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:FOR</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:LIST</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_tgl"</span>
|
229
|
+
<span class="ruby-identifier">foreach_code</span> = <span class="ruby-identifier">loopval</span> <span class="ruby-value">? </span><span class="ruby-node">"#{looplist}.each do |#{loopvar}, #{loopval}|"</span> \
|
230
|
+
<span class="ruby-operator">:</span> <span class="ruby-node">"for #{loopvar} in #{looplist} do"</span>
|
231
|
+
<span class="ruby-identifier">code</span> = []
|
232
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{counter} = 0"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
233
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">foreach_code</span>
|
234
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{counter} += 1"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
235
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{toggle} = #{counter}%2==0 ? #{@even} : #{@odd}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">toggle</span>
|
236
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
|
237
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">:foreach</span>)
|
238
|
+
<span class="ruby-keyword kw">else</span>
|
239
|
+
<span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">:foreach</span>)
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
241
|
+
|
242
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:while</span>
|
243
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"while #{d_arg} do"</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">:while</span>)
|
244
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("while #{d_arg} do", :while)</span>
|
245
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
246
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
247
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
248
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("end", :while)</span>
|
249
|
+
|
250
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:loop</span>
|
251
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
|
252
|
+
<span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"while #{d_arg} do"</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">:while</span>)
|
253
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
254
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("while #{d_arg} do", :while)</span>
|
255
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
256
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("end", :while)</span>
|
257
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
258
|
+
|
259
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:set</span>
|
260
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">d_arg</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:set</span>)
|
261
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(d_arg, :set)</span>
|
262
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
263
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
264
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
265
|
+
|
266
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:if</span>
|
267
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"if #{d_arg} then"</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">:if</span>)
|
268
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("if #{d_arg} then", :if)</span>
|
269
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
270
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
271
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
272
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("end", :if)</span>
|
273
|
+
|
274
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elsif</span>, <span class="ruby-identifier">:else</span>
|
275
|
+
<span class="ruby-identifier">error_when_last_stmt_is_not_if</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>)
|
276
|
+
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">pop</span> <span class="ruby-comment cmt"># delete 'end'</span>
|
277
|
+
<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:elseif</span>
|
278
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"else"</span> <span class="ruby-operator">:</span> <span class="ruby-node">"elsif #{d_arg} then"</span>
|
279
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"end"</span>, <span class="ruby-identifier">kind</span>)
|
280
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(code, kind)</span>
|
281
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
282
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
283
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
284
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("end", kind)</span>
|
285
|
+
|
286
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:default</span>, <span class="ruby-identifier">:Default</span>, <span class="ruby-identifier">:DEFAULT</span>
|
287
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
|
288
|
+
<span class="ruby-identifier">expr_code</span> = <span class="ruby-identifier">d_arg</span>
|
289
|
+
<span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:default</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Default</span>)
|
290
|
+
<span class="ruby-identifier">add_native_expr_with_default</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">expr_code</span>, <span class="ruby-identifier">flag_escape</span>,
|
291
|
+
<span class="ruby-node">"if (#{d_arg}) && !(#{d_arg}).to_s.empty? then"</span>,
|
292
|
+
<span class="ruby-value str">"else"</span>, <span class="ruby-value str">"end"</span>)
|
293
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
294
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("if (#{d_arg}) && !(#{d_arg}).to_s.empty? then", :if)</span>
|
295
|
+
<span class="ruby-comment cmt">#flag_escape = d_name == :default ? nil : (d_name == :Default)</span>
|
296
|
+
<span class="ruby-comment cmt">#stmt_list << PrintStatement.new([ NativeExpression.new(d_arg, flag_escape) ])</span>
|
297
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("else", :else)</span>
|
298
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
299
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("end", :else)</span>
|
300
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
301
|
+
|
302
|
+
<span class="ruby-keyword kw">else</span>
|
303
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
304
|
+
|
305
|
+
<span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
|
306
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
307
|
+
|
308
|
+
<span class="ruby-keyword kw">end</span>
|
309
|
+
</pre>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
<div id="method-M000156" class="method-detail">
|
315
|
+
<a name="M000156"></a>
|
316
|
+
|
317
|
+
<div class="method-heading">
|
318
|
+
<a href="#M000156" class="method-signature">
|
319
|
+
<span class="method-name">mapping_pattern</span><span class="method-args">()</span>
|
320
|
+
</a>
|
321
|
+
</div>
|
322
|
+
|
323
|
+
<div class="method-description">
|
324
|
+
<p><a class="source-toggle" href="#"
|
325
|
+
onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
|
326
|
+
<div class="method-source-code" id="M000156-source">
|
327
|
+
<pre>
|
328
|
+
<span class="ruby-comment cmt"># File kwartz/binding/ruby.rb, line 31</span>
|
329
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
|
330
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBY_MAPPING_PATTERN</span>
|
331
|
+
<span class="ruby-keyword kw">end</span>
|
332
|
+
</pre>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
<div id="validator-badges">
|
345
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</body>
|
349
|
+
</html>
|
@@ -112,18 +112,18 @@ presentation logic example (ruby style):
|
|
112
112
|
<h3 class="section-bar">Methods</h3>
|
113
113
|
|
114
114
|
<div class="name-list">
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
119
|
-
<a href="#
|
120
|
-
<a href="#
|
121
|
-
<a href="#
|
122
|
-
<a href="#
|
123
|
-
<a href="#
|
124
|
-
<a href="#
|
125
|
-
<a href="#
|
126
|
-
<a href="#
|
115
|
+
<a href="#M000148">_parse_block</a>
|
116
|
+
<a href="#M000147">_parse_item</a>
|
117
|
+
<a href="#M000144">_parse_list</a>
|
118
|
+
<a href="#M000146">_parse_str</a>
|
119
|
+
<a href="#M000145">_parse_strs</a>
|
120
|
+
<a href="#M000149">_parse_tuples</a>
|
121
|
+
<a href="#M000143">has_space?</a>
|
122
|
+
<a href="#M000141">keywords</a>
|
123
|
+
<a href="#M000139">parse</a>
|
124
|
+
<a href="#M000142">parse_document_ruleset</a>
|
125
|
+
<a href="#M000150">parse_element_ruleset</a>
|
126
|
+
<a href="#M000140">scan_hook</a>
|
127
127
|
</div>
|
128
128
|
</div>
|
129
129
|
|
@@ -158,21 +158,21 @@ presentation logic example (ruby style):
|
|
158
158
|
<div id="methods">
|
159
159
|
<h3 class="section-bar">Public Instance methods</h3>
|
160
160
|
|
161
|
-
<div id="method-
|
162
|
-
<a name="
|
161
|
+
<div id="method-M000139" class="method-detail">
|
162
|
+
<a name="M000139"></a>
|
163
163
|
|
164
164
|
<div class="method-heading">
|
165
|
-
<a href="#
|
165
|
+
<a href="#M000139" class="method-signature">
|
166
166
|
<span class="method-name">parse</span><span class="method-args">(input, filename='')</span>
|
167
167
|
</a>
|
168
168
|
</div>
|
169
169
|
|
170
170
|
<div class="method-description">
|
171
171
|
<p><a class="source-toggle" href="#"
|
172
|
-
onclick="toggleCode('
|
173
|
-
<div class="method-source-code" id="
|
172
|
+
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000139-source">
|
174
174
|
<pre>
|
175
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
175
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 405</span>
|
176
176
|
<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>)
|
177
177
|
<span class="ruby-identifier">reset</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">filename</span>)
|
178
178
|
<span class="ruby-identifier">scan</span>()
|
@@ -196,21 +196,21 @@ presentation logic example (ruby style):
|
|
196
196
|
|
197
197
|
<h3 class="section-bar">Protected Instance methods</h3>
|
198
198
|
|
199
|
-
<div id="method-
|
200
|
-
<a name="
|
199
|
+
<div id="method-M000148" class="method-detail">
|
200
|
+
<a name="M000148"></a>
|
201
201
|
|
202
202
|
<div class="method-heading">
|
203
|
-
<a href="#
|
203
|
+
<a href="#M000148" class="method-signature">
|
204
204
|
<span class="method-name">_parse_block</span><span class="method-args">()</span>
|
205
205
|
</a>
|
206
206
|
</div>
|
207
207
|
|
208
208
|
<div class="method-description">
|
209
209
|
<p><a class="source-toggle" href="#"
|
210
|
-
onclick="toggleCode('
|
211
|
-
<div class="method-source-code" id="
|
210
|
+
onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
|
211
|
+
<div class="method-source-code" id="M000148-source">
|
212
212
|
<pre>
|
213
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
213
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 511</span>
|
214
214
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_block</span>
|
215
215
|
<span class="ruby-keyword kw">super</span>
|
216
216
|
<span class="ruby-keyword kw">end</span>
|
@@ -219,21 +219,21 @@ presentation logic example (ruby style):
|
|
219
219
|
</div>
|
220
220
|
</div>
|
221
221
|
|
222
|
-
<div id="method-
|
223
|
-
<a name="
|
222
|
+
<div id="method-M000147" class="method-detail">
|
223
|
+
<a name="M000147"></a>
|
224
224
|
|
225
225
|
<div class="method-heading">
|
226
|
-
<a href="#
|
226
|
+
<a href="#M000147" class="method-signature">
|
227
227
|
<span class="method-name">_parse_item</span><span class="method-args">()</span>
|
228
228
|
</a>
|
229
229
|
</div>
|
230
230
|
|
231
231
|
<div class="method-description">
|
232
232
|
<p><a class="source-toggle" href="#"
|
233
|
-
onclick="toggleCode('
|
234
|
-
<div class="method-source-code" id="
|
233
|
+
onclick="toggleCode('M000147-source');return false;">[Source]</a></p>
|
234
|
+
<div class="method-source-code" id="M000147-source">
|
235
235
|
<pre>
|
236
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
236
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 504</span>
|
237
237
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_item</span>
|
238
238
|
<span class="ruby-identifier">item</span> = <span class="ruby-identifier">scan_line</span>()
|
239
239
|
<span class="ruby-identifier">item</span>.<span class="ruby-identifier">strip!</span>
|
@@ -244,21 +244,21 @@ presentation logic example (ruby style):
|
|
244
244
|
</div>
|
245
245
|
</div>
|
246
246
|
|
247
|
-
<div id="method-
|
248
|
-
<a name="
|
247
|
+
<div id="method-M000144" class="method-detail">
|
248
|
+
<a name="M000144"></a>
|
249
249
|
|
250
250
|
<div class="method-heading">
|
251
|
-
<a href="#
|
251
|
+
<a href="#M000144" class="method-signature">
|
252
252
|
<span class="method-name">_parse_list</span><span class="method-args">()</span>
|
253
253
|
</a>
|
254
254
|
</div>
|
255
255
|
|
256
256
|
<div class="method-description">
|
257
257
|
<p><a class="source-toggle" href="#"
|
258
|
-
onclick="toggleCode('
|
259
|
-
<div class="method-source-code" id="
|
258
|
+
onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
|
259
|
+
<div class="method-source-code" id="M000144-source">
|
260
260
|
<pre>
|
261
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
261
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 477</span>
|
262
262
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_list</span>
|
263
263
|
<span class="ruby-identifier">line</span> = <span class="ruby-identifier">scan_line</span>()
|
264
264
|
<span class="ruby-identifier">list</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,\s+/</span>).<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">strip</span>}
|
@@ -269,21 +269,21 @@ presentation logic example (ruby style):
|
|
269
269
|
</div>
|
270
270
|
</div>
|
271
271
|
|
272
|
-
<div id="method-
|
273
|
-
<a name="
|
272
|
+
<div id="method-M000146" class="method-detail">
|
273
|
+
<a name="M000146"></a>
|
274
274
|
|
275
275
|
<div class="method-heading">
|
276
|
-
<a href="#
|
276
|
+
<a href="#M000146" class="method-signature">
|
277
277
|
<span class="method-name">_parse_str</span><span class="method-args">()</span>
|
278
278
|
</a>
|
279
279
|
</div>
|
280
280
|
|
281
281
|
<div class="method-description">
|
282
282
|
<p><a class="source-toggle" href="#"
|
283
|
-
onclick="toggleCode('
|
284
|
-
<div class="method-source-code" id="
|
283
|
+
onclick="toggleCode('M000146-source');return false;">[Source]</a></p>
|
284
|
+
<div class="method-source-code" id="M000146-source">
|
285
285
|
<pre>
|
286
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
286
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 499</span>
|
287
287
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_str</span>
|
288
288
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_parse_strs</span>()[<span class="ruby-value">0</span>]
|
289
289
|
<span class="ruby-keyword kw">end</span>
|
@@ -292,21 +292,21 @@ presentation logic example (ruby style):
|
|
292
292
|
</div>
|
293
293
|
</div>
|
294
294
|
|
295
|
-
<div id="method-
|
296
|
-
<a name="
|
295
|
+
<div id="method-M000145" class="method-detail">
|
296
|
+
<a name="M000145"></a>
|
297
297
|
|
298
298
|
<div class="method-heading">
|
299
|
-
<a href="#
|
299
|
+
<a href="#M000145" class="method-signature">
|
300
300
|
<span class="method-name">_parse_strs</span><span class="method-args">()</span>
|
301
301
|
</a>
|
302
302
|
</div>
|
303
303
|
|
304
304
|
<div class="method-description">
|
305
305
|
<p><a class="source-toggle" href="#"
|
306
|
-
onclick="toggleCode('
|
307
|
-
<div class="method-source-code" id="
|
306
|
+
onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
|
307
|
+
<div class="method-source-code" id="M000145-source">
|
308
308
|
<pre>
|
309
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
309
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 484</span>
|
310
310
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_strs</span>
|
311
311
|
<span class="ruby-identifier">list</span> = <span class="ruby-identifier">_parse_list</span>()
|
312
312
|
<span class="ruby-identifier">list2</span> = []
|
@@ -325,21 +325,21 @@ presentation logic example (ruby style):
|
|
325
325
|
</div>
|
326
326
|
</div>
|
327
327
|
|
328
|
-
<div id="method-
|
329
|
-
<a name="
|
328
|
+
<div id="method-M000149" class="method-detail">
|
329
|
+
<a name="M000149"></a>
|
330
330
|
|
331
331
|
<div class="method-heading">
|
332
|
-
<a href="#
|
332
|
+
<a href="#M000149" class="method-signature">
|
333
333
|
<span class="method-name">_parse_tuples</span><span class="method-args">()</span>
|
334
334
|
</a>
|
335
335
|
</div>
|
336
336
|
|
337
337
|
<div class="method-description">
|
338
338
|
<p><a class="source-toggle" href="#"
|
339
|
-
onclick="toggleCode('
|
340
|
-
<div class="method-source-code" id="
|
339
|
+
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
|
340
|
+
<div class="method-source-code" id="M000149-source">
|
341
341
|
<pre>
|
342
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
342
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 516</span>
|
343
343
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_parse_tuples</span>
|
344
344
|
<span class="ruby-identifier">line</span> = <span class="ruby-identifier">scan_line</span>()
|
345
345
|
<span class="ruby-identifier">items</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,\s+/</span>)
|
@@ -366,21 +366,21 @@ presentation logic example (ruby style):
|
|
366
366
|
</div>
|
367
367
|
</div>
|
368
368
|
|
369
|
-
<div id="method-
|
370
|
-
<a name="
|
369
|
+
<div id="method-M000143" class="method-detail">
|
370
|
+
<a name="M000143"></a>
|
371
371
|
|
372
372
|
<div class="method-heading">
|
373
|
-
<a href="#
|
373
|
+
<a href="#M000143" class="method-signature">
|
374
374
|
<span class="method-name">has_space?</span><span class="method-args">()</span>
|
375
375
|
</a>
|
376
376
|
</div>
|
377
377
|
|
378
378
|
<div class="method-description">
|
379
379
|
<p><a class="source-toggle" href="#"
|
380
|
-
onclick="toggleCode('
|
381
|
-
<div class="method-source-code" id="
|
380
|
+
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
|
381
|
+
<div class="method-source-code" id="M000143-source">
|
382
382
|
<pre>
|
383
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
383
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 470</span>
|
384
384
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_space?</span>
|
385
385
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?\ </span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?\t</span>
|
386
386
|
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">parse_error</span>(<span class="ruby-node">"'#{@value}': following spaces are required but got '#{@ch.chr}'."</span>)
|
@@ -391,21 +391,21 @@ presentation logic example (ruby style):
|
|
391
391
|
</div>
|
392
392
|
</div>
|
393
393
|
|
394
|
-
<div id="method-
|
395
|
-
<a name="
|
394
|
+
<div id="method-M000141" class="method-detail">
|
395
|
+
<a name="M000141"></a>
|
396
396
|
|
397
397
|
<div class="method-heading">
|
398
|
-
<a href="#
|
398
|
+
<a href="#M000141" class="method-signature">
|
399
399
|
<span class="method-name">keywords</span><span class="method-args">(keyword)</span>
|
400
400
|
</a>
|
401
401
|
</div>
|
402
402
|
|
403
403
|
<div class="method-description">
|
404
404
|
<p><a class="source-toggle" href="#"
|
405
|
-
onclick="toggleCode('
|
406
|
-
<div class="method-source-code" id="
|
405
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
406
|
+
<div class="method-source-code" id="M000141-source">
|
407
407
|
<pre>
|
408
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
408
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 437</span>
|
409
409
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keywords</span>(<span class="ruby-identifier">keyword</span>)
|
410
410
|
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBYSTYLE_KEYWORDS</span>[<span class="ruby-identifier">keyword</span>]
|
411
411
|
<span class="ruby-keyword kw">end</span>
|
@@ -414,21 +414,21 @@ presentation logic example (ruby style):
|
|
414
414
|
</div>
|
415
415
|
</div>
|
416
416
|
|
417
|
-
<div id="method-
|
418
|
-
<a name="
|
417
|
+
<div id="method-M000142" class="method-detail">
|
418
|
+
<a name="M000142"></a>
|
419
419
|
|
420
420
|
<div class="method-heading">
|
421
|
-
<a href="#
|
421
|
+
<a href="#M000142" class="method-signature">
|
422
422
|
<span class="method-name">parse_document_ruleset</span><span class="method-args">()</span>
|
423
423
|
</a>
|
424
424
|
</div>
|
425
425
|
|
426
426
|
<div class="method-description">
|
427
427
|
<p><a class="source-toggle" href="#"
|
428
|
-
onclick="toggleCode('
|
429
|
-
<div class="method-source-code" id="
|
428
|
+
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
|
429
|
+
<div class="method-source-code" id="M000142-source">
|
430
430
|
<pre>
|
431
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
431
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 443</span>
|
432
432
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_document_ruleset</span>
|
433
433
|
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@token</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:document</span>
|
434
434
|
<span class="ruby-identifier">scan</span>()
|
@@ -459,21 +459,21 @@ presentation logic example (ruby style):
|
|
459
459
|
</div>
|
460
460
|
</div>
|
461
461
|
|
462
|
-
<div id="method-
|
463
|
-
<a name="
|
462
|
+
<div id="method-M000150" class="method-detail">
|
463
|
+
<a name="M000150"></a>
|
464
464
|
|
465
465
|
<div class="method-heading">
|
466
|
-
<a href="#
|
466
|
+
<a href="#M000150" class="method-signature">
|
467
467
|
<span class="method-name">parse_element_ruleset</span><span class="method-args">()</span>
|
468
468
|
</a>
|
469
469
|
</div>
|
470
470
|
|
471
471
|
<div class="method-description">
|
472
472
|
<p><a class="source-toggle" href="#"
|
473
|
-
onclick="toggleCode('
|
474
|
-
<div class="method-source-code" id="
|
473
|
+
onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
|
474
|
+
<div class="method-source-code" id="M000150-source">
|
475
475
|
<pre>
|
476
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
476
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 539</span>
|
477
477
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_element_ruleset</span>
|
478
478
|
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@token</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:element</span>
|
479
479
|
<span class="ruby-identifier">scan</span>()
|
@@ -514,21 +514,21 @@ presentation logic example (ruby style):
|
|
514
514
|
</div>
|
515
515
|
</div>
|
516
516
|
|
517
|
-
<div id="method-
|
518
|
-
<a name="
|
517
|
+
<div id="method-M000140" class="method-detail">
|
518
|
+
<a name="M000140"></a>
|
519
519
|
|
520
520
|
<div class="method-heading">
|
521
|
-
<a href="#
|
521
|
+
<a href="#M000140" class="method-signature">
|
522
522
|
<span class="method-name">scan_hook</span><span class="method-args">()</span>
|
523
523
|
</a>
|
524
524
|
</div>
|
525
525
|
|
526
526
|
<div class="method-description">
|
527
527
|
<p><a class="source-toggle" href="#"
|
528
|
-
onclick="toggleCode('
|
529
|
-
<div class="method-source-code" id="
|
528
|
+
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
529
|
+
<div class="method-source-code" id="M000140-source">
|
530
530
|
<pre>
|
531
|
-
<span class="ruby-comment cmt"># File kwartz/parser.rb, line
|
531
|
+
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 426</span>
|
532
532
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scan_hook</span>
|
533
533
|
<span class="ruby-comment cmt">## line comment</span>
|
534
534
|
<span class="ruby-identifier">c</span> = <span class="ruby-ivar">@ch</span>
|
@@ -536,7 +536,7 @@ presentation logic example (ruby style):
|
|
536
536
|
<span class="ruby-identifier">scan_line</span>
|
537
537
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">scan</span>()
|
538
538
|
<span class="ruby-keyword kw">end</span>
|
539
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">
|
539
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
540
540
|
<span class="ruby-keyword kw">end</span>
|
541
541
|
</pre>
|
542
542
|
</div>
|