declare works with list

This commit is contained in:
Minh VU
2025-04-05 15:55:24 +02:00
parent a06374fbab
commit 0a48bf22bf
6 changed files with 40 additions and 15 deletions

View File

@@ -46,6 +46,15 @@ public class SymTable {
return false;
}
public Type getvar_Type(String s){
for(int i= stackMap.size()-1; i>=0; i--){
if(stackMap.get(i).containsKey(s)){
return stackMap.get(i).get(s);
}
}
return null;
}
public String print_all(){
StringBuilder str = new StringBuilder();
for(int i= stackMap.size()-1; i>=0; i--){