Main > Programming > Code Generators >

cid-compiler 0.1

cid-compiler 0.1

Sponsored Links

cid-compiler 0.1 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 6 (1 times)
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;

cid-compiler 0.1 Screenshot

Advertisements

cid-compiler 0.1 Keywords

Bookmark cid-compiler 0.1

Hyperlink code:
Link for forum:

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

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
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