ChartToC.h
Go to the documentation of this file.
1 
20 #ifndef FSMTOCPP_H_201672B0
21 #define FSMTOCPP_H_201672B0
22 
23 #include "uscxml/util/DOM.h"
24 #include "uscxml/transform/Trie.h"
25 #include "Transformer.h"
26 
27 #include <xercesc/dom/DOM.hpp>
28 #include <ostream>
29 #include <set>
30 
31 namespace uscxml {
32 
33 class USCXML_API ChartToC : public TransformerImpl {
34 public:
35 
36  virtual ~ChartToC();
37  static Transformer transform(const Interpreter& other);
38 
39  void writeTo(std::ostream& stream);
40 
41 protected:
42  ChartToC(const Interpreter& other);
43 
44  void writeIncludes(std::ostream& stream);
45  void writeMacros(std::ostream& stream);
46  void writeTypes(std::ostream& stream);
47  void writeHelpers(std::ostream& stream);
48  void writeExecContent(std::ostream& stream);
49  void writeExecContentFinalize(std::ostream& stream);
50  void writeElementInfoInvocation(std::ostream& stream);
51  void writeForwardDeclarations(std::ostream& stream);
52 
53  void writeElementInfo(std::ostream& stream);
54 
55  void writeMachineInfo(std::ostream& stream);
56  void writeStates(std::ostream& stream);
57  void writeTransitions(std::ostream& stream);
58  void writeFSM(std::ostream& stream);
59  void writeCharArrayInitList(std::ostream& stream, const std::string& boolString);
60 
61  void writeExecContent(std::ostream& stream, const XERCESC_NS::DOMNode* node, size_t indent = 0);
62 
63  void resortStates(XERCESC_NS::DOMNode* node);
64  void setHistoryCompletion();
65  void setStateCompletion();
66  void prepare();
67 
68  void findNestedMachines();
69 
70  Interpreter interpreter;
71 
72  std::vector<XERCESC_NS::DOMElement*> _states;
73  std::vector<XERCESC_NS::DOMElement*> _transitions;
74 
75  std::string _md5;
76  std::string _prefix;
77  std::set<std::string> _hasElement;
78 
79  size_t _transCharArraySize;
80  std::string _transCharArrayInit;
81  std::string _transDataType;
82 
83  size_t _stateCharArraySize;
84  std::string _stateCharArrayInit;
85  std::string _stateDataType;
86 
87  ChartToC* _topMostMachine;
88  ChartToC* _parentMachine;
89  std::list<ChartToC*> _nestedMachines;
90  std::list<ChartToC*> _allMachines;
91 
92  std::list<std::string>* _prefixes;
93  bool _hasNativeDataModel;
94 };
95 
96 }
97 
98 #endif /* end of include guard: FSMTOCPP_H_201672B0 */
Definition: Breakpoint.cpp:26
Central class to interpret and process SCXML documents.
Definition: Interpreter.h:79
Definition: ChartToC.h:33
Definition: Transformer.h:29
Definition: Transformer.h:67