Could someone help me get started on this program or where to look to
get information, I am not sure how to put things together.
1. Create 4 double linked lists as follows:
(a) A double linked list called NAMES which will contain all C like
identifiers of less than
256 characters long identified in the input file F. Each identifier
will be represented by
a triple (I, length, string) where I is used to identify the type of
the object as being an
identifier, length is an integer representing the length of the
identifier in characters, and
string is a string of characters representing the identifier itself.
(b) A double linked list called NUMBERS which will contain all C like
numbers of less than
256 characters long identified in the input file F. Each number will be
represented by a
triple (N, length, string) where N is used to identify the type of the
objects as being a
number, length is an integer representing the length of the number in
characters, and
string is the string of characters representing the number itself.
(c) A double linked list called SEPARATORS which will contain all C
language separators
and operators identified in the input file F. Each separator will be
represented by a triple
(X, length, string) where X is S for separators, O for operators, R for
symbols denoting
relations, L for new line and E for end of file. The length is an
integer representing the
length of the symbol and string is the string of characters
representing the symbol itself.
(d) A double linked list called UNKNOWN which will contain all symbols
you discovered in
the file F which could not be classied in the lists NAMES, NUMBERS,
SEPARATORS.
Each object in this list will be represented by a triple (Y, length,
string) where Y is used
to signify that an unknown symbol was discovered, length is an integer
representing the
length in characters of the unknown symbol, and string is the string of
characters that
make up the unknown symbol itself.
The input file F will be an arbitrary text file in your directory. The
actions of list creation and list printing will be programmed as
functions which will be called from a main program. Use in your program
the functions list(H, T), to create an empty list L whose header is H
and tail is T, and append(L, OBJ), to append the object OBJ to the list
L.