kwartz 3.1.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +444 -0
- data/README.txt +4 -1
- data/bin/kwartz +2 -2
- data/doc-api/classes/Kwartz.html +16 -7
- 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 +71 -61
- data/doc-api/classes/Kwartz/BaseError.html +12 -12
- data/doc-api/classes/Kwartz/BaseTranslator.html +104 -74
- 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 +50 -50
- data/doc-api/classes/Kwartz/Config.html +5 -0
- data/doc-api/classes/Kwartz/ConvertError.html +12 -12
- data/doc-api/classes/Kwartz/Converter.html +31 -33
- data/doc-api/classes/Kwartz/CssStyleParser.html +207 -168
- data/doc-api/classes/Kwartz/Defun.html +32 -31
- data/doc-api/classes/Kwartz/{HandlerArgument.html → Directive.html} +27 -53
- data/doc-api/classes/Kwartz/ElementInfo.html +68 -53
- data/doc-api/classes/Kwartz/EperlExpressionParser.html +185 -0
- data/doc-api/classes/Kwartz/EperlHandler.html +65 -58
- data/doc-api/classes/Kwartz/EperlTranslator.html +14 -7
- data/doc-api/classes/Kwartz/ErubisTranslator.html +14 -7
- data/doc-api/classes/Kwartz/ErubyTranslator.html +14 -7
- data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
- data/doc-api/classes/Kwartz/Expander.html +358 -0
- data/doc-api/classes/Kwartz/Handler.html +287 -157
- data/doc-api/classes/Kwartz/{StatementHelper.html → HandlerHelper.html} +307 -112
- data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +23 -23
- data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +96 -96
- data/doc-api/classes/Kwartz/JstlExpressionParser.html +181 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +134 -126
- data/doc-api/classes/Kwartz/JstlTranslator.html +21 -14
- data/doc-api/classes/Kwartz/KwartzError.html +6 -6
- data/doc-api/classes/Kwartz/Main.html +4 -4
- data/doc-api/classes/Kwartz/NativeExpression.html +19 -19
- data/doc-api/classes/Kwartz/NativeStatement.html +24 -24
- data/doc-api/classes/Kwartz/Node.html +7 -7
- data/doc-api/classes/Kwartz/PIErubisTranslator.html +21 -14
- data/doc-api/classes/Kwartz/ParseError.html +6 -6
- data/doc-api/classes/Kwartz/PerlExpressionParser.html +185 -0
- data/doc-api/classes/Kwartz/PerlHandler.html +353 -0
- data/doc-api/classes/Kwartz/PerlTranslator.html +226 -0
- data/doc-api/classes/Kwartz/PhpExpressionParser.html +185 -0
- data/doc-api/classes/Kwartz/PhpHandler.html +63 -56
- data/doc-api/classes/Kwartz/PhpTranslator.html +21 -14
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +126 -123
- data/doc-api/classes/Kwartz/PrintStatement.html +18 -18
- data/doc-api/classes/Kwartz/RailsHandler.html +84 -85
- data/doc-api/classes/Kwartz/RailsTranslator.html +13 -6
- data/doc-api/classes/Kwartz/RubyExpressionParser.html +180 -0
- data/doc-api/classes/Kwartz/RubyHandler.html +73 -69
- data/doc-api/classes/Kwartz/RubyStyleParser.html +86 -86
- data/doc-api/classes/Kwartz/RubyTranslator.html +28 -21
- data/doc-api/classes/Kwartz/Ruleset.html +622 -1
- data/doc-api/classes/Kwartz/StrutsTranslator.html +14 -14
- data/doc-api/classes/Kwartz/TagInfo.html +52 -27
- data/doc-api/classes/Kwartz/TextConverter.html +75 -37
- data/doc-api/classes/Kwartz/Translator.html +54 -53
- data/doc-api/classes/Kwartz/Util.html +25 -25
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +7 -2
- data/doc-api/files/kwartz/assert_rb.html +2 -2
- data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/erubis_rb.html +2 -2
- data/doc-api/files/kwartz/binding/eruby_rb.html +2 -2
- data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/perl_rb.html +115 -0
- data/doc-api/files/kwartz/binding/php_rb.html +2 -2
- data/doc-api/files/kwartz/binding/pierubis_rb.html +2 -2
- data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
- data/doc-api/files/kwartz/binding/ruby_rb.html +2 -2
- data/doc-api/files/kwartz/binding/struts_rb.html +2 -2
- data/doc-api/files/kwartz/config_rb.html +2 -2
- data/doc-api/files/kwartz/converter_rb.html +2 -2
- data/doc-api/files/kwartz/defun_rb.html +2 -2
- data/doc-api/files/kwartz/error_rb.html +2 -2
- data/doc-api/files/kwartz/helper/rails_rb.html +2 -2
- data/doc-api/files/kwartz/main_rb.html +3 -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 +2 -2
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwartz/util_rb.html +2 -2
- data/doc-api/files/kwartz_rb.html +2 -2
- data/doc-api/fr_class_index.html +10 -5
- data/doc-api/fr_file_index.html +1 -0
- data/doc-api/fr_method_index.html +268 -239
- data/doc/docstyle.css +9 -3
- data/doc/img/fig05.png +0 -0
- data/doc/introduction-to-kwartz.html +3040 -0
- data/doc/pattern-catalog.html +5 -3
- data/doc/reference.html +680 -26
- data/doc/users-guide.html +222 -67
- data/kwartz.gemspec +4 -4
- data/lib/kwartz.rb +3 -3
- data/lib/kwartz/assert.rb +2 -2
- data/lib/kwartz/binding/eperl.rb +71 -31
- data/lib/kwartz/binding/erubis.rb +3 -2
- data/lib/kwartz/binding/eruby.rb +3 -2
- data/lib/kwartz/binding/jstl.rb +66 -29
- data/lib/kwartz/binding/perl.rb +230 -0
- data/lib/kwartz/binding/php.rb +69 -29
- data/lib/kwartz/binding/pierubis.rb +3 -2
- data/lib/kwartz/binding/rails.rb +18 -18
- data/lib/kwartz/binding/ruby.rb +74 -42
- data/lib/kwartz/binding/struts.rb +22 -21
- data/lib/kwartz/config.rb +4 -4
- data/lib/kwartz/converter.rb +465 -345
- data/lib/kwartz/defun.rb +2 -2
- data/lib/kwartz/error.rb +2 -2
- data/lib/kwartz/helper/rails.rb +2 -2
- data/lib/kwartz/main.rb +5 -4
- data/lib/kwartz/node.rb +92 -144
- data/lib/kwartz/parser.rb +112 -103
- data/lib/kwartz/translator.rb +14 -6
- data/lib/kwartz/util.rb +2 -2
- data/lib/kwartz/util/assert-text-equal.rb +2 -2
- data/lib/kwartz/util/testcase-helper.rb +1 -1
- data/test/test-compile.rb +2 -2
- data/test/test-compile.yaml +81 -0
- data/test/test-converter.rb +4 -8
- data/test/test-converter.yaml +152 -3
- data/test/test-directives.rb +2 -2
- data/test/test-directives.yaml +222 -0
- data/test/test-main.rb +6 -4
- data/test/test-main.yaml +66 -1
- data/test/test-parser.rb +12 -3
- data/test/test-parser.yaml +64 -51
- data/test/test-rails.rb +2 -2
- data/test/test-ruleset.rb +2 -2
- data/test/test-ruleset.yaml +465 -4
- data/test/test.log +6 -0
- data/test/test.rb +2 -2
- metadata +116 -106
- data/ChangeLog +0 -156
- data/doc-api/classes/Kwartz/DocumentRuleset.html +0 -369
- data/doc-api/classes/Kwartz/ElementExpander.html +0 -325
- data/doc-api/classes/Kwartz/ElementRuleset.html +0 -612
@@ -94,7 +94,7 @@ translator for Erubis
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
97
|
+
<a href="#M000271">new</a>
|
98
98
|
</div>
|
99
99
|
</div>
|
100
100
|
|
@@ -102,6 +102,13 @@ translator for Erubis
|
|
102
102
|
|
103
103
|
|
104
104
|
<!-- if includes -->
|
105
|
+
<div id="includes">
|
106
|
+
<h3 class="section-bar">Included Modules</h3>
|
107
|
+
|
108
|
+
<div id="includes-list">
|
109
|
+
<span class="include-name"><a href="RubyExpressionParser.html">RubyExpressionParser</a></span>
|
110
|
+
</div>
|
111
|
+
</div>
|
105
112
|
|
106
113
|
<div id="section">
|
107
114
|
|
@@ -129,21 +136,21 @@ translator for Erubis
|
|
129
136
|
<div id="methods">
|
130
137
|
<h3 class="section-bar">Public Class methods</h3>
|
131
138
|
|
132
|
-
<div id="method-
|
133
|
-
<a name="
|
139
|
+
<div id="method-M000271" class="method-detail">
|
140
|
+
<a name="M000271"></a>
|
134
141
|
|
135
142
|
<div class="method-heading">
|
136
|
-
<a href="#
|
143
|
+
<a href="#M000271" class="method-signature">
|
137
144
|
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
138
145
|
</a>
|
139
146
|
</div>
|
140
147
|
|
141
148
|
<div class="method-description">
|
142
149
|
<p><a class="source-toggle" href="#"
|
143
|
-
onclick="toggleCode('
|
144
|
-
<div class="method-source-code" id="
|
150
|
+
onclick="toggleCode('M000271-source');return false;">[Source]</a></p>
|
151
|
+
<div class="method-source-code" id="M000271-source">
|
145
152
|
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File kwartz/binding/erubis.rb, line
|
153
|
+
<span class="ruby-comment cmt"># File kwartz/binding/erubis.rb, line 37</span>
|
147
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
148
155
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-constant">ERUBIS_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
|
149
156
|
<span class="ruby-comment cmt">#@escape = true if @escape == nil</span>
|
@@ -94,7 +94,7 @@ translator for eRuby
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
97
|
+
<a href="#M000123">new</a>
|
98
98
|
</div>
|
99
99
|
</div>
|
100
100
|
|
@@ -102,6 +102,13 @@ translator for eRuby
|
|
102
102
|
|
103
103
|
|
104
104
|
<!-- if includes -->
|
105
|
+
<div id="includes">
|
106
|
+
<h3 class="section-bar">Included Modules</h3>
|
107
|
+
|
108
|
+
<div id="includes-list">
|
109
|
+
<span class="include-name"><a href="RubyExpressionParser.html">RubyExpressionParser</a></span>
|
110
|
+
</div>
|
111
|
+
</div>
|
105
112
|
|
106
113
|
<div id="section">
|
107
114
|
|
@@ -129,21 +136,21 @@ translator for eRuby
|
|
129
136
|
<div id="methods">
|
130
137
|
<h3 class="section-bar">Public Class methods</h3>
|
131
138
|
|
132
|
-
<div id="method-
|
133
|
-
<a name="
|
139
|
+
<div id="method-M000123" class="method-detail">
|
140
|
+
<a name="M000123"></a>
|
134
141
|
|
135
142
|
<div class="method-heading">
|
136
|
-
<a href="#
|
143
|
+
<a href="#M000123" class="method-signature">
|
137
144
|
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
138
145
|
</a>
|
139
146
|
</div>
|
140
147
|
|
141
148
|
<div class="method-description">
|
142
149
|
<p><a class="source-toggle" href="#"
|
143
|
-
onclick="toggleCode('
|
144
|
-
<div class="method-source-code" id="
|
150
|
+
onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
|
151
|
+
<div class="method-source-code" id="M000123-source">
|
145
152
|
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File kwartz/binding/eruby.rb, line
|
153
|
+
<span class="ruby-comment cmt"># File kwartz/binding/eruby.rb, line 40</span>
|
147
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
148
155
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-constant">ERUBY_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
|
149
156
|
<span class="ruby-keyword kw">end</span>
|
@@ -94,9 +94,9 @@ represents _stag, _cont, _etag, _elem, _element(name), and _content(name)
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
97
|
+
<a href="#M000079">_inspect</a>
|
98
|
+
<a href="#M000080">accept</a>
|
99
|
+
<a href="#M000078">new</a>
|
100
100
|
</div>
|
101
101
|
</div>
|
102
102
|
|
@@ -136,22 +136,22 @@ represents _stag, _cont, _etag, _elem, _element(name), and _content(name)
|
|
136
136
|
<div id="methods">
|
137
137
|
<h3 class="section-bar">Public Class methods</h3>
|
138
138
|
|
139
|
-
<div id="method-
|
140
|
-
<a name="
|
139
|
+
<div id="method-M000078" class="method-detail">
|
140
|
+
<a name="M000078"></a>
|
141
141
|
|
142
142
|
<div class="method-heading">
|
143
|
-
<a href="#
|
144
|
-
<span class="method-name">new</span><span class="method-args">(kind, name)</span>
|
143
|
+
<a href="#M000078" class="method-signature">
|
144
|
+
<span class="method-name">new</span><span class="method-args">(kind, name=nil)</span>
|
145
145
|
</a>
|
146
146
|
</div>
|
147
147
|
|
148
148
|
<div class="method-description">
|
149
149
|
<p><a class="source-toggle" href="#"
|
150
|
-
onclick="toggleCode('
|
151
|
-
<div class="method-source-code" id="
|
150
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
151
|
+
<div class="method-source-code" id="M000078-source">
|
152
152
|
<pre>
|
153
153
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 147</span>
|
154
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">name</span>)
|
154
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">name</span>=<span class="ruby-keyword kw">nil</span>)
|
155
155
|
<span class="ruby-ivar">@kind</span> = <span class="ruby-identifier">kind</span> <span class="ruby-comment cmt"># symbol</span>
|
156
156
|
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span> <span class="ruby-comment cmt"># string</span>
|
157
157
|
<span class="ruby-keyword kw">end</span>
|
@@ -162,19 +162,19 @@ represents _stag, _cont, _etag, _elem, _element(name), and _content(name)
|
|
162
162
|
|
163
163
|
<h3 class="section-bar">Public Instance methods</h3>
|
164
164
|
|
165
|
-
<div id="method-
|
166
|
-
<a name="
|
165
|
+
<div id="method-M000079" class="method-detail">
|
166
|
+
<a name="M000079"></a>
|
167
167
|
|
168
168
|
<div class="method-heading">
|
169
|
-
<a href="#
|
169
|
+
<a href="#M000079" class="method-signature">
|
170
170
|
<span class="method-name">_inspect</span><span class="method-args">(indent=0)</span>
|
171
171
|
</a>
|
172
172
|
</div>
|
173
173
|
|
174
174
|
<div class="method-description">
|
175
175
|
<p><a class="source-toggle" href="#"
|
176
|
-
onclick="toggleCode('
|
177
|
-
<div class="method-source-code" id="
|
176
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
177
|
+
<div class="method-source-code" id="M000079-source">
|
178
178
|
<pre>
|
179
179
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 155</span>
|
180
180
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_inspect</span>(<span class="ruby-identifier">indent</span>=<span class="ruby-value">0</span>)
|
@@ -189,19 +189,19 @@ represents _stag, _cont, _etag, _elem, _element(name), and _content(name)
|
|
189
189
|
</div>
|
190
190
|
</div>
|
191
191
|
|
192
|
-
<div id="method-
|
193
|
-
<a name="
|
192
|
+
<div id="method-M000080" class="method-detail">
|
193
|
+
<a name="M000080"></a>
|
194
194
|
|
195
195
|
<div class="method-heading">
|
196
|
-
<a href="#
|
196
|
+
<a href="#M000080" class="method-signature">
|
197
197
|
<span class="method-name">accept</span><span class="method-args">(translator)</span>
|
198
198
|
</a>
|
199
199
|
</div>
|
200
200
|
|
201
201
|
<div class="method-description">
|
202
202
|
<p><a class="source-toggle" href="#"
|
203
|
-
onclick="toggleCode('
|
204
|
-
<div class="method-source-code" id="
|
203
|
+
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
|
204
|
+
<div class="method-source-code" id="M000080-source">
|
205
205
|
<pre>
|
206
206
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 164</span>
|
207
207
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)
|
@@ -0,0 +1,358 @@
|
|
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>Module: Kwartz::Expander</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Kwartz::Expander</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/converter_rb.html">
|
59
|
+
kwartz/converter.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
(abstract) expand <a href="ExpandStatement.html">ExpandStatement</a> and <a
|
78
|
+
href="ElementInfo.html">ElementInfo</a>
|
79
|
+
</p>
|
80
|
+
<p>
|
81
|
+
<a href="Handler.html">Handler</a> class includes this module.
|
82
|
+
</p>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
<div id="method-list">
|
90
|
+
<h3 class="section-bar">Methods</h3>
|
91
|
+
|
92
|
+
<div class="name-list">
|
93
|
+
<a href="#M000003">expand_element_info</a>
|
94
|
+
<a href="#M000005">expand_statement</a>
|
95
|
+
<a href="#M000004">expand_statements</a>
|
96
|
+
<a href="#M000002">get_element_info</a>
|
97
|
+
<a href="#M000001">get_ruleset</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
<div id="includes">
|
106
|
+
<h3 class="section-bar">Included Modules</h3>
|
107
|
+
|
108
|
+
<div id="includes-list">
|
109
|
+
<span class="include-name"><a href="Assertion.html">Assertion</a></span>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div id="section">
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<!-- if method_list -->
|
123
|
+
<div id="methods">
|
124
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
125
|
+
|
126
|
+
<div id="method-M000003" class="method-detail">
|
127
|
+
<a name="M000003"></a>
|
128
|
+
|
129
|
+
<div class="method-heading">
|
130
|
+
<a href="#M000003" class="method-signature">
|
131
|
+
<span class="method-name">expand_element_info</span><span class="method-args">(elem_info, stmt_list, content_only=false)</span>
|
132
|
+
</a>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
<p>
|
137
|
+
expand <a href="ElementInfo.html">ElementInfo</a>
|
138
|
+
</p>
|
139
|
+
<p><a class="source-toggle" href="#"
|
140
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
141
|
+
<div class="method-source-code" id="M000003-source">
|
142
|
+
<pre>
|
143
|
+
<span class="ruby-comment cmt"># File kwartz/converter.rb, line 486</span>
|
144
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">content_only</span>=<span class="ruby-keyword kw">false</span>)
|
145
|
+
<span class="ruby-identifier">expand_statements</span>(<span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">before</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">before</span>
|
146
|
+
<span class="ruby-identifier">stmts</span> = <span class="ruby-identifier">content_only</span> <span class="ruby-value">? </span>[ <span class="ruby-constant">ExpandStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:cont</span>) ] <span class="ruby-operator">:</span> <span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">logic</span>
|
147
|
+
<span class="ruby-identifier">stmts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stmt</span><span class="ruby-operator">|</span>
|
148
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
149
|
+
<span class="ruby-keyword kw">end</span>
|
150
|
+
<span class="ruby-identifier">expand_statements</span>(<span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">after</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">after</span>
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div id="method-M000005" class="method-detail">
|
158
|
+
<a name="M000005"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="#M000005" class="method-signature">
|
162
|
+
<span class="method-name">expand_statement</span><span class="method-args">(stmt, stmt_list, elem_info)</span>
|
163
|
+
</a>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
<p>
|
168
|
+
expand <a href="ExpandStatement.html">ExpandStatement</a>
|
169
|
+
</p>
|
170
|
+
<p><a class="source-toggle" href="#"
|
171
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000005-source">
|
173
|
+
<pre>
|
174
|
+
<span class="ruby-comment cmt"># File kwartz/converter.rb, line 505</span>
|
175
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
176
|
+
|
177
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeStatement</span>)
|
178
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">elem_info</span>
|
179
|
+
<span class="ruby-identifier">native_stmt</span> = <span class="ruby-identifier">expand_attr_vars_in_native_stmt</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">attr_info</span>)
|
180
|
+
<span class="ruby-keyword kw">else</span>
|
181
|
+
<span class="ruby-identifier">native_stmt</span> = <span class="ruby-identifier">stmt</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">native_stmt</span>
|
184
|
+
<span class="ruby-keyword kw">return</span>
|
185
|
+
<span class="ruby-keyword kw">end</span>
|
186
|
+
|
187
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ExpandStatement</span>)
|
188
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">stmt</span>
|
189
|
+
<span class="ruby-keyword kw">return</span>
|
190
|
+
<span class="ruby-keyword kw">end</span>
|
191
|
+
|
192
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-identifier">elem_info</span>
|
193
|
+
|
194
|
+
<span class="ruby-comment cmt">## remove dummy <span> tag</span>
|
195
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@delspan</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">elem_info</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">dummy_span_tag?</span>(<span class="ruby-value str">'span'</span>)
|
196
|
+
<span class="ruby-comment cmt">#e.stag_info.tagname = e.etag_info.tagname = nil</span>
|
197
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">clear_as_dummy_tag</span>()
|
198
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">clear_as_dummy_tag</span>()
|
199
|
+
<span class="ruby-keyword kw">end</span>
|
200
|
+
|
201
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span>
|
202
|
+
|
203
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:stag</span>
|
204
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
|
205
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_expr</span>
|
206
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
|
207
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_expr</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attr_info</span>)
|
208
|
+
<span class="ruby-keyword kw">else</span>
|
209
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">append_exprs</span>)
|
210
|
+
<span class="ruby-keyword kw">end</span>
|
211
|
+
|
212
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:etag</span>
|
213
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
|
214
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_expr</span>
|
215
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
|
216
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_expr</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attr_info</span>)
|
217
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_info</span> <span class="ruby-comment cmt"># e.etag_info is nil when <br>, <input>, <hr>, <img>, <meta></span>
|
218
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
|
219
|
+
<span class="ruby-keyword kw">end</span>
|
220
|
+
|
221
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:cont</span>
|
222
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">cont_expr</span>
|
223
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">cont_expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
|
224
|
+
<span class="ruby-comment cmt">#stmt_list << PrintStatement.new([e.cont_expr])</span>
|
225
|
+
<span class="ruby-identifier">native_expr</span> = <span class="ruby-identifier">expand_attr_vars_in_native_expr</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">cont_expr</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attr_info</span>)
|
226
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>([<span class="ruby-identifier">native_expr</span>])
|
227
|
+
<span class="ruby-keyword kw">else</span>
|
228
|
+
<span class="ruby-identifier">elem_info</span>.<span class="ruby-identifier">cont_stmts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cont_stmt</span><span class="ruby-operator">|</span>
|
229
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">cont_stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-keyword kw">nil</span>)
|
230
|
+
<span class="ruby-keyword kw">end</span>
|
231
|
+
<span class="ruby-keyword kw">end</span>
|
232
|
+
|
233
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elem</span>
|
234
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
|
235
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">elem_expr</span>
|
236
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">elem_expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
|
237
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">elem_expr</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attr_info</span>)
|
238
|
+
<span class="ruby-keyword kw">else</span>
|
239
|
+
<span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:stag</span>
|
240
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
241
|
+
<span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:cont</span>
|
242
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
243
|
+
<span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:etag</span>
|
244
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
245
|
+
<span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:elem</span>
|
246
|
+
<span class="ruby-keyword kw">end</span>
|
247
|
+
|
248
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:element</span>, <span class="ruby-identifier">:content</span>
|
249
|
+
<span class="ruby-identifier">content_only</span> = <span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:content</span>
|
250
|
+
<span class="ruby-comment cmt">#elem_info = @elements[stmt.name]</span>
|
251
|
+
<span class="ruby-identifier">elem_info</span> = <span class="ruby-identifier">get_element_info</span>(<span class="ruby-identifier">stmt</span>.<span class="ruby-identifier">name</span>)
|
252
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
|
253
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"element '#{stmt.name}' is not found."</span>, <span class="ruby-keyword kw">nil</span>)
|
254
|
+
<span class="ruby-keyword kw">end</span>
|
255
|
+
<span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">content_only</span>)
|
256
|
+
|
257
|
+
<span class="ruby-keyword kw">else</span>
|
258
|
+
<span class="ruby-identifier">assert</span>
|
259
|
+
<span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
|
260
|
+
<span class="ruby-keyword kw">end</span>
|
261
|
+
</pre>
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div id="method-M000004" class="method-detail">
|
267
|
+
<a name="M000004"></a>
|
268
|
+
|
269
|
+
<div class="method-heading">
|
270
|
+
<a href="#M000004" class="method-signature">
|
271
|
+
<span class="method-name">expand_statements</span><span class="method-args">(stmts, stmt_list, elem_info)</span>
|
272
|
+
</a>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
<div class="method-description">
|
276
|
+
<p>
|
277
|
+
expand list of <a href="ExpandStatement.html">ExpandStatement</a>
|
278
|
+
</p>
|
279
|
+
<p><a class="source-toggle" href="#"
|
280
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
281
|
+
<div class="method-source-code" id="M000004-source">
|
282
|
+
<pre>
|
283
|
+
<span class="ruby-comment cmt"># File kwartz/converter.rb, line 497</span>
|
284
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_statements</span>(<span class="ruby-identifier">stmts</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
285
|
+
<span class="ruby-identifier">stmts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stmt</span><span class="ruby-operator">|</span>
|
286
|
+
<span class="ruby-identifier">expand_statement</span>(<span class="ruby-identifier">stmt</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">elem_info</span>)
|
287
|
+
<span class="ruby-keyword kw">end</span>
|
288
|
+
<span class="ruby-keyword kw">end</span>
|
289
|
+
</pre>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
<div id="method-M000002" class="method-detail">
|
295
|
+
<a name="M000002"></a>
|
296
|
+
|
297
|
+
<div class="method-heading">
|
298
|
+
<a href="#M000002" class="method-signature">
|
299
|
+
<span class="method-name">get_element_info</span><span class="method-args">(name)</span>
|
300
|
+
</a>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
<div class="method-description">
|
304
|
+
<p>
|
305
|
+
(abstract) get <a href="ElementInfo.html">ElementInfo</a>
|
306
|
+
</p>
|
307
|
+
<p><a class="source-toggle" href="#"
|
308
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
309
|
+
<div class="method-source-code" id="M000002-source">
|
310
|
+
<pre>
|
311
|
+
<span class="ruby-comment cmt"># File kwartz/converter.rb, line 480</span>
|
312
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_element_info</span>(<span class="ruby-identifier">name</span>)
|
313
|
+
<span class="ruby-identifier">not_implemented</span>
|
314
|
+
<span class="ruby-keyword kw">end</span>
|
315
|
+
</pre>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div id="method-M000001" class="method-detail">
|
321
|
+
<a name="M000001"></a>
|
322
|
+
|
323
|
+
<div class="method-heading">
|
324
|
+
<a href="#M000001" class="method-signature">
|
325
|
+
<span class="method-name">get_ruleset</span><span class="method-args">(selector)</span>
|
326
|
+
</a>
|
327
|
+
</div>
|
328
|
+
|
329
|
+
<div class="method-description">
|
330
|
+
<p>
|
331
|
+
(abstract) get <a href="Ruleset.html">Ruleset</a>
|
332
|
+
</p>
|
333
|
+
<p><a class="source-toggle" href="#"
|
334
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
335
|
+
<div class="method-source-code" id="M000001-source">
|
336
|
+
<pre>
|
337
|
+
<span class="ruby-comment cmt"># File kwartz/converter.rb, line 474</span>
|
338
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ruleset</span>(<span class="ruby-identifier">selector</span>)
|
339
|
+
<span class="ruby-identifier">not_implemented</span>
|
340
|
+
<span class="ruby-keyword kw">end</span>
|
341
|
+
</pre>
|
342
|
+
</div>
|
343
|
+
</div>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
</div>
|
348
|
+
|
349
|
+
|
350
|
+
</div>
|
351
|
+
|
352
|
+
|
353
|
+
<div id="validator-badges">
|
354
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</body>
|
358
|
+
</html>
|