ROSE 0.11.145.192
|
Base class for backend code generators.
Definition at line 10 of file Generator.h.
#include <Rosebud/Generator.h>
Public Types | |
using | Ptr = GeneratorPtr |
Public Member Functions | |
virtual void | adjustParser (Sawyer::CommandLine::Parser &) |
Add command-line switches and documentation to a parser. | |
virtual std::string | name () const =0 |
Property: Every generator should have a unique name. | |
virtual std::string | purpose () const =0 |
Property: Single-line description for documentation. | |
virtual void | generate (const Ast::ProjectPtr &)=0 |
Generate code. | |
virtual std::string | propertyDataMemberName (const Ast::PropertyPtr &) const |
Data member name for a property. | |
virtual std::vector< std::string > | propertyAccessorNames (const Ast::PropertyPtr &) const |
Accessor names for a property. | |
virtual std::vector< std::string > | propertyMutatorNames (const Ast::PropertyPtr &) const |
Mutator names for a property. | |
void | commandLine (const std::vector< std::string > &) |
Property: Entire Rosebud command line. | |
const std::vector< std::string > & | commandLine () const |
Property: Entire Rosebud command line. | |
Static Public Member Functions | |
static void | registerGenerator (const Ptr &) |
Register a backend for use later. | |
static const std::vector< Ptr > & | registeredGenerators () |
Return all registered backends. | |
static Ptr | lookup (const std::string &) |
Return the registered generator with the specified name. | |
static void | addAllToParser (Sawyer::CommandLine::Parser &) |
Add all known generator switches to parser. | |
Protected Member Functions | |
std::string | generatedByRosebud (const std::string &prefix) |
Return a multi-line comment that this file was generated by Rosebud. | |
using Rosebud::Generator::Ptr = GeneratorPtr |
Definition at line 15 of file Generator.h.
|
inlinevirtual |
Definition at line 28 of file Generator.h.
|
inlineprotected |
Definition at line 31 of file Generator.h.
|
inlinevirtual |
Add command-line switches and documentation to a parser.
Any command-line switches and documentation that is specific to the backend are added to the specified parser. In order to not conflict with other backends that might also be adding switch parsers, the backend should create a switch group and give it a unique prefix.
Reimplemented in Rosebud::RosettaGenerator, Rosebud::SawyerGenerator, and Rosebud::YamlGenerator.
Definition at line 48 of file Generator.h.
|
pure virtual |
Property: Every generator should have a unique name.
Implemented in Rosebud::NoneGenerator, Rosebud::RosettaGenerator, Rosebud::SawyerGenerator, and Rosebud::YamlGenerator.
|
pure virtual |
Property: Single-line description for documentation.
Implemented in Rosebud::NoneGenerator, Rosebud::RosettaGenerator, Rosebud::SawyerGenerator, and Rosebud::YamlGenerator.
|
pure virtual |
Generate code.
The specified project AST is used to generate code.
Implemented in Rosebud::NoneGenerator, Rosebud::RosettaGenerator, Rosebud::SawyerGenerator, and Rosebud::YamlGenerator.
|
virtual |
Data member name for a property.
Returns the name of the class data member that stores the value of the property. The returned value must be a valid C++ name for the property data member. Each property has exactly one data member.
Reimplemented in Rosebud::SawyerGenerator, and Rosebud::RosettaGenerator.
|
virtual |
Accessor names for a property.
Returns a list of zero or more C++ member function names to use as accessor names. If no names are returned, then no accessor functions are declared or defined.
Reimplemented in Rosebud::RosettaGenerator.
|
virtual |
Mutator names for a property.
Returns a list of zero or more C++ member function names to use as mutator names. If no names are returned, then no mutator functions are declared or defined.
Reimplemented in Rosebud::RosettaGenerator.