theCompiler 10.0
NHI1 -
theKernel -
theLink -
theConfig -
theSq3Lite -
theCompiler -
theBrain -
theGuard
|
extend "C" to the MAX
Well, "C" is the most famous programming language in the world and the basis for almost everything in the computing world. The strategic goal in metaprogramming is to use the existing C programming language and add new language features that are used for integration.
All types are checked at compile time by default (like C)
int
, double
etc A class-type is available and, like C, is also a static type, but can be checked at runtime if necessary (upgrade cast).
Unlike C++ there is a root class MkObjectC and thus there is no need for a template or generic-type "nightmare" like in C++
All functions and names (including class, method and attribute) are unique and are therefore easily locatable via the TAG file.
The general name-syntax is:
usage | syntax | example |
---|---|---|
instance method | PrefixClassMethod(Class hdl, ...) | (runtime) MK_BUF MkBufferAppendSTR(MK_BUF const buf, MK_STRN const val) |
class method | PrefixClassAttribute(...) | (static,runtime) MK_BUF MkBufferHandleResolve(MK_HDL const netHdl) |
virtual method | MkObjectMethod(Object hdl, ...) | (runtime) void MkObjectLog(MK_OBJN const obj, MK_OBJ fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl) call (runtime) void MkBufferLog(MK_BUFN const buf, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl) ... |
The name-syntax is not fixed, the name in a specific target-langugage follow by default the "C" style but using the target-language-syntax, example for C#:
usage | syntax | example |
---|---|---|
instance method | hdl.Method(...) | doc_mk_cs_BufferAppendSTR |
class method | Class.Attribute(...) | doc_mk_cs_BufferHandleResolve |
virtual method | obj.Method(...) | doc_mk_cs_ObjectLog doc_mk_cs_BufferLog ... |
But even the target-language-syntax is not fixed and can be changed, example: use underscore
notation :
usage | syntax | other syntax |
---|---|---|
instance method | PrefixClassMethod(Class hdl, ...) | prefix_class_method(Class hdl, ...) |
class method | PrefixClassAttribute(...) | prefix_class_attribute(...) |
virtual method | MkObjectMethod(Object hdl, ...) | prefix_object_method(Object hdl, ...) |
To add a new feature into C additional code is required (e.g. class). However, the required code is NOT written by the programmer or the compiler (C++), but inserted DIRECTLY into the source code (.c or .h) by the alc-compiler-toolset , where the code ends up in release management where it is then safe and is verifiable.
gcc
, the alc-compiler generate valid source-code, configuration-data etc used by a specific tool (like javac
) as input. like C, memory must be allocated and deallocated, but unlike C and C++, a pointer can be checked for validity or invalidity
gcc
, make
, ctage
, vim
, etc