00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef DDL_PARSER_BASE_H
00010 #define DDL_PARSER_BASE_H
00011
00012 #include <iostream>
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015 #include <string.h>
00016 #include "DDLScannerBase.h"
00017 #include "DDLParserInt.h"
00018 #include "CifFileReadDef.h"
00019 #include "ISTable.h"
00020 #include "TableFile.h"
00021
00022 class DDLParser:public DDLScanner
00023 {
00024 private:
00025 string _uString;
00026 string _mString;
00027 TableFile *_fobj;
00028 ISTable *_tbl;
00029 int _afterLoop;
00030 TableFile *_saveobj;
00031 ISTable *_savetbl;
00032 ISTable * format;
00033 int _nTablesInBlock;
00034 int _curItemNo, _curValueNo, _numDataBlocks, _fieldListAlloc, _curRow, _curCol;
00035 vector<string> _fieldList;
00036 string _pBufValue;
00037 vector<string> * _rowBuf;
00038 string _tBufKeyword;
00039 string _curCategoryName;
00040 string _curDataBlockName;
00041 string _prevDataBlockName;
00042 int _nTablesInBlockSave;
00043 int _curItemNoSave, _curValueNoSave;
00044 int _numDataBlocksSave, _fieldListAllocSave;
00045 int _curRowSave, _curColSave;
00046 vector<string> _fieldListSave;
00047 vector<string> * _rowBufSave;
00048 string _curCategoryNameSave;
00049 string _curDataBlockNameSave;
00050 string _prevDataBlockNameSave;
00051 public:
00052 DDLParser(TableFile *fo, ISTable *format2, int verbose);
00053 void Parse(const string& fileName, string& diagnostics);
00054 void Clear();
00055 void Error(const char*);
00056 void Reset();
00057 void ProcessLoopDeclaration(void);
00058 void ProcessItemNameList(void);
00059 void ProcessValueList(void);
00060 void ProcessItemValuePair(void);
00061 void ProcessLoopDeclarationSave(void);
00062 void ProcessItemNameListSave(void);
00063 void ProcessValueListSave(void);
00064 void ProcessItemValuePairSave(void);
00065 void ProcessAssignments(void);
00066 void ProcessOneAssignment(void);
00067 void ProcessItemNameListLoop(void);
00068 void ProcessItemNameListName(void);
00069 void ProcessValueListItem(void);
00070 void ProcessItemName(void);
00071 void ProcessLoop(void);
00072 void ProcessItemValue(void);
00073 void ProcessLsItemValue(void);
00074 void ProcessUnknownValue(void);
00075 void ProcessMissingValue(void);
00076 void ProcessSaveBegin(void);
00077 void ProcessSaveEnd(void);
00078 void ProcessDataBlockName(void);
00079 string errorLog;
00080 virtual ~DDLParser();
00081 };
00082
00083 #endif