Translates text table files into HTML table files
Text Table File Format
[
title: title_of_the_table;
heading: heading_1, heading_2, ..., heading_n;
row: value_1, value_2, ..., value_n;
row: value_1, value_2, ..., value_n;
... ... ...
border: (yes | no); // default: no
csum: (yes | no); // default: no
rsum: (yes | no); // default: no
]
[
... // another table
]
...
Each table begins with “[“ and ends with “]”
•Each statement begins with a specific keyword and ends with “;”
•Statements have no order, i.e., they can be intermixed
•“row” statement is essential (at lease 1 required) but others are optional
•Keywords are not case sensitive
•A text file may contain unlimited number of tables
•A table can embed another table within a row (refer to the next slide)
text table code
[
title: Example table A;
heading: heading_1, heading_2, heading_3;
row: value_11, value_21, value_31;
row: value_12, value_22, value_32;
]
translate to html table(output)
<table>
<caption>Example table A</caption>
<tr>
<th>heading_1</th><th>heading_2</th><th>heading_3</th>
</tr>
<tr>
<td>value_11</td><td>value_21</td><td>value_31</td>
</tr>
<tr>
<td>value_12</td><td>value_22</td><td>value_32</td>
</tr>
<table>
if text table code has a ' border:yes '
output table should have a border
Basic Requirements
•Must conform basic principles of OOP
–Encapsulation, inheritance, polymorphism, overloading, …
•HTML table elements must be implemented as a class and must form a inheritance hierarchy
–Make the root class “Element” that has common data and methods
•E.g., data member “children”, “value”, …
•E.g., polymorphic method “serialize” that calls “serialize” of child objects
–Make each table element class by inheriting from class “Element”
•E.g., class “Table”, “Caption”, “Tr”, “Th”, “Td”, …
•Others
–Handle all expected exceptions
–Write comments for each class, method, object, function, and variable in detail