Before installing CINT on the All BASIC Cloud9 IDE, I built the current preproduction (6.0) version of CERN ROOT on my Utbuntu 12.04 LTS 64 bit laptop. It took about an hour to build. I have never built anything this big before. Gambas held the record until CERN ROOT CINT. ROOT is more than just a C/C++ interpreter. It has data modelling functions with a GUI canvas. (X11 based) Back to the reason for the post. I'm happy to announce that AIR's C++ BASIC (ccpbas) works with ROOT interpretively.
jrs@laptop:~/C_BASIC/cppbasic$ root
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 5.99/03 9 September 2013 *
* *
* You are welcome to visit our web site *
* http://root.cern.ch *
* *
* !!! THIS IS A PREPRODUCTION VERSION !!! *
* Please use 5.34 for any real work until *
* ROOT 6 is released. *
* *
*******************************************
ROOT 5.99/03 (heads/master@v5-99-03-01-661-ge3f3248, Nov 05 2013, 14:54:36 on linuxx8664gcc)
cling C/C++ Interpreter: type .? for help.
root [0] .?
Cling meta commands usage
Syntax: .Command [arg0 arg1 ... argN]
.q - Exit the program
.L <filename> - Load file or library
.(x|X) <filename>[args] - Same as .L and runs a function with signature ret_type filename(args)
.I [path] - Shows the include path. If a path is given -
adds the path to the include paths
.@ - Cancels and ignores the multiline input
.rawInput [0|1] - Toggle wrapping and printing the execution
results of the input
.dynamicExtensions [0|1] - Toggles the use of the dynamic scopes and the late binding
.printAST [0|1] - Toggles the printing of input's corresponding AST nodes
.help - Shows this information
root [1] .L demo.cpp
In file included from -:1:
In file included from input_line_16:1:
In file included from /home/jrs/C_BASIC/cppbasic/demo.cpp:2:
./cppbas.inc:42:9: warning: 'ADDRESS' macro redefined
#define ADDRESS &
^
/home/jrs/C_BASIC/root/include/mmprivate.h:113:9: note: previous definition is here
#define ADDRESS(B) ((PTR) (((B) - 1) * BLOCKSIZE + mdp -> heapbase))
^
root [2] CSTRING mystring = "This is a string.";
root [3] PRINT (LEFT$(mystring,4));
This
root [4] PRINT (RIGHT$(mystring,7));
string.
root [5] PRINT (MID$(mystring,5,4));
is a
root [6] PRINT (STR$(INSTR(mystring,"is")));
2
root [7] PRINT (LCASE$(mystring));
this is a string.
root [8] PRINT (UCASE$(mystring));
THIS IS A STRING.
root [9] PRINT (MCASE$(mystring));
This Is A String.
root [10] PRINT (LTRIM$(" This should not have leading spaces "));
This should not have leading spaces
root [11] PRINT (RTRIM$(" This should not have any trailing spaces "));
This should not have any trailing spaces
root [12] PRINT (TRIM$(" This should not have any leading or trailing spaces "));
This should not have any leading or trailing spaces
root [13] PRINT (SPLITPATH$("/Users/riveraa/myfile.txt",4));
/Users/riveraa
root [14] PRINT (SPLITPATH$("/Users/riveraa/myfile.txt",8));
myfile
root [15] PRINT (SPLITPATH$("/Users/riveraa/myfile.txt",12));
/Users/riveraa/myfile
root [16] PRINT (SPLITPATH$("/Users/riveraa/myfile.txt",16));
txt
root [17] PRINT (REVERSE$(mystring));
.gnirts a si sihT
root [18] PRINT ( REPLACE$(mystring,"string","Number") );
This is a Number.
root [19] .q
jrs@laptop:~/C_BASIC/cppbasic$
I thought I would give shot at fixing the ADDRESS conflict warning and change the following (unused) #define in his program.
#define ADDR &
jrs@laptop:~/C_BASIC/cppbasic$ root
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 5.99/03 9 September 2013 *
* *
* You are welcome to visit our web site *
* http://root.cern.ch *
* *
* !!! THIS IS A PREPRODUCTION VERSION !!! *
* Please use 5.34 for any real work until *
* ROOT 6 is released. *
* *
*******************************************
ROOT 5.99/03 (heads/master@v5-99-03-01-661-ge3f3248, Nov 05 2013, 14:54:36 on linuxx8664gcc)
cling C/C++ Interpreter: type .? for help.
root [0] .L demo.cpp
root [1] PRINT (UCASE$("it worked!"));
IT WORKED!
root [2] .q
jrs@laptop:~/C_BASIC/cppbasic$