tableau update

This commit is contained in:
Vu Tuan Minh
2025-04-30 14:07:05 +02:00
parent 43ef0b93d3
commit 19c637e323
4 changed files with 24 additions and 6 deletions

View File

@@ -104,15 +104,21 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
@Override
public InstrAndSymTable visitDeclaration(DeclarationImp instr, SymTable h) {
ArrayList<InstructionLLVM> list = new ArrayList<>();
/*
for(int i = 0; i<instr.s().size();i++){
TypeLLVM t2 = instr.t().accept(this,h);
Result r = h.addVar(instr.s().get(i),t2);
String name = r.var;
Result r;
String nom= instr.s().get(i).nom();
Integer size=instr.s().get(i).size();
if(size==null){
r= h.addVar(nom,t2);
}else {
TypeLLVM arrayType = new ArrayLLVMImp(t2, size);
r = h.addVar(nom, arrayType);
}
h = r.symTable;
list.add(new AssignLLVMImp(new VarLLVMImp(t2, name,false),new allocaLLVMImp(t2)));
list.add(new AssignLLVMImp(new VarLLVMImp(t2, nom,false),new allocaLLVMImp(t2)));
}
*/
return new InstrAndSymTable(list,h);
}