The functions to implement now are ones that will be needed for the Parser, mainly constructors for creating String instances from a character array including one from two pointers (one pointing to the beginning of the string and one pointing to the character after the last one of the same string), one from a pointer and a length, one from a just a length (just allocates the character array), and one from a C string constant pointer (for holding error strings). There are also constructors that create a null or zero length string (length is zero, pointer is zero) and one from another string instance. There is a destructor that deallocates the character array if there is one (i.e. allocated, for which length is greater than zero). Finally there are access functions for returning the length and the character array pointer.
The next group of functions to implement are for comparing strings. These include one for comparison two strings ignoring case, one for comparing a string to a character array ignoring case (needed for the Parser when searching the Operator Table), one for comparing two strings for equality, and one for comparing two strings for less than, greater than or equal to (needed for the BASIC string relational operators).
There is a group of functions for working with sub-strings, like the LEFT$, MID$ and RIGHT$ BASIC string functions. These include a set one character within a string (that was previously allocated; need by the Parser for creating string constants), one that gets a reference to a sub-string, one that sets a sub-string of a reference and a function that resets the length and pointer (so that no deallocation is performed when the instance is deleted).
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)