Skip to content

Releases: dmsc/tbxl-parser

Version 9

24 Oct 00:03
Compare
Choose a tag to compare

The mayor change in this version as adding support for PROC with parameters and local variables, converted to standard TurboBasic XL code on output. Note that currently the parser adds too many extra variables, an optimization pass that removes unused variables will be added later.

There are other minor new features:

  • Check all EXEC targets and print error if not matching to the corresponding PROC.
  • Allows the "-o" option to specify an output file name extension.

And other code changes:

  • Cleanup the PEG parser to use standard constructs to parse most tokens.
  • Use a common dynamic array implementation for all the arrays in the code.
  • Cleanup warnings when compiled with GCC -Wextra.

Version 8

21 Oct 02:58
Compare
Choose a tag to compare

The code was restructured so that old parser to statements and tokens was completely removed, now the source code parses directly to an expression tree. This simplifies the code but does not affect any of the current output.

As part of the restructuring many small bugs were fixed:

  • Some subtle buffer overflows.
  • Crashes in the parser on some statement combinations and errors in definitions.
  • Enabling and disabling of individual optimizations.
  • Unsupported parsing of some GET/PUT/%GET/%PUT variants.

And some minor enhancements:

  • Printing numbers in long-output with full precision.
  • Output $defines in the long-output as is.

Version 7.1

12 Oct 04:50
Compare
Choose a tag to compare

This version adds more optimization passes and fixes some minor bugs:

  • Added tree new optimization passes:
    • commute, swap arguments to binary operations to minimize running time and binary size.
    • line_numbers removes all Basic line numbers that are unused, this allows producing a smaller file.
    • const_replace, replaces repeated constant values (numeric or string) with a variable initialized to the value. The initialization code is added before any statement in the program, and tries to use the minimum number of bytes possible.
  • Fixes minor memory leak and allocation bugs.

Version 6

04 Oct 05:03
Compare
Choose a tag to compare

This is a major release, with two big features added:

  • Support for parser directives, adding options, defines and binary file inclusion.
  • Added an optimizer, currently performs constant folding and replacing of small values with %*.

A major change is that the parser now outputs binary tokenized files by default, instead of the short listings. To get the old behavior, use the "-s" option.

A full list of changes from version 5 is:

  • Make parsing error messages more specific, indicating if a numeric or string expression is expected.
  • Adds parsing of "$options" directive.
  • Adds an "extended" mode to the parser that is stricter with the spacing before tokens, this allows using variable names that are problematic in the original TurboBasic XL.
  • Fixes variable names starting with "REM".
  • Adds a tree-based optimizer, that transforms the tokenized program to an expression tree and back again. All optimizations operate in the tree representation.
  • Adds a constant-folding optimization pass.
  • Adds an optimization pass that converts numbers from 0 to 3 to %0 to %3.
  • Adds support for "definitions" to the parser, those are similar to C defines.
  • Adds a directive to include binary files to a string define.
  • Makes default output mode the binary tokenized format.

Version 5

21 Sep 02:27
Compare
Choose a tag to compare

This release adds more complete error reporting:

  • Always report errors with the file name and file line number.
  • Fixes corner cases parsing variable names that are prefixes to statement names, and document current behavior.
  • Parse TIME$= with spaces before the equal sign.
  • Fixes an error when splitting lines in the short listing mode.
  • Check variable names with statement/token list and warn on problematic names.

Version 4.1

19 Sep 14:40
Compare
Choose a tag to compare

This version is a minor fix to detect and return error on invalid line numbers.

Version 4

19 Sep 02:40
Compare
Choose a tag to compare

Another minor bug-fixing release, fixes:

  • Make '' generate a single backslash inside string constants.
  • Fixes parsing of label after RESTORE statements.
  • Allows parsing of empty files.
  • Allows UTF8 BOM at the start of input files (this gives better compatibility with UTF8 files in Windows).
  • Give a better message when generating long listings of programs with errors.

Version 3

12 Sep 19:30
Compare
Choose a tag to compare

This is as bug-fixing release, fixes many problems:

  • Handling of IF/THEN statements is now fully supported in the short and binary output formats.
  • Fixed a bug on length calculation for some lines.
  • Fixes writing of '%0'-'%3' tokens.
  • Correctly transform IF/THEN on the long output.
  • Keeps track of user supplied line numbers, include a minimal comment if no statements are left.

Version 2

07 Sep 02:00
Compare
Choose a tag to compare

This version supports extended strings, see README and samples.