DiaDes  0.1
DIAgnosis of Discrete-Event System
TsFile.hh
Go to the documentation of this file.
1 
9 #ifndef __DIADES__AUTOMATA__EXPERIMENTAL__TSFILE__HH__
10 #define __DIADES__AUTOMATA__EXPERIMENTAL__TSFILE__HH__
11 
13 
14 namespace Diades
15 {
16  namespace Automata
17  {
18  namespace Experimental
19  {
20 
22 
23  using TsFsm = DdAutFsm;
24  using TsFsmPtr = std::shared_ptr<TsFsm>;
27  using TsStMgrPtr = std::shared_ptr<TsStMgr>;
28  using TsEvtMgrPtr = std::shared_ptr<TsEvtMgr>;
29  using ManagedTsFsm = std::tuple<TsFsmPtr,TsStMgrPtr,TsEvtMgrPtr>;
30  using ManagedTsFsms = std::vector<ManagedTsFsm>;
31 
44  std::streampos nextNoWhiteSpaceCharacter(std::istream & stream, bool & ok);
45 
58  bool pruneCommentsBlock(std::istream& stream, bool & ok);
59 
60 
74  bool pruneComments(std::istream& stream, bool & ok);
75 
93  bool checkSystemIdentifier(std::string & tsName, std::string::size_type & semiColonIndex);
94 
107  std::istream & tsFileTransitionLabel(std::istream & stream,
108  std::unordered_map<std::string,std::string> & events,
109  std::string & fullEventLabel,
110  bool & ok);
111 
112 
124  void tsExtractTargetState(const std::string & rawTargetState,
125  std::string & targetState,
126  std::string::size_type & semiColonIndex);
127 
128 
139  std::istream & tsFileHeader(std::istream& stream, std::string & tsName, bool & ok);
140 
141 
142 
143 
161  std::istream & tsFileTransitions(std::istream & stream,
162  ManagedTsFsms & fsms,
163  // DdAutFsm & fsm,
164  // DdAutStateManager & sManager,
165  //DdAutEventManager & eManager,
166  bool & ok,
167  TsConversionMode mode);
168 
169 
170 
171  std::istream & tsFileStates(std::istream & stream, ManagedTsFsms & fsms,
172  bool & ok);
173 
174 
175 
189  bool fromTsFile(std::istream& stream,
190  ManagedTsFsms & fsms,
191  TsConversionMode mode);
192 
193 
194  std::string tsPrettyEvent(const std::string & tsEvent);
195 
196  }
197  }
198 }
199 
200 
201 
202 #endif
std::istream & tsFileTransitions(std::istream &stream, ManagedTsFsms &fsms, bool &ok, TsConversionMode mode)
Read the transitions of a Ts-format stream.
StatePropertyManager< DdAutStateLabel, DdAutStateId > DdAutStateManager
Definition: DdAutFile.hh:63
std::istream & tsFileTransitionLabel(std::istream &stream, std::unordered_map< std::string, std::string > &events, std::string &fullEventLabel, bool &ok)
Read the transition label in a ts-format file.
std::tuple< TsFsmPtr, TsStMgrPtr, TsEvtMgrPtr > ManagedTsFsm
Definition: TsFile.hh:29
bool checkSystemIdentifier(std::string &tsName, std::string::size_type &semiColonIndex)
check that tsName is the name of a transition_system
void tsExtractTargetState(const std::string &rawTargetState, std::string &targetState, std::string::size_type &semiColonIndex)
extract the target state for the raw target state
std::istream & tsFileStates(std::istream &stream, ManagedTsFsms &fsms, bool &ok)
bool fromTsFile(std::istream &stream, ManagedTsFsms &fsms, TsConversionMode mode)
Load a Ts file as a DdAutFsm.
Namespace of the Diades project.
bool pruneComments(std::istream &stream, bool &ok)
read the stream and ignore the next c-style/cpp style comments
std::shared_ptr< TsStMgr > TsStMgrPtr
Definition: TsFile.hh:27
EventManager< DdAutEventLabel, DdAutEventId > DdAutEventManager
Definition: DdAutFile.hh:68
std::vector< ManagedTsFsm > ManagedTsFsms
Definition: TsFile.hh:30
std::shared_ptr< TsEvtMgr > TsEvtMgrPtr
Definition: TsFile.hh:28
StateMachine< DdAutStateId, DdAutEventId > DdAutFsm
Definition: DdAutFile.hh:42
bool pruneCommentsBlock(std::istream &stream, bool &ok)
analyze the stream and look for the end of a comment block
std::shared_ptr< TsFsm > TsFsmPtr
Definition: TsFile.hh:24
std::istream & tsFileHeader(std::istream &stream, std::string &tsName, bool &ok)
parse the Ts-format file header
std::string tsPrettyEvent(const std::string &tsEvent)
std::streampos nextNoWhiteSpaceCharacter(std::istream &stream, bool &ok)
return the stream position just before the first character that is a white space (not such that std::...