kwartz 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. data/CHANGES +444 -0
  2. data/README.txt +4 -1
  3. data/bin/kwartz +2 -2
  4. data/doc-api/classes/Kwartz.html +16 -7
  5. data/doc-api/classes/Kwartz/Assertion.html +6 -6
  6. data/doc-api/classes/Kwartz/AssertionError.html +6 -6
  7. data/doc-api/classes/Kwartz/AttrInfo.html +71 -61
  8. data/doc-api/classes/Kwartz/BaseError.html +12 -12
  9. data/doc-api/classes/Kwartz/BaseTranslator.html +104 -74
  10. data/doc-api/classes/Kwartz/CharacterType.html +24 -24
  11. data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
  12. data/doc-api/classes/Kwartz/CommandOptions.html +50 -50
  13. data/doc-api/classes/Kwartz/Config.html +5 -0
  14. data/doc-api/classes/Kwartz/ConvertError.html +12 -12
  15. data/doc-api/classes/Kwartz/Converter.html +31 -33
  16. data/doc-api/classes/Kwartz/CssStyleParser.html +207 -168
  17. data/doc-api/classes/Kwartz/Defun.html +32 -31
  18. data/doc-api/classes/Kwartz/{HandlerArgument.html → Directive.html} +27 -53
  19. data/doc-api/classes/Kwartz/ElementInfo.html +68 -53
  20. data/doc-api/classes/Kwartz/EperlExpressionParser.html +185 -0
  21. data/doc-api/classes/Kwartz/EperlHandler.html +65 -58
  22. data/doc-api/classes/Kwartz/EperlTranslator.html +14 -7
  23. data/doc-api/classes/Kwartz/ErubisTranslator.html +14 -7
  24. data/doc-api/classes/Kwartz/ErubyTranslator.html +14 -7
  25. data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
  26. data/doc-api/classes/Kwartz/Expander.html +358 -0
  27. data/doc-api/classes/Kwartz/Handler.html +287 -157
  28. data/doc-api/classes/Kwartz/{StatementHelper.html → HandlerHelper.html} +307 -112
  29. data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +23 -23
  30. data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +96 -96
  31. data/doc-api/classes/Kwartz/JstlExpressionParser.html +181 -0
  32. data/doc-api/classes/Kwartz/JstlHandler.html +134 -126
  33. data/doc-api/classes/Kwartz/JstlTranslator.html +21 -14
  34. data/doc-api/classes/Kwartz/KwartzError.html +6 -6
  35. data/doc-api/classes/Kwartz/Main.html +4 -4
  36. data/doc-api/classes/Kwartz/NativeExpression.html +19 -19
  37. data/doc-api/classes/Kwartz/NativeStatement.html +24 -24
  38. data/doc-api/classes/Kwartz/Node.html +7 -7
  39. data/doc-api/classes/Kwartz/PIErubisTranslator.html +21 -14
  40. data/doc-api/classes/Kwartz/ParseError.html +6 -6
  41. data/doc-api/classes/Kwartz/PerlExpressionParser.html +185 -0
  42. data/doc-api/classes/Kwartz/PerlHandler.html +353 -0
  43. data/doc-api/classes/Kwartz/PerlTranslator.html +226 -0
  44. data/doc-api/classes/Kwartz/PhpExpressionParser.html +185 -0
  45. data/doc-api/classes/Kwartz/PhpHandler.html +63 -56
  46. data/doc-api/classes/Kwartz/PhpTranslator.html +21 -14
  47. data/doc-api/classes/Kwartz/PresentationLogicParser.html +126 -123
  48. data/doc-api/classes/Kwartz/PrintStatement.html +18 -18
  49. data/doc-api/classes/Kwartz/RailsHandler.html +84 -85
  50. data/doc-api/classes/Kwartz/RailsTranslator.html +13 -6
  51. data/doc-api/classes/Kwartz/RubyExpressionParser.html +180 -0
  52. data/doc-api/classes/Kwartz/RubyHandler.html +73 -69
  53. data/doc-api/classes/Kwartz/RubyStyleParser.html +86 -86
  54. data/doc-api/classes/Kwartz/RubyTranslator.html +28 -21
  55. data/doc-api/classes/Kwartz/Ruleset.html +622 -1
  56. data/doc-api/classes/Kwartz/StrutsTranslator.html +14 -14
  57. data/doc-api/classes/Kwartz/TagInfo.html +52 -27
  58. data/doc-api/classes/Kwartz/TextConverter.html +75 -37
  59. data/doc-api/classes/Kwartz/Translator.html +54 -53
  60. data/doc-api/classes/Kwartz/Util.html +25 -25
  61. data/doc-api/created.rid +1 -1
  62. data/doc-api/files/__/README_txt.html +7 -2
  63. data/doc-api/files/kwartz/assert_rb.html +2 -2
  64. data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
  65. data/doc-api/files/kwartz/binding/erubis_rb.html +2 -2
  66. data/doc-api/files/kwartz/binding/eruby_rb.html +2 -2
  67. data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
  68. data/doc-api/files/kwartz/binding/perl_rb.html +115 -0
  69. data/doc-api/files/kwartz/binding/php_rb.html +2 -2
  70. data/doc-api/files/kwartz/binding/pierubis_rb.html +2 -2
  71. data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
  72. data/doc-api/files/kwartz/binding/ruby_rb.html +2 -2
  73. data/doc-api/files/kwartz/binding/struts_rb.html +2 -2
  74. data/doc-api/files/kwartz/config_rb.html +2 -2
  75. data/doc-api/files/kwartz/converter_rb.html +2 -2
  76. data/doc-api/files/kwartz/defun_rb.html +2 -2
  77. data/doc-api/files/kwartz/error_rb.html +2 -2
  78. data/doc-api/files/kwartz/helper/rails_rb.html +2 -2
  79. data/doc-api/files/kwartz/main_rb.html +3 -2
  80. data/doc-api/files/kwartz/node_rb.html +2 -2
  81. data/doc-api/files/kwartz/parser_rb.html +2 -2
  82. data/doc-api/files/kwartz/translator_rb.html +2 -2
  83. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +2 -2
  84. data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
  85. data/doc-api/files/kwartz/util_rb.html +2 -2
  86. data/doc-api/files/kwartz_rb.html +2 -2
  87. data/doc-api/fr_class_index.html +10 -5
  88. data/doc-api/fr_file_index.html +1 -0
  89. data/doc-api/fr_method_index.html +268 -239
  90. data/doc/docstyle.css +9 -3
  91. data/doc/img/fig05.png +0 -0
  92. data/doc/introduction-to-kwartz.html +3040 -0
  93. data/doc/pattern-catalog.html +5 -3
  94. data/doc/reference.html +680 -26
  95. data/doc/users-guide.html +222 -67
  96. data/kwartz.gemspec +4 -4
  97. data/lib/kwartz.rb +3 -3
  98. data/lib/kwartz/assert.rb +2 -2
  99. data/lib/kwartz/binding/eperl.rb +71 -31
  100. data/lib/kwartz/binding/erubis.rb +3 -2
  101. data/lib/kwartz/binding/eruby.rb +3 -2
  102. data/lib/kwartz/binding/jstl.rb +66 -29
  103. data/lib/kwartz/binding/perl.rb +230 -0
  104. data/lib/kwartz/binding/php.rb +69 -29
  105. data/lib/kwartz/binding/pierubis.rb +3 -2
  106. data/lib/kwartz/binding/rails.rb +18 -18
  107. data/lib/kwartz/binding/ruby.rb +74 -42
  108. data/lib/kwartz/binding/struts.rb +22 -21
  109. data/lib/kwartz/config.rb +4 -4
  110. data/lib/kwartz/converter.rb +465 -345
  111. data/lib/kwartz/defun.rb +2 -2
  112. data/lib/kwartz/error.rb +2 -2
  113. data/lib/kwartz/helper/rails.rb +2 -2
  114. data/lib/kwartz/main.rb +5 -4
  115. data/lib/kwartz/node.rb +92 -144
  116. data/lib/kwartz/parser.rb +112 -103
  117. data/lib/kwartz/translator.rb +14 -6
  118. data/lib/kwartz/util.rb +2 -2
  119. data/lib/kwartz/util/assert-text-equal.rb +2 -2
  120. data/lib/kwartz/util/testcase-helper.rb +1 -1
  121. data/test/test-compile.rb +2 -2
  122. data/test/test-compile.yaml +81 -0
  123. data/test/test-converter.rb +4 -8
  124. data/test/test-converter.yaml +152 -3
  125. data/test/test-directives.rb +2 -2
  126. data/test/test-directives.yaml +222 -0
  127. data/test/test-main.rb +6 -4
  128. data/test/test-main.yaml +66 -1
  129. data/test/test-parser.rb +12 -3
  130. data/test/test-parser.yaml +64 -51
  131. data/test/test-rails.rb +2 -2
  132. data/test/test-ruleset.rb +2 -2
  133. data/test/test-ruleset.yaml +465 -4
  134. data/test/test.log +6 -0
  135. data/test/test.rb +2 -2
  136. metadata +116 -106
  137. data/ChangeLog +0 -156
  138. data/doc-api/classes/Kwartz/DocumentRuleset.html +0 -369
  139. data/doc-api/classes/Kwartz/ElementExpander.html +0 -325
  140. data/doc-api/classes/Kwartz/ElementRuleset.html +0 -612
@@ -13,9 +13,11 @@
13
13
  <div class="mainbody">
14
14
 
15
15
  <div align="left"><h1>Presentation Pattern Catalog</h1></div>
16
- <p>$Release: 3.1.2 $<br>
17
- $Date: 2006-09-28 22:22:34 +0900 (Thu, 28 Sep 2006) $
18
- </p>
16
+ <div align="left">
17
+ release: $Release: 3.2.0 $<br>
18
+ last update: $Date$<br>
19
+ </div>
20
+
19
21
  <a name="preface"></a>
20
22
  <h2 class="section1">Preface</h2>
21
23
  <p>Kwartz is the template system which realized the concept of '<strong>Independence of Presentation Logic (IoPL)</strong>.'
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html">
5
- <title>Kwartz-ruby 3.0 Reference Guide</title>
5
+ <title>Kwartz-ruby 3.2 Reference Guide</title>
6
6
  <meta name="generator" content="kwaser">
7
7
  <meta http-equiv="Content-Style-Type" content="text/css">
8
8
  <link rel="stylesheet" href="docstyle.css" type="text/css">
@@ -12,10 +12,12 @@
12
12
  <blockquote>
13
13
  <div class="mainbody">
14
14
 
15
- <div align="left"><h1>Kwartz-ruby 3.0 Reference Guide</h1></div>
16
- <p>$Release: 3.1.2 $<br>
17
- $Date: 2006-09-30 05:02:08 +0900 (Sat, 30 Sep 2006) $
18
- </p>
15
+ <div align="left"><h1>Kwartz-ruby 3.2 Reference Guide</h1></div>
16
+ <div align="left">
17
+ release: $Release: 3.2.0 $<br>
18
+ last update: $Date$<br>
19
+ </div>
20
+
19
21
  <a name="preface"></a>
20
22
  <h2 class="section1">Preface</h2>
21
23
  <p>This document<sup>(<a href="#fnref:1" name="fnlink:1">*1</a>)</sup> is the reference manual of Kwartz-ruby.
@@ -43,7 +45,7 @@ Kwartz-ruby is an implementation of Kwartz in Ruby.
43
45
  </li>
44
46
  </ul>
45
47
  </li>
46
- <li><a href="#plogic">Pesentation Logic</a>
48
+ <li><a href="#plogic">Properties in Pesentation Logic</a>
47
49
  <ul>
48
50
  <li><a href="#property-elem">elem, Elem, ELEM</a>
49
51
  </li>
@@ -63,11 +65,15 @@ Kwartz-ruby is an implementation of Kwartz in Ruby.
63
65
  </li>
64
66
  <li><a href="#property-logic">logic</a>
65
67
  </li>
68
+ <li><a href="#property-before">before, after</a>
69
+ </li>
66
70
  <li><a href="#property-begin">begin, end</a>
67
71
  </li>
72
+ <li><a href="#property-attrvar">Attribute Variable</a>
73
+ </li>
68
74
  </ul>
69
75
  </li>
70
- <li><a href="#directives">Directives</a>
76
+ <li><a href="#directives">Directives in Presentation Data</a>
71
77
  <ul>
72
78
  <li><a href="#directive-elem">elem, Elem, ELEM</a>
73
79
  </li>
@@ -105,6 +111,8 @@ Kwartz-ruby is an implementation of Kwartz in Ruby.
105
111
  </li>
106
112
  <li><a href="#directive-replace">replace_element/content_with_element/content</a>
107
113
  </li>
114
+ <li><a href="#directive-expr">Language-independent Directive</a>
115
+ </li>
108
116
  </ul>
109
117
  </li>
110
118
  <li><a href="#cmdline">Command-Line Options</a>
@@ -117,7 +125,7 @@ Kwartz-ruby is an implementation of Kwartz in Ruby.
117
125
 
118
126
 
119
127
  <a name="plogic"></a>
120
- <h2 class="section1">Pesentation Logic</h2>
128
+ <h2 class="section1">Properties in Pesentation Logic</h2>
121
129
  <p>Presentation logic format in Kwartz is similar to Cascading Style Sheet (CSS).
122
130
  </p>
123
131
  <ul type="disc">
@@ -130,19 +138,31 @@ Kwartz-ruby is an implementation of Kwartz in Ruby.
130
138
  </ul>
131
139
  <div class="output_caption">
132
140
  Pseudo-EBNF syntax of presentation logic</div>
133
- <pre class="output">plogic ::= ruleset*
134
- ruleset ::= selector '{' [ declaration ';' ]* '}'
135
- selector ::= '#' name
136
- declaration ::= property ':' value
137
- property ::= 'elem' | 'Elem' | 'ELEM'
138
- | 'stag' | 'Stag' | 'STAG'
139
- | 'etag' | 'Etag' | 'ETAG'
140
- | 'cont' | 'Cont' | 'CONT'
141
- | 'value' | 'Value' | 'VALUE'
142
- | 'attrs' | 'Attrs' | 'ATTRS'
143
- | 'append' | 'Append' | 'APPEND'
144
- | 'remove'
145
- | 'logic'
141
+ <pre class="output">plogic ::= rulesets
142
+ rulesets ::= rulesets ruleset
143
+ | ruleset
144
+ ruleset ::= selectors '{' declarations '}'
145
+ | selectors '{' '}'
146
+ selectors ::= selectors ',' selector
147
+ | selector
148
+ desclarations ::= declarations declaration
149
+ | declaration
150
+ selector ::= '#' name
151
+ | '.' name
152
+ | name
153
+ declaration ::= property ':' value ';'
154
+ | property ':' '{' value '}'
155
+ property ::= 'elem' | 'Elem' | 'ELEM'
156
+ | 'stag' | 'Stag' | 'STAG'
157
+ | 'etag' | 'Etag' | 'ETAG'
158
+ | 'cont' | 'Cont' | 'CONT'
159
+ | 'value' | 'Value' | 'VALUE'
160
+ | 'attrs' | 'Attrs' | 'ATTRS'
161
+ | 'append' | 'Append' | 'APPEND'
162
+ | 'remove'
163
+ | 'logic'
164
+ | 'before'
165
+ | 'after'
146
166
  </pre>
147
167
  <p>Notice that the tail semicolon of declaration is not omittable.
148
168
  </p>
@@ -1288,12 +1308,358 @@ compile</div>
1288
1308
  <br>
1289
1309
 
1290
1310
 
1311
+ <a name="property-before"></a>
1312
+ <h3 class="section2">before, after</h3>
1313
+ <p><code>before:</code> and <code>after:</code> property represents the prework and postwork
1314
+ of each element's presentation logics.
1315
+ These properties enables to share or reuse presentation logics.
1316
+ </p>
1317
+ <a name="property-before-eruby"></a>
1318
+ <h4 class="section3">Ruby</h4>
1319
+ <div class="program_caption">
1320
+ presentation data (ex-before.pdata)</div>
1321
+ <pre class="program">&lt;!-- Groups --&gt;
1322
+ &lt;ul id="mark:groups"&gt;
1323
+ &lt;li class="item"&gt;&lt;/li&gt;
1324
+ &lt;/ul&gt;
1325
+
1326
+ &lt;!-- Members --&gt;
1327
+ &lt;ol id="mark:members"&gt;
1328
+ &lt;li class="item"&gt;&lt;/li&gt;
1329
+ &lt;/ol&gt;
1330
+ </pre>
1331
+ <div class="program_caption">
1332
+ presentation logic (ex-before.plogic)</div>
1333
+ <pre class="program">#groups {
1334
+ <strong>before:</strong> {
1335
+ <strong>list = @groups</strong>
1336
+ }
1337
+ <strong>after:</strong> {
1338
+ <strong>group_count = count</strong>
1339
+ }
1340
+ }
1341
+ #members {
1342
+ <strong>before:</strong> {
1343
+ <strong>list = @members</strong>
1344
+ }
1345
+ <strong>after:</strong> {
1346
+ <strong>member_count = count</strong>
1347
+ }
1348
+ }
1349
+
1350
+ /* common 'logic:' part */
1351
+ #groups, #members {
1352
+ logic: {
1353
+ count = 0
1354
+ _stag
1355
+ for item in list
1356
+ unless item.obsolete?
1357
+ count += 1
1358
+ _cont
1359
+ end
1360
+ end
1361
+ _etag
1362
+ }
1363
+ }
1364
+
1365
+ .item {
1366
+ value: item.name;
1367
+ }
1368
+ </pre>
1369
+ <div class="terminal_caption">
1370
+ compile</div>
1371
+ <pre class="terminal">$ kwartz -l eruby -p ex-before.plogic ex-before.pdata
1372
+ &lt;!-- Groups --&gt;
1373
+ &lt;% <strong>list = @groups</strong> %&gt;
1374
+ &lt;% count = 0 %&gt;
1375
+ &lt;ul&gt;
1376
+ &lt;% for item in list %&gt;
1377
+ &lt;% unless item.obsolete? %&gt;
1378
+ &lt;% count += 1 %&gt;
1379
+ &lt;li class="item"&gt;&lt;%= item.name %&gt;&lt;/li&gt;
1380
+ &lt;% end %&gt;
1381
+ &lt;% end %&gt;
1382
+ &lt;/ul&gt;
1383
+ &lt;% <strong>group_count = count</strong> %&gt;
1384
+
1385
+ &lt;!-- Members --&gt;
1386
+ &lt;% <strong>list = @members</strong> %&gt;
1387
+ &lt;% count = 0 %&gt;
1388
+ &lt;ol&gt;
1389
+ &lt;% for item in list %&gt;
1390
+ &lt;% unless item.obsolete? %&gt;
1391
+ &lt;% count += 1 %&gt;
1392
+ &lt;li class="item"&gt;&lt;%= item.name %&gt;&lt;/li&gt;
1393
+ &lt;% end %&gt;
1394
+ &lt;% end %&gt;
1395
+ &lt;/ol&gt;
1396
+ &lt;% <strong>member_count = count</strong> %&gt;
1397
+ </pre>
1398
+ <br>
1399
+
1400
+ <a name="property-before-php"></a>
1401
+ <h4 class="section3">PHP</h4>
1402
+ <div class="program_caption">
1403
+ presentation data (ex-before.pdata)</div>
1404
+ <pre class="program">&lt;!-- Groups --&gt;
1405
+ &lt;ul id="mark:groups"&gt;
1406
+ &lt;li class="item"&gt;&lt;/li&gt;
1407
+ &lt;/ul&gt;
1408
+
1409
+ &lt;!-- Members --&gt;
1410
+ &lt;ol id="mark:members"&gt;
1411
+ &lt;li class="item"&gt;&lt;/li&gt;
1412
+ &lt;/ol&gt;
1413
+ </pre>
1414
+ <div class="program_caption">
1415
+ presentation logic (ex-before.plogic)</div>
1416
+ <pre class="program">#groups {
1417
+ <strong>before:</strong> {
1418
+ <strong>$list = $groups;</strong>
1419
+ }
1420
+ <strong>after:</strong> {
1421
+ <strong>$group_count = $count;</strong>
1422
+ }
1423
+ }
1424
+ #members {
1425
+ <strong>before:</strong> {
1426
+ <strong>$list = $members;</strong>
1427
+ }
1428
+ <strong>after:</strong> {
1429
+ <strong>$member_count = $count;</strong>
1430
+ }
1431
+ }
1432
+
1433
+ /* common 'logic:' part */
1434
+ #groups, #members {
1435
+ logic: {
1436
+ $count = 0;
1437
+ _stag();
1438
+ foreach ($list as $item) {
1439
+ if (! $item-&gt;obsolete) {
1440
+ $count++;
1441
+ _cont();
1442
+ }
1443
+ }
1444
+ _etag();
1445
+ }
1446
+ }
1447
+
1448
+ .item {
1449
+ value: $item-&gt;name;
1450
+ }
1451
+ </pre>
1452
+ <div class="terminal_caption">
1453
+ compile</div>
1454
+ <pre class="terminal">$ kwartz -l php -p ex-before.plogic ex-before.pdata
1455
+ &lt;!-- Groups --&gt;
1456
+ &lt;?php <strong>$list = $groups;</strong> ?&gt;
1457
+ &lt;?php $count = 0; ?&gt;
1458
+ &lt;ul&gt;
1459
+ &lt;?php foreach ($list as $item) { ?&gt;
1460
+ &lt;?php if (! $item-&gt;obsolete) { ?&gt;
1461
+ &lt;?php $count++; ?&gt;
1462
+ &lt;li class="item"&gt;&lt;?php echo $item-&gt;name; ?&gt;&lt;/li&gt;
1463
+ &lt;?php } ?&gt;
1464
+ &lt;?php } ?&gt;
1465
+ &lt;/ul&gt;
1466
+ &lt;?php <strong>$group_count = $count;</strong> ?&gt;
1467
+
1468
+ &lt;!-- Members --&gt;
1469
+ &lt;?php <strong>$list = $members;</strong> ?&gt;
1470
+ &lt;?php $count = 0; ?&gt;
1471
+ &lt;ol&gt;
1472
+ &lt;?php foreach ($list as $item) { ?&gt;
1473
+ &lt;?php if (! $item-&gt;obsolete) { ?&gt;
1474
+ &lt;?php $count++; ?&gt;
1475
+ &lt;li class="item"&gt;&lt;?php echo $item-&gt;name; ?&gt;&lt;/li&gt;
1476
+ &lt;?php } ?&gt;
1477
+ &lt;?php } ?&gt;
1478
+ &lt;/ol&gt;
1479
+ &lt;?php <strong>$member_count = $count;</strong> ?&gt;
1480
+ </pre>
1481
+ <br>
1482
+
1483
+ <a name="property-before-jstl"></a>
1484
+ <h4 class="section3">JSP</h4>
1485
+ <div class="program_caption">
1486
+ presentation data (ex-before.pdata)</div>
1487
+ <pre class="program">&lt;!-- Groups --&gt;
1488
+ &lt;ul id="mark:groups"&gt;
1489
+ &lt;li class="item"&gt;&lt;/li&gt;
1490
+ &lt;/ul&gt;
1491
+
1492
+ &lt;!-- Members --&gt;
1493
+ &lt;ol id="mark:members"&gt;
1494
+ &lt;li class="item"&gt;&lt;/li&gt;
1495
+ &lt;/ol&gt;
1496
+ </pre>
1497
+ <div class="program_caption">
1498
+ presentation logic (ex-before.plogic)</div>
1499
+ <pre class="program">#groups {
1500
+ <strong>before:</strong> {
1501
+ <strong>&lt;c:set var="list" value="${groups}" /&gt;</strong>
1502
+ }
1503
+ <strong>after:</strong> {
1504
+ <strong>&lt;c:set var="group_count" value="${count}" /&gt;</strong>
1505
+ }
1506
+ }
1507
+ #members {
1508
+ <strong>before:</strong> {
1509
+ <strong>&lt;c:set var="list" value="${members}" /&gt;</strong>
1510
+ }
1511
+ <strong>after:</strong> {
1512
+ <strong>&lt;c:set var="members_count" value="${count}" /&gt;</strong>
1513
+ }
1514
+ }
1515
+
1516
+ /* common 'logic:' part */
1517
+ #groups, #members {
1518
+ logic: {
1519
+ &lt;c:set var="count" value="${0}" /&gt;
1520
+ _stag()
1521
+ &lt;c:forEach var="item" items="${list}" /&gt;
1522
+ &lt;c:if test="${not item.obsolete}" /&gt;
1523
+ &lt;c:set var="count" value="${count+1}" /&gt;
1524
+ _cont()
1525
+ &lt;/c:if&gt;
1526
+ &lt;/c:forEach&gt;
1527
+ _etag()
1528
+ }
1529
+ }
1530
+
1531
+ .item {
1532
+ value: item.name;
1533
+ }
1534
+ </pre>
1535
+ <div class="terminal_caption">
1536
+ compile</div>
1537
+ <pre class="terminal">$ kwartz -l jstl -p ex-before.plogic ex-before.pdata
1538
+ &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
1539
+ &lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %&gt;
1540
+ &lt;!-- Groups --&gt;
1541
+ <strong>&lt;c:set var="list" value="${groups}" /&gt;</strong>
1542
+ &lt;c:set var="count" value="${0}" /&gt;
1543
+ &lt;ul&gt;
1544
+ &lt;c:forEach var="item" items="${list}" /&gt;
1545
+ &lt;c:if test="${not item.obsolete}" /&gt;
1546
+ &lt;c:set var="count" value="${count+1}" /&gt;
1547
+ &lt;li class="item"&gt;${item.name}&lt;/li&gt;
1548
+ &lt;/c:if&gt;
1549
+ &lt;/c:forEach&gt;
1550
+ &lt;/ul&gt;
1551
+ <strong>&lt;c:set var="group_count" value="${count}" /&gt;</strong>
1552
+
1553
+ &lt;!-- Members --&gt;
1554
+ <strong>&lt;c:set var="list" value="${members}" /&gt;</strong>
1555
+ &lt;c:set var="count" value="${0}" /&gt;
1556
+ &lt;ol&gt;
1557
+ &lt;c:forEach var="item" items="${list}" /&gt;
1558
+ &lt;c:if test="${not item.obsolete}" /&gt;
1559
+ &lt;c:set var="count" value="${count+1}" /&gt;
1560
+ &lt;li class="item"&gt;${item.name}&lt;/li&gt;
1561
+ &lt;/c:if&gt;
1562
+ &lt;/c:forEach&gt;
1563
+ &lt;/ol&gt;
1564
+ <strong>&lt;c:set var="members_count" value="${count}" /&gt;</strong>
1565
+ </pre>
1566
+ <br>
1567
+
1568
+ <a name="property-before-eperl"></a>
1569
+ <h4 class="section3">Perl</h4>
1570
+ <div class="program_caption">
1571
+ presentation data (ex-before.pdata)</div>
1572
+ <pre class="program">&lt;!-- Groups --&gt;
1573
+ &lt;ul id="mark:groups"&gt;
1574
+ &lt;li class="item"&gt;&lt;/li&gt;
1575
+ &lt;/ul&gt;
1576
+
1577
+ &lt;!-- Members --&gt;
1578
+ &lt;ol id="mark:members"&gt;
1579
+ &lt;li class="item"&gt;&lt;/li&gt;
1580
+ &lt;/ol&gt;
1581
+ </pre>
1582
+ <div class="program_caption">
1583
+ presentation logic (ex-before.plogic)</div>
1584
+ <pre class="program">#groups {
1585
+ <strong>before:</strong> {
1586
+ <strong>@list = @groups;</strong>
1587
+ }
1588
+ <strong>after:</strong> {
1589
+ <strong>$group_count = $count;</strong>
1590
+ }
1591
+ }
1592
+ #members {
1593
+ <strong>before:</strong> {
1594
+ <strong>@list = @members;</strong>
1595
+ }
1596
+ <strong>after:</strong> {
1597
+ <strong>$member_count = $count;</strong>
1598
+ }
1599
+ }
1600
+
1601
+ /* common 'logic:' part */
1602
+ #groups, #members {
1603
+ logic: {
1604
+ $count = 0;
1605
+ _stag();
1606
+ foreach $item (@list) {
1607
+ if (! $item['obsolete']) {
1608
+ $count++;
1609
+ _cont();
1610
+ }
1611
+ }
1612
+ _etag();
1613
+ }
1614
+ }
1615
+
1616
+ .item {
1617
+ value: $item['name'];
1618
+ }
1619
+ </pre>
1620
+ <div class="terminal_caption">
1621
+ compile</div>
1622
+ <pre class="terminal">$ kwartz -l eperl -p ex-before.plogic ex-before.pdata
1623
+ &lt;!-- Groups --&gt;
1624
+ &lt;? <strong>@list = @groups;</strong> !&gt;
1625
+ &lt;? $count = 0; !&gt;
1626
+ &lt;ul&gt;
1627
+ &lt;? foreach $item (@list) { !&gt;
1628
+ &lt;? if (! $item['obsolete']) { !&gt;
1629
+ &lt;? $count++; !&gt;
1630
+ &lt;li class="item"&gt;&lt;?= $item['name'] !&gt;&lt;/li&gt;
1631
+ &lt;? } !&gt;
1632
+ &lt;? } !&gt;
1633
+ &lt;/ul&gt;
1634
+ &lt;? <strong>$group_count = $count;</strong> !&gt;
1635
+
1636
+ &lt;!-- Members --&gt;
1637
+ &lt;? <strong>@list = @members;</strong> !&gt;
1638
+ &lt;? $count = 0; !&gt;
1639
+ &lt;ol&gt;
1640
+ &lt;? foreach $item (@list) { !&gt;
1641
+ &lt;? if (! $item['obsolete']) { !&gt;
1642
+ &lt;? $count++; !&gt;
1643
+ &lt;li class="item"&gt;&lt;?= $item['name'] !&gt;&lt;/li&gt;
1644
+ &lt;? } !&gt;
1645
+ &lt;? } !&gt;
1646
+ &lt;/ol&gt;
1647
+ &lt;? <strong>$member_count = $count;</strong> !&gt;
1648
+ </pre>
1649
+ <br>
1650
+
1651
+ <br>
1652
+
1653
+
1291
1654
  <a name="property-begin"></a>
1292
1655
  <h3 class="section2">begin, end</h3>
1293
- <p><code>begin:</code> and <code>end:</code> property represents the prework and postwork
1294
- of document respectively.
1295
- These properties takes target code block and are available only with
1296
- '#DOCUMENT' selector.
1656
+ <p><code>begin:</code> and <code>end:</code> properties are equal to <code>before:</code> and <code>after:</code>.
1657
+ <strong>These are obsolete and leaved for compatibility</strong>.
1658
+ </p>
1659
+ <p><code>begin:</code> and <code>end:</code> were aimed to add prework and postwork of document,
1660
+ and restricted to be available only with '#DOCUMENT' selector.
1661
+ Currently <code>before:</code> and <code>after:</code> are available with '#DOCUMENT' selector,
1662
+ so you should use these properties instead of <code>begin:</code> and <code>end:</code>.
1297
1663
  </p>
1298
1664
  <a name="property-begin-eruby"></a>
1299
1665
  <h4 class="section3">Ruby</h4>
@@ -1488,11 +1854,177 @@ compile</div>
1488
1854
  <br>
1489
1855
 
1490
1856
 
1857
+ <a name="property-attrvar"></a>
1858
+ <h3 class="section2">Attribute Variable</h3>
1859
+ <p>Attribute variable is a notation such as '$(attrname)' which represents attribute value.
1860
+ Attribute variable allows presentation logic to refer attribute value in presentation data.
1861
+ </p>
1862
+ <a name="property-attrvar-eruby"></a>
1863
+ <h4 class="section3">Ruby</h4>
1864
+ <div class="program_caption">
1865
+ presentation data (ex-attrvar.pdata)</div>
1866
+ <pre class="program">&lt;form action="create" <strong>method="post"</strong>&gt;
1867
+ Username: &lt;input type="text" id="comment_username" <strong>size="30"</strong>&gt;&lt;br&gt;
1868
+ Comment: &lt;textarea id="comment_text" <strong>rows="3"</strong> <strong>cols="50"</strong>&gt;&lt;/textarea&gt;&lt;br&gt;
1869
+ &lt;input id="mark:submit" type="submit" <strong>value="Send comment"</strong>&gt;
1870
+ &lt;/form&gt;
1871
+ </pre>
1872
+ <div class="program_caption">
1873
+ presentation logic (ex-attrvar.plogic)</div>
1874
+ <pre class="program">form {
1875
+ stag: start_form_tag :action=&gt;'<strong>$(action)</strong>';
1876
+ }
1877
+ #comment_username {
1878
+ elem: text_field 'comment', 'username', :size=&gt;<strong>$(size)</strong>;
1879
+ }
1880
+ #comment_text {
1881
+ elem: text_area 'comment', 'text', :rows=&gt;<strong>$(rows)</strong>, :cols=&gt;<strong>$(cols)</strong>;
1882
+ }
1883
+ #submit {
1884
+ elem: submit_tag '<strong>$(value)</strong>';
1885
+ }
1886
+ </pre>
1887
+ <div class="terminal_caption">
1888
+ compile</div>
1889
+ <pre class="terminal">$ kwartz -l eruby -p ex-attrvar.plogic ex-attrvar.pdata
1890
+ &lt;%= start_form_tag :action=&gt;'<strong>create</strong>' %&gt;
1891
+ Username: &lt;%= text_field 'comment', 'username', :size=&gt;<strong>30</strong> %&gt;&lt;br&gt;
1892
+ Comment: &lt;%= text_area 'comment', 'text', :rows=&gt;<strong>3</strong>, :cols=&gt;<strong>50</strong> %&gt;&lt;br&gt;
1893
+ &lt;%= submit_tag '<strong>Send comment</strong>' %&gt;
1894
+ &lt;/form&gt;
1895
+ </pre>
1896
+ <br>
1897
+
1898
+ <a name="property-attrvar-php"></a>
1899
+ <h4 class="section3">PHP</h4>
1900
+ <div class="program_caption">
1901
+ presentation data (ex-attrvar.pdata)</div>
1902
+ <pre class="program">&lt;form action="create" <strong>method="post"</strong>&gt;
1903
+ Username: &lt;input type="text" id="comment_username" <strong>size="30"</strong>&gt;&lt;br&gt;
1904
+ Comment: &lt;textarea id="comment_text" <strong>rows="3"</strong> <strong>cols="50"</strong>&gt;&lt;/textarea&gt;&lt;br&gt;
1905
+ &lt;input id="mark:submit" type="submit" <strong>value="Send comment"</strong>&gt;
1906
+ &lt;/form&gt;
1907
+ </pre>
1908
+ <div class="program_caption">
1909
+ presentation logic (ex-attrvar.plogic)</div>
1910
+ <pre class="program">form {
1911
+ stag: form_tag('comment/<strong>$(action)</strong>');
1912
+ }
1913
+ #comment_username {
1914
+ elem: text_field('comment', 'username', array('size'=&gt;<strong>$(size)</strong>));
1915
+ }
1916
+ #comment_text {
1917
+ elem: text_area('comment', 'text', array('rows'=&gt;<strong>$(rows)</strong>, 'cols'=&gt;<strong>$(cols)</strong>));
1918
+ }
1919
+ #submit {
1920
+ elem: submit_tag('<strong>$(value)</strong>');
1921
+ }
1922
+ </pre>
1923
+ <div class="terminal_caption">
1924
+ compile</div>
1925
+ <pre class="terminal">$ kwartz -l php -p ex-attrvar.plogic ex-attrvar.pdata
1926
+ &lt;?php echo form_tag('comment/<strong>create</strong>'); ?&gt;
1927
+ Username: &lt;?php echo text_field('comment', 'username', array('size'=&gt;<strong>30</strong>)); ?&gt;&lt;br&gt;
1928
+ Comment: &lt;?php echo text_area('comment', 'text', array('rows'=&gt;<strong>3</strong>, 'cols'=&gt;<strong>50</strong>)); ?&gt;&lt;br&gt;
1929
+ &lt;?php echo submit_tag('<strong>Send comment</strong>'); ?&gt;
1930
+ &lt;/form&gt;
1931
+ </pre>
1932
+ <br>
1933
+
1934
+ <a name="property-attrvar-jstl"></a>
1935
+ <h4 class="section3">JSP</h4>
1936
+ <div class="program_caption">
1937
+ presentation data (ex-attrvar.pdata)</div>
1938
+ <pre class="program">&lt;form action="create" <strong>method="post"</strong>&gt;
1939
+ Username: &lt;input type="text" id="comment_username" <strong>size="30"</strong>&gt;&lt;br&gt;
1940
+ Comment: &lt;textarea id="comment_text" <strong>rows="3"</strong> <strong>cols="50"</strong>&gt;&lt;/textarea&gt;&lt;br&gt;
1941
+ &lt;input id="mark:submit" type="submit" <strong>value="Send comment"</strong>&gt;
1942
+ &lt;/form&gt;
1943
+ </pre>
1944
+ <div class="program_caption">
1945
+ presentation logic (ex-attrvar.plogic)</div>
1946
+ <pre class="program">form {
1947
+ logic: {
1948
+ &lt;form:form action="<strong>$(action)</strong>.do"&gt;
1949
+ _cont
1950
+ &lt;/form:form&gt;
1951
+ }
1952
+ }
1953
+ #comment_username {
1954
+ logic: {
1955
+ &lt;form:textfield name="username" size="<strong>$(size)</strong>"/&gt;
1956
+ }
1957
+ }
1958
+ #comment_text {
1959
+ logic: {
1960
+ &lt;form:textarea name="text", rows="<strong>$(rows)</strong>" cols="<strong>$(cols)</strong>"/&gt;
1961
+ }
1962
+ }
1963
+ #submit {
1964
+ logic: {
1965
+ &lt;form:submit value="<strong>$(value)</strong>"/&gt;
1966
+ }
1967
+ }
1968
+ </pre>
1969
+ <div class="terminal_caption">
1970
+ compile</div>
1971
+ <pre class="terminal">$ kwartz -l jstl -p ex-attrvar.plogic ex-attrvar.pdata
1972
+ &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
1973
+ &lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %&gt;
1974
+ &lt;form:form action="<strong>create</strong>.do"&gt;
1975
+ Username: &lt;form:textfield name="username" size="<strong>30</strong>"/&gt;
1976
+ &lt;br&gt;
1977
+ Comment: &lt;form:textarea name="text", rows="<strong>3</strong>" cols="<strong>50</strong>"/&gt;
1978
+ &lt;br&gt;
1979
+ &lt;form:submit value="<strong>Send comment</strong>"/&gt;
1980
+ &lt;/form:form&gt;
1981
+ </pre>
1982
+ <br>
1983
+
1984
+ <a name="property-attrvar-eperl"></a>
1985
+ <h4 class="section3">Perl</h4>
1986
+ <div class="program_caption">
1987
+ presentation data (ex-attrvar.pdata)</div>
1988
+ <pre class="program">&lt;form action="create" <strong>method="post"</strong>&gt;
1989
+ Username: &lt;input type="text" id="comment_username" <strong>size="30"</strong>&gt;&lt;br&gt;
1990
+ Comment: &lt;textarea id="comment_text" <strong>rows="3"</strong> <strong>cols="50"</strong>&gt;&lt;/textarea&gt;&lt;br&gt;
1991
+ &lt;input id="mark:submit" type="submit" <strong>value="Send comment"</strong>&gt;
1992
+ &lt;/form&gt;
1993
+ </pre>
1994
+ <div class="program_caption">
1995
+ presentation logic (ex-attrvar.plogic)</div>
1996
+ <pre class="program">form {
1997
+ stag: &amp;form_tag({'action'=&gt;'<strong>$(action)</strong>'});
1998
+ }
1999
+ #comment_username {
2000
+ elem: &amp;text_field('comment', 'username', {'size'=&gt;<strong>$(size)</strong>});
2001
+ }
2002
+ #comment_text {
2003
+ elem: &amp;text_area('comment', 'text', {'rows'=&gt;<strong>$(rows)</strong>, 'cols'=&gt;<strong>$(cols)</strong>});
2004
+ }
2005
+ #submit {
2006
+ elem: &amp;submit_tag('<strong>$(value)</strong>');
2007
+ }
2008
+ </pre>
2009
+ <div class="terminal_caption">
2010
+ compile</div>
2011
+ <pre class="terminal">$ kwartz -l eperl -p ex-attrvar.plogic ex-attrvar.pdata
2012
+ &lt;?= &amp;form_tag({'action'=&gt;'<strong>create</strong>'}) !&gt;
2013
+ Username: &lt;?= &amp;text_field('comment', 'username', {'size'=&gt;<strong>30</strong>}) !&gt;&lt;br&gt;
2014
+ Comment: &lt;?= &amp;text_area('comment', 'text', {'rows'=&gt;<strong>3</strong>, 'cols'=&gt;<strong>50</strong>}) !&gt;&lt;br&gt;
2015
+ &lt;?= &amp;submit_tag('<strong>Send comment</strong>') !&gt;
2016
+ &lt;/form&gt;
2017
+ </pre>
2018
+ <br>
2019
+
2020
+ <br>
2021
+
2022
+
1491
2023
  <br>
1492
2024
 
1493
2025
 
1494
2026
  <a name="directives"></a>
1495
- <h2 class="section1">Directives</h2>
2027
+ <h2 class="section1">Directives in Presentation Data</h2>
1496
2028
  <p>Directives are commands to embed presentation logics into presentation data.
1497
2029
  For example, <code>title="for item in @list"</code> directive represents iteration of the element.
1498
2030
  </p>
@@ -3250,6 +3782,128 @@ compile</div>
3250
3782
  <br>
3251
3783
 
3252
3784
 
3785
+ <a name="directive-expr"></a>
3786
+ <h3 class="section2">Language-independent Directive</h3>
3787
+ <p>Some directives can be language-independent.
3788
+ </p>
3789
+ <ul type="disc">
3790
+ <li>'mark' and 'replace_(element|content)_with_(element|content)' directives can be
3791
+ language-independent because their argument is element name which is
3792
+ language-independent.
3793
+ </li>
3794
+ <li>'dummy' directive can be language-independent because it takes dummy argument.
3795
+ </li>
3796
+ <li>'value', 'elem', 'stag', 'etag', 'cont', and 'default' directives can be
3797
+ language-independent if their expression argument is one of the following format.
3798
+ <ul type="circle">
3799
+ <li><code>variable</code>
3800
+ </li>
3801
+ <li><code>object.property</code>
3802
+ </li>
3803
+ <li><code>hash['key']</code>, <code>hash["key"]</code>, <code>hash[:key]</code>
3804
+ </li>
3805
+ <li><code>array[123]</code>, <code>array[var]</code>
3806
+ </li>
3807
+ </ul>
3808
+ </li>
3809
+ </ul>
3810
+ <p>Language-independent directives are always described with id attribute.
3811
+ </p>
3812
+ <a name="directive-expr-eruby"></a>
3813
+ <h4 class="section3">Ruby</h4>
3814
+ <div class="program_caption">
3815
+ presentation data (ex-expr.pdata)</div>
3816
+ <pre class="program">&lt;p id="value:user"&gt;foo&lt;/p&gt;
3817
+ &lt;p id="value:user.name"&gt;foo&lt;/p&gt;
3818
+ &lt;p id="value:user['name']"&gt;foo&lt;/p&gt;
3819
+ &lt;p id="value:user[:name]"&gt;foo&lt;/p&gt;
3820
+ &lt;p id="value:user[0]"&gt;foo&lt;/p&gt;
3821
+ &lt;p id="value:user[index]"&gt;foo&lt;/p&gt;
3822
+ </pre>
3823
+ <div class="terminal_caption">
3824
+ compile</div>
3825
+ <pre class="terminal">$ kwartz -l eruby ex-expr.pdata
3826
+ &lt;p&gt;&lt;%= user %&gt;&lt;/p&gt;
3827
+ &lt;p&gt;&lt;%= user.name %&gt;&lt;/p&gt;
3828
+ &lt;p&gt;&lt;%= user['name'] %&gt;&lt;/p&gt;
3829
+ &lt;p&gt;&lt;%= user[:name] %&gt;&lt;/p&gt;
3830
+ &lt;p&gt;&lt;%= user[0] %&gt;&lt;/p&gt;
3831
+ &lt;p&gt;&lt;%= user[index] %&gt;&lt;/p&gt;
3832
+ </pre>
3833
+ <br>
3834
+
3835
+ <a name="directive-expr-php"></a>
3836
+ <h4 class="section3">PHP</h4>
3837
+ <div class="program_caption">
3838
+ presentation data (ex-expr.pdata)</div>
3839
+ <pre class="program">&lt;p id="value:user"&gt;foo&lt;/p&gt;
3840
+ &lt;p id="value:user.name"&gt;foo&lt;/p&gt;
3841
+ &lt;p id="value:user['name']"&gt;foo&lt;/p&gt;
3842
+ &lt;p id="value:user[:name]"&gt;foo&lt;/p&gt;
3843
+ &lt;p id="value:user[0]"&gt;foo&lt;/p&gt;
3844
+ &lt;p id="value:user[index]"&gt;foo&lt;/p&gt;
3845
+ </pre>
3846
+ <div class="terminal_caption">
3847
+ compile</div>
3848
+ <pre class="terminal">$ kwartz -l php ex-expr.pdata
3849
+ &lt;p&gt;&lt;?php echo $user; ?&gt;&lt;/p&gt;
3850
+ &lt;p&gt;&lt;?php echo $user-&gt;name; ?&gt;&lt;/p&gt;
3851
+ &lt;p&gt;&lt;?php echo $user['name']; ?&gt;&lt;/p&gt;
3852
+ &lt;p&gt;&lt;?php echo $user['name']; ?&gt;&lt;/p&gt;
3853
+ &lt;p&gt;&lt;?php echo $user[0]; ?&gt;&lt;/p&gt;
3854
+ &lt;p&gt;&lt;?php echo $user[$index]; ?&gt;&lt;/p&gt;
3855
+ </pre>
3856
+ <br>
3857
+
3858
+ <a name="directive-expr-jstl"></a>
3859
+ <h4 class="section3">JSP</h4>
3860
+ <div class="program_caption">
3861
+ presentation data (ex-expr.pdata)</div>
3862
+ <pre class="program">&lt;p id="value:user"&gt;foo&lt;/p&gt;
3863
+ &lt;p id="value:user.name"&gt;foo&lt;/p&gt;
3864
+ &lt;p id="value:user['name']"&gt;foo&lt;/p&gt;
3865
+ &lt;p id="value:user[:name]"&gt;foo&lt;/p&gt;
3866
+ &lt;p id="value:user[0]"&gt;foo&lt;/p&gt;
3867
+ &lt;p id="value:user[index]"&gt;foo&lt;/p&gt;
3868
+ </pre>
3869
+ <div class="terminal_caption">
3870
+ compile</div>
3871
+ <pre class="terminal">$ kwartz -l jstl ex-expr.pdata
3872
+ &lt;p&gt;${user}&lt;/p&gt;
3873
+ &lt;p&gt;${user.name}&lt;/p&gt;
3874
+ &lt;p&gt;${user['name']}&lt;/p&gt;
3875
+ &lt;p&gt;${user['name']}&lt;/p&gt;
3876
+ &lt;p&gt;${user[0]}&lt;/p&gt;
3877
+ &lt;p&gt;${user[index]}&lt;/p&gt;
3878
+ </pre>
3879
+ <br>
3880
+
3881
+ <a name="directive-expr-eperl"></a>
3882
+ <h4 class="section3">Perl</h4>
3883
+ <div class="program_caption">
3884
+ presentation data (ex-expr.pdata)</div>
3885
+ <pre class="program">&lt;p id="value:user"&gt;foo&lt;/p&gt;
3886
+ &lt;p id="value:user.name"&gt;foo&lt;/p&gt;
3887
+ &lt;p id="value:user['name']"&gt;foo&lt;/p&gt;
3888
+ &lt;p id="value:user[:name]"&gt;foo&lt;/p&gt;
3889
+ &lt;p id="value:user[0]"&gt;foo&lt;/p&gt;
3890
+ &lt;p id="value:user[index]"&gt;foo&lt;/p&gt;
3891
+ </pre>
3892
+ <div class="terminal_caption">
3893
+ compile</div>
3894
+ <pre class="terminal">$ kwartz -l eperl ex-expr.pdata
3895
+ &lt;p&gt;&lt;?= $user !&gt;&lt;/p&gt;
3896
+ &lt;p&gt;&lt;?= $user-&gt;{name} !&gt;&lt;/p&gt;
3897
+ &lt;p&gt;&lt;?= $user{'name'} !&gt;&lt;/p&gt;
3898
+ &lt;p&gt;&lt;?= $user{'name'} !&gt;&lt;/p&gt;
3899
+ &lt;p&gt;&lt;?= $user[0] !&gt;&lt;/p&gt;
3900
+ &lt;p&gt;&lt;?= $user[$index] !&gt;&lt;/p&gt;
3901
+ </pre>
3902
+ <br>
3903
+
3904
+ <br>
3905
+
3906
+
3253
3907
  <br>
3254
3908
 
3255
3909