From 6b74d623cb97ef9e95def486d7e06fa0eb00ee81 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 5 Jan 2024 08:58:54 +0100 Subject: CompilerDriver\{cc, ccplus}: Adding support for struct and classes in C++ CompilerDriver\cc: Also add TODO for keywords '.' and '->' Signed-off-by: Amlal El Mahrouss --- CompilerDriver/ccplus.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'CompilerDriver/ccplus.cc') diff --git a/CompilerDriver/ccplus.cc b/CompilerDriver/ccplus.cc index fc8ab3a..bf6df0b 100644 --- a/CompilerDriver/ccplus.cc +++ b/CompilerDriver/ccplus.cc @@ -49,13 +49,27 @@ namespace detail struct CompilerRegisterMap { std::string fName; - std::string fRegister; + std::string fReg; + }; + + // \brief Offset based struct/class + struct CompilerStructMap + { + std::string fName; + std::string fReg; + + // offset counter + std::size_t fOffsetsCnt; + + // offset array + std::vector> fOffsets; }; struct CompilerState { std::vector fSyntaxTreeList; std::vector kStackFrame; + std::vector kStructMap; ParserKit::SyntaxLeafList* fSyntaxTree{ nullptr }; std::unique_ptr fOutputAssembly; std::string fLastFile; -- cgit v1.2.3