a
Program Organization Chart
exhibiting the interactions between major program
components. Attach a report to the chart
providing a rationale for the program organization.
(Why does it organize the parts of the computation
in a coherent way? How does it facilitate independent
work on different parts of the program by different
people?)
a printed copy of a file containing a mark-up text
a
session transcript
in which you execute the command "main".
This causes the Hugs system to produce the
value of the variable "main", defined in the
project framework
in Supplied Software
(teamProjBFramework.lhs).
The effect of producing the value of main is
an interactive session in which
the person at the keyboard is prompted to enter
the name of a file containing mark-up text, after
which a new file is created containing a display
version of the text.
a printed copy of a file containing text in display
form, as produced by the text layout program
your team constructs for this project
Mark-up Text
A mark-up text is a string
beginning with a line-width directive followed by a
newline character and continuing with
a sequence of paragraphs.
Paragraphs are separated by line-break
directives (<br>).
The file
markup.txt,
which you may download from the Supplied Software page of the
class web site, provides an example of a mark-up text.
Display Text
A display text is a string derived from a mark-up text.
The display text is made up of lines (that is,
contiguous substrings terminated by newline characters)
containing the words and table entries of the source
mark-up text
in the order and format required by the directives
in the mark-up text. Except within a table, space between
words in a display text bears no special relationship
to the space between words in the mark-up text. Spaces
are inserted or deleted between words in a display text
as needed to properly justify lines, regardless of the
spacing between those words in the mark-up text.
Mark-up Directives
Mark-up directives always appear on a line containing
no other text, and no lines other than those containing
mark-up directives will begin with a "<" sign.
line-width directive: <line-width w>
where w is a number indicating the
number of spaces each line is to have in it
This directive, which appears on the first line
of a mark-up text (and only on the first line),
indicates a line width for the display of the text.
A display text will have fully justified lines.
That is,
each line of a display text will begin with
a non-whitespace character and, if the line contains
more than one word,
it will end with a non-whitespace character.
Lines in a display text will
contain exactly as many characters as the
specified line width,
except that
(1) the last line
of a paragraph will be just wide enough to accommodate
the words it contains,
(2) any word whose length exceeds the line width will
occupy a line by itself, and
(3) lines in tables will be of whatever form is required
to fulfill the table specifications.
line-break directive: <br>
Paragraphs in mark-up texts are separated by
<br> directives. The number of paragraphs
is one more than the number of <br> directives.
The display text starts
each of these paragraphs on a new line. Note that two
<br> directives in a row, with no intervening
words in the mark-up text, lead to a blank line in
the display text between the paragraph
preceding the first of the two directives and the
paragraph following the second. The blank line
corresponds to the empty paragraph between the two
<br> directives.
table directives:
<table cg>, </table>
where c and g are numbers indicating the
number of columns in the table and the minimum gap between
columns
The lines between a
<table cg> directive and a
</table> directive,
known as a table segment
of a mark-up text,
are treated as the entries of a table with c
columns. These entries are to be displayed in columns
arranged vertically down the page
so that the order of the entries in the first column
matches the order of the initial portion of the entries
in the table segment of the mark-up text. These are
followed by the entries displayed in the second column,
which begins on the same line in the display text as the
first column. The entries in the second column
come from the portion of the entries in the table segment
that immediately follow those of the first column.
In the display text, the entries in the second
column match the order of the corresponding entries
in the table segment of the mark-up text.
Then the third column, and so on.
The initial characters from each entry must line up
vertically in the displayed columns, and the minimum gap
between columns must contain exactly g spaces.
Each column displayed must contain the same number of
entries if possible. If that is not possible, then no displayed
column may contain more than one more entry than any other
column.
Table entries are full lines from the mark-up text, taken
as-is, except without their trailing whitespace, if they
have any. The line width directive is ignored in a table
display. So, lines in a table occupy whatever space they
need to meet the requirements
specified in the
<table cg>
directive
as to the number of columns and
the minimum gap between columns.
No mark-up directives will appear between a
<table cg> directive and
a </table> directive.
Definition of "word"
A word, for the purposes of this project, is
a contiguous substring containing only non-whitespace characters
and surrounded by whitespace characters or occurring
at the beginning or end of a string and delimited at its
other boundary by whitespace.
Definition of whitespace
Whitespace characters are characters like blanks and newlines
that aren't visible on display devices.
The intrinsic function isSpace :: Char -> Bool delivers
True if its argument is a whitespace character and False
otherwise. Strictly speaking, isSpace is provided via the
Char module (a standard module supplied with all Haskell
systems), so it is best to include an import Char(isSpace)
directive in any script that refers to isSpace.
textDisplay function
Define a function textDisplay :: String -> String that delivers
a display version of the mark-up text supplied as its
argument.
Export the textDisplay function from a module called
TextDisplay. This module will be loaded automatically by
Hugs when you load the file
teamProjBFramework.lhs,
which is available
from the Supplied Software page of
the class web site.
Ground Rules
In each team project, certain team members will
have
special assignments:
leader
recorder
librarian
collector
The
Team Organization document
outlines the duties associated with these assignments.
The people who play these roles will be chosen by the
team at the first work session for the project.
Team members should play different roles on different
projects.
Contact the
instructor
if your team has difficulty
rotating assignments.
It is important that you use the software each of you
developed for Individual Project 2 to complete the team
project. Do not redefine
those functions. You may use those defined on the
class web site (Individual Project
3A,
3B,
3C,
3D)
if those defined by
your team members did not meet the
requirements of Project 3.
You may use any aspect of Haskell discussed in
Lessons 1-17 of the Haskell text. You may also use
any other operators
that have been discussed in class or that are
defined in the modules
SequenceUtilities
and
IOutilities
on the class web site. For example,
you may want to use the function integralFromString,
defined in the IOutilities module, to help interpret
line-length and table directives.
You may also want to use
the function packets, defined in the SequenceUtilities
module to help split a mark-up text into paragraphs.
You may download the module
TeamProjBS, pport
from the Supplied Software page of
the class web site. This module exports a function
called bracketedBlocks, which you may find useful in
separating out the table segments in a paragraph.
CS 1323 Section 30 - Fundamentals of Computer Programming -
Spring 1997