The program view will get the same output as produced at the end of encoder test output, which includes the offset range, and the debug text or the error information (column, length and message) of the line. Currently a program line with an error does not have any code associated with it (an input error). However, for a code error, the program line will have been successfully encoded and stored into the program. An example of a code error is a missing ENDIF to an IF.
The generation of the line offset range and error output was moved from the tester class to the program model debug text routine so that it can also be used for the program view. This code was also modified to output both the debug text and the error information instead one or the other. Since input errors have no code, this works as before.
Since the debug text routine is also used by the tester class encode input routine to just obtain the debug text for a line, the debug text routine was given an flag argument for whether to return the full information (offset range, debug text and error information) or just the debug text.
The error information is handled differently by the encode input routine, where the error column and length are used to point to the error. This was modified to get a pointer to the error item for the line instead of the RPN list using the new error item access function added to the program model class, which returns a null pointer if the line does not have an error.
[commit 3fde3da2e0]
Saturday, October 26, 2013
Program – Delay Line Encoding
The edit box class has an issue where sometimes unmodified lines are reported as being changed. There is currently a check when replacing a program line where if the line has not changed, no action is taken. Currently the translated RPN list is compared to the stored RPN list for the line. Eventually however, the RPN lists will not be stored and this line change detection will have to be changed. More on this later, but this change will be made once the recreator is implemented.
A newly translated line can't be encoded until it has been determined that the line has changed because the process of encoding adds or updates references in the dictionaries. If the line then hasn't changed, this would need to be undone, which would be unnecessarily complicated. Therefore, the encoding of the line was delayed until after it is determined that the line changed. Since this does not affect new line insertions, the line also needs to be encoded for the insert operation. The line is only encoded in both places if there was no translation error.
[commit b5c9020cc8]
A newly translated line can't be encoded until it has been determined that the line has changed because the process of encoding adds or updates references in the dictionaries. If the line then hasn't changed, this would need to be undone, which would be unnecessarily complicated. Therefore, the encoding of the line was delayed until after it is determined that the line changed. Since this does not affect new line insertions, the line also needs to be encoded for the insert operation. The line is only encoded in both places if there was no translation error.
[commit b5c9020cc8]
Program – Removing RPN List Dependency
The pointer to the RPN list of a program line from the translator is currently being held in the line information list for the program (along with offset and size of the line and an index to the error list if the line has an error). This pointer will eventually be removed since the RPN list is not needed after a line is encoded and stored in the program. There were two dependencies on the RPN list that needed to be removed.
The program model update error routine used the RPN list from an line information list item to determine if the line has an error. If it did, an error item is created from the RPN list (retrieving the error column, error and message) and stored in the error list. The index of the error item in this list is then stored in the line information item for the line.
Since the RPN list pointer is going to be removed from the line information list, the update error routine was modified to obtain the error information differently. Instead of creating the error item in this routine, the error item is now created in the calling update line routine just after the line is translated and checked for an error. The error item with the error information is passed to the update error routine, which was modified to use it instead of the RPN list.
So that an empty error item can be indicated, a new none error type was added to the error item class. An is empty access function was added to return if the error item does not contain an error. A default constructor was added to create an empty error item. Also for clarity, the translator and encoder error types were renamed to the input and code error types.
Even though currently no encoder errors can occur, the error item constructor was modified from having an RPN list pointer argument to having arguments for the error column, length and message. This will allow setting errors from encoding without an RPN list (the error item class is no longer dependent on the RPN list class).
[commit 0a10ddae84]
The program model update error routine used the RPN list from an line information list item to determine if the line has an error. If it did, an error item is created from the RPN list (retrieving the error column, error and message) and stored in the error list. The index of the error item in this list is then stored in the line information item for the line.
Since the RPN list pointer is going to be removed from the line information list, the update error routine was modified to obtain the error information differently. Instead of creating the error item in this routine, the error item is now created in the calling update line routine just after the line is translated and checked for an error. The error item with the error information is passed to the update error routine, which was modified to use it instead of the RPN list.
So that an empty error item can be indicated, a new none error type was added to the error item class. An is empty access function was added to return if the error item does not contain an error. A default constructor was added to create an empty error item. Also for clarity, the translator and encoder error types were renamed to the input and code error types.
Even though currently no encoder errors can occur, the error item constructor was modified from having an RPN list pointer argument to having arguments for the error column, length and message. This will allow setting errors from encoding without an RPN list (the error item class is no longer dependent on the RPN list class).
[commit 0a10ddae84]
Friday, October 25, 2013
Program – Dictionary Debug Output
The program debug output shows the indexes of dictionary entries, but this is insufficient for showing if the dictionary entries were removed correctly and are placed on the free stack of the dictionary for reused. Code was added to output the contents of each dictionary.
The debug text routine was added to the dictionary class that takes a header string as an argument. After appending the header string to the output string, it loops through the dictionary entries and appends the index, use count and string of every entry with a non-zero use count. After the entries, the indexes in the free stack are appended. If any free stack item contains a non-zero use count, the use count is appended after the index. Also, if the item has a non-empty string, the string is also append. The strings of deleted entries should be cleared.
The debug text dictionaries routine was added to the program model class, which calls the debug text routine of each dictionary and appends each to the output string. A call to this routine was added to the tester class run routine after the program model debug text function is called to output the program code. The expected results for encoder test #1 and #2 were updated for the additional dictionary debug output.
[commit 11337cb673]
The debug text routine was added to the dictionary class that takes a header string as an argument. After appending the header string to the output string, it loops through the dictionary entries and appends the index, use count and string of every entry with a non-zero use count. After the entries, the indexes in the free stack are appended. If any free stack item contains a non-zero use count, the use count is appended after the index. Also, if the item has a non-empty string, the string is also append. The strings of deleted entries should be cleared.
The debug text dictionaries routine was added to the program model class, which calls the debug text routine of each dictionary and appends each to the output string. A call to this routine was added to the tester class run routine after the program model debug text function is called to output the program code. The expected results for encoder test #1 and #2 were updated for the additional dictionary debug output.
[commit 11337cb673]
Program – Dereference Removed Lines
When a line of code is replaced or removed, the use counts of any dictionary entries referenced on the line need to be decremented. If the use counts becomes zero, the entry is no longer being used and needs to be deleted from the dictionary (the entry becomes available for use by another item upon the next add).
The dereference routine was added to the program model to scan a line that is about to be replaced or removed. This routine loops through each program word of the line and removes the reference for any code that has an operand, which is determined by whether the code has a remove function. In the update line routine, this routine is called before the line is replaced or removed.
Table entry remove functions were added for the various REM, constant and variable codes. Each remove function calls the remove routine of appropriate dictionary (just like the encode function calls the add routine of appropriate dictionary to add a reference).
Encoder test #2 contains replace and remove operations, but previously the use counts of dictionary entries were not being decremented. Now that they are, several dictionary entries are now removed since their uses counts become zero and are removed from the dictionary. This allowed new items to be added in the unused entries, which affected the index of several dictionary entries on some of the program lines, therefore the expected results were updated.
[commit a310dc458e]
The dereference routine was added to the program model to scan a line that is about to be replaced or removed. This routine loops through each program word of the line and removes the reference for any code that has an operand, which is determined by whether the code has a remove function. In the update line routine, this routine is called before the line is replaced or removed.
Table entry remove functions were added for the various REM, constant and variable codes. Each remove function calls the remove routine of appropriate dictionary (just like the encode function calls the add routine of appropriate dictionary to add a reference).
Encoder test #2 contains replace and remove operations, but previously the use counts of dictionary entries were not being decremented. Now that they are, several dictionary entries are now removed since their uses counts become zero and are removed from the dictionary. This allowed new items to be added in the unused entries, which affected the index of several dictionary entries on some of the program lines, therefore the expected results were updated.
[commit a310dc458e]
Monday, October 21, 2013
Program – Error Handling Issues
When checking for memory errors, a use of uninitialized memory error was detected with new encoder test #2. The problem occurred in the remove error routine, which was always adjusting the rest of the errors after the current line. It should have only been doing this if the line was not deleted and did not have an error. Because this routine did not return for this condition, the error index loop variable was not initialized causing the memory error.
When the update error routine was modified back to not returning the status of whether the line has an error, the routine was not changed back to its original code correctly. This caused errors not to be added to the errors list and therefore did not show up when running the GUI. The routine was put back to its original code from an earlier commit.
When a line was replaced with an empty line (for example, a line with an error), the replace line routine of the new LineInfoList class was supposed to call the remove line routine and then return. Instead if was calling the base QList class remove routine and not returning. This caused extra code to be removed from the program.
A line with an error was added as a replacement line to encoder test #2 to verify the corrections described above. The offset for a line with an error was added to the test output to verify that errors lines are added to the program correctly. The offset is needed for when the line with the error is replaced with good code.
[commit d8ef155e5e]
When the update error routine was modified back to not returning the status of whether the line has an error, the routine was not changed back to its original code correctly. This caused errors not to be added to the errors list and therefore did not show up when running the GUI. The routine was put back to its original code from an earlier commit.
When a line was replaced with an empty line (for example, a line with an error), the replace line routine of the new LineInfoList class was supposed to call the remove line routine and then return. Instead if was calling the base QList class remove routine and not returning. This caused extra code to be removed from the program.
A line with an error was added as a replacement line to encoder test #2 to verify the corrections described above. The offset for a line with an error was added to the test output to verify that errors lines are added to the program correctly. The offset is needed for when the line with the error is replaced with good code.
[commit d8ef155e5e]
Sunday, October 20, 2013
Program – Operation Testing
With the program line operations (insert, replace and remove) implemented, some automated mechanism was needed to test them using the command line test mode. The encoder test mode was modified to accept a special syntax at the beginning of each test line to indicate a program operation.
The syntax starts with an optional '+' for insert line and '-' for delete line. This is followed by a line index number indicating the line that should be inserted or deleted. If there is just a line index number, the line is replaced. The number is followed by optional spaces (though the number ends when there are no more digits). The number must be within the valid range for the lines currently in the program. The number is optional after a '+' in which case, the line is appended to the end of the program, the same as if the line does not contain this syntax. After a '-' and its number, there must be no statement.
When using this syntax, the normal "Input:" and "Output:" lines are suppressed. This is the difference between using a lone '+' (output suppressed) and no syntax (output not suppressed) for appending a line. After processing this syntax, the characters are removed from the line, and the appropriate call to the update slot routine is made for the specified operation to translate, encode and perform the program operation on the line. However, if a line does have an error, the outputs are not suppressed to report the error.
Encoder test #1 still operates the way it did before since none of the lines contain this additional operation syntax. This test was copied into new encoder test #2 where a lone '+' was added to every line. Several additional lines were added to test #2 to test various program operations. (Note: this test currently produces a memory error that needs to be resolved.)
[commit e6ac67e6b7]
The syntax starts with an optional '+' for insert line and '-' for delete line. This is followed by a line index number indicating the line that should be inserted or deleted. If there is just a line index number, the line is replaced. The number is followed by optional spaces (though the number ends when there are no more digits). The number must be within the valid range for the lines currently in the program. The number is optional after a '+' in which case, the line is appended to the end of the program, the same as if the line does not contain this syntax. After a '-' and its number, there must be no statement.
When using this syntax, the normal "Input:" and "Output:" lines are suppressed. This is the difference between using a lone '+' (output suppressed) and no syntax (output not suppressed) for appending a line. After processing this syntax, the characters are removed from the line, and the appropriate call to the update slot routine is made for the specified operation to translate, encode and perform the program operation on the line. However, if a line does have an error, the outputs are not suppressed to report the error.
Encoder test #1 still operates the way it did before since none of the lines contain this additional operation syntax. This test was copied into new encoder test #2 where a lone '+' was added to every line. Several additional lines were added to test #2 to test various program operations. (Note: this test currently produces a memory error that needs to be resolved.)
[commit e6ac67e6b7]
Saturday, October 19, 2013
Additional Memory Issues
Some memory errors were reported when performing memory testing on the current source. Checking previous commits back to the last tag reported the same memory errors, which was strange because the previous commits successfully passed the memory tests. The memory errors were reported in libglib2.0.
I remembered that there was just an update for this library within the past week, which explained why these memory errors were previously not reported. There must be some interaction between the Qt library and the new version of this library. These errors were added to the error suppression file so that they will no longer be reported. These extra errors will not affect the memory tests if the update for this library is not applied.
[commit 7ccd9ac05f]
I remembered that there was just an update for this library within the past week, which explained why these memory errors were previously not reported. There must be some interaction between the Qt library and the new version of this library. These errors were added to the error suppression file so that they will no longer be reported. These extra errors will not affect the memory tests if the update for this library is not applied.
[commit 7ccd9ac05f]
Program – Replace and Remove Lines
So far, only the insertion of program lines into the program had been implemented. The removal and replacement of program lines was implemented to complete the operations needed. Some additional support functions were also needed. The remove line routine just calls the remove routine of the QVector base class with the offset and size of the line if the size of the line if greater than zero (otherwise, no code needs to be deleted).
The replace line routine was much more involved. If the replacement line size is zero, then the current line is deleted by calling the new remove routine. If the replacement line is larger, then the program code vector is first resized for the net increase in the size of the line. The code after the current line is then moved up by the net increase. If the new line is smaller, then the code after the current line is moved down by the net decrease. The program code vector is then resized by the net decrease in the line. Finally, the contents of the replacement line is copied into the program.
The standard library memmove() function is used to move that program code, which is also used by the base QVector class. The address of the code to move is obtained using the data() function of QVector (the data in the vector is guaranteed to be in continuous memory). However, a word of caution learned while debugging: the data() function must be called after a call to the resize() function since this function may relocate the actual data.
When a line is inserted, removed or replaced with a different size line, the offset of every line after the line needs to be adjusted for the net change in program size. To accomplish this, a new LineInfoList class was implemented based on the QList class. The replace, insert and remove functions were reimplemented to adjust the offset of all lines after the affected line for the net change in program size.
[commit 49257e119d]
The replace line routine was much more involved. If the replacement line size is zero, then the current line is deleted by calling the new remove routine. If the replacement line is larger, then the program code vector is first resized for the net increase in the size of the line. The code after the current line is then moved up by the net increase. If the new line is smaller, then the code after the current line is moved down by the net decrease. The program code vector is then resized by the net decrease in the line. Finally, the contents of the replacement line is copied into the program.
The standard library memmove() function is used to move that program code, which is also used by the base QVector class. The address of the code to move is obtained using the data() function of QVector (the data in the vector is guaranteed to be in continuous memory). However, a word of caution learned while debugging: the data() function must be called after a call to the resize() function since this function may relocate the actual data.
When a line is inserted, removed or replaced with a different size line, the offset of every line after the line needs to be adjusted for the net change in program size. To accomplish this, a new LineInfoList class was implemented based on the QList class. The replace, insert and remove functions were reimplemented to adjust the offset of all lines after the affected line for the net change in program size.
[commit 49257e119d]
Program – Lines With Errors
For a line with a translator error, there is nothing to insert into the program for the line. Even though there is no code to insert, the offset into where the line belongs in the program still needs to be recorded along with a size of zero. However, if the line had an error, the offset and size for the line was not being set. This was corrected, and as a result, the update error routine no longer needs to return whether the line has an error, which was being used as the condition whether to set the offset and size.
[commit a871ca953e]
[commit a871ca953e]
Monday, October 14, 2013
Encoder Testing – Program Output
Now that encoder testing is inserting the input test lines into an actual program model, it would be helpful to know if the lines are being inserted correctly. The encoded line is output after each input line, and while this is extracted from the program model, it is not known if the lines are actually in the correct location within the program.
The offset and size could have been added to the output line, but this is insufficient for testing if lines are replaced and removed correctly. These operations have not been implemented yet, but will be shortly. Therefore, at the end of testing, all of the lines currently in the program model are output. If a line contains an error, the column, length and message of the error are output.
Included in the output is the index number of the line, the offset range of the line to verify that lines are inserted in the correct place with no gaps between lines, and the debug text output for the line. Blank lines take no space in the program code and so no offset range, so only the offset is output. The offset is needed in case the blank line is replaced. The expected results for encoder test #1 were updated for the new output.
[commit 96060db9b7]
The offset and size could have been added to the output line, but this is insufficient for testing if lines are replaced and removed correctly. These operations have not been implemented yet, but will be shortly. Therefore, at the end of testing, all of the lines currently in the program model are output. If a line contains an error, the column, length and message of the error are output.
Included in the output is the index number of the line, the offset range of the line to verify that lines are inserted in the correct place with no gaps between lines, and the debug text output for the line. Blank lines take no space in the program code and so no offset range, so only the offset is output. The offset is needed in case the blank line is replaced. The expected results for encoder test #1 were updated for the new output.
[commit 96060db9b7]
Sunday, October 13, 2013
Program – Single Code Vector
The program model was modified to contain a single code vector of program words so that during execution, no handling of individual lines is needed. Program execution will simply flow from one line to the next as if it was a single block of code. This will allow for fast execution. The temporary line code vector that was added to the line info list was replaced with an offset into the single code vector and the code size of the line.
The code vector was previously just a QVector of the program words. However, the QVector class does not have an existing function for inserting another vector into a vector. Therefore, a new ProgramCode class was created based on the QVector class. This was similar to the ProgramLine that was previously implemented and then removed. This time, a new insert line routine was implemented to insert a vector (code for a line) into another vector (the single code for the program).
The new insert line routine does nothing if the line to insert is empty. Otherwise the program is first resized to allow for the new line. A hole is made for the new line if the insert point is not at the end of the program. Finally, the code of the line is copied into the program code.
The update line routine was modified (insert operation only) to insert the code for a line that does not have an error. The offset for the new line is determined. If the new line will be at the end of the program, the offset is set to the current size of the program, otherwise the offset is set to the offset of the line being inserted before. The size is set to the size of the line code, and the line is inserted into the program.
The update error routine was modified to return if the line being inserted has an error. This is used to determine if the code for the line is to be inserted into the program. If the line has an translator error, the line was not encoded, so there is no code to insert into the program, though information for the line is still inserted into the line info list.
The debug text routine previously just retrieved the code vector inserted into the line info list for a specified line. Since this code vector was removed, this routine was modified to calculate the address of the line by adding the offset for the line to the base address of the program code vector. The size is obtained from the new size added to the line info list.
[commit dd94ed0ef9]
The code vector was previously just a QVector of the program words. However, the QVector class does not have an existing function for inserting another vector into a vector. Therefore, a new ProgramCode class was created based on the QVector class. This was similar to the ProgramLine that was previously implemented and then removed. This time, a new insert line routine was implemented to insert a vector (code for a line) into another vector (the single code for the program).
The new insert line routine does nothing if the line to insert is empty. Otherwise the program is first resized to allow for the new line. A hole is made for the new line if the insert point is not at the end of the program. Finally, the code of the line is copied into the program code.
The update line routine was modified (insert operation only) to insert the code for a line that does not have an error. The offset for the new line is determined. If the new line will be at the end of the program, the offset is set to the current size of the program, otherwise the offset is set to the offset of the line being inserted before. The size is set to the size of the line code, and the line is inserted into the program.
The update error routine was modified to return if the line being inserted has an error. This is used to determine if the code for the line is to be inserted into the program. If the line has an translator error, the line was not encoded, so there is no code to insert into the program, though information for the line is still inserted into the line info list.
The debug text routine previously just retrieved the code vector inserted into the line info list for a specified line. Since this code vector was removed, this routine was modified to calculate the address of the line by adding the offset for the line to the base address of the program code vector. The size is obtained from the new size added to the line info list.
[commit dd94ed0ef9]
Program Model Update – Encoding
The program model needs to encode lines when an update signal is received once each line has been successfully translated. The program model update slot routine receives this signal from the edit box, which includes the line number, number of lines deleted, number of lines inserted, and a list of strings of the lines. The type of operations needed on the program is then determined (change, insert or remove lines) and calls the update line routine to perform the operation for each line affected.
The update line routine was modified to encode the line after a successful translate. A temporary program word vector was added to the line info list to the code for the line. The line info list currently holds a pointer to the translated RPN list (temporary), and an index to the error list if the line has an error. The program model will contain a single program word vector for the entire program unit with the line info list containing offsets and sizes of the lines within this vector. This will allow execution through the program without using time dealing with lines. Only the insert operation was modified to store the line code vector at this time.
The tester class encode input routine was modified to let the program model translate and encode the line, by calling the update slot routine directly to insert a single line to the end of the program. An access function to the RPN list pointer was added to the program model to get the RPN list for a line to determine if there was a translation error and to get the information about the error (column, length and message). The debug text routine was modified to take a line index argument instead of a program word pointer and a word count, which uses the line index to get the program line code and work count. Because the program model still possesses the RPN list, the encode input routine can no longer delete it.
As a result, a token memory leak occurred (which could previously be seen when running the GUI and then exiting) because the program model was not deleting the RPN lists contained in the line info list when the application exited. This was corrected by deleting all of the RPN lists in the program model destructor. The tester class run routine was modified not to report token errors after each line, which will be reported when the application terminates.
[commit 49b3231acb]
The update line routine was modified to encode the line after a successful translate. A temporary program word vector was added to the line info list to the code for the line. The line info list currently holds a pointer to the translated RPN list (temporary), and an index to the error list if the line has an error. The program model will contain a single program word vector for the entire program unit with the line info list containing offsets and sizes of the lines within this vector. This will allow execution through the program without using time dealing with lines. Only the insert operation was modified to store the line code vector at this time.
The tester class encode input routine was modified to let the program model translate and encode the line, by calling the update slot routine directly to insert a single line to the end of the program. An access function to the RPN list pointer was added to the program model to get the RPN list for a line to determine if there was a translation error and to get the information about the error (column, length and message). The debug text routine was modified to take a line index argument instead of a program word pointer and a word count, which uses the line index to get the program line code and work count. Because the program model still possesses the RPN list, the encode input routine can no longer delete it.
As a result, a token memory leak occurred (which could previously be seen when running the GUI and then exiting) because the program model was not deleting the RPN lists contained in the line info list when the application exited. This was corrected by deleting all of the RPN lists in the program model destructor. The tester class run routine was modified not to report token errors after each line, which will be reported when the application terminates.
[commit 49b3231acb]
Saturday, October 12, 2013
Encoder Class – Removal
The next step is to implement the code to insert the encoded lines into the program (currently the translated RPN lists are stored). Part of this process that is already implemented is to increment the use counts for dictionary items when a line is inserted into the program. The encoder handled this part. Related to this is when a line is removed from the program - the use counts need to be decremented for dictionary items that were on the line (deleting a dictionary item when it is no longer used).
This remove line process appeared to be mirror to the encode (add) line process and therefore the question arose whether the encoder class should also contain a remove routine. Looking at the current encoder class, it currently contained the single encode routine and no member variables (except for a reference to the table instance). It also required a pointer to the current program unit, which is only used to pass to the encode functions for each code with an operand. A reference to the encoder was not passed to the encode function since the encoder class did not contain anything that was needed.
So the conclusion was made that the encoder class was not really necessary and that the encode routine should be in the program model (which contains all the dictionaries needed for encoding) along with the remove routine that will be implemented. Therefore, the encoder class was removed and the encode routine was moved to the program model class.
[commit 85827d49e8]
This remove line process appeared to be mirror to the encode (add) line process and therefore the question arose whether the encoder class should also contain a remove routine. Looking at the current encoder class, it currently contained the single encode routine and no member variables (except for a reference to the table instance). It also required a pointer to the current program unit, which is only used to pass to the encode functions for each code with an operand. A reference to the encoder was not passed to the encode function since the encoder class did not contain anything that was needed.
So the conclusion was made that the encoder class was not really necessary and that the encode routine should be in the program model (which contains all the dictionaries needed for encoding) along with the remove routine that will be implemented. Therefore, the encoder class was removed and the encode routine was moved to the program model class.
[commit 85827d49e8]
Friday, October 11, 2013
Program – Unit Vs. Model
The original plan was for program unit class to contain the code and dictionaries for a single unit (main routine, subroutine, or function) and the program model to contain all the program units. The program model class contained the functions for manipulating the program (inserting, replacing and removing lines), which needed to be moved to the program unit class. However, these functions are triggered by signals from the edit box, and also generate signals for updating the program view dock widget. The program model class still needs to be connected to receive and generate these signals.
Eventually when subroutines and functions are implemented, additional edit box windows can be created for each program unit opened. Each edit box opened will be connected to a program unit. This implies that the program model should only contain a single program unit that will be connected to an edit box when opened for editing, and there will be a program model for each program unit. Something else will need to contain a list of all the program units.
Currently, the main window class contains the edit box and program model instances. It is logical that when subroutines and functions are implemented, the main window will contain the list of program units, which are really program unit models. As each program unit is opened for editing, the main window will create an additional edit box window.
Therefore, the program unit class members were merged into the program model class. While doing this, all the member variables were placed at the end of the class definition to follow the same style that Qt uses. This was also done with the program word class. The other classes that don't currently follow this convention will be modified at some future point.
The constructor of the program model class was modified to get the table instance directly instead of being passed the table instance as an argument. The table instance is then used to create the translator instance before proceeding to create the dictionaries. Eventually the constructor will need to be aware if a subroutine or function program unit is being created and get the translator instance along with pointers to the global dictionaries (like the constant and remark dictionaries) from the main routine program unit.
[commit f3b76d057c]
Eventually when subroutines and functions are implemented, additional edit box windows can be created for each program unit opened. Each edit box opened will be connected to a program unit. This implies that the program model should only contain a single program unit that will be connected to an edit box when opened for editing, and there will be a program model for each program unit. Something else will need to contain a list of all the program units.
Currently, the main window class contains the edit box and program model instances. It is logical that when subroutines and functions are implemented, the main window will contain the list of program units, which are really program unit models. As each program unit is opened for editing, the main window will create an additional edit box window.
Therefore, the program unit class members were merged into the program model class. While doing this, all the member variables were placed at the end of the class definition to follow the same style that Qt uses. This was also done with the program word class. The other classes that don't currently follow this convention will be modified at some future point.
The constructor of the program model class was modified to get the table instance directly instead of being passed the table instance as an argument. The table instance is then used to create the translator instance before proceeding to create the dictionaries. Eventually the constructor will need to be aware if a subroutine or function program unit is being created and get the translator instance along with pointers to the global dictionaries (like the constant and remark dictionaries) from the main routine program unit.
[commit f3b76d057c]
Sunday, October 6, 2013
Encoding – Second Phase (Tagged)
This concludes the implementation of the encoder for the planned components needed to getting all modules up to the run-time working. The next step is fully integrating the encoder into the program model, where lines are inserted into, placed and removed from the program. Before continuing, the source was tagged version v0.5.2.
[commit cf579cd389]
Subscribe to:
Posts (Atom)