CompileDES  3.13
Executable-Code Generation from Synchronised libFAUDES Automata
cgp_plcoxml.h
Go to the documentation of this file.
1 
3 /*
4  FAU Discrete Event Systems Library (libFAUDES)
5 
6  Copyright (C) 2010, 2016, 2017 Thomas Moor
7 
8 */
9 
10 
11 
12 #ifndef FAUDES_PLCOXML_H
13 #define FAUDES_PLCOXML_H
14 
15 #include "libfaudes.h"
16 #include "cgp_iec61131st.h"
17 
18 using namespace faudes;
19 
20 
21 
92 
93 public:
94 
95  /*****************************************
96  *****************************************
97  *****************************************
98  *****************************************/
99 
105  PlcoxmlCodeGenerator(void);
106 
110  virtual ~PlcoxmlCodeGenerator(void);
111 
112 
117  virtual void Clear(void);
118 
119 
122 protected:
123 
125  std::string mIecSchemeVersion;
126 
128  std::string mIecToolVendor;
129 
131  std::string mIecContentAuthor;
132 
135 
137  std::string mIecContentVersion;
138 
140  std::string mIecTextElement;
141 
143  void DoGenerate(void);
144 
146  void DoGenerateFunction(void);
147 
149  void DoGenerateInterface(void);
150 
152  void DoGenerateBody(void);
153 
155  void DoGenerateLookups(void);
156 
157  /* re-implement primitives (declarations) */
158  virtual void VariableDeclare(const std::string& ladd, const std::string& ltype);
159  virtual void VariableDeclare(const std::string& ladd, const std::string& ltype, const std::string& lval);
160  virtual void CintarrayDeclare(const AA& address, int offset, const std::vector<int>& val);
161  virtual void CwordarrayDeclare(const AA& address, int offset, const std::vector<word_t>& val);
162  virtual void CstrarrayDeclare(const AA& address, int offset, const std::vector<std::string>& val);
163  virtual void IntarrayDeclare(const AA& address, int offset, int len);
164  virtual void IntarrayDeclare(const AA& address, int offset, const std::vector<int>& val);
165  virtual void WordarrayDeclare(const AA& address, int offset, int len);
166  virtual void WordarrayDeclare(const AA& address, int offset, const std::vector<word_t>& val);
167 
168  /* re-implement iec specific code snippets */
169  virtual void DeclareImportPhysicalIo(void);
170 
171  /* xml spexcific helpers */
172  virtual void XmlBeginPlainText();
173  virtual void XmlEndPlainText();
174  virtual void XmlDocumentation(const std::string& text);
175 
188  virtual void DoReadTargetConfiguration(TokenReader& rTr);
189 
201  virtual void DoWriteTargetConfiguration(TokenWriter& rTw) const;
202 
203 };
204 
205 
206 #endif
Code-generator for target IEC 61131-3 ST.
Abstract address; see also Absstract_Addresses.
Implementation of primitives by IEC 61131 ST.
Target PlcOpen XML (IEC 61131-3 ST)
Definition: cgp_plcoxml.h:91
std::string mIecSchemeVersion
option: plcopen-xml version "v1.01" or "v2.01"
Definition: cgp_plcoxml.h:125
std::string mIecToolVendor
option: xml entry file header "company"
Definition: cgp_plcoxml.h:128
std::string mIecContentAuthor
option: xml entry content header "author"
Definition: cgp_plcoxml.h:131
std::string mIecContentOrganization
option: xml entry content header "company"
Definition: cgp_plcoxml.h:134
std::string mIecTextElement
option: plain text xml-element "cdata", "xhtml", or "pre"
Definition: cgp_plcoxml.h:140
std::string mIecContentVersion
option: xml entry content header "version"
Definition: cgp_plcoxml.h:137