From 1a6f1ea3b76c3ed4cad5aba5502af390ce50a2c0 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 28 May 2022 20:52:42 -0700 Subject: Changeset: 42 Change codegen input parsing to lookahead based; lookup table infra; input/output decl infra --- buildtools/codegen/CodegenOutput.inl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 buildtools/codegen/CodegenOutput.inl (limited to 'buildtools/codegen/CodegenOutput.inl') 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 +#include +#include +#include + +// 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 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 + } +}; -- cgit v1.2.3-70-g09d2