Saturday, February 14, 2009

Using CINT - C/C++ Interpreter - Basic Commands

L that load files into interpreter, and file that list these loaded files.
cint.exe> L iostream
cint.exe> files
  0 fp=0x781c1bd0 lines=13   file="iostream"
  1 fp=0x781c1bf0 lines=479  file="iostream.h"
  2 fp=0x781c1c10 lines=11  *file="iosenum.h"
  3 fp=0x781c1c30 lines=34   file="bool.h"
  4 fp=0x781c1c50 lines=173 *file="_iostream"
If we use #include in curly bracket, we will get the same result
cint.exe> {#include <iostream>}
cint.exe> files
  0 fp=0x781c1bf0 lines=13   file="iostream"
  1 fp=0x781c1c10 lines=479  file="iostream.h"
  2 fp=0x781c1c30 lines=11  *file="iosenum.h"
  3 fp=0x781c1c50 lines=34   file="bool.h"
  4 fp=0x781c1c70 lines=173 *file="_iostream"
U command unload a file, a C/C++ header file can include other header files, which in turn can include additional header files and so all. CINT is good enough and maintain this dependencies so if we unload one file, others referenced files may get unloaded also.
cint.exe> L string
cint.exe> files
  0 fp=0x781c1bd0 lines=11   file="string"
  1 fp=0x781c1bf0 lines=72   file="_string"
  2 fp=0x       0 lines=0    file="string.dll"
  3 fp=0x781c1c10 lines=13   file="iostream"
  4 fp=0x781c1c30 lines=479  file="iostream.h"
  5 fp=0x781c1c50 lines=11  *file="iosenum.h"
  6 fp=0x781c1c70 lines=34   file="bool.h"
  7 fp=0x781c1c90 lines=173 *file="_iostream"
cint.exe> U string
cint.exe> files
reset reset interpreter environment and unload all files
cint.exe> {int a=1;}
cint.exe> {a;}
cint.exe> reset
cint.exe> {a;}
Error: Symbol a is not defined in current scope  (tmpfile)(1)
!!!Dictionary position rewound... !!!Error recovered!!!
cint.exe> L vector
cint.exe> files
  0 fp=0x781c1bd0 lines=11   file="vector"
  1 fp=0x781c1bf0 lines=18   file="_vector"
  2 fp=0x       0 lines=0    file="vector.dll"
  3 fp=0x       0 lines=0    file="vectorbool.dll"
  4 fp=0x781c1c10 lines=313  file="_vector.h"
  5 fp=0x781c1c30 lines=282  file="function.h"
  6 fp=0x781c1c50 lines=34   file="bool.h"
  7 fp=0x781c1c70 lines=235  file="algobase.h"
  8 fp=0x781c1c90 lines=55   file="_pair.h"
  9 fp=0x781c1cb0 lines=17   file="_iterator"
 10 fp=0x781c1cd0 lines=668  file="_iterator.h"
 11 fp=0x781c1cf0 lines=6    file="stddef.h"
 12 fp=0x781c1d10 lines=479  file="iostream.h"
 13 fp=0x781c1d30 lines=11  *file="iosenum.h"
 14 fp=0x781c1d50 lines=173 *file="_iostream"
 15 fp=0x781c1d70 lines=177  file="defalloc.h"
 16 fp=0x781c1d90 lines=34   file="new.h"
 17 fp=0x781c1db0 lines=34   file="stdio.h"
 18 fp=0x       0 lines=0    file="stdfunc.dll"
 19 fp=0x781c1dd0 lines=14   file="stdlib.h"
 20 fp=0x  476800 lines=19   file="limits.h"

-- Press return for more -- (input [number] of lines, Cont,Step,More)
cint.exe> reset
cint.exe> files

No comments: