CLIP home page

Extensions in compiler and preprocessor


All words beginning with HASH_ are translated by the preprocessor into hashstr("HASH_....."). We need this to reduce the number of files included. And, instead of writing #define HASH_asdf 12345678 #define HASH_qwerty 231423534 and so on, we may simply use HASH_.... key words in the program text, e.g. do case case HASH_asdf case HASH_qwerty .... endcase You may be sure that, if you come accross a set of HASH_asdf symbols in different prg files, the result will be identical, as if the word had been announced via #define.
The preprocessor can get data from the environment, for instance:
#define $USER will be actually translated into #define uri In particular, you may use CLIP_LANG environment variable to change the language spoken by clip libraries. For example:
export CLIP_LANG=LANG_RUSSIAN
there are some predefined constants: __FILE__ __BASE_FILE__ __LINE__ __VERSION__ __CLIP__ __SYSTEM__ __DATE__ __TIME__
New preprocessor command is added - #xdefine - being the same as #define, but insensible to the case of macros name announced.
The set of options may be written into .cliprc file, and the latter may be put into the home or current directory.
In addition to std.ch, some more automatically included head files may be written by putting in .cliprc file strings like: -U std.ch -U clip.ch -U config.ch
Compiler options are not in full compliance with the standard Clipper compiler, error and warning messages being not in compliance at all. But we believe that this incompliance will not give you great troubles.
The compiler can decode source codes in various Russian codes during the compilation, i.e. you may write programs in DOS and, without tricks, make them in UNIX. The only restriction: file names must be in the lower case.
The compiler can generate

Libraries are made of O files by standard librarians.
Libraries are made of PO files by clipar utility.
GET command has been changed, formerly it called _GET_ internal function, and now it calls GETNEW with added parameters.
Now, in run-time, you may download a pseudocode (code blocks) from files; For example, mylib.prg is being done, in which func myfunc1 return 1 func myfunc2 return 2 command is being done clip -p mylib.prg, as a result, mylib.po file with a pseudocode inside appears.
During the operation of any program, you may write: load("mylib.po") ? myfunc1() ? myfunc2()
In addition to outdev and outerr, one more output stream into log file was made. SET(_SET_LOGLEVEL,num_level) // sets debug level SET(_SET_LOGFILE,filename) // sets log file name; if it isn't set, the whole output will be directed into <program_name>.log OUTLOG(level, <list ,,,>) // if the level isn't indicated, or the first indicated parameter isnt't a number, this information will ALWAYS be output into log file irrespective of current debug level. For applied logging, use levels 1 to 3; level 4 gives information on called functions compiled as a byte code; level 5 outputs information on all functions called.
Note - log file isn't removed, therefere you need to do this yourselves.

As an explanation and recommendation: we would use