summaryrefslogtreecommitdiff
path: root/st/SymTableVars.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-09 00:36:50 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-09 00:36:50 -0600
commitf86e714a4fdebb994101813a5fa6664f5883a0ab (patch)
tree727bec17afbb6fc373d6a6b73a69ba47ad1b7a4c /st/SymTableVars.java
parentf59241de07bfc0170fe3a18dc279d2a66bd58fdb (diff)
Many final bug-fixes in heat visitor, symbol table
Diffstat (limited to 'st/SymTableVars.java')
-rw-r--r--st/SymTableVars.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/st/SymTableVars.java b/st/SymTableVars.java
index 014beb1..b9a7c1b 100644
--- a/st/SymTableVars.java
+++ b/st/SymTableVars.java
@@ -55,6 +55,17 @@ public class SymTableVars<R> extends GJDepthFirst<R,SymbolTable> {
n.f16.accept(this, symt);
n.f17.accept(this, symt);
+ // add the "string" arg
+ TokenKey s = new TokenKey(n.f11.f0.tokenImage,
+ TypeEnum.integer,
+ (ClassInstance) symt.getActive(TypeEnum.classname),
+ (MethodInstance) symt.getActive(TypeEnum.method));
+ TypeInstance instance = new TypeInstance(s.getName(), TypeEnum.string, (MethodInstance) symt.getActive(TypeEnum.method),
+ (ClassInstance) symt.getActive(TypeEnum.classname));
+ symt.put(s, instance);
+ symt.addParameter(s.getName());
+
+
symt.addMethod(id);
symt.removeActive(TypeEnum.method);
symt.removeActive(TypeEnum.classname);
@@ -119,6 +130,7 @@ public class SymTableVars<R> extends GJDepthFirst<R,SymbolTable> {
n.f1.accept(this, symt);
n.f2.accept(this, symt);
TokenKey id = new TokenKey(n.f1.f0.tokenImage,
+ TypeEnum.integer,
(ClassInstance) symt.getActive(TypeEnum.classname),
(MethodInstance) symt.getActive(TypeEnum.method));
TypeEnum rtrn = null;
@@ -191,6 +203,7 @@ public class SymTableVars<R> extends GJDepthFirst<R,SymbolTable> {
n.f0.accept(this, symt);
n.f1.accept(this, symt);
TokenKey id = new TokenKey(n.f1.f0.tokenImage,
+ TypeEnum.integer,
(ClassInstance) symt.getActive(TypeEnum.classname),
(MethodInstance) symt.getActive(TypeEnum.method));