botanist  v0.1.0
Loading...
Searching...
No Matches
token.hpp
Go to the documentation of this file.
1
4
5#ifndef BOTANIST_TOKEN_H
6#define BOTANIST_TOKEN_H
7
8#include <stddef.h>
9#include <stdint.h>
10
11namespace botanist {
12
14struct Token {
16 enum class Kind : uint8_t {
18 Empty,
19
21 Number,
22
25
27 Bracket,
28
30 Symbol,
31
34 };
35
38
40 uint8_t length = 0;
41
43 const char* content = nullptr;
44
45 Token() = default;
46
54 Token(Kind kind, const char* content, uint8_t length)
56};
57
58} // namespace botanist
59
60#endif /* BOTANIST_TOKEN_H */
式を構成するトークン
Definition: token.hpp:14
uint8_t length
contentの長さ
Definition: token.hpp:40
const char * content
トークンが持つ内容
Definition: token.hpp:43
Kind kind
このトークンの種類
Definition: token.hpp:37
Token(Kind kind, const char *content, uint8_t length)
トークンを生成
Definition: token.hpp:54
Kind
トークンの種類
Definition: token.hpp:16
@ Symbol
それ以外のシンボル
@ Terminator
トークン列の終端
@ Empty
リスト内に存在しないトークン