X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/dbc4a22d3c8c4189459f0361cb9da06415ec2dc9..c2ba7425955ae538e220cec79d9124756d1b4c8b:/src/repr.h diff --git a/src/repr.h b/src/repr.h index f196427..f12b0da 100644 --- a/src/repr.h +++ b/src/repr.h @@ -37,6 +37,12 @@ struct AssignStmt; struct ReturnStmt; struct Stmt; +struct Context +{ + std::shared_ptr parent; + std::vector variables; +}; + enum class TypeModifierType { Pointer, Array @@ -65,7 +71,7 @@ struct Variable struct Body { - std::vector variables; + std::shared_ptr ctx; std::vector statements; }; @@ -74,6 +80,7 @@ struct Function Type returnType; std::string name; std::vector parameters; + bool defined; Body body; }; @@ -95,7 +102,7 @@ struct Struct struct Namespace { std::string name; - std::vector variables; + std::shared_ptr ctx; std::vector structs; std::vector functions; std::vector namespaces; @@ -103,7 +110,7 @@ struct Namespace struct Program { - std::vector variables; + std::shared_ptr ctx; std::vector structs; std::vector functions; std::vector namespaces;