Генерация исходных текстов программ - Пример кодогенерации
// ## begin module%1.3%.codegen_version preserve=yes // Read the documentation to learn more about C++ code generator versioning.//## end module%1.3%.codegen_version //## begin module%395AF70D0321.cm preserve=no // %X% %Q% %Z% %W% //## begin module%395AF70D0321.cp preserve=no //## Module: MyString%395AF70D0321; Pseudo Package specification #ifndef MyString_h //## begin module%395AF70D0321.additionalIncludes preserve=no //## begin module%395AF70D0321.includes preserve=yes //## begin module%395AF70D0321.additionalDeclarations preserve=yes //## begin MyString%395AF70D0321.preface preserve=yes //## end MyString%395AF70D0321.preface //## Class: MyString%395AF70D0321 // Данный класс позволяет проводить различные операции class MyString //## begin MyString%395AF70D0321.initialDeclarations preserve=yes public: //## Constructors (generated) MyStringQ; //## Destructor (generated) // ## Assignment Operation (generated)MyString &; operator=(const MyString &right); // ## Equality Operations (generated)int operator==(const MyString &right) const; int operator!=(const MyString &right) const; //## Other Operations (specified) //## Operation: GetStringSize%395AF87900E9 Int GetStringSize (Char *massiv // Указатель на массив //## Operation: PrintString%395AF88800B9 //## Operation: CmpString%395AF892013F Char *Str2 // Указатель на второй массив //## Operation: CpyString%395AF89COOD5 //## Get and Set Operations for Class Attributes (generated) const Int get_Stat () const; //## Attribute: Count%395AF8C20148 void set_Count (Int value); // Additional Public Declarations protected: //## end MyString%395AF70D0321.protected private: //## Get and Set Operations for Class Attributes (generated) //## Attribute: TmpString%395AF8B201E5 const Char * get_TmpString () const; void set_TmpString (Char * value); // Additional Private Declarations //## end MyString%395AF70D0321.private private: //## implementation //## begin MyStrmg::TmpString%395AF8B201E5.attr preserve=no // private: Char * U Char *TmpString; //## begin MyString::Stat%395AF8BB0289.attr preserve=no public: Int U Int Stat;//## end MyString::Stat%395AF8BB0289.attr //## begin MyString::Count%395AF8C20148.attr preserve=no public: Int U Int Count;//## end MyString::Count%395AF8C20148.attr // Additional Implementation Declarations //## end MyString%395AF70D0321.implementation }; //## begin MyString%395AF70D0321.postscript preserve=yes // Class MyString // ## Get and Set Operations for Class Attributes (inline)inline const Char * MyString::get_TmpString () const { //## begin MyString::get_TmpString%395AF8B201E5.get preserve=no return TmpString; //## end MyString::get_TmpString%395AF8B201E5.get inline void MyString::set_TmpString (Char * value) //## begin MyString::set_TmpString%395AF8B201E5.set preserve=no TmpString = value; //## end MyString::set_TmpString%395AF8B201E5.set } inline const Int MyString::get_Stat () const { //## begin MyString::get_Stat%395AF8BB0289.get preserve=no inline void MyString::set_Stat (Int value) { //## begin MyString::set_Stat%395AF8BB0289.set preserve=no inline const Int MyString::get_Count () const inline void MyString::set_Count (Int value) { //## begin MyString::set_Count%395AF8C20148.set preserve=no //## begin module%395AF70D0321.epilog preserve=yes //## end module%395AF70D0321.epilog #endif
Читайте также:
|
