abouttreesummaryrefslogcommitdiff
path: root/src/repr.h
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-04 15:05:42 +0200
committerPatrick Schönberger2021-08-04 15:05:42 +0200
commit7f83e1b208e87e3808b268303bb633a8fda203f5 (patch)
tree8ab149b206144fc1bf99872b281cb7d965edf5e1 /src/repr.h
parentbe56e29997e17685eebf8bd7cb745183c60de7db (diff)
downloadtoc-7f83e1b208e87e3808b268303bb633a8fda203f5.tar.gz
toc-7f83e1b208e87e3808b268303bb633a8fda203f5.zip
pre change
Diffstat (limited to 'src/repr.h')
-rw-r--r--src/repr.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/repr.h b/src/repr.h
index f196427..fc77d92 100644
--- a/src/repr.h
+++ b/src/repr.h
@@ -37,6 +37,12 @@ struct AssignStmt;
struct ReturnStmt;
struct Stmt;
+struct Context
+{
+ std::shared_ptr<Context> parent;
+ std::vector<Variable> variables;
+};
+
enum class TypeModifierType
{
Pointer, Array
@@ -65,7 +71,7 @@ struct Variable
struct Body
{
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Stmt> statements;
};
@@ -95,7 +101,7 @@ struct Struct
struct Namespace
{
std::string name;
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Struct> structs;
std::vector<Function> functions;
std::vector<Namespace> namespaces;
@@ -103,7 +109,7 @@ struct Namespace
struct Program
{
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Struct> structs;
std::vector<Function> functions;
std::vector<Namespace> namespaces;