-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTokenArray.h
More file actions
49 lines (28 loc) · 706 Bytes
/
TokenArray.h
File metadata and controls
49 lines (28 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _EXCELFORMUAL_TOKEN_ARRAY_H__
#define _EXCELFORMUAL_TOKEN_ARRAY_H__
#include <vector>
#include <cstddef>
using std::vector;
namespace ExcelFormula{
class Token;
class TokenArray{
public:
TokenArray();
void toVector(vector<Token*>&);
void fromVector(vector<Token*>&);
size_t size() {return m_tokens.size();}
bool isBOF() {return (m_index <= 0)?true:false;}
bool isEOF() {return (m_index >= m_tokens.size())?true:false;}
Token* getCurrent();
Token* getNext();
Token* getPrevious();
Token* add(Token*);
bool moveNext();
void reset(){m_index = 0;}
void releaseAll();
private:
size_t m_index;
vector<Token*> m_tokens;
};
}
#endif