-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScanner.h
More file actions
42 lines (32 loc) · 1.18 KB
/
Scanner.h
File metadata and controls
42 lines (32 loc) · 1.18 KB
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
//
// Created by LE, Duc Anh on 8/3/15.
//
#ifndef CLDEPARSER_SCANNER_H
#define CLDEPARSER_SCANNER_H
#include "Token.h"
#include "Tokenizer.h"
#include "Common/IDefines.h"
#include "Exceptions/ScannerException.h"
namespace CLDEParser {
class Scanner {
int _exceptionTokenNo{Common::BufferSize::SIXTYFOUR};
SPtrTokenizerVector _tokenizers;
public:
Scanner() = default;
Scanner(const Scanner &) = default;
Scanner(Scanner &&) = default;
Scanner &operator=(const Scanner &) = default;
Scanner &operator=(Scanner &&) = default;
virtual ~Scanner() = default;
// Locals
SPtrTokenizerVector &Tokenizers();
SPtrTokenVector Scan(const std::string &string) const;
int ExceptionTokenNo() const { return _exceptionTokenNo; }
void setExceptionTokenNo(int exceptionTokenNo) { _exceptionTokenNo = exceptionTokenNo; }
protected:
SPtrToken ProcessAndMoveNext(std::string::const_iterator &cIter,
std::string::const_iterator &cEnd,
SPtrTokenizerList &matchedTokenizers) const;
};
}
#endif //CLDEPARSER_SCANNER_H