--- TODO 2004/10/26 12:07:42 1.7
+++ TODO 2004/10/27 09:20:53 1.8
@@ -54,3 +54,81 @@
NAME SAVE HYPERLINK
------------------------------
+- modules:
+
+ * transformation module:
+ - format 1: 2d form elements (input after submit of web form)
+ lo2 lo1 lo0 fn fo fv
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ 0 ...| | | | | | | grp | |== | | Mail |
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ 1 ...| | | | ||| | | desc | |=~ | | \bMTA\b |
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ 2 ...| | |&& | | | | class | |== | | CORE |
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ 3 ...| | | | ||| | | class | |== | | BASE |
+ +---+ +---+ +---+ +---------+ +---+ +---------+
+ : : : : : :
+
+ fn-0="grp"&fo-0="=="&fv-0="Mail"&lo0-1="||"&fn-1="desc"&fo-1="=~"&fv-1="\bMTA\b"
+ lo1-2="&&"&fn-2="class"&fo-2="=="&fv-2="CORE"&lo0-3="||"&fn-3="class"&fo-3="=="&fv-3="BASE"
+
+ - format 2a: astract syntax tree for query expression (internal representation)
+
+ function-style:
+ AND( OR( EQ(grp,"Mail"),
+ RE(desc,"\bMTA\b") ),
+ OR( EQ(class,"CORE"),
+ EQ(class,"BASE") ) )
+
+ in-core-style:
+ my $expr =
+ [ "AND", [ "OR", [ "EQ", "grp", "Mail" ],
+ [ "RE", "desc", "\bMTA\b"] ],
+ [ "OR", [ "EQ", "class", "CORE" ],
+ [ "EQ", "class", "BASE" ] ] ];
+
+ "print $expr->[2]->[1]->[2];" -> "CORE"
+
+ my $format2b = &transform_tree($expr, \&transform_style_perl);
+ my $format2c = &transform_tree($expr, \&transform_style_sql);
+ sub transform_tree {
+ my ($expr, $style) = @_;
+ my $str = '';
+ my ($op, $a1, $a2) = @{$expr};
+ $op = &style($op);
+ $a1 = ref($a1) ? &style(&transform_tree($a1, $style)) : &style($a1);
+ $a2 = ref($a2) ? &style(&transform_tree($a2, $style)) : &style($a2);
+ $str = "$a1 $op $a2";
+ return $str;
+ }
+ sub transform_style_perl {
+ my ($token) = @_;
+ $token =~ s/^AND$/&&/;
+ $token =~ s/^OR$/||/;
+ $token =~ s/^EQ$/==/;
+ $token =~ s/^RE$/=~/;
+ return $token;
+ }
+ sub transform_style_sql {
+ my ($token) = @_;
+ $token =~ s/^EQ$/=/;
+ $token =~ s/^RE$/MATCH/;
+ return $token;
+ }
+
+ - format 2b: C-style query expression (input after hyperlink in web page)
+
+ (grp == "Mail" || desc =~ "\bMTA\b") &&
+ (class == "CORE || class == "BASE")
+
+ - format 2c: SQL-style query expression (output for database query)
+
+ (quos.q_grp = 'Mail' OR quos.q_desc MATCH? '\bMTA\b') AND
+ (quos.q_class = 'CORE' OR quos.q_class = 'BASE')
+
+ * creation of web formular (render query)
+ sub_render_form (cgi-Object | expression, row, column
|