correction erreur + clean
This commit is contained in:
@@ -182,9 +182,19 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
|||||||
Object obj = instr.t().get(i);
|
Object obj = instr.t().get(i);
|
||||||
if(obj instanceof String){
|
if(obj instanceof String){
|
||||||
String str = (String)obj;
|
String str = (String)obj;
|
||||||
size+=str.length(); //on compte avant car \0A compte pour 1 en LLVM, mais 3 pour java
|
|
||||||
str = str.replace("\\n", "\\0A");
|
str = str.replace("\\n", "\\0A");
|
||||||
strGlobal+=str;
|
|
||||||
|
//count OA
|
||||||
|
int countOA = 0;
|
||||||
|
int index = 0;
|
||||||
|
//using array
|
||||||
|
while ((index = str.indexOf("\\0A", index)) != -1) {
|
||||||
|
countOA++;
|
||||||
|
index += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
size += str.length() - countOA * 2;
|
||||||
|
strGlobal += str;
|
||||||
}
|
}
|
||||||
else if(obj instanceof Expression){
|
else if(obj instanceof Expression){
|
||||||
Expression exp = (Expression)obj;
|
Expression exp = (Expression)obj;
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user