tableau
This commit is contained in:
@@ -104,6 +104,7 @@ 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);
|
||||
@@ -111,6 +112,14 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
||||
h = r.symTable;
|
||||
list.add(new AssignLLVMImp(new VarLLVMImp(t2, name,false),new allocaLLVMImp(t2)));
|
||||
}
|
||||
*/
|
||||
return new InstrAndSymTable(list,h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstrAndSymTable visitVarDecl(VarDeclImp instr, SymTable h) {
|
||||
ArrayList<InstructionLLVM> list = new ArrayList<>();
|
||||
//TODO
|
||||
return new InstrAndSymTable(list,h);
|
||||
}
|
||||
|
||||
@@ -288,6 +297,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
||||
String labelThen= "then"+h.getNewIdLabel();
|
||||
String labelFin= "fi"+h.getNewIdLabel();
|
||||
|
||||
l.add(new BrLLVMImp(labelIf));
|
||||
l.add(new LabelLLVMImp(labelIf));
|
||||
InstrAndVal temp = instr.e().accept(this,h);
|
||||
l.addAll(temp.instrs);
|
||||
@@ -317,6 +327,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
||||
String labelElse= "else"+h.getNewIdLabel();
|
||||
String labelFin= "fi"+h.getNewIdLabel();
|
||||
|
||||
l.add(new BrLLVMImp(labelIf));
|
||||
l.add(new LabelLLVMImp(labelIf));
|
||||
InstrAndVal temp = instr.e().accept(this,h);
|
||||
l.addAll(temp.instrs);
|
||||
|
||||
Reference in New Issue
Block a user