cid-compiler 0.1
Sponsored Links
cid-compiler 0.1 Ranking & Summary
File size:
0.098 MB
Platform:
Any Platform
License:
BSD License
Price:
Downloads:
1335
Date added:
2006-03-07
Publisher:
Markus W Weissmann
cid-compiler 0.1 description
cid-compiler is a language tool to easily create C code with object oriented features. Its compiler generates header (.h) files and implementations (.c) from a specification file (.i).
The generated C code consists of a struct, a opaque pointer to it (in the header file) and rewritten functions. The defined functions will get prefixed with the class name, they will also get a new first argument that is a pointer to the newly defined struct.
Functions that do not have a return value are considered constructors and will not get a new 1st argument but will automatically get a return value of pointer to the struct. The place between @class "name" and @attributes is e. g. for include statements and will make it into the header file.
To ease renaming the class, you can use the define CLASS, which will always be a define to a pointer of the new struct type.
Interface example
@class cstring
#include < stdio.h >
#include < string.h >
@attributes
char *c;
@methods
new(char *n) {
CLASS i = NEWCLASS;
i->c = strdup(n);
return i;
}
int length() {
return strlen(this->c);
}
@end
will yield a cstring.h file:
#ifndef _CSTRING_H_
#define _CSTRING_H_
#include < stdio.h >
#include < string.h >
typedef struct cstring *cstring;
cstring cstring_new(char *n);
int cstring_length(cstring this);
#endif
and a cstring.c file:
#include "cstring.h"
#define CLASS cstring
#define NEWCLASS malloc(sizeof(struct cstring));
#define NEWCLASS_M malloc(sizeof(struct cstring));
#define NEWCLASS_C calloc(1,sizeof(struct cstring));
struct cstring {
char *c;
};
cstring cstring_new(char *n) {
CLASS i = NEWCLASS;
i->c = strdup(n);
return i;
}
int cstring_length(cstring this) {
return strlen(this->c);
}
Issues:
The current compiler (v0.1) will reject quite some valid C code. Also the given error is not very helpful;
The generated C code consists of a struct, a opaque pointer to it (in the header file) and rewritten functions. The defined functions will get prefixed with the class name, they will also get a new first argument that is a pointer to the newly defined struct.
Functions that do not have a return value are considered constructors and will not get a new 1st argument but will automatically get a return value of pointer to the struct. The place between @class "name" and @attributes is e. g. for include statements and will make it into the header file.
To ease renaming the class, you can use the define CLASS, which will always be a define to a pointer of the new struct type.
Interface example
@class cstring
#include < stdio.h >
#include < string.h >
@attributes
char *c;
@methods
new(char *n) {
CLASS i = NEWCLASS;
i->c = strdup(n);
return i;
}
int length() {
return strlen(this->c);
}
@end
will yield a cstring.h file:
#ifndef _CSTRING_H_
#define _CSTRING_H_
#include < stdio.h >
#include < string.h >
typedef struct cstring *cstring;
cstring cstring_new(char *n);
int cstring_length(cstring this);
#endif
and a cstring.c file:
#include "cstring.h"
#define CLASS cstring
#define NEWCLASS malloc(sizeof(struct cstring));
#define NEWCLASS_M malloc(sizeof(struct cstring));
#define NEWCLASS_C calloc(1,sizeof(struct cstring));
struct cstring {
char *c;
};
cstring cstring_new(char *n) {
CLASS i = NEWCLASS;
i->c = strdup(n);
return i;
}
int cstring_length(cstring this) {
return strlen(this->c);
}
Issues:
The current compiler (v0.1) will reject quite some valid C code. Also the given error is not very helpful;
cid-compiler 0.1 Screenshot
cid-compiler 0.1 Keywords
NEWCLASS
CLASS
C code
To Easily
Object Oriented
Easily Create
create c
language tool
CString
c
struct
define
new
return
cid-compiler
cidcompiler
Bookmark cid-compiler 0.1
cid-compiler 0.1 Copyright
WareSeeker periodically updates pricing and software information of cid-compiler 0.1 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of cid-compiler 0.1 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
c codes
c code examples
structural pest control board
c c code
c code for matrix multiplication
zip codes
structural engineering
c code snippets
s c code of laws
structured settlement
structuralism
d c code
c code display string reverse
c code generator
structured settlements
structural steel
define renaissance
turbo c code
Related Software
Struct::Compare is a recursive diff for perl structures. Free Download
Class::Simple is a simple Object-Oriented Base Class. Free Download
The Complex Language project is an object oriented programming language intended for scripting or rapid apps prototyping. Free Download
XCOM project is a system designed to support component based programming in Linux. Free Download
XML::XMLWriter is a Perl module for creating a XML document object oriented with on the fly validating towards the given DTD. Free Download
C::Include is a package to easy operate with binary data via describing they like C/C++ structs. Free Download
AModules3 is a flexible framework for developing applications using Object Oriented Programming. Free Download
CGI::Kwiki::New is the default new wiki generator for CGI::Kwiki. Free Download
Latest Software
Popular Software
Favourite Software