no more string concatenation in graph text writer

This commit is contained in:
2015-07-07 16:24:43 +02:00
parent 2b94ddf793
commit 31eb284b60
43 changed files with 160 additions and 111 deletions
@@ -53,7 +53,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
writer.append("l" + type + size + "(");
writer.append("l").append(type).append(size).append("(");
ofs.toString(writer, localData);
return writer.append(")");
}
@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -46,7 +46,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
writer.append("si" + size + "(");
writer.append("si").append(size).append("(");
value.toString(writer, localData);
return writer.append(")");
}
@@ -54,7 +54,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
writer.append("s" + type + size + "(");
writer.append("s").append(type).append(size).append("(");
ofs.toString(writer, localData);
writer.append(",");
value.toString(writer, localData);
@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -40,7 +41,7 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
return writer.append("" + value);
return writer.append(value);
}
@Override
@@ -44,7 +44,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
return writer.append("" + value);
return writer.append(value);
}
@Override
@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -35,7 +36,7 @@ public class ScriptAVM2Item extends AVM2Item {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
return writer.append("script" + scriptIndex);
return writer.append("script").append(scriptIndex);
}
@Override
@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
@@ -43,7 +44,7 @@ public class SetGlobalSlotAVM2Item extends AVM2Item {
writer.append("setglobalslot");
writer.spaceBeforeCallParenthesies(2);
writer.append("(");
writer.append(slotId + ",");
writer.append(slotId).append(",");
value.toString(writer, localData);
return writer.append(")");
}
@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -48,7 +49,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
String localName = localRegName(localData.localRegNames, regIndex);
srcData.localName = localName;
writer.append(localName + " = ");
writer.append(localName).append(" = ");
return value.toString(writer, localData);
}
@@ -43,7 +43,7 @@ public class StringAVM2Item extends AVM2Item implements SimpleValue {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
return writer.append("\"" + Helper.escapeActionScriptString(value) + "\"");
return writer.append("\"").append(Helper.escapeActionScriptString(value)).append("\"");
}
@Override
@@ -86,7 +86,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block {
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
}
if (labelUsed) {
writer.append("loop" + loop.id + ":").newLine();
writer.append("loop").append(loop.id).append(":").newLine();
}
writer.append("for each");
if (writer.getFormatting().spaceBeforeParenthesesForEachParentheses) {
@@ -86,7 +86,7 @@ public class ForInAVM2Item extends LoopItem implements Block {
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
}
if (labelUsed) {
writer.append("loop" + loop.id + ":").newLine();
writer.append("loop").append(loop.id).append(":").newLine();
}
writer.append("for");
if (writer.getFormatting().spaceBeforeParenthesesForParentheses) {