symTable Var
This commit is contained in:
@@ -51,6 +51,17 @@ public class SymTable {
|
||||
return new Result(newSymTab,newVar);
|
||||
}
|
||||
|
||||
public Result addVar(String nomVar){
|
||||
String newVar = nomVar+id;
|
||||
SymTable newSymTab = this.addVar(nomVar,new Type_intImp()); //TODO
|
||||
return new Result(newSymTab,newVar);
|
||||
}
|
||||
|
||||
public String getVar(String nomVar){
|
||||
System.out.println("getVar(" + nomVar +") -------------------------------------------");
|
||||
return nomVar + this.stackMap.getLast().get(nomVar).id;
|
||||
}
|
||||
|
||||
public PStack<PMap<String,ValueTable>> next_layer(){
|
||||
return stackMap.plus(HashTreePMap.empty());
|
||||
}
|
||||
@@ -65,7 +76,6 @@ public class SymTable {
|
||||
|
||||
public PMap<String,ValueTable> peppapeek(){
|
||||
if(stackMap.isEmpty()){
|
||||
System.out.println("TEST...............................");
|
||||
return this.next_layer().getLast();
|
||||
}
|
||||
return stackMap.getLast();
|
||||
|
||||
Reference in New Issue
Block a user