33 FD_DCG(
"GebtoolsCodeGenerator(" <<
this <<
")::GebtoolsCodeGenerator()");
39 FD_DCG(
"GebtoolsCodeGenerator(" <<
this <<
")::~GebtoolsCodeGenerator()");
45 FD_DCG(
"GebtoolsCodeGenerator::Clear()");
54 FD_DCG(
"GebtoolsCodeGenerator::DoReadTargetConfiguration()");
59 if(rTr.ExistsBegin(
"IecTypedArrayConstants")) {
60 rTr.ReadBegin(
"IecTypedArrayConstants",token);
62 rTr.ReadEnd(
"IecTypedArrayConstants");
68 FD_DCG(
"GebtoolsCodeGenerator::DoWriteTargetConfiguration()");
73 token.SetEmpty(
"IecTypedArrayConstants");
97 Comment(
"************************************************");
98 Comment(
"* array types --- GEB IDE specific *");
99 Comment(
"************************************************");
108 EventSetDeclare(
AA(
"aux_locenabled"));
109 EventSetDeclare(
AA(
"aux_executables"));
117 Comment(
"************************************************");
118 Comment(
"* function block to host cyclic code *");
119 Comment(
"************************************************");
151 Output() <<
"VAR_EXTERNAL";
169 Output() <<
"END_FUNCTION_BLOCK (* end of " <<
mPrefix <<
"cyclic_fb *)";
180 Comment(
"************************************************");
181 Comment(
"* initialised array types --- GEB IDE specific *");
182 Comment(
"************************************************");
215 FCG_ERR(
"GebtoolsCodeGenerator::Cintarray(): ignoring empty const vector");
219 FCG_ERR(
"GebtoolsCodeGenerator::Cwordarray(): const vector exceeds address range");
247 FCG_ERR(
"GebtoolsCodeGenerator::Cwordarray(): ignoring empty const vector");
251 FCG_ERR(
"GebtoolsCodeGenerator::Cwordarray(): const vector exceeds addres range");
279 FCG_ERR(
"GebtoolsCodeGenerator::Cstrarray(): ignoring empty const vector");
283 FCG_ERR(
"GebtoolsCodeGenerator::Cstrarray(): const vector exceeds addres range");
293 for(
size_t i=0; i<val.size(); ++i)
294 if(val[i].size()>len) len=val[i].size();
300 Output() <<
TargetAddress(address) <<
"_st" <<
" : STRING[" << ToStringInteger(len) <<
"];";
302 Output() <<
TargetAddress(
AA(address+
"_t")) <<
" : ARRAY[" << offset <<
".." << val.size()+offset-1 <<
"] OF "<<
320 FCG_ERR(
"GebtoolsCodeGenerator::Intarray(): ignoring empty const vector");
324 FCG_ERR(
"GebtoolsCodeGenerator::Intarray(): const vector exceeds addres range");
352 FCG_ERR(
"GebtoolsCodeGenerator::Intarray(): ignoring empty vector");
355 if(((
unsigned long long) len+offset) >= (1ULL << (
mIntegerSize-1))) {
356 FCG_ERR(
"GebtoolsCodeGenerator::Intarray(): const vector exceeds addres range");
379 FCG_ERR(
"GebtoolsCodeGenerator::Wordarray(): ignoring empty const vector");
383 FCG_ERR(
"GebtoolsCodeGenerator::Wordarray(): const vector exceeds addres range");
411 FCG_ERR(
"GebtoolsCodeGenerator::Wordarray(): ignoring empty vector");
414 if(((
unsigned long long) len+offset ) >= (1ULL << (
mIntegerSize-1))) {
415 FCG_ERR(
"GebtoolsCodeGenerator::Wordarray(): const vector exceeds addres range");
#define FAUDES_REGISTERCODEGENERATOR(ftype, ctype)
Class registration macro.
virtual void LineFeed(int lines=1)
LineFeed (convenience support for derived classes)
virtual void IndentInc()
Indentation (convenience support for derived classes)
virtual void MuteMode(char mode)
Set current mute mode.
int mIntegerSize
compressed boolean capacity of target type integer
virtual std::ostream & Output(void)
Output stream.
virtual void MuteCond(char mode)
Set mode condition.
virtual void IndentDec()
Indentation (convenience support for derived classes)
Abstract address; see also Absstract_Addresses.
virtual void DeclareSmallCarray(void)
Declare bit-mask loop-ups.
virtual void DoGenerateResetCode(void)
cut-and-paste template for code snippet assembly
virtual void DeclareReset(void)
Declare "reset".
virtual void DeclareStatus(void)
Declare "status".
virtual void DeclareRecentEvent(void)
Declare "recent_event".
virtual void DeclareAux(void)
Declare variables local to the provided snippets, e.g. helpers for bit-mask computation.
bool mEventNameLookup
code option: event name lookup
virtual void DeclareEventNameLookup(void)
Declare symbolic name lookup tables.
bool mStateNameLookup
code option: state name lookup
virtual void DeclareParallelState(void)
Declare "parallel_state".
std::string mIntegerType
target data type for integer
virtual void DeclareLoopState(void)
Declare loop state, i.e. line levels, loop flag.
virtual void DoGenerateCyclicCode(void)
cut-and-paste template for code snippet assembly
std::string mWordType
target data type for word
virtual void DeclareLargeCarray(void)
Declare compiled transition relations.
virtual void DeclareStateNameLookup(void)
Declare symbolic name lookup tables.
virtual void DeclarePendingEvents(void)
Declare "pending_events" and "enabled_events".
std::string mPrefix
universal prefix (pseudo name space)
Implementation of primitives by IEC 61131 ST.
virtual void DoReadTargetConfiguration(TokenReader &rTr)
File i/o.
virtual void DoWriteTargetConfiguration(TokenWriter &rTw) const
File i/o.
virtual void DeclareImportPhysicalIo(void)
generate code: conditionals
virtual void CintarrayDeclare(const AA &address, int offset, const std::vector< int > &val)
generate code: conditionals
virtual void Clear(void)
Clear all data.
virtual AX WordarrayConstant(const std::vector< word_t > &val)
generate code: conditionals
virtual AX StrarrayConstant(const std::vector< std::string > &val)
generate code: conditionals
virtual void DeclareSystime(void)
generate code: conditionals
virtual void WordarrayDeclare(const AA &address, int offset, int len)
generate code: conditionals
virtual void Comment(const std::string &text)
generate code: conditionals
virtual void DecrementTimers(void)
code snippet
virtual void DeclareImportSymbolicIo(void)
generate code: conditionals
virtual AX IntarrayConstant(const std::vector< int > &val)
generate code: conditionals
virtual std::string TargetAddress(const AA &address)
abstract address conversion
virtual int CountImportPhysicalIo(void)
generate code: conditionals
virtual void DoGenerateLookups(void)
code generation hook (lookup functions)
virtual void CstrarrayDeclare(const AA &address, int offset, const std::vector< std::string > &val)
generate code: conditionals
virtual void DeclareTimers(void)
generate code: conditionals
virtual void CwordarrayDeclare(const AA &address, int offset, const std::vector< word_t > &val)
generate code: conditionals
virtual void IntarrayDeclare(const AA &address, int offset, int len)
generate code: conditionals
virtual int CountImportSymbolicIo(void)
generate code: conditionals
std::string mIecDeclarePhysical
option: formal declaration of io lines
virtual void LiteralCyclic(void)
generate code: conditionals