diff options
author | rtk0c <[email protected]> | 2022-05-28 20:52:42 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-05-28 20:52:42 -0700 |
commit | 1a6f1ea3b76c3ed4cad5aba5502af390ce50a2c0 (patch) | |
tree | 40627f5cdfd931b8c28f0b3a5ec78ef0d0f2b9f0 /buildtools/codegen/CodegenOutput.inl | |
parent | 6c3007295a6a8c6803933392834c974ec5f56aa0 (diff) |
Changeset: 42 Change codegen input parsing to lookahead based; lookup table infra; input/output decl infra
Diffstat (limited to 'buildtools/codegen/CodegenOutput.inl')
-rw-r--r-- | buildtools/codegen/CodegenOutput.inl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/buildtools/codegen/CodegenOutput.inl b/buildtools/codegen/CodegenOutput.inl new file mode 100644 index 0000000..6d59301 --- /dev/null +++ b/buildtools/codegen/CodegenOutput.inl @@ -0,0 +1,31 @@ +#pragma once + +#include "CodegenDecl.hpp" + +#include <cstdio> +#include <cstdlib> +#include <string> +#include <vector> + +// A generic "thing" (could be anything, comments, string-concated functionsm, etc.) to spit into the output file +struct CodegenOutputThing { + std::string text; +}; + +class CodegenOutput { +private: + std::vector<CodegenOutputThing> mOutThings; + +public: + void AddOutputThing(CodegenOutputThing thing) { + mOutThings.push_back(std::move(thing)); + } + + void MergeContents(CodegenOutput other) { + std::move(other.mOutThings.begin(), other.mOutThings.end(), this->mOutThings.begin()); + } + + void Write(FILE* file) { + // TODO + } +}; |