Webserv
Loading...
Searching...
No Matches
includes
Token.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "
webserv.hpp
"
3
4
enum
TOKEN
{
5
CURLY_OPEN
,
6
CURLY_CLOSE
,
7
COLON
,
8
STRING
,
9
NUMBER
,
10
ARRAY_OPEN
,
11
ARRAY_CLOSE
,
12
COMMA
,
13
BOOLEAN
,
14
NULL_TYPE
15
};
16
17
typedef
struct
Token_s
{
18
string
value
;
19
TOKEN
type
;
20
}
Token
;
21
22
class
Tokenizer
{
23
std::fstream
file
;
24
size_t
prevPos
;
25
26
public
:
27
Tokenizer
(
string
fileName);
28
bool
hasMoreTokens
();
29
char
getWithoutWhiteSpace
();
30
void
rollBackToken
();
31
Token
getToken
();
32
};
Token
struct Token_s Token
TOKEN
TOKEN
Definition:
Token.hpp:4
NUMBER
@ NUMBER
Definition:
Token.hpp:9
COLON
@ COLON
Definition:
Token.hpp:7
CURLY_OPEN
@ CURLY_OPEN
Definition:
Token.hpp:5
ARRAY_OPEN
@ ARRAY_OPEN
Definition:
Token.hpp:10
NULL_TYPE
@ NULL_TYPE
Definition:
Token.hpp:14
BOOLEAN
@ BOOLEAN
Definition:
Token.hpp:13
ARRAY_CLOSE
@ ARRAY_CLOSE
Definition:
Token.hpp:11
CURLY_CLOSE
@ CURLY_CLOSE
Definition:
Token.hpp:6
STRING
@ STRING
Definition:
Token.hpp:8
COMMA
@ COMMA
Definition:
Token.hpp:12
Tokenizer
Definition:
Token.hpp:22
Tokenizer::rollBackToken
void rollBackToken()
Definition:
Token.cpp:26
Tokenizer::prevPos
size_t prevPos
Definition:
Token.hpp:24
Tokenizer::file
std::fstream file
Definition:
Token.hpp:23
Tokenizer::getWithoutWhiteSpace
char getWithoutWhiteSpace()
Definition:
Token.cpp:11
Tokenizer::hasMoreTokens
bool hasMoreTokens()
Definition:
Token.cpp:9
Tokenizer::getToken
Token getToken()
Definition:
Token.cpp:31
Token_s
Definition:
Token.hpp:17
Token_s::value
string value
Definition:
Token.hpp:18
Token_s::type
TOKEN type
Definition:
Token.hpp:19
webserv.hpp
Generated by
1.9.7