botanist  v0.1.0
Loading...
Searching...
No Matches
serializer.hpp
Go to the documentation of this file.
1
4
5#ifndef BOTANIST_SERIALIZER_H
6#define BOTANIST_SERIALIZER_H
7
8#include <collection2/list.hpp>
9#include <collection2/tree.hpp>
10
11#include "syntaxnode.hpp"
12
13namespace botanist {
14
17 private:
19 collection2::List<SyntaxNode>& syntaxNodeList;
20
26 void serialize(const collection2::TreeNode<SyntaxNode>* nodePtr);
27
28 public:
29 explicit Serializer(collection2::List<SyntaxNode>& syntaxNodeList) : syntaxNodeList(syntaxNodeList){};
30
36 void serializeTree(const collection2::TreeNode<SyntaxNode>* rootNode);
37
38#ifndef HEADLESS
39
44
45#else
46 void dumpSeralizedNodeList() = delete;
47#endif
48};
49
50} // namespace botanist
51
52#endif
構文木をスタックマシンが実行可能な形に変換する
Definition: serializer.hpp:16
void dumpSeralizedNodeList() const
直列化されたノードリストをダンプ
void serializeTree(const collection2::TreeNode< SyntaxNode > *rootNode)
構文木をスタックマシンで処理できる形に並べ替え、ノードリストを更新する