Good evening everybody.

First: What is Genesis?
Genesis is a Precompiler which can Precompute C++ like Classes and convert them to LiteC

What is the Goal?
The goal is to extend LiteC with Class-Features(Inheritance, virtual methods). While Genesis converts the c++ classes to LiteC code, it starts the LiteC compiler afterwards to do the final step. Output is captured.

What is working:
  • write Classes C++ like
  • Can include Fieldvars
  • Can include Methods
  • you can derove one class from another
  • methods are correctly overwritten
  • you can define a method as virtual, and it will work like it does in real C++
  • define your own constructors/destructors with extended parameters(constructor ONLY)
  • a final constructor is automatically created. Use _ClassName(my parameters) to create your instance
  • use Super(this) to call the parent version of an overriden method
  • 'this' paremeter is always defined inside a method. Currently you call methods like MYObject.Foo(MyObject).
    An autofill will be added
    later for simple notation.
  • all Class objects can be casted in usual LiteC way.
  • Property ClassName and ParentClassName is set automatically. They are part of the CBaseClass(DO NOT MODIFY)
  • Objects are removed with "delete(MyObject);"
  • use include statements. Including another .cxx file auotriggers compiling for this file(as LiteC does). Other
    filetypes(.c, .h are
    added to includes but not precomputed)
  • write normal functions (functions which are not part of a class).

as of version 0.4:
  • You can define Global vars
  • You can define global function dummies
  • You can define structs (its yet not possible to define values at the end)
  • You can define (lazy) enums. You cant set custom values. Each value in an enum is unique
  • New warnings for possible wrong/missing return statements
  • You dont have to add the instancepointer to the method call manually anymore. Its automatic^^
  • super() is obsoleted. You can finally use ParentClass:ParentMethod() to call methods from a parentclass
  • Showing alternative matchind identifier(not yet used everywhere)
  • Showing LiteC Errors correctly in log

as of version 0.5:
  • Bugfix: stringcontent is ignored now when parsing methodcontent.
  • Its now possible to use single and/or multiline comments.
  • You can now use private/protected/public to define the accessspecifiers as you do in C++
  • Implicit "this". Inside a method, you no longer need to write "this" before accessing a member of this instance.
  • for each(<LokalVar> in <List>). to get your class work with the for each loop, just derive it from CForEachObject and implement the 3 methods defined there
  • new/delete can be used as in C++ now(only for classes and no arrays atm). You dont have to write "_ClassName" to construct an object. Just write "new ClassName". And "delete" can be used without brackets now.
  • Required Compilerfiles(CBaseObject, CForEachObject) are automatically copied to your project folder. You dont have to put them in your folder manually anymore


Currently, GPC is available in 2 versions:
GPC: the Precompiler with GUI. Just open your mainfile(.cxx) and let it run.
GPCC: The commandline Precompiler. You can use it with CodeBlocks for example(where GCC is normally required). After successfully precompiling, it starts the LiteC
compiler on your system. Doubleklick GPCC.exe for more info(or ask here if required^^). GPCC captures the LiteC error to and marks
the faulty line for you(well, CodeBlocks does with the info provided by GPCC).

GPCC should work with IDEs where GCC is working too.


PS: Just in case, Put BaseClass.cxx into your projectfolder. It might not be copied and cause LiteC error(missing file). I'll fis this in a futire version.

Download(On my Blog)

If you find any Bugs, please tell me.

EDIT: Small tutorial on how to use it with CodeBlocks
Tutorial

Greetings
Rackscha

Last edited by Rackscha; 02/04/12 13:02.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development