annotate trunk/src/TypeRules.d @ 800:dcd30b0ba711

Added --xml option to command 'ddoc'.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sat, 01 Mar 2008 17:58:23 +0100
parents 05dfe88dd3bb
children f51305056196
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
1 /++
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
2 Author: Aziz Köksal
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
3 License: GPL3
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
4 +/
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
5 module TypeRules;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
6
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
7 import common;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
8
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
9 template ExpressionType(char[] T1, char[] T2, char[] expression)
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
10 {
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
11 mixin("alias "~T1~" X;");
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
12 mixin("alias "~T2~" Y;");
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
13 X x;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
14 Y y;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
15 static if(is(typeof(mixin(expression)) ResultType))
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
16 const char[] result = ResultType.stringof;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
17 else
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
18 const char[] result = "Error";
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
19 }
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
20 alias ExpressionType EType;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
21
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
22 // pragma(msg, EType!("char", "int", "&x").result);
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
23
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
24 static const string[] basicTypes = [
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
25 "char"[], "wchar", "dchar", "bool",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
26 "byte", "ubyte", "short", "ushort",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
27 "int", "uint", "long", "ulong",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
28 /+"cent", "ucent",+/
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
29 "float", "double", "real",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
30 "ifloat", "idouble", "ireal",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
31 "cfloat", "cdouble", "creal"/+, "void"+/
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
32 ];
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
33
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
34 static const string[] unaryExpressions = [
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
35 "!x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
36 "&x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
37 "~x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
38 "+x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
39 "-x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
40 "++x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
41 "--x",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
42 "x++",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
43 "x--",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
44 ];
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
45
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
46 static const string[] binaryExpressions = [
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
47 "x!<>=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
48 "x!<>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
49 "x!<=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
50 "x!<y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
51 "x!>=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
52 "x!>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
53 "x<>=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
54 "x<>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
55
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
56 "x=y", "x==y", "x!=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
57 "x<=y", "x<y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
58 "x>=y", "x>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
59 "x<<=y", "x<<y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
60 "x>>=y","x>>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
61 "x>>>=y", "x>>>y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
62 "x|=y", "x||y", "x|y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
63 "x&=y", "x&&y", "x&y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
64 "x+=y", "x+y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
65 "x-=y", "x-y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
66 "x/=y", "x/y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
67 "x*=y", "x*y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
68 "x%=y", "x%y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
69 "x^=y", "x^y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
70 "x~=y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
71 "x~y",
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
72 "x,y"
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
73 ];
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
74
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
75 char[] genBinaryExpArray(char[] expression)
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
76 {
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
77 char[] result = "[\n";
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
78 foreach (t1; basicTypes)
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
79 {
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
80 result ~= "[\n";
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
81 foreach (t2; basicTypes)
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
82 result ~= `EType!("`~t1~`", "`~t2~`", "`~expression~`").result,`\n;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
83 result[result.length-2] = ']'; // Overwrite last comma.
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
84 result[result.length-1] = ','; // Overwrite last \n.
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
85 }
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
86 result[result.length-1] = ']'; // Overwrite last comma.
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
87 return result;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
88 }
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
89 // pragma(msg, mixin(genBinaryExpArray("x%y")).stringof);
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
90
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
91 char[] genBinaryExpsArray()
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
92 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
93 char[] result = "[\n";
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
94 foreach (expression; binaryExpressions[0..42])
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
95 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
96 // pragma(msg, "asd");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
97 result ~= genBinaryExpArray(expression)/+ ~ ",\n"+/;
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
98 result ~= ",\n";
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
99 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
100 result[result.length-2] = ']';
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
101 return result;
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
102 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
103
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
104 // pragma(msg, mixin(genBinaryExpsArray()).stringof);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
105
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
106 char[] genUnaryExpArray(char[] expression)
792
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
107 {
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
108 char[] result = "[\n";
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
109 foreach (t1; basicTypes)
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
110 result ~= `EType!("`~t1~`", "int", "`~expression~`").result,`\n;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
111 result[result.length-2] = ']'; // Overwrite last comma.
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
112 return result;
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
113 }
05dfe88dd3bb Added new module TypeRules.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
114
800
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
115 char[] genUnaryExpsArray()
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
116 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
117 char[] result = "[\n";
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
118 foreach (expression; unaryExpressions)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
119 result ~= genUnaryExpArray(expression) ~ ",\n";
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
120 result[result.length-2] = ']';
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
121 return result;
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
122 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
123
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
124 // pragma(msg, mixin(genUnaryExpsArray()).stringof);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
125
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
126 void genHTMLTypeRulesTables()
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
127 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
128 auto unaryExpsResults = mixin(genUnaryExpsArray());
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
129 // auto binaryExpsResults = mixin(genBinaryExpsArray());
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
130
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
131 Stdout(
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
132 `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
133 `<html>`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
134 `<head>`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
135 ` <meta http-equiv="Content-Type" content="text/html; charset=utf-8">`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
136 ` <link href="" rel="stylesheet" type="text/css">`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
137 `</head>`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
138 `<body>`\n
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
139 );
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
140
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
141 Stdout.format("<table>\n<tr><th colspan=\"{}\">Unary Expressions</th></tr>", unaryExpressions.length);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
142 Stdout("<tr><td><!--typecol--></td>");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
143 foreach (unaryExpression; unaryExpressions)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
144 Stdout.format("<td>{}</td>", unaryExpression);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
145 Stdout("</tr>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
146 foreach (i, basicType; basicTypes)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
147 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
148 Stdout.format("<tr>\n<td>{}</td>", basicType);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
149 foreach (unaryExpResults; unaryExpsResults)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
150 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
151 assert(unaryExpResults.length == basicTypes.length);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
152 Stdout.format("<td>{}</td>", unaryExpResults[i]);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
153 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
154 Stdout("\n<tr>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
155 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
156 Stdout("</table>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
157
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
158 foreach (binaryExpression; binaryExpressions)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
159 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
160 Stdout.format("<table>\n<tr><th colspan=\"{}\">Binary Expression</th></tr>", basicTypes.length);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
161 Stdout.format("<tr><td>{}</td>", binaryExpression);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
162 Stdout("\n<tr>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
163 foreach (i, basicType; basicTypes)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
164 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
165 Stdout.format("<tr>\n<td>{}</td>", basicType);
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
166 // foreach (basicType; basicTypes)
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
167 {
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
168 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
169 Stdout("\n<tr>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
170 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
171 Stdout("</table>\n");
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
172 }
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
173
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
174 Stdout(
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
175 "\n</body>"
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
176 "\n</html>"
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
177 );
dcd30b0ba711 Added --xml option to command 'ddoc'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 792
diff changeset
178 }