Showing posts with label Tag. Show all posts
Showing posts with label Tag. Show all posts

Saturday, November 23, 2013

Recreator – RPN Lists (Tagged)

The recreator is now complete and all of the initial set of commands (LET, PRINT, INPUT, and REM) are fully supported.  The repository has been tagged v0.6.1 to mark this milestone.  Some minor issues were also corrected for this commit including:
  • Corrected an expected results for the recreated translator test #12 (INPUT tests).
  • Reorganized the access functions in the recreator class.
  • Renamed the recreator class is empty access function to output is empty so as not to be confused with the stack is empty function.
  • Renamed the recreator class last access function to the more explicit output last character and removed the output string is empty check.
  • Corrected some comment formatting and added some missing comments.
  • Corrected formatting issues where spaces were incorrectly added instead of tab characters (problems are caused by QtCreator editor bugs where is doesn't always pay attention to the spacing/tab settings).
  • Added some missing FLAG option comments (details below).
The next major step is to integrate the recreator with the GUI, but in order to do this, the program code of lines needs to be decoded into an RPN list of tokens for the recreator.  When a line is entered into the program, it will be recreated and the recreated text will replaced the entered text in the edit box.  Preferences will be added to control the formatting of the recreated output, for example, if spaces should be added around operators, after commas, etc.  The FLAG option comments show where checks for these options will be.

[commit 0cd7b84700]

Saturday, November 9, 2013

Recreator – Expressions (Tagged)

Expressions are now fully supported by the recreator.  All the expressions test recreate the original source correctly.  The next step is to add support for the first round of commands (LET, PRINT, INPUT and REM).  The first tag of the 0.6 development series was added, v0.6.0.

[commit 0dc1f0ebf5]

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]

Sunday, September 22, 2013

Encoding – First Phase - Revisited (Tagged)

The tokenCodes0.5 branch of development was successful so it was merged back into branch0.5 (a fast forward merge meaning the branch0.5 pointer was simply moved).

Since the commands.h header file will contain definitions for other things (like routines for constants), it was renamed to the more generic basic.h, which was also added as a dependency to the application binary in the CMake build file so that it appears in the Project source file list within QtCreator.

In the table entry initialization, it turns out that using "" (blank string) and NULL (pointer) for an initializer to a constant QString variable has the same effect, therefore, all "" were replaced with NULL in the table entries.

The first phase required for encoding is complete (again) except now it is now performed by the translator.  This is a good point to tag version v0.5.1.  Work will now begin again in encoding the tokens into the internal program code format to be stored in the program model.

[commit b461229bcd] [commit f64d4401d2]

Saturday, September 7, 2013

Encoder – First Phase Complete (Tagged)

The initial implementation of the encode is complete, which includes preparing the tokens for encoding.  Version v.0.5.0 has been tagged.  Work will now begin in encoding the tokens into the internal program code format.

[commit 6ed93f833c]

Friday, August 23, 2013

New Translator – Complete (Tagged)

The implementation of the new translator routines is now complete for all the items previously completed in the old translator routines (LET, PRINT, INPUT and REM, with the additional item of multiple statement support).  Before removing the old translator routines, this is a good place to set a tag even though it has been only three commits from the last tag.  This \will be the last commit that will contain the old translator routines.

Version v0.4.5 has been tagged.  All tests, including the new multiple statement test (#16) with the new translator routines.  Test #16 does not pass with the old translator routines since multiple statement support was never added (would have required a new colon token handler).  Some comments were added indicating items that need to be removed with the old translators, which will now commence.

[commit 51ef63448b]

Sunday, August 18, 2013

New Translator – INPUT Statements (Tagged)

The implementation of INPUT statement translation went fairly quickly using the new translation routines.  Only a couple of days were required using the new command centric translator routines, compared to well over a month using the old token centric translator routines.  This should be an indicator how the implementation should go for the rest of the BASIC commands.

The INPUT statements implementation in the new translator is now complete and version v0.4.4 has been tagged.  All tests still pass with the old translator routines.  All translator tests pass with the new translator routines with the exception of the REM statements (test #15) as this has not been implemented yet.  Some slight cleanup was done with the latest commit along with updating the files for v0.4.4.  Implementation of REM statements and operators can now commence in the new translator.

[commit 00815b4bac]

Thursday, August 15, 2013

New Translator – PRINT Statements (Tagged)

A minor parser issue was discovered with how the length of double word command tokens were being set, which was noticed with the "not yet implemented" errors not pointing at the entire INPUT PROMPT command.  The token length was only being set to the length of the second word plus one for the space.  This was corrected by setting the token length to the current position (first character after the second word) minus the starting column of the first word.  This also takes into account if more than one space is entered between the two words.

The PRINT statements implementation in the new translator is now complete and version v0.4.3 has been tagged.  All tests pass with the old translator routines (after some corrections were made).  All translator tests pass with the new translator routines with the exception of the INPUT and REM statements as these have not been implemented yet.  Some minor cleanup was done with the latest commit along with updating the files for v0.4.3 (see the commit log for details).  Implementation of INPUT statements can now commence in the new translator.

[commit bd608f5cf3] [commit 0e316f71ce]

Thursday, August 1, 2013

New Translator – LET Statements (Tagged)

The implementation of LET statements including multiple assignments and sub-string assignments in the new translator is now complete and version v0.4.2 has been tagged.  All tests pass with the old translator routines (after some corrections were made).  All expressions tests and all assignment statements in the translator tests pass in the new translator routines.  Some minor cleanup was preformed with the latest commit along with updating the files for v0.4.2 (see the commit log for details).  Implementation of PRINT statements can now commence in the new translator.

[commit a5d3434fbe]

Friday, July 5, 2013

New Translator – Parentheses Expressions (Tagged)

The implementation of expressions for all tokens with parentheses including open and closing parentheses is now complete.  The new translator routines now fully support expressions and version v0.4.1 has been tagged.  Note that expression test #1 currently still fails with the regression and memory test scripts because of problems with the expression mode in the old translator routines.  The new translator routines run all expression tests successfully.  Implementation of command translation can now commence in the new translator.

[commit ac6658f16f]

Sunday, June 30, 2013

New Translator – Simple Expressions (Tagged)

The implementation for simple expressions is now complete in the new translator and version v0.4.0 has been tagged.  Note that expression test #1 currently fails with the regression and memory test scripts because of problems with the expression mode in the old translator routines.  The new translator routines run this test successfully, but should not yet be used on any of the other expression tests.  Also, parser errors are not yet handled correctly by the new translator routines, but this is going to require a major change to how token errors are handled.

[commit 552aa6176a]

Friday, April 5, 2013

Program Model Translator Integration Complete

The translator (with the parser) has now been integrated with the program model, though for now, the program model is only holding the translated RPN lists of the program lines (or error information).  Eventually, the program model will hold the compiled program lines, but the encoder that will do this compiling has not yet been implemented.

The next step is to highlight any translator errors in the edit box.  But first, this is a good point to make a development release.  The release related files were updated, along with some minor file clean up, for a new release and the repository was given the tag v0.3.4.

[commit 2a19163e3c]

Saturday, March 23, 2013

Initial Program Model Complete

There were some minor problems with the Save As action causing it to not work as desired, namely the file name was incorrectly defaulting to "." and the directory of the file saved was not being remembered.  The default file name was set to "." in the attempt to use the current directory, but the get save file name dialog saw this as the file name with no directory and used the directory the program was started in.  The string "./" should have been used.

The way it should be working is that the file name should start with the current file name giving the user the option to replace it or modify it.  If the user doesn't change the file name, the dialog will issue a warning asking if the file should be overwritten.  If the current file is untitled, then the default file name will be set to the current directory, and the dialog will contain a blank file name.  After the file is saved successfully, the current directory (that gets saved in the program settings upon exit) is set to the directory of the saved file.

Now it is time to start hooking up the parser and translator between the edit box and program model.  But first, this is a good point to make a development release.  The release related files were updated for a new release and the repository was given the tag v0.3.3.

[commit 143f449330] [commit f95a3d8d55]

Saturday, March 9, 2013

Line Change Detection Complete

The detection of program line changes should now be complete.  This feature is necessary so that program lines can be incrementally compiled as they are modified.  Even though the implementation was starting to look rather complicated, it turned out to be fairly simply, which was mostly concentrated in the processing of the edit box document's contents change signal that contained sufficient information to report line changes.  From the time the new implementation was started, the size of the edit box code was reduced by about half and the previous implementation wasn't complete.

The next step is to connect the new program changed signal from the edit box to some new program class that will eventually hold the BASIC program code, though the goal of the current 0.3.x release series is to get the translator part hooked up.  However, this is a good point to make a development release.  In preparation for this, there was some minor cleanup of the code:
  1. Renamed the edit box line number widget related functions with the consistent prefix of lineNumberWidget (separate commit).
  2. Corrected a memory leak of the edit box instance by assigning the main window as its parent.
  3. Removed the setting of the ignore change flag at the end of the edit box key press event handler (this flag is now only used when a new program is set).
  4. Updated the copyright of the modified files and a few other very minor changes.
The various files (CMake, read me, and release notes) were updated for this development release and the code was given the tag v0.3.2.

[commit a2cfa5361a] [commit a13c485632]

Monday, January 21, 2013

Edit Box For Program Entry

Now that some additional GUI has been implemented, it is time to start to work on the edit box to make it more appropriate for editing a program and not just text.  The immediate goal is to accept BASIC code that is currently recognized by the parser and translator, parse and translate it and display the translation in a dock widget beside the edit box.  (A dock widget is a widget that can be moved or docked to any side of the application window or detached completely from the window.)

For an incremental compiler, the application will need to know when a line has been edited (when the user leaves a modified line) so that the line can be recompiled (for now translated), which could be several lines (by a deletion when multiple lines were selected, or a paste of several lines).  Also, the font of the edit box needs to be changed to a fixed width font and there needs to be a way to add color, for example, indicating errors and syntax highlighting of BASIC keywords and other program elements.

As seen so far, this will be accomplished with the text cursor that is part of the QTextEdit's document.  The document part of QTextEdit is one continuous string of characters, but there is a way to retrieve and replace individual lines within the document.  All this needs to be figured out, which will take place over the next several commits.

But first, with additional GUI implemented and working, this is a good place to tag for v0.3.1.  The various files (CMake, read me and release notes) were updated for this development release.

[commit a938626ffc]

Tuesday, January 1, 2013

Base GUI Complete

All the basic GUI elements have now been added, so this is a good place to tag the release, which was tagged with the name v0.3.0.  The various files (license, read me, release notes, etc.) were updated for this development release.

It was also noticed the about box (nor the test output) contained the full GPL statement, only the copyright and warranty statements.  The CommandLine class was updated to reflect this, but the test output was not changed so that the regression tests continue to pass.  The About box was updated to contain the full GPL statement along with the required Oxygen icons license statement and web links.

The original release numbering is again being used.  While Git did sort the tags as desired with the '-' developmental release before the '.' official release (so v0.2.0 will be listed after v0.2-6); GitHub (on the tags page) appears to only look at the numbers ignoring the separator characters, so v0.2.0 is sorted before v0.2-1 instead of after v0.2-6, which could be very confusing even though a fuzzy time of the release is listed, it's not obvious, and there is no way to sort by this time.

Since all 0.x releases are development releases, there is no reason to have development development releases.  For now on, only the last one of the development release series will be uploaded to Sourceforge, whatever is release number is at that point.  The source code of the others can be downloaded as archives from GitHub on the tags page.  The release number for any patches needed for an official release will simply increment the last (patch) number and re-uploaded.

[commit 4f0378e72c]

Sunday, December 9, 2012

Qt Transition – Release

The Qt transition is now complete and the implementation of the GUI can begin.  But first this is a good point to make a development release.  Release 0.2.0 was made (branch0.2 was merged to the master branch and tagged v0.2.0).

There is one issue when running the program on Windows when starting the program from Explorer.  A console window is opened underneath the GUI (About box), which is closed upon exit.  This can be removed by adding the WIN32 option to the add_executable command in the CMake build file.  However, this causes the command line options to no longer work.  This issue will be resolved later.

Archive files containing the source files and binary files (with test files) have been uploaded to SourceForge.  For Windows, there is also the ibcp‑libs.zip file that contains all the dynamic linked libraries required to run the program if the MinGW and QtSDK packages have not been installed (extract in the ibcp directory).  Linux should already have the required libraries installed.

This concludes the 0.2 development series.  Implementation of the GUI elements will now begin with the 0.3 development series.

[commit 85d28cd9e5]

Saturday, December 8, 2012

GUI Preparation

The 0.2 development series is going to conclude with the program displaying its about box and then exiting.  The GUI elements will be added in the 0.3 development series.  Before adding the about box, some modifications to existing classes are needed, which will occur over the next set of commits.  But first, this is probably a good time to create the v0.2-6 tag as there have been 11 commits since the last development tag.

The base GUI is already present in the program, which was added by default when the main window class was created by new class wizard in QtCreator.  This GUI only contains a blank menu bar, tool bar and status bar.  If it was activated, the only thing present beside the window title (with the normal minimize, maximum, close, etc. icons) would a blank window with an empty tool bar that can be docked (more on this later) on any of the four sides of the window.

However, the program is not currently activating this window because it exits with a usage message if no options were present on the command line.  The command line and tester classes need some minor modifications before the about box can be implemented, which will contain information that will be obtained from the command line class (version, GPL statement, etc.).

[commit 6f55c2ffae]

Sunday, November 18, 2012

Qt Application – Main Function

Another convention of Qt applications is that the main() function goes in the main.cpp source file, so the ibcp.cpp source file was renamed (and the CMake build file was updated).

While reviewing the CMake documentation, I discovered that there is a specific FindGit module, so it is not necessary to use the more generic find_program command.  The CMake build file was updated to use the find_package with the FindGit module (by using the Git argument).  There is no specific module for finding the Awk program, so this will remain using the generic find_program command.

Note: For now on instead of saying the changes have been pushed to GitHub, the specific commit ID (short form) will be put at the bottom of the post with a direct link to the commit on GitHub that is associated with the post (instead of a generic link to the Git repository, which is on the right under Downloads).  The post will also be given the GitHub label.  Recent posts are being updated to this convention.

I also noticed that the patch version number in the CMake file hasn't been updated for recent development tags.  This is not an issue when building from a source directory with the Git repository, but is when building from downloaded archives from GitHub.  So to set things straight going forward, tag v0.2-5 was added with the correct patch number in the CMake file.

[commit 381d30da1a]

Monday, November 12, 2012

Constant Access Getter Functions

Class member functions that do not modify the class instance should be defined to indicate this, which is coded as a trailing const on the function inside the class definition:
class MyClass {
    int value;
    ...
public:
    int value(void) const
    {
        return m_value;
    }
    int valueSquared(void) const;
}
If the function body is defined in class source file instead in the class definition in the header file, the trailing const is also necessary:
int MyClass::valueSquared(void) const
{
    return m_value * m_value;
}
The functions in the Table, Token and Translator classes that don't modify the instances were made constant functions.  The Parser class doesn't have any non-modifying access functions.  The getToken() function was also renamed to the more consistent token().  This is a good place to create another development tag: v0.2-4.

[commit  af69957e69]