KlemC Reference Manual(preliminary)
Order dependencies are minimized.
Elimination of many of the syntax requirements.
Semicolon';' not required at the end of most instructions.
Parenthesis'()' is not required around if equations.
Brackets '{}' are not needed..
Debug shows how the code got to the bad spot.
History of previous failures is available. The date and time of each failure is present.
Multiple failures that are the same will be noted in the debug file.
Better modularization of code.
Documentation can be included with the code.
Documentation can be changed whenever the code changes.
Compilation string is in the code. No research has to be done to compile the package.
Any shell like execution, can automatically be run.
A KlemC program is divided into sections. Each section command must be at
KlemC section | Options | Purpose |
INCLUDES |
| Contains '#include' statements. |
TYPEDEFS | proto/noProto | Contains '#define' and '#typedef' statements. These statements should not have any dependencies on other statements. |
DEFINES | proto/noProto | Contains '#define' statements that may have dependencies on previous '#define' and '#typedef' statements. |
VARIABLES | proto/noProto globals/threads | Contains global variables. |
ROUTINES | proto/noProto | Contains routines that are not attached to an object. |
OBJECT objectName | proto/noProto routines/variables “pointer†| Contains object routines or variables. |
EXECUTE |
| This contains the shell commands needed to compile the generated code. It may also contain commands to install and or test the code. |
DOCS |
| This contains man style documentation. |
proto = The prototypes and inline code for this section will be placed in a programName.h file.
globals = The variables specified in this section will be global for all threads.
threads = The variables specified in this section will have a unique copy for each thread.
routines = This section will contain routines that belong to the object.
variables = This section contains variables that belong to the object.
KlemC type | C type |
char | char |
uchar | unsigned char |
short | short |
ushort | unsigned short |
int | int |
uint | unsigned int |
long | long int |
ulong | unsigned long int |
llong | long long int |
ullong | unsigned long long int |
float | float |
double | double |
string | char |
cstring | const char |
@category.subject – Short description
@category.nextSubject – Short description
This section is to create man style documentation. The cman routine will display the documentation.
Each entry is layered by category, and then the subject.
@category.subject – Short description
DOCROUTINE [objectName] "searchPhrase"
This keyword will list all routine prototypes for the routines that exist in the source code.
objectName – The object name.
This keyword will list all the variables that belong to the given object.
“searchPhrase†– List all descriptions that start with this phrase.
“searchPhrase†– List all typedefs that start with this phrase.
This keyword will list all statements in the TYPEDEF sections that start with searchPhrase.
“searchPhrase†– List all typedefs that start with this phrase.
This keyword will list all statements in the DEFINE sections that start with searchPhrase.
This keyword will list all the document descriptions that have the given search phrase.
name – The name of the #typedef variable.
fileName – The KlemC file to include
This keyword is used to tell KlemC to also use the given file.
noProto – This is the default. Do not put the code in this section in the main(xxx.cc) file.
Proto – Put the code in this section in the header(xxx.h) file.
noProto – This is the default. Do not put the code in this section in the main(xxx.cc) file.
Proto – Put the code in this section in the header(xxx.h) file.
VARIABLES globals/threads [noProto/proto]
globals – These variables will be global for all threads.
threads – These variables are global for each separate thread.
noProto – This is the default. Do not put the code in this section in the main(xxx.cc) file.
Proto – Put the code in this section in the header(xxx.h) file.
noProto – This is the default. Do not put the code in this section in the main(xxx.cc) file.
Proto – Put the code in this section in the header(xxx.h) file.
This section is for general routines that are not attached to an object.
OBJECT name variables/routines [proto/noProto] [“pointerâ€]
variables – The code in this section is the variables used in the object.
threads – The code in this section is routines owned by the object.
noProto – This is the default. Do not put the code in this section in the main(xxx.cc) file.
proto – Put the code in this section in the header(xxx.h) file.
OBJECT varObj variables “varObjPtr->â€
void varObjSet(int a, cstring *name)
This section is used to tell KlemC what to do after successfully generating the C code.
DEBUG type printfPhrase printfVars …
debugGeneral | 0x1 | General debug statement. |
debugDetail | 0x2 | Detail debug statement. |
debugMoreDetail | 0x4 | More details. |
debugRoutines | 0x10 | General routine statement. |
debugRoutinesEnd | 0x20 | End of a general routine statement. |
debugBase | 0x100 | Base debug statement. |
debugBaseEnd | 0x200 | Base end statement. |
PrintfVars – The variables specified by ege printfPhrase.
DEBUGLIST object “destPtrâ€
object – The object name to debug.
destPtr – A pointer to the string buffer that will contain the dump of the object.
This command will dump the values of all the variables in the given object.
Contact Dave Klemer (davidKlemer@yahoo.com)