DICParserBase.h
Go to the documentation of this file.
//$$FILE$$
//$$VERSION$$
//$$DATE$$
//$$LICENSE$$
/*
PURPOSE: A DDL 2.1 compliant CIF file parser.
*/
#ifndef DIC_PARSER_BASE_H
#define DIC_PARSER_BASE_H
#include <iostream>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rcsb/DICScannerBase.h>
#include <rcsb/DICParserInt.h>
#include <rcsb/CifFileReadDef.h>
#include <rcsb/ISTable.h>
#include <rcsb/DicFile.h>
class DICParser : public DICScanner
{
public:
DICParser(DicFile* dicFileP, CifFile* ddlFileP, bool verbose = false);
void Parse(const string& fileName, string& diagnostics);
virtual ~DICParser();
void Error(const char*);
void Clear();
void Reset();
void ProcessAssignments(void);
void ProcessOneAssignment(void);
void ProcessItemNameListLoop(void);
void ProcessItemNameListName(void);
void ProcessValueListItem(void);
void ProcessItemName(void);
void ProcessLoop(void);
void ProcessItemValue(void);
void ProcessLsItemValue(void);
void ProcessUnknownValue(void);
void ProcessMissingValue(void);
void ProcessSaveBegin(void);
void ProcessSaveEnd(void);
void ProcessDataBlockName(void);
private:
DicFile *_fobj;
ISTable *_tbl;
int _afterLoop;
CifFile *_saveobj;
ISTable *_savetbl;
ISTable *_prevtbl;
ISTable * format;
ISTable * cattbl;
ISTable * itemtbl;
CifFile *ddl;
int itemColIndex;
int catColIndex;
int colIndex2;
vector<string> listcat, listitem;
vector<string> listitem2;
int _nTablesInBlock;
int _curItemNo, _curValueNo, _numDataBlocks, _fieldListAlloc, _curRow;
vector<string> _fieldList;
string _pBufValue;
string _tBufKeyword;
string _curCategoryName;
string _curDataBlockName;
string _prevDataBlockName;
int _nTablesInBlockSave;
int _curItemNoSave, _curValueNoSave;
int _numDataBlocksSave, _fieldListAllocSave;
int _curRowSave;
vector<string> _fieldListSave;
string _curCategoryNameSave;
string _curDataBlockNameSave;
string _prevDataBlockNameSave;
string _tmpDataBlockNameSave;
string errorLog;
std::set<string> _saveFrames;
void ProcessLoopDeclaration(void);
void ProcessItemNameList(void);
void ProcessValueList(void);
void ProcessItemValuePair(void);
void ProcessLoopDeclarationSave(void);
void ProcessItemNameListSave(void);
void ProcessValueListSave(void);
void ProcessItemValuePairSave(void);
void CheckDDL(void);
void AfterParseProcessing();
void InsertImplicitOrdinalItems();
};
#endif /* DIC_PARSER_BASE_H */