botanist  v0.1.0
Loading...
Searching...
No Matches
syntaxnode.hpp
Go to the documentation of this file.
1
4
5#ifndef BOTANIST_SYNTAX_NODE_H
6#define BOTANIST_SYNTAX_NODE_H
7
8#include <stdint.h>
9
10#include "token.hpp"
11
12namespace botanist {
13
15struct SyntaxNode {
17 enum class Kind : uint8_t {
19 Empty,
20
22 Add,
23
26
29
31 Divide,
32
34 Number,
35
38 };
39
42
44 const char* content = nullptr;
45
47 size_t length = 0;
48
49 SyntaxNode() = default;
50
59};
60
61} // namespace botanist
62
63#endif /* BOTANIST_SYNTAX_NODE_H */
構文木のノード
Definition: syntaxnode.hpp:15
SyntaxNode(const SyntaxNode::Kind kind, const char *content, size_t length)
値を渡してノードオブジェクトを初期化
Definition: syntaxnode.hpp:58
Kind
ノードの種類
Definition: syntaxnode.hpp:17
@ Invalid
無効なノード
@ Empty
ツリー中に存在しないノード
size_t length
contentの長さ
Definition: syntaxnode.hpp:47
Kind kind
このノードの種類
Definition: syntaxnode.hpp:41
const char * content
ノードが持つ内容
Definition: syntaxnode.hpp:44
数式トークン