#include <pattern_based_code_generator.hh>
Inheritance diagram for mpcl::text::codegen::TPatternBasedCodeGenerator:
Public Methods | |
TPatternBasedCodeGenerator (const TString &rkySOURCE_CDML_FILE, const TString &rkyCDML_PATH) | |
TPatternBasedCodeGenerator (void) | |
Builds a new instance without loading any CDML document. | |
void | clear (void) |
Resets values removing all instructions. | |
void | clearCode (void) |
Clears code from all clauses. | |
void | compile (void) |
void | loadFrom (const TString &rkySOURCE_CDML_FILE) |
void | preprocessVariables (void) |
void | setDescription (const char *pkcSOURCE_DESCRIPTION) |
void | setCdmlPath (const TString &rkyCDML_PATH) |
const TStringToVariableMap & | variables (void) const |
bool | existsVariable (const char *pkcVARIABLE_NAME) const |
const TInstructionBody & | operator[] (const char *pkcINSTRUCTION_NAME) const |
TInstructionBody & | operator[] (const char *pkcINSTRUCTION_NAME) |
Protected Methods | |
void | initConstants (void) const |
Initializes pattern-length constants if needed. | |
void | inheritFrom (const TString &rkySOURCE_CDML_FILE) |
void | read (std::basic_istream< char_type, traits_type > &rtSOURCE_STREAM) |
void | write (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const |
As its name says, its function is, given a CDML file, an instruction name, and a clause name, it generates the corresponding code.
CDML (Code Description Mark-up Language) is a language that defines a matter of generating parameterizable code. Each CDML file can inherit from another CDML file (just one), but this means that only instructions/clauses that already stand in father CDML file, can be (re)defined. Variables can't contain other variable tags.
Definition at line 70 of file pattern_based_code_generator.hh.
|
Builds a new instance from a CDML file.
Definition at line 37 of file pattern_based_code_generator.cc. References initConstants(), loadFrom(), and mpcl::text::TString. |
|
Makes the CDML file to inherit from no other CDML file. It really only empties yInherit value and makes substitutions of entity '&eoc;'. Definition at line 148 of file pattern_based_code_generator.cc. |
|
Returns true if there is a variable named pkcVARIABLE_NAME.
|
|
Inherits from another CDML file.
Definition at line 264 of file pattern_based_code_generator.cc. References loadFrom(), and mpcl::text::TString. Referenced by read(). |
|
Loads a CDML file.
Definition at line 92 of file pattern_based_code_generator.cc. References mpcl::text::Format(), read(), and mpcl::text::TString. Referenced by inheritFrom(), and TPatternBasedCodeGenerator(). |
|
Gets the instruction body corresponding to instruction pkcINSTRUCTION_NAME. This member function is a synonym of instruction().
Definition at line 250 of file pattern_based_code_generator.hh. |
|
Gets the instruction body corresponding to instruction pkcINSTRUCTION_NAME. This member function is a synonym of instruction().
Definition at line 238 of file pattern_based_code_generator.hh. |
|
Preprocess entities on variables. Definition at line 205 of file pattern_based_code_generator.cc. References mpcl::text::codegen::InstantiateEntities(). |
|
Loads the instance from stream rtSOURCE_ISTREAM.
Definition at line 283 of file pattern_based_code_generator.cc. References mpcl::text::Format(), mpcl::text::codegen::TClauseTagString::hasTarget(), inheritFrom(), mpcl::text::codegen::TClauseTagString::overloadFrom(), and mpcl::text::TString. Referenced by loadFrom(). |
|
Sets path for loading CDML files.
Definition at line 229 of file pattern_based_code_generator.cc. References mpcl::text::TString. |
|
Updates attribute yDescription.
Definition at line 220 of file pattern_based_code_generator.cc. |
|
Gets the variable map.
Definition at line 655 of file pattern_based_code_generator.cc. |
|
Writes the instance onto stream rtTARGET_OSTREAM.
Definition at line 735 of file pattern_based_code_generator.cc. |