An initial dump of ideas for a php generator
- use composer and symfony console tools for cli manipulation
- pluggable architecture
components needed - configuration parsing scanning? (helper for generating definitions) templating
An initial dump of ideas for a php generator
components needed - configuration parsing scanning? (helper for generating definitions) templating
An example of definitions/classes.php could be:
<?php
$class = new ClassSymbol("SomeClassName");
$class->AddMethod(
"MethodName",
[
"static" => false,
"const" => true,
"virtual" => true,
"pure_virtual" => false,
"protected" => false,
"return_type" => "const int*",
"description" => "This method does this and that",
"parameters" => new Parameters() //Will think on this later
]
);
Peg\Application->GetSymbolsTable()->AddClass($class);
//etc...
I actually have quite a bit of that already done in one fashion - see https://github.com/gtkforphp/generator/tree/master/lib/objects - - we'll need to set up the proper hierarchy - module -> package (actually this is namespace but namespace is a reserved word - we'll have similar issues with clas) -> class -> method but also namespace -> function or just package->function - then for both return values and parameters they are subclasses of args - and we should probably do a "documentation" type with info to fill in docblocks, etc
Also I didn't mention it much but we should make this with a pluggable front-end
So we can have peg-cli and peg-gtk adn peg-web versions for people to play with ;)
I love sqlite the problem with sqlite is that i cant use a text editor in case i want to manually modify or fix something on the definitions/cache.
Before using json the original wxphp developer used serialize/unserialize but if editing was required it was almost impossible.
Php format sounds good, but parsing a huge php file would surely take some time and memory too.
In my experience json hasnt been bad and wxWidgets is a huge library check https://github.com/wxphp/wxphp/blob/master/json/classes.json
Anyways if we choose php I would be happy, everything would PHP xd even template files :D it would just require a little bit more of work at first.