#if(0) c++ -pipe -xc++ -fpermissive -w --include ptsvubas.cc -o "${0%.*}.exe" "$0" ; exit $? /* BASIC language subset/dialect in C++ Authors: NASZVADI, Peter and pts@fazekas.hu, 2017 All rights reserved, free for educational purpose only, which must be noncommercial! Cannot remove or alter lines 3-8! */ /* This is a standalone c++ file, which allows basic code to be compiled as c++ code. There are at least two ways. The first: # c++ -pipe -xc++ -fpermissive -w --include ptsvubas.cc -o YOURFILE.exe FOOBAR.bas from CLI should be invoked the upper line in order to complie the FOOBAR.bas basic code. In that case, do not include "ptsvubas.cc" from basic source! The second way is: eliminate "--include ptsvubas.cc" from the command line above and make sure that the basic source contains #include "ptsvubas.cc" in its first lines before "BEGINBASIC(...)" line. Implemented a BASIC language dialect/subset, with the following restrictions: - All variables and statements must be allcaps - All lines must begin with a line number from 1 to 32767 - All lines must have a trailing semicolon - One statement per line (except IF-THEN) - "THEN" must NOT be followed by a "GOTO" nor "GOSUB"! - Implemented keywords: --- IF THEN