ROSE  0.11.145.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Rosebud::RosettaGenerator Class Reference

Description

Generator that produces ROSETTA output.

Definition at line 8 of file RosettaGenerator.h.

#include <Rosebud/RosettaGenerator.h>

Inheritance diagram for Rosebud::RosettaGenerator:
Inheritance graph
[legend]
Collaboration diagram for Rosebud::RosettaGenerator:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< RosettaGenerator >
 
- Public Types inherited from Rosebud::Generator
using Ptr = GeneratorPtr
 

Public Member Functions

virtual std::string name () const override
 Every generator should have a unique name. More...
 
virtual std::string purpose () const override
 Single-line description for documentation. More...
 
virtual void adjustParser (Sawyer::CommandLine::Parser &) override
 Add command-line switches and documentation to a parser. More...
 
virtual void generate (const Ast::ProjectPtr &) override
 Generate code. More...
 
virtual std::string propertyDataMemberName (const Ast::PropertyPtr &p) const override
 Data member name for a property. More...
 
virtual std::vector< std::string > propertyAccessorNames (const Ast::PropertyPtr &) const override
 Accessor names for a property. More...
 
virtual std::vector< std::string > propertyMutatorNames (const Ast::PropertyPtr &) const override
 Mutator names for a property. More...
 

Static Public Member Functions

static Ptr instance ()
 
- Static Public Member Functions inherited from Rosebud::Generator
static void registerGenerator (const Ptr &)
 Register a backend for use later. More...
 
static const std::vector< Ptr > & registeredGenerators ()
 Return all registered backends. More...
 
static Ptr lookup (const std::string &)
 Return the registered generator with the specified name. More...
 
static void addAllToParser (Sawyer::CommandLine::Parser &)
 Add all known generator switches to parser. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Rosebud::CxxGenerator
virtual std::string machineGenerated (char commentType= '/')
 Return a title comment that says the file is machine generated. More...
 
virtual std::string ctorInitializerExpression (const Ast::PropertyPtr &, const std::string &expr)
 Expression for initializing a property in a constructor, or empty. More...
 
virtual std::string resetStatement (const Ast::PropertyPtr &)
 Statement to initialize a property. More...
 
virtual std::string dataMemberType (const Ast::PropertyPtr &)
 Type for the data member for a property. More...
 
virtual std::string initialValue (const Ast::PropertyPtr &)
 Initial value expression for the property. More...
 
virtual std::string valueType (const Ast::PropertyPtr &)
 Type of value for initializing a property. More...
 
virtual void genDestructor (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &)
 Emit code for the class destructor. More...
 
virtual void genDefaultConstructor (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, Access)
 Emit code for the class default constructor. More...
 
virtual void genArgsConstructor (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &, const Hierarchy &, Access)
 Emit code for the constructor with ctor_args property arguments. More...
 
virtual void genInitProperties (std::ostream &header, std::ostream &impl, const Ast::ClassPtr &)
 Emit code that initializes all local properties. More...
 
- Protected Attributes inherited from Rosebud::CxxGenerator
size_t outputWidth = 130
 

Member Function Documentation

virtual std::string Rosebud::RosettaGenerator::name ( ) const
overridevirtual

Every generator should have a unique name.

Implements Rosebud::Generator.

virtual std::string Rosebud::RosettaGenerator::purpose ( ) const
overridevirtual

Single-line description for documentation.

Implements Rosebud::Generator.

virtual void Rosebud::RosettaGenerator::adjustParser ( Sawyer::CommandLine::Parser )
overridevirtual

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 from Rosebud::Generator.

virtual void Rosebud::RosettaGenerator::generate ( const Ast::ProjectPtr )
overridevirtual

Generate code.

The specified project AST is used to generate code.

Implements Rosebud::Generator.

virtual std::string Rosebud::RosettaGenerator::propertyDataMemberName ( const Ast::PropertyPtr ) const
overridevirtual

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 from Rosebud::Generator.

virtual std::vector<std::string> Rosebud::RosettaGenerator::propertyAccessorNames ( const Ast::PropertyPtr ) const
overridevirtual

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 from Rosebud::Generator.

virtual std::vector<std::string> Rosebud::RosettaGenerator::propertyMutatorNames ( const Ast::PropertyPtr ) const
overridevirtual

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 from Rosebud::Generator.


The documentation for this class was generated from the following file: