summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-13 14:45:13 +0300
committerKonstantin Kirik (snegovick) <snegovick@uprojects.org>2025-12-13 14:45:13 +0300
commita104f80e61f7e6a110a209cf7cc5ffd09d6b5b4f (patch)
treeb5282c35b4e50a1cd0e08f54c8de35d64ae9bd1c /module
parent70c48bade8529b4b5f762754db96982c8c95c31a (diff)
Add variable substitution
Diffstat (limited to 'module')
-rw-r--r--module/sh9parser.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/sh9parser.m b/module/sh9parser.m
index 22d3f09..aa8a403 100644
--- a/module/sh9parser.m
+++ b/module/sh9parser.m
@@ -33,11 +33,19 @@ ShModule: adt {
name: string;
vars: list of ref ModVar;
procs: list of ref ModProc;
+ find_var: fn(m: self ref ShModule, name: string): ref ModVar;
+ set_var: fn(m: self ref ShModule, v: ref ModVar);
+ print_vars: fn(m: self ref ShModule);
};
ParserCtx: adt {
modules: list of ref ShModule;
add_module: fn(ctx: self ref ParserCtx, name: string);
+ current_module: string;
+ get_current_module: fn(ctx: self ref ParserCtx): ref ShModule;
+ find_var_in_current_module: fn(ctx: self ref ParserCtx, name: string): ref ModVar;
+ find_module: fn(ctx: self ref ParserCtx, name: string): ref ShModule;
+ print_all_vars: fn(ctx: self ref ParserCtx);
};
GrammarNode: adt {