librcsb-core-wrapper  1.005
DICParserBase.h
Go to the documentation of this file.
1 //$$FILE$$
2 //$$VERSION$$
3 //$$DATE$$
4 //$$LICENSE$$
5 
6 
14 /*
15  PURPOSE: A DDL 2.1 compliant CIF file parser.
16 */
17 
18 
19 #ifndef DIC_PARSER_BASE_H
20 #define DIC_PARSER_BASE_H
21 
22 
23 #include <iostream>
24 #include <set>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <rcsb/DICScannerBase.h>
29 #include <rcsb/DICParserInt.h>
30 #include <rcsb/CifFileReadDef.h>
31 #include <rcsb/ISTable.h>
32 #include <rcsb/DicFile.h>
33 
43 class DICParser : public DICScanner
44 {
45  public:
67  DICParser(DicFile* dicFileP, CifFile* ddlFileP, bool verbose = false);
68 
86  void Parse(const string& fileName, string& diagnostics);
87 
101  virtual ~DICParser();
102 
107  void Error(const char*);
108 
113  void Clear();
114 
119  void Reset();
120 
125  void ProcessAssignments(void);
126 
132 
138 
144 
150 
155  void ProcessItemName(void);
156 
161  void ProcessLoop(void);
162 
167  void ProcessItemValue(void);
168 
173  void ProcessLsItemValue(void);
174 
180 
186 
191  void ProcessSaveBegin(void);
192 
197  void ProcessSaveEnd(void);
198 
204 
205  private:
206  DicFile *_fobj;
207  ISTable *_tbl;
208  int _afterLoop;
209  CifFile *_saveobj;
210  ISTable *_savetbl;
211  ISTable *_prevtbl;
212  ISTable * format;
213  ISTable * cattbl;
214  ISTable * itemtbl;
215  CifFile *ddl;
216  vector<string> listcat, listitem;
217  vector<string> listitem2;
218  int _nTablesInBlock;
219  int _curItemNo, _curValueNo, _numDataBlocks, _fieldListAlloc, _curRow;
220  vector<string> _fieldList;
221  string _pBufValue;
222  string _tBufKeyword;
223  string _curCategoryName;
224  string _curDataBlockName;
225  string _prevDataBlockName;
226  int _nTablesInBlockSave;
227  int _curItemNoSave, _curValueNoSave;
228  int _fieldListAllocSave;
229  int _curRowSave;
230  vector<string> _fieldListSave;
231  string _curCategoryNameSave;
232  string _curDataBlockNameSave;
233  string _prevDataBlockNameSave;
234  string _tmpDataBlockNameSave;
235  string errorLog;
236  std::set<string> _saveFrames;
237  void ProcessLoopDeclaration(void);
238  void ProcessItemNameList(void);
239  void ProcessValueList(void);
240  void ProcessItemValuePair(void);
241  void ProcessLoopDeclarationSave(void);
242  void ProcessItemNameListSave(void);
243  void ProcessValueListSave(void);
244  void ProcessItemValuePairSave(void);
245  void CheckDDL(void);
246 
247  void AfterParseProcessing();
248 
249  void InsertImplicitOrdinalItems();
250 };
251 
252 #endif /* DIC_PARSER_BASE_H */
Header file for CifFileReadDef class.
Header file for bison interfacing to DICParser class.
Header file for DICScanner class.
Header file for DicFile class.
Header file for ISTable class.
Public class that represents a CIF file, composed of blocks with tables.
Definition: CifFile.h:48
Public class that respresents a dictionary parser.
Definition: DICParserBase.h:44
void ProcessValueListItem(void)
void ProcessUnknownValue(void)
void ProcessSaveEnd(void)
void ProcessItemNameListLoop(void)
void ProcessDataBlockName(void)
void ProcessItemName(void)
void Clear()
void ProcessAssignments(void)
virtual ~DICParser()
void ProcessMissingValue(void)
void ProcessLsItemValue(void)
DICParser(DicFile *dicFileP, CifFile *ddlFileP, bool verbose=false)
void Reset()
void ProcessLoop(void)
void Parse(const string &fileName, string &diagnostics)
void ProcessItemValue(void)
void ProcessSaveBegin(void)
void ProcessOneAssignment(void)
void ProcessItemNameListName(void)
void Error(const char *)
Private class that represents a dictionary scanner.
Definition: DICScannerBase.h:49
Public class that represents a dictionary file, composed of blocks with tables.
Definition: DicFile.h:37
Public class that respresents a two-dimensional table of strings.
Definition: ISTable.h:54