JB to C (toy) translator
 
Main idea:
The question "how far one could go until it gets too complex".

Goals are:
* make a thing that converts working BASIC program to compilable working C
* really REALLY (!) limited subset of BASIC
* don't even think of GUI

"really limited subset of BASIC" initially is:
* numerical variables are double
* no arrays
* no string support except constants in PRINT/INPUT (for prompts, like "input x" or "y=")
* no sub/function or even GOSUBs
* operators:
	PRINT
	INPUT
	assignment (=)
	IF
	FOR
	timer$("ms") - just to measure how fast our endless loops are!
* no attempts at expression rewriting, that is, x+1 will be passed as is, x^2 will be passed as is and of cource would not work in C
* no error checking - supposed to get correct working program as input

Uses  tcc.exe, Tiny C Compiler.
Project started Dec 11 2013

--------------------------------------------------------------
 v.1.0, Dec 25 2013
Ok, initial project goals are met so I call it v.1.0
Uploaded to Just BASIC Files Archive Site.

supports:
* numerical variables (as C double)
* print, input ("print 1" now works too, internally fixed to "print 1.0")
* text constants in print, input (to be used as prompts)
* for (with optional step, negative step works too)
* if (only block version, with "end if" and optional "else")
	BASIC conditions and logic functions are converted to C ones (<> to !=, AND to && etc)
* assignment (expressions are left as is,
	except "=time$("ms")" changed to "=clock()" - quick hack to allow program timing)
Only single operator on a line.
Extra:
* '-style comments converts to //comments
* unrecognized lines converted to //??? comments
* labels and GOTO are implemented. So you can simulate WHILE loops.
* output indented (for and if)

--------------------------------------------------------------
 v.1.1, Dec 28 2013
* added:
	EXIT FOR
	WHILE/WEND, EXIT WHILE
	DO/LOOP (all variants), EXIT DO
*demo file for version 1.1
	demo1.1.bas
	(demo for previous version named demo1.0.bas)
* added function returning version (jb2cConv.ver$(), jb2cGUI.ver$()),
	version info displayed in Help/About
* major rewrite - operators in select case ordered alphabetically
* added this file

--------------------------------------------------------------
 v.1.2, Dec 30 2013
added:
* Several operators on a line, like
    x=1: y=2
* continuation lines, like
    print "x=", _
        x, "y=", y
* single-line IF, like
    IF condition then operator
    IF condition then operator1[: operator 2]
    IF condition then operator1[: operator 2] else operator 3[: operator 4]
    , you know.
    - two IF on single line will fail.

--------------------------------------------------------------
 v.1.3, Dec 31 2013
 Changed:
 * better PRINT handling
    separated by (;) prints without gaps
    separated by (,) prints via TAB
    print without new line
        print ends by (;)
        print ends by (,)
* nested single line IF
    actually, only form that makes sense is
    IF cond1 THEN op1 ELSE IF cond 2 THEN op2 ... ELSE opElse

--------------------------------------------------------------
GUI change
 v.1.1, Dec 31 2013
* log pane converted from texteditor to listbox.
    Now, if you get error after compiling, like
        temp.c:26: ';' expected
    and double click on it, "Generated C source" pane will position
    just above offending line (in ths case - on line 25).
    Because often, cause of error is on previous line.
* better handling of compiler output:
    now it checks compiler return codes (creates files for "ok" or "fail")
    instead of checking for presence of EXE file.

--------------------------------------------------------------
 convertor v.1.4, Jan 11 2014
 Fixed:
 * a case then unterminated string in PRINT hang convertor
    (I am not saying it will not hang - there basically no error checking -
    it'll just not hang in this special case)
 Added:
 * RND(1) support
 (RND, RANDOMIZE, and initial call to srand(time(0));)

 GUI v.1.2, Jan 11 2013
 Added:
 * option for RND support
 * option for math support (basically, to include MATH.H)
    - not used yet

--------------------------------------------------------------
 convertor v.1.5, Jan 22 2014
 Added:
 * math support
    included <math.h>, some functions aliased
    int() and abs() skipped for now
    MOD and ^ postponed until expression gets rewritten


--------------------------------------------------------------
 convertor v.1.6, Jan 29 2014
 Added: 
 * built-in min, max: (required changing parsing print arguments)

 GUI v.1.3, Jan 29 2013
 Added:
 * option for built-in min, max support
 Changed: 
 * asking for binary options converted to function

--------------------------------------------------------------
 convertor v.1.7, Feb 01 2014
 Added: 
 * data/read/restore
  - No "restore label" yet
  - Read past end of data ends program with message
    ERROR: Read past end of data
 * cls (thanks to Plus3Code for C equivalent)

--------------------------------------------------------------
 convertor v.1.8, Feb 02 2014
 Added: 
 * run
  - run command
  - run command, mode
    only min, max (no hide or noActive)

--------------------------------------------------------------
 convertor v.1.9, Feb 02 2014
 Changed:
 * restore label
 is supported.
 Attempt to restore non-existing label, say
   restore 21
 ends up with C compiler message
   'restore_lbl_21' undeclared
   
--------------------------------------------------------------
 convertor v.1.10, Feb 03 2014
 Changed:
* numeric expressions are passed through numExprRewrite$(expr$)
  function, which does some search/replace.
  So here we got:
  - abs(), int() now supported (if MATH support is ON).
  So we have all math functions except MOD and ^ (!)
  - case is fixed to all functions. So Sin(), RND() all works
  - numExprRewrite$ called in condRewrite$ too, 
    so same things work in conditions.

