CCC(ID:5018/ccc001)


Extension to C/C++ to enable automatic creation of classes when they return NULL

From paper:

"CCC, a class is define by a condition, and a class hierarchy is a condition hierarchy. When a message is sent the system checks conditions that define classes, finds a class whose condition is satisfied and has no subclass whose condition is satisfied, and executes the method that is associated with the class. "


Related languages
C => CCC   Extension of
C++ => CCC   Extension of

References:
  • Yasunori Harada, Kenichi Yamazaki "CCC - An Object Oriented C Extention with Conditonally Defined Classes" IPSJ Transactions on Programming Vol.42 No.SIG02 - 006 view details Abstract: We sometimes use a NULL pointer to indicate a list structure termination in C or C++ programming. Because NULL is not an object of a C++, we can not define a NULL class. So in C++ programming, an if statement, if (pointer) pointer->|message(É); is used for a NULL related method call. This problem is because of C++ and other object oriented languages use their own object structure for object implementation. When a programmer wants to treat a special data structure (ex. NULL, data packet, system call É) as an object, such kind of problem occurrs. We propose a new language, CCC, that extends C and C++ to overcome the above problem. In CCC, a class is define by a condition, and a class hierarchy is a condition hierarchy. When a message is sent the system checks conditions that define classes, finds a class whose condition is satisfied and has no subclass whose condition is satisfied, and executes the method that is associated with the class. Using such a mechanism, we can treat a NULL pointer as a NULL class. CCC compiler is implemented as a C and C++ preprocesser. Its other features are class-local macro definition/extraction, a source modifying mechanism for inserting blocks, and class independent modules. This paper also describes an experience using CCC to develop a symbol manipulating language whose pointers include tag information.