Monday, June 24, 2013

Translator – New Design

The Translator will be redesigned to change it from token centric to command centric.  This includes how expressions are processed, meaning the processing of expressions needs to be changed from being fed tokens to getting tokens from the parser as needed.  This should make for a much simpler design by eliminating the various states and modes used to determine how tokens get processed and for the checks in determining errors when they are detected.

This will be a major undertaking, so it will be down in steps.  For the moment, the original translator code will be left in place and the new routines will be added along side the old ones.  Some thought needs to be given to how the program will be executed at run time to determine how the program needs to be translated.  These will be covered in upcoming posts.

To get started, the Remark token type was removed since it was not being used.  Remarks are either handled as a command token (REM) or an operator token (').  Also, since it will be needed, the valgrind suppressed errors file needed to be updated.  For some reason, the previously generated file was no longer sufficient.  The memory test did pass when version 0.3.5 was generated, but building this version today now generates additional memory errors.  All these errors occur within the Qt libraries and can be ignored.

[commit 61dc082425] [commit 98aee21078]