CompileDES  3.09
Executable-Code Generation from Synchronised libFAUDES Automata
cgp_codegenerator.h File Reference

Code-generator common base class. More...

Detailed Description

Definition in file cgp_codegenerator.h.

#include "libfaudes.h"
#include "cgp_eventconfig.h"

Go to the source code of this file.

Classes

class  CodeGenerator
 Code-generation common base. More...
struct  CodeGenerator::LineAddress
 Compiled record per input line. More...
struct  CodeGenerator::FlagExpression
 Compiled record per input flag-expression. More...
struct  CodeGenerator::TimerConfiguration
 Compiled record per timer acting. More...
struct  CodeGenerator::ActionAddress
 Compiled record per action-address. More...
class  CodeGenerator::TimerAction
 Compiled record per event on how it affects timers. More...
class  CodeGenerator::Registration< T >
 Registration class. More...
class  CodeGenerator::cgp_streambuf

Macros

#define FCG_VERB0(msg)   { if(mVerbLevel>=0) *pErrStream << msg << std::endl; }
#define FCG_VERB1(msg)   { if(mVerbLevel>=1) *pErrStream << msg << std::endl; }
#define FCG_VERB2(msg)   { if(mVerbLevel>=2) *pErrStream << msg << std::endl; }
#define FCG_ERR(msg)   { *pErrStream << msg << std::endl; throw Exception("CodeGenerator()","internal error", 500); }
#define COMPILEDES_VERSION   "3.0x"

Code-Generator Registry

Derived classes register via a static registration mechanism to provide an application-invokable constructor. The static registry records the constructor with a std::string typename as identifier. The purpose of this mechanism is to instantiate derived classes by their identifier at runtime.E.g.

instantiates a CodeGenerator object of the type registered by "iec". See the command-line tool compiledes.cpp for a relevant use case.

Registration can be conveniently triggered by instantiation of a CodeGenerator::Registration object via the provided macro. E.g. in the source that defines the class IecCodeGenerator

FAUDES_REGISTERCODEGENERATOR("iec",IecCodeGenerator);

is used to register the respective class with the identifier "iec".

#define FAUDES_REGISTERCODEGENERATOR(ftype, ctype)   static CodeGenerator::Registration<ctype> gRegister(ftype)
 Class registration macro.

Class Documentation

struct CodeGenerator::LineAddress
Class Members
string mAddress
int mBitAddress
EventSet mPosEvents
EventSet mNegEvents
EventSet mPosStatics
EventSet mNegStatics
bool mStatic
struct CodeGenerator::FlagExpression
Class Members
string mAddress
EventSet mEvents
struct CodeGenerator::TimerConfiguration
Class Members
string mAddress
string mElapseEvent
string mInitialValue
EventSet mStartEvents
EventSet mStopEvents
EventSet mResetEvents
struct CodeGenerator::ActionAddress
Class Members
string mAddress
bool mSetClr
bool mExe