cid-compiler
Details
| Size: | 98K |
| Last Update: | 2008-05-15 22:22:56 |
| Version: | 0.1 |
| OS Support: | Linux |
| License/Program Type: | BSD License |
| Publisher: | Markus W Weissmann |
| Price: | $0.00 |
Description:
cid-compiler 0.1 is code generators software developed by Markus W Weissmann.
cid-compiler is a language tool to easily create C code with object oriented features. It's 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 supports different languages (including english). It works with Linux.
Downloading cid-compiler 0.1 will take several seconds if you use fast ADSL connection.
0 comments
Add to
cid-compiler Version History
Related Software
|
|
From category: Libraries |
| AudioFile::Info::MP3::ID3Lib 1.05 is libraries software developed by Dave Cross. AudioFile::Info::MP3::ID3Lib is a Perl extension to get info from MP3 files. This is a plugin for AudioFile::... |
|
|
From category: Libraries |
| Data::TreeDumper::Renderer::GTK 0.01 is libraries software developed by Khemir Nadim ibn Hamouda. Data::TreeDumper::Renderer::GTK is a Gtk2::TreeView renderer for Data::TreeDumper. SYNOPSIS\... |
|
|
From category: Libraries |
| DateTime::Format::Epoch 0.10 is libraries software developed by Eugene van der Pijli. DateTime::Format::Epoch is a Perl module that can convert DateTimes to/from epoch seconds. SYNOPSIS \... |
|
|
From category: Bug-Tracking |
| XPTracker is a radical alternative agile planning tool.... |
|
|
From category: Version-Control |
| Syncro SVN Client makes easier the document and code sharing between content authors or developers.... |
|
|
From category: Libraries |
| Audio::OSS 0.0501 is libraries software developed by David Huggins-Daines. Audio::OSS is a pure-perl interface to OSS (open sound system) audio devices. SYNOPSIS use Audio::OSS qw(:... |
|
|
From category: Libraries |
| C++ Machine Objects 0.9.4 is libraries software developed by Eduard Hiti. C++ Machine Objects class library supports a subset of the UML statechart notation for implementing hierarchical state mach... |
|
|
From category: Assembler-Tools |
| Custom Eclipse Builder 0.1 is assembler tools software developed by Alexander Bretz. Custom Eclipse Builder is a lightweight Ant-based project to build a company and personal customized Eclipse di... |
|
|
From category: Perl-Modules |
| DBIx::Record is a middle tier system for representing database records as objects.... |
|
|
From category: Assembler-Tools |
| POMStrap is a little opensource (BSD License) application bootstrap designed to avoid the Java library dependency headache.... |
|
|
From category: Quality-Assurance-and-Testing |
| Apache AntUnit 1.0 Beta 2 is quality assurance and testing software developed by Apache Ant Development Team. AntUnit is a library of Ant tasks that was initially developed to write tests for Ant t... |
|
|
From category: Libraries |
| core2 1.0.1 is libraries software developed by Zwetan Kjukov. core2 project is a library that extends the ECMAScript built-in objects: Array, Boolean, Date, Error, Function, Number, Object, and Str... |
|
|
From category: Libraries |
| CrissCross 0.5.2 is libraries software developed by Steven Noonan. CrissCross is a small cross-platform C++ library for threading, console and file I/O, CPU identification (CPUID), and sockets (TCP... |
|
|
From category: Libraries |
| Audio::TagLib::Shell 1.42 is libraries software developed by Dongxu Ma. Audio::TagLib::Shell is a mini shell of Audio::TagLib. SYNOPSIS $> perl -MAudio::TagLib::Shell -e shell... |
|
|
From category: Bug-Tracking |
| Bugzilla 2.23.3 is bug tracking software developed by The Mozilla Organization. Bugzilla project is server software designed to help you manage software development. Bugzilla is a \"Defect T... |
Leave a comment