1 #ifndef Rosebud_Generator_H
2 #define Rosebud_Generator_H
3 #include <Rosebud/Utility.h>
5 #include <Sawyer/CommandLine.h>
21 static std::vector<Ptr> registry_;
40 static Ptr
lookup(
const std::string&);
57 virtual std::string
name()
const = 0;
60 virtual std::string
purpose()
const = 0;
90 static void initRegistry();
static Ptr lookup(const std::string &)
Return the registered generator with the specified name.
virtual void adjustParser(Sawyer::CommandLine::Parser &)
Add command-line switches and documentation to a parser.
std::shared_ptr< Project > ProjectPtr
Shared-ownership pointer to a Project.
Rosebud is a tool to generate code for ROSE.
static const std::vector< Ptr > & registeredGenerators()
Return all registered backends.
Base class for backend code generators.
The parser for a program command line.
std::shared_ptr< Generator > GeneratorPtr
Shared-ownership pointer to a Generator.
virtual void generate(const Ast::ProjectPtr &)=0
Generate code.
virtual std::vector< std::string > propertyMutatorNames(const Ast::PropertyPtr &) const
Mutator names for a property.
static void addAllToParser(Sawyer::CommandLine::Parser &)
Add all known generator switches to parser.
virtual std::string name() const =0
Every generator should have a unique name.
virtual std::string purpose() const =0
Single-line description for documentation.
std::shared_ptr< Property > PropertyPtr
Shared-ownership pointer to a Property.
virtual std::string propertyDataMemberName(const Ast::PropertyPtr &) const
Data member name for a property.
static void registerGenerator(const Ptr &)
Register a backend for use later.
virtual std::vector< std::string > propertyAccessorNames(const Ast::PropertyPtr &) const
Accessor names for a property.