xylemical / code-generator
Converts the object model into code.
dev-master
2022-07-23 12:56 UTC
Requires
- php: >=8.0
- xylemical/code: dev-master
- xylemical/token: dev-master
Requires (Dev)
- xylemical/composer-dev-bundle: ^0.1.0
This package is auto-updated.
Last update: 2025-03-23 18:54:47 UTC
README
Converts the simple object model into different code outputs, by defining syntax generators and code styles.
Install
The recommended way to install this library is through composer.
composer require xylemical/code-generator
Usage
use Xylemical\Code\Generator\Generator; $syntax = ...; // A syntax generator defined by \Xylemical\Code\Generator\SyntaxInterface. $styles = [...]; // Styles defined by \Xylemical\Code\Generator\StyleInterface. $generator = new Generator($syntax, $styles); $definition = ...; // Any definition from the object model library of \Xylemical\Code. print $generator->generate($definition);
License
MIT, see LICENSE.