Open source around Full BASIC

Building Full BASIC meant turning a 1987 standard into running code, and proving that the result really follows it. Two pieces of that work are useful beyond the app, so they are published under the MIT licence for anyone to use, check or improve.


Full BASIC Conformance Suite (FBCS)

github.com/Full-BASIC/full-basic-conformance · latest release v1.0.1 (2026-11-12) · MIT

An interpreter-independent conformance suite for ANSI X3.113-1987 Full BASIC (FIPS PUB 68-2) and ECMA-116, in the spirit of the classic NBS test programs for Minimal BASIC. As far as I know, nothing like it was publicly available for Full BASIC.

How it works

  • Every statement the suite makes about the language is a claim, written in its own words and citing the clause of the standard (it never reproduces the standard's text).
  • Each claim points to one or more small BASIC programs that decide it.
  • A runner executes them against any interpreter you can call from the command line. Python 3 standard library only; nothing to install.

Tests come in several types: SELF (the program checks itself), OUTPUT (exact expected output), REJECT (the interpreter must refuse a non-conforming program), FATAL and WARN (the right exception code at the right line), plus graphics tests that compare a log of drawing primitives.

python3 tools/run_suite.py --interpreter 'myinterp {file}' \
        --name 'MyInterp 1.0' --output results/myinterp.json

Results for Full BASIC

Test programs 2,085 — all passing
ANSI X3.113-1987 claims 1,270 (Core, Enhanced Files, Graphics, Fixed Decimal)
ECMA-116 claims 787 (BASIC-2 + Graphics)

The two conformance statements are generated from the results, so they only list claims whose tests pass: nothing is claimed by hand.


The ANTLR grammar

antlr/grammars-v4 — pull request #5202 · submitted 2026-11-14 · pending review · MIT

The parser of Full BASIC is built from an ANTLR 4 grammar written from scratch from the standard's syntax rules. A cleaned-up version — the same one the interpreter uses — has been contributed to grammars-v4, the community collection of ANTLR grammars, as basic/fullbasic/.

  • Split lexer and parser (FullBASICLexer.g4, FullBASICParser.g4), with no actions or predicates, so it builds for every ANTLR target (Java, C#, Python, JavaScript, C++, Go and others).
  • Covers the whole language, including the modules almost no implementation ever had: enhanced files, exception handling, graphics and fixed decimal.
  • Rules follow the numbering of the standard (§), so each one can be checked against its source.
  • Ships with 60 example programs taken from the conformance suite.

grammars-v4 had several BASIC dialects, but not the standard Full BASIC. Until the pull request is merged, the grammar can be followed on the PR itself.


Sources

The language is the same in the three published standards:

  • ANSI X3.113-1987, adopted by the U.S. government as FIPS PUB 68-2 (freely available).
  • ECMA-116, 1st edition, June 1986 (free download from Ecma International).
  • ISO/IEC 10279:1991.

Full BASIC, FBCS and the grammar are independent work. They are not affiliated with, endorsed by or certified by ANSI, NIST, Ecma International, ISO or the ANTLR project.


← Back to Full BASIC · Código abierto (español)