Tuesday, April 9, 2013

Highlighting Errors – List Of Errors

The program code will be stored in a continuous array of words.  This will make the program easy to run by simply starting at the beginning of the array and executing instructions until an END or STOP is encountered.  There will always be an END at the end of the array.  There will be no line markers in this array, so that the run-time module can just execute the code without dealing with line separators.  Subroutines and functions will be stored in there own code arrays.

In order to maintain the code as individual program lines, there will be another array containing information about each line.  Each element of this line information array will contain an index into the code array to where the line begins.  The run-time module will not need to access this array.  If the line has an error, the index to the code array value will be invalid.  For a line with a warning, the index to the code array will be valid.

There will also be a list of errors (and warnings).  This list will correspond to and mirror the list of extra selections that will be used to highlight the errors in the edit box.  Each item in this list will have the line number (index) back to the line information array, and the line information array elements with errors (and warnings) will contain an index to this error list.  The program can only be run when this list is empty.

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.)