Fixed: #2355 AS1/2 Simplify expressions feature colliding with some other features like hex values

- introducing GraphTarget dialect
This commit is contained in:
Jindra Petřík
2025-05-01 20:14:36 +02:00
parent 598294de9c
commit 33bc40be14
117 changed files with 626 additions and 304 deletions
@@ -222,7 +222,7 @@ public class AVM2Graph extends Graph {
* @param localRegAssignmentIps Local register assignment IPs
*/
public AVM2Graph(int swfVersion, AbcIndexing abcIndex, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap<Integer, GraphTargetItem> localRegs, ScopeStack scopeStack, ScopeStack localScopeStack, HashMap<Integer, String> localRegNames, List<DottedChain> fullyQualifiedNames, HashMap<Integer, Integer> localRegAssignmentIps) {
super(new AVM2GraphSource(code, isStatic, scriptIndex, classIndex, localRegs, abc, body, localRegNames, fullyQualifiedNames, localRegAssignmentIps), getExceptionEntries(body));
super(AVM2GraphTargetDialect.INSTANCE, new AVM2GraphSource(code, isStatic, scriptIndex, classIndex, localRegs, abc, body, localRegNames, fullyQualifiedNames, localRegAssignmentIps), getExceptionEntries(body));
this.avm2code = code;
this.abc = abc;
this.body = body;
@@ -2066,17 +2066,17 @@ public class AVM2Graph extends Graph {
if (withCommands.size() > 1) {
withCommands.remove(withCommands.size() - 1);
withCommands.add(expr);
expr = new CommaExpressionItem(null, localData.lineStartInstruction, withCommands);
expr = new CommaExpressionItem(dialect, null, localData.lineStartInstruction, withCommands);
}
} else {
//There is no if - this means there was something that
// can be evaluated on compiletime and compiler removed the whole if
// ASC2 does this
withCommands.add(new FalseItem(null, localData.lineStartInstruction));
expr = new CommaExpressionItem(null, localData.lineStartInstruction, withCommands);
withCommands.add(new FalseItem(dialect, null, localData.lineStartInstruction));
expr = new CommaExpressionItem(dialect, null, localData.lineStartInstruction, withCommands);
}
} else {
expr = new FalseItem(null, localData.lineStartInstruction);
expr = new FalseItem(dialect, null, localData.lineStartInstruction);
}
FilteredCheckAVM2Item filteredCheck = (FilteredCheckAVM2Item) hn.obj.getThroughRegister().getNotCoerced();
FilterAVM2Item filter = new FilterAVM2Item(null, null, filteredCheck.object, expr);
@@ -2737,13 +2737,13 @@ public class AVM2Graph extends Graph {
if (wi.expression == list && !list.isEmpty()) {
GraphTargetItem lastExpr = list.remove(list.size() - 1);
List<GraphTargetItem> onTrue = new ArrayList<>();
BreakItem bi = new BreakItem(null, null, wi.loop.id);
BreakItem bi = new BreakItem(dialect, null, null, wi.loop.id);
onTrue.add(bi);
IfItem ifi = new IfItem(null, null, lastExpr.invert(null), onTrue, new ArrayList<>());
IfItem ifi = new IfItem(dialect, null, null, lastExpr.invert(null), onTrue, new ArrayList<>());
list.add(ifi);
wi.commands.addAll(0, list);
list.clear();
list.add(new TrueItem(null, null));
list.add(new TrueItem(dialect, null, null));
}
}
@@ -0,0 +1,88 @@
package com.jpexs.decompiler.flash.abc.avm2.graph;
import com.jpexs.decompiler.flash.abc.avm2.model.DoubleValueAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.NameValuePair;
import com.jpexs.decompiler.flash.abc.avm2.model.NewArrayAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.NewObjectAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.StringAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item;
import com.jpexs.decompiler.flash.ecma.ArrayType;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.ecma.ObjectType;
import com.jpexs.decompiler.flash.ecma.Undefined;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.model.FalseItem;
import com.jpexs.decompiler.graph.model.TrueItem;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author JPEXS
*/
public class AVM2GraphTargetDialect extends GraphTargetDialect {
public static final GraphTargetDialect INSTANCE = new AVM2GraphTargetDialect();
private AVM2GraphTargetDialect() {
}
@Override
public String getName() {
return "AVM2";
}
@Override
public GraphTargetItem valToItem(Object r) {
if (r == null) {
return null;
}
if (r instanceof Boolean) {
if ((Boolean) r) {
return new TrueItem(this, null, null);
} else {
return new FalseItem(this, null, null);
}
}
if (r instanceof String) {
return new StringAVM2Item(null, null, (String) r);
}
if (r instanceof Long) {
return new DoubleValueAVM2Item(null, null, (double) (Long) r);
}
if (r instanceof Integer) {
return new IntegerValueAVM2Item(null, null, (Integer) r);
}
if (r instanceof Double) {
return new DoubleValueAVM2Item(null, null, (Double) r);
}
if (r instanceof Null) {
return new NullAVM2Item(null, null);
}
if (r instanceof Undefined) {
return new UndefinedAVM2Item(null, null);
}
if (r instanceof ArrayType) {
List<GraphTargetItem> vals = new ArrayList<>();
ArrayType at = (ArrayType) r;
for (Object v : at.values) {
vals.add(valToItem(v));
}
return new NewArrayAVM2Item(null, null, vals);
}
if (r instanceof ObjectType) {
List<NameValuePair> props = new ArrayList<>();
ObjectType ot = (ObjectType) r;
for (String k : ot.getAttributeNames()) {
props.add(new NameValuePair(valToItem(k), valToItem(ot.getAttribute(k))));
}
return new NewObjectAVM2Item(null, null, props);
}
return null;
}
}
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -53,7 +54,7 @@ public class DupIns extends InstructionDefinition {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem v = stack.pop();
stack.push(v);
stack.push(new DuplicateItem(ins, localData.lineStartInstruction, v));
stack.push(new DuplicateItem(AVM2GraphTargetDialect.INSTANCE, ins, localData.lineStartInstruction, v));
//v.moreSrc.add(new GraphSourceItemPos(ins, 0));
}
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -49,7 +50,7 @@ public class PushFalseIns extends InstructionDefinition {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
stack.push(new FalseItem(ins, localData.lineStartInstruction));
stack.push(new FalseItem(AVM2GraphTargetDialect.INSTANCE, ins, localData.lineStartInstruction));
}
@Override
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -49,7 +50,7 @@ public class PushTrueIns extends InstructionDefinition {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
stack.push(new TrueItem(ins, localData.lineStartInstruction));
stack.push(new TrueItem(AVM2GraphTargetDialect.INSTANCE, ins, localData.lineStartInstruction));
}
@Override
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -68,7 +69,7 @@ public abstract class AVM2Item extends GraphTargetItem {
* @param value Value
*/
public AVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, int precedence, GraphTargetItem value) {
super(instruction, lineStartIns, precedence, value);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, precedence, value);
if (instruction instanceof AVM2Instruction) {
this.instruction = (AVM2Instruction) instruction;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -33,7 +34,7 @@ import java.util.List;
public class NullCoalesceAVM2Item extends BinaryOpItem {
public NullCoalesceAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartItem, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartItem, PRECEDENCE_NULLCOALESCE, leftSide, rightSide, "??", null, null);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartItem, PRECEDENCE_NULLCOALESCE, leftSide, rightSide, "??", null, null);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.clauses;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -88,7 +89,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block {
* @param commands Commands
*/
public ForEachInAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, Loop loop, InAVM2Item expression, List<GraphTargetItem> commands) {
super(instruction, lineStartIns, loop);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, loop);
/*
Following was commented out:
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.clauses;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -88,7 +89,7 @@ public class ForInAVM2Item extends LoopItem implements Block {
* @param commands Commands
*/
public ForInAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, Loop loop, InAVM2Item expression, List<GraphTargetItem> commands) {
super(instruction, lineStartIns, loop);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, loop);
//Commented out - see the comment in ForEachInAVM2Item
/*if (!commands.isEmpty()) {
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -48,7 +49,7 @@ public class AddAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
* @param rightSide Right side
*/
public AddAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+", "", ""); //?
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+", "", ""); //?
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -42,7 +43,7 @@ public class AsTypeAVM2Item extends BinaryOpItem {
* @param type Type
*/
public AsTypeAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem type) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "as", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "as", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item;
@@ -44,7 +45,7 @@ public class BitNotAVM2Item extends UnaryOpItem {
* @param value Value
*/
public BitNotAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, value, "~", "int");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, value, "~", "int");
}
@Override
@@ -16,6 +16,7 @@
*/
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -43,7 +44,7 @@ public abstract class BitwiseBinaryOpAVM2Item extends BinaryOpItem implements Co
* @param coerceRight Coerce right
*/
public BitwiseBinaryOpAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem leftSide, GraphTargetItem rightSide, String operator, String coerceLeft, String coerceRight) {
super(instruction, lineStartItem, precedence, leftSide, rightSide, operator, coerceLeft, coerceRight);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartItem, precedence, leftSide, rightSide, operator, coerceLeft, coerceRight);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -47,7 +48,7 @@ public class DivideAVM2Item extends BinaryOpItem implements CompoundableBinaryOp
* @param rightSide Right side
*/
public DivideAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class EqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
* @param rightSide Right side
*/
public EqAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "==", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "==", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class GeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
* @param rightSide Right side
*/
public GeAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">=", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">=", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class GtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
* @param rightSide Right side
*/
public GtAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class InAVM2Item extends BinaryOpItem {
* @param object Object
*/
public InAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem name, GraphTargetItem object) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, name, object, "in", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, name, object, "in", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class InstanceOfAVM2Item extends BinaryOpItem {
* @param type Type
*/
public InstanceOfAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem type) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "instanceof", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "instanceof", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class IsTypeAVM2Item extends BinaryOpItem {
* @param type Type
*/
public IsTypeAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem type) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "is", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "is", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class LShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryOp
* @param rightSide Right side
*/
public LShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class LeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
* @param rightSide Right side
*/
public LeAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<=", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<=", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class LtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi
* @param rightSide Right side
*/
public LtAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -46,7 +47,7 @@ public class ModuloAVM2Item extends BinaryOpItem implements CompoundableBinaryOp
* @param rightSide Right side
*/
public ModuloAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -46,7 +47,7 @@ public class MultiplyAVM2Item extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public MultiplyAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -41,7 +42,7 @@ public class NegAVM2Item extends UnaryOpItem {
* @param value Value
*/
public NegAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, value, "-", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, value, "-", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class NeqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfCondit
* @param rightSide Right side
*/
public NeqAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.model.clauses.AssignmentAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AssignableAVM2Item;
import com.jpexs.decompiler.graph.CompilationException;
@@ -41,7 +42,7 @@ public class PreDecrementAVM2Item extends UnaryOpItem implements AssignmentAVM2I
* @param object Object
*/
public PreDecrementAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem object) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, object, "--", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, object, "--", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AssignableAVM2Item;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -40,7 +41,7 @@ public class PreIncrementAVM2Item extends UnaryOpItem {
* @param object Object
*/
public PreIncrementAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem object) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, object, "++", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, object, "++", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class RShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryOp
* @param rightSide Right side
*/
public RShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class StrictEqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfC
* @param rightSide Right side
*/
public StrictEqAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "===", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "===", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -46,7 +47,7 @@ public class StrictNeqAVM2Item extends BinaryOpItem implements LogicalOpItem, If
* @param rightSide Right side
*/
public StrictNeqAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!==", "", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!==", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -46,7 +47,7 @@ public class SubtractAVM2Item extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public SubtractAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -45,7 +46,7 @@ public class TypeOfAVM2Item extends UnaryOpItem {
* @param value Value
*/
public TypeOfAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, value, "typeof ", "");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, value, "typeof ", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class URShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryO
* @param rightSide Right side
*/
public URShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>", "Number", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.graph.CompilationException;
@@ -41,7 +42,7 @@ public class UnPlusAVM2Item extends UnaryOpItem {
* @param value Value
*/
public UnPlusAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, value, "+", "Number");
super(AVM2GraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, value, "+", "Number");
}
@Override
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -450,7 +451,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
AssignableAVM2Item.setTemp(localData, this, collectionReg)
));
GraphTargetItem assigned = new GraphTargetItem() {
GraphTargetItem assigned = new GraphTargetItem(AVM2GraphTargetDialect.INSTANCE) {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
return null;
@@ -770,7 +771,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
*/
List<NameValuePair> pairs = new ArrayList<>();
for (String tname : skinParts.keySet()) {
pairs.add(new NameValuePair(new StringAVM2Item(null, null, tname), skinParts.get(tname) ? new TrueItem(null, null) : new FalseItem(null, null)));
pairs.add(new NameValuePair(new StringAVM2Item(null, null, tname), skinParts.get(tname) ? new TrueItem(AVM2GraphTargetDialect.INSTANCE, null, null) : new FalseItem(AVM2GraphTargetDialect.INSTANCE, null, null)));
}
NewObjectAVM2Item sltVal = new NewObjectAVM2Item(null, null, pairs);
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.NumberContext;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphTargetDialect;
import com.jpexs.decompiler.flash.abc.avm2.model.ApplyTypeAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item;
@@ -97,6 +98,7 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.Loop;
import com.jpexs.decompiler.graph.TypeItem;
@@ -147,6 +149,8 @@ import macromedia.asc.util.Decimal128;
* @author JPEXS
*/
public class ActionScript3Parser {
private static final GraphTargetDialect DIALECT = AVM2GraphTargetDialect.INSTANCE;
private long uniqLast = 0;
@@ -1661,7 +1665,7 @@ public class ActionScript3Parser {
}
break;
case CURLY_OPEN:
ret = new BlockItem(null, null, commands(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables, abc));
ret = new BlockItem(DIALECT, null, null, commands(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, variables, abc));
expectedType(SymbolType.CURLY_CLOSE);
break;
/*case INCREMENT: //preincrement
@@ -1701,7 +1705,7 @@ public class ActionScript3Parser {
} else {
lexer.pushback(s);
}
ret = new IfItem(null, null, ifExpr, onTrueList, onFalseList);
ret = new IfItem(DIALECT, null, null, ifExpr, onTrueList, onFalseList);
break;
case WHILE:
expectedType(SymbolType.PARENT_OPEN);
@@ -1715,7 +1719,7 @@ public class ActionScript3Parser {
}
loops.push(wloop);
whileBody.add(command(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables, abc));
ret = new WhileItem(null, null, wloop, whileExpr, whileBody);
ret = new WhileItem(DIALECT, null, null, wloop, whileExpr, whileBody);
loops.pop();
break;
case DO:
@@ -1731,7 +1735,7 @@ public class ActionScript3Parser {
List<GraphTargetItem> doExpr = new ArrayList<>();
doExpr.add(expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc));
expectedType(SymbolType.PARENT_CLOSE);
ret = new DoWhileItem(null, null, dloop, doBody, doExpr);
ret = new DoWhileItem(DIALECT, null, null, dloop, doBody, doExpr);
loops.pop();
break;
case FOR:
@@ -1777,7 +1781,7 @@ public class ActionScript3Parser {
//GraphTargetItem firstCommand = command(thisType,pkg,needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables);
forExpr = expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, false, abc);
if (forExpr == null) {
forExpr = new TrueItem(null, null);
forExpr = new TrueItem(DIALECT, null, null);
}
expectedType(SymbolType.SEMICOLON);
GraphTargetItem fcom = command(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, variables, abc);
@@ -1796,7 +1800,7 @@ public class ActionScript3Parser {
ret = new ForInAVM2Item(null, null, floop, inexpr, forBody);
}
} else {
ret = new ForItem(null, null, floop, forFirstCommands, forExpr, forFinalCommands, forBody);
ret = new ForItem(DIALECT, null, null, floop, forFirstCommands, forExpr, forFinalCommands, forBody);
}
loops.pop();
break;
@@ -1827,7 +1831,7 @@ public class ActionScript3Parser {
int pos = 0;
while (s.type == SymbolType.CASE || s.type == SymbolType.DEFAULT) {
while (s.type == SymbolType.CASE || s.type == SymbolType.DEFAULT) {
GraphTargetItem curCaseExpr = s.type == SymbolType.DEFAULT ? new DefaultItem() : expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc);
GraphTargetItem curCaseExpr = s.type == SymbolType.DEFAULT ? new DefaultItem(DIALECT) : expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc);
expectedType(SymbolType.COLON);
s = lex();
caseExprsAll.add(curCaseExpr);
@@ -1840,7 +1844,7 @@ public class ActionScript3Parser {
s = lex();
}
expected(s, lexer.yyline(), SymbolType.CURLY_CLOSE);
ret = new SwitchItem(null, null, sloop, switchExpr, caseExprsAll, caseCmds, valueMapping);
ret = new SwitchItem(DIALECT, null, null, sloop, switchExpr, caseExprsAll, caseCmds, valueMapping);
loops.pop();
break;
case BREAK:
@@ -1864,7 +1868,7 @@ public class ActionScript3Parser {
lexer.pushback(s);
bloopId = loops.peek().id;
}
ret = new BreakItem(null, null, bloopId);
ret = new BreakItem(DIALECT, null, null, bloopId);
break;
case CONTINUE:
s = lex();
@@ -1899,7 +1903,7 @@ public class ActionScript3Parser {
}
}
//TODO: handle switch
ret = new ContinueItem(null, null, cloopId);
ret = new ContinueItem(DIALECT, null, null, cloopId);
break;
case RETURN:
GraphTargetItem retexpr = expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, true, registerVars, inFunction, inMethod, true, variables, false, abc);
@@ -2011,7 +2015,7 @@ public class ActionScript3Parser {
break;
}
if (s.type == SymbolType.SEMICOLON) {
return new EmptyCommand();
return new EmptyCommand(DIALECT);
}
lexer.pushback(s);
ret = expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc);
@@ -2114,7 +2118,7 @@ public class ActionScript3Parser {
if (commaItems.size() == 1) {
return commaItems.get(0);
}
return new CommaExpressionItem(null, null, commaItems);
return new CommaExpressionItem(DIALECT, null, null, commaItems);
}
/**
@@ -2219,7 +2223,7 @@ public class ActionScript3Parser {
break;
case TERNAR: //???
lhs = new TernarOpItem(null, null, lhs, mhs, rhs);
lhs = new TernarOpItem(DIALECT, null, null, lhs, mhs, rhs);
break;
case SHIFT_LEFT:
lhs = new LShiftAVM2Item(null, null, lhs, rhs);
@@ -2267,10 +2271,10 @@ public class ActionScript3Parser {
lhs = new GeAVM2Item(null, null, lhs, rhs);
break;
case AND:
lhs = new AndItem(null, null, lhs, rhs);
lhs = new AndItem(DIALECT, null, null, lhs, rhs);
break;
case OR:
lhs = new OrItem(null, null, lhs, rhs);
lhs = new OrItem(DIALECT, null, null, lhs, rhs);
break;
case MINUS:
lhs = new SubtractAVM2Item(null, null, lhs, rhs);
@@ -2344,10 +2348,10 @@ public class ActionScript3Parser {
assigned = new BitXorAVM2Item(null, null, lhs, assigned);
break;
case ASSIGN_AND:
assigned = new AndItem(null, null, lhs, assigned);
assigned = new AndItem(DIALECT, null, null, lhs, assigned);
break;
case ASSIGN_OR:
assigned = new OrItem(null, null, lhs, assigned);
assigned = new OrItem(DIALECT, null, null, lhs, assigned);
break;
case ASSIGN:
default:
@@ -2422,13 +2426,13 @@ public class ActionScript3Parser {
break;
//Both ASs
case "dup":
ret = new DuplicateItem(null, null, expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, false, abc));
ret = new DuplicateItem(DIALECT, null, null, expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, false, abc));
break;
case "push":
ret = new PushItem(expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, false, abc));
break;
case "pop":
ret = new PopItem(null, null);
ret = new PopItem(DIALECT, null, null);
break;
case "goto": //TODO
case "multiname":
@@ -2634,11 +2638,11 @@ public class ActionScript3Parser {
break;
case NOT:
ret = new NotItem(null, null, expressionPrimary(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, false, registerVars, inFunction, inMethod, false, variables, abc));
ret = new NotItem(DIALECT, null, null, expressionPrimary(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, false, registerVars, inFunction, inMethod, false, variables, abc));
break;
case PARENT_OPEN:
ret = new ParenthesisItem(null, null, expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc));
ret = new ParenthesisItem(DIALECT, null, null, expression(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables, true, abc));
expectedType(SymbolType.PARENT_CLOSE);
if (ret.value == null) {
throw new AVM2ParseException("Expression in parenthesis expected", lexer.yyline());
@@ -51,7 +51,7 @@ public abstract class AssignableAVM2Item extends AVM2Item {
protected GraphTargetItem makeCoerced(GraphTargetItem assignedValue, GraphTargetItem targetType) {
if (assignedValue instanceof OrItem) {
OrItem oi = (OrItem) assignedValue;
return new OrItem(assignedValue.getSrc(), assignedValue.getLineStartItem(), makeCoerced(oi.leftSide, targetType), makeCoerced(oi.rightSide, targetType));
return new OrItem(dialect, assignedValue.getSrc(), assignedValue.getLineStartItem(), makeCoerced(oi.leftSide, targetType), makeCoerced(oi.rightSide, targetType));
}
//TODO: Is it needed for AndItem too?
return new CoerceAVM2Item(null, null, assignedValue, targetType);
@@ -1241,7 +1241,7 @@ public abstract class Action implements GraphSourceItem {
break;
}
if (ip >= actions.size()) {
output.add(new ScriptEndItem());
output.add(new ScriptEndItem(ActionGraphTargetDialect.INSTANCE));
break;
}
if (Configuration.simplifyExpressions.get()) {
@@ -123,7 +123,7 @@ public class ActionGraph extends Graph {
* @param charset Charset
*/
public ActionGraph(Map<String, Map<String, Trait>> uninitializedClassTraits, String path, boolean insideDoInitAction, boolean insideFunction, List<Action> code, HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int version, String charset) {
super(new ActionGraphSource(path, insideDoInitAction, code, version, registerNames, variables, functions, charset), new ArrayList<>());
super(ActionGraphTargetDialect.INSTANCE, new ActionGraphSource(path, insideDoInitAction, code, version, registerNames, variables, functions, charset), new ArrayList<>());
this.uninitializedClassTraits = uninitializedClassTraits;
this.insideDoInitAction = insideDoInitAction;
this.insideFunction = insideFunction;
@@ -506,7 +506,7 @@ public class ActionGraph extends Graph {
checkedBody.remove(0);
if (checkedLoop == null) {
checkedLoop = new Loop(localData.loops.size(), null, null);
checkedBody.add(new BreakItem(null, null, checkedLoop.id));
checkedBody.add(new BreakItem(dialect, null, null, checkedLoop.id));
}
sti.setValue(new DirectValueActionItem(Null.INSTANCE));
list.add(t, new ForInActionItem(null, null, checkedLoop, (GraphTargetItem) sti, enumerateItem.object, checkedBody));
@@ -524,7 +524,7 @@ public class ActionGraph extends Graph {
list.remove(t);
if (checkedLoop == null) {
checkedLoop = new Loop(localData.loops.size(), null, null);
checkedBody.add(new BreakItem(null, null, checkedLoop.id));
checkedBody.add(new BreakItem(dialect, null, null, checkedLoop.id));
}
list.remove(t - 1);
t--;
@@ -0,0 +1,90 @@
package com.jpexs.decompiler.flash.action;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.model.InitArrayActionItem;
import com.jpexs.decompiler.flash.action.model.InitObjectActionItem;
import com.jpexs.decompiler.flash.ecma.ArrayType;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.ecma.ObjectType;
import com.jpexs.decompiler.flash.ecma.Undefined;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.model.FalseItem;
import com.jpexs.decompiler.graph.model.TrueItem;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author JPEXS
*/
public class ActionGraphTargetDialect extends GraphTargetDialect {
public static final GraphTargetDialect INSTANCE = new ActionGraphTargetDialect();
private ActionGraphTargetDialect() {
}
@Override
public String getName() {
return "Action";
}
@Override
public GraphTargetItem valToItem(Object r) {
if (r == null) {
return null;
}
if (r instanceof Boolean) {
if ((Boolean) r) {
return new TrueItem(this, null, null);
} else {
return new FalseItem(this, null, null);
}
}
if (r instanceof String) {
return new DirectValueActionItem((String) r);
}
if (r instanceof Long) {
return new DirectValueActionItem((Long) r);
}
if (r instanceof Integer) {
return new DirectValueActionItem((Long)(long)(Integer) r);
}
if (r instanceof Short) {
return new DirectValueActionItem((Long)(long)(Short) r);
}
if (r instanceof Byte) {
return new DirectValueActionItem((Long)(long)(Byte) r);
}
if (r instanceof Double) {
return new DirectValueActionItem((Double) r);
}
if (r instanceof Null) {
return new DirectValueActionItem(Null.INSTANCE);
}
if (r instanceof Undefined) {
return new DirectValueActionItem(Undefined.INSTANCE);
}
if (r instanceof ArrayType) {
List<GraphTargetItem> vals = new ArrayList<>();
ArrayType at = (ArrayType) r;
for (Object v : at.values) {
vals.add(valToItem(v));
}
return new InitArrayActionItem(null, null, vals);
}
if (r instanceof ObjectType) {
List<GraphTargetItem> names = new ArrayList<>();
List<GraphTargetItem> vals = new ArrayList<>();
ObjectType ot = (ObjectType) r;
for (String k : ot.getAttributeNames()) {
names.add(valToItem(k));
vals.add(valToItem(ot.getAttribute(k)));
}
return new InitObjectActionItem(null, null, names, vals);
}
return null;
}
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.as2;
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CallFunctionActionItem;
import com.jpexs.decompiler.flash.action.model.CallMethodActionItem;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
@@ -873,7 +874,7 @@ public class ActionScript2ClassDetector {
} else {
onFalse.add(ter.onFalse);
}
commands.set(i, new IfItem(null, null, ter.expression, onTrue, onFalse));
commands.set(i, new IfItem(ActionGraphTargetDialect.INSTANCE, null, null, ter.expression, onTrue, onFalse));
}
}
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionPop;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
@@ -42,7 +43,7 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable
* Constructor.
*/
public ActionItem() {
super(null, null, NOPRECEDENCE);
super(ActionGraphTargetDialect.INSTANCE, null, null, NOPRECEDENCE);
}
/**
@@ -65,7 +66,7 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable
* @param value Value
*/
public ActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, int precedence, GraphTargetItem value) {
super(instruction, lineStartIns, precedence, value);
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, precedence, value);
}
/**
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf4.ActionAdd;
import com.jpexs.decompiler.flash.action.swf5.ActionAdd2;
@@ -56,7 +57,7 @@ public class AddActionItem extends BinaryOpItem implements CompoundableBinaryOpA
* @param version2 Version 2
*/
public AddActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide, boolean version2) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+", "", "");
this.version2 = version2;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionAnd;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class AndActionItem extends BinaryOpItem {
* @param rightSide Right side
*/
public AndActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_LOGICALAND, leftSide, rightSide, "and", "Boolean", "Boolean");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_LOGICALAND, leftSide, rightSide, "and", "Boolean", "Boolean");
}
@Override
@@ -16,6 +16,7 @@
*/
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
@@ -43,7 +44,7 @@ public abstract class BitwiseBinaryOpActionItem extends BinaryOpItem implements
* @param coerceRight Coerce right
*/
public BitwiseBinaryOpActionItem(GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem leftSide, GraphTargetItem rightSide, String operator, String coerceLeft, String coerceRight) {
super(instruction, lineStartItem, precedence, leftSide, rightSide, operator, coerceLeft, coerceRight);
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartItem, precedence, leftSide, rightSide, operator, coerceLeft, coerceRight);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf4.ActionDivide;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class DivideActionItem extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public DivideActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/", "Number", "Number");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/", "Number", "Number");
}
@Override
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf5.ActionEquals2;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -52,7 +53,7 @@ public class EqActionItem extends BinaryOpItem implements LogicalOpItem, EqualsT
* @param version2 Version 2 flag
*/
public EqActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide, boolean version2) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "==", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "==", "", "");
this.version2 = version2;
}
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
@@ -55,7 +56,7 @@ public class GeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte
* @param version2 Version 2 flag
*/
public GeActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide, boolean version2) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">=", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">=", "", "");
this.version2 = version2;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf5.ActionLess2;
@@ -48,7 +49,7 @@ public class GtActionItem extends BinaryOpItem implements LogicalOpItem {
* @param rightSide Right side
*/
public GtActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">", "", "");
}
@Override
@@ -16,6 +16,7 @@
*/
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.ActionItem;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -41,7 +42,7 @@ public class InActionItem extends BinaryOpItem {
* @param object Object
*/
public InActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, ActionItem name, ActionItem object) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, name, object, "in", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, name, object, "in", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf6.ActionInstanceOf;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -43,7 +44,7 @@ public class InstanceOfActionItem extends BinaryOpItem {
* @param type Type
*/
public InstanceOfActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem type) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "instanceof", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, value, type, "instanceof", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -44,7 +45,7 @@ public class LShiftActionItem extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public LShiftActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<", "int", "int");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<", "int", "int");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
@@ -49,7 +50,7 @@ public class LeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte
* @param rightSide Right side
*/
public LeActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<=", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<=", "", "");
}
@Override
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionLess;
import com.jpexs.decompiler.flash.action.swf5.ActionLess2;
@@ -55,7 +56,7 @@ public class LtActionItem extends BinaryOpItem implements LogicalOpItem {
* @param version2 Version 2 flag
*/
public LtActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide, boolean version2) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<", "", "");
this.version2 = version2;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf5.ActionModulo;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class ModuloActionItem extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public ModuloActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%", "Number", "Number");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf4.ActionMultiply;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class MultiplyActionItem extends BinaryOpItem implements CompoundableBina
* @param rightSide Right side
*/
public MultiplyActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*", "Number", "Number");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*", "Number", "Number");
}
@Override
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf5.ActionEquals2;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -54,7 +55,7 @@ public class NeqActionItem extends BinaryOpItem implements LogicalOpItem, Invert
* @param version2 Version 2 flag
*/
public NeqActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide, boolean version2) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=", "", "");
this.version2 = version2;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionOr;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class OrActionItem extends BinaryOpItem {
* @param rightSide Right side
*/
public OrActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_LOGICALOR, leftSide, rightSide, "or", "Boolean", "Boolean");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_LOGICALOR, leftSide, rightSide, "or", "Boolean", "Boolean");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.model.GetMemberActionItem;
import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem;
@@ -52,7 +53,7 @@ public class PreDecrementActionItem extends UnaryOpItem {
* @param object Object
*/
public PreDecrementActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem object) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, object, "--", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, object, "--", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.model.GetMemberActionItem;
import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem;
@@ -53,7 +54,7 @@ public class PreIncrementActionItem extends UnaryOpItem {
* @param object Object
*/
public PreIncrementActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem object) {
super(instruction, lineStartIns, PRECEDENCE_UNARY, object, "++", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_UNARY, object, "++", "" /*"Number" Causes unnecessary ++Number(xx) when xx not number*/);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -44,7 +45,7 @@ public class RShiftActionItem extends BinaryOpItem implements CompoundableBinary
* @param rightSide Right side
*/
public RShiftActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>", "int", "int");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>", "int", "int");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -45,7 +46,7 @@ public class StrictEqActionItem extends BinaryOpItem implements LogicalOpItem, I
* @param rightSide Right side
*/
public StrictEqActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "===", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "===", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -47,7 +48,7 @@ public class StrictNeqActionItem extends BinaryOpItem implements LogicalOpItem,
* @param rightSide Right side
*/
public StrictNeqActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!==", "", "");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "!==", "", "");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionStringAdd;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class StringAddActionItem extends BinaryOpItem {
* @param rightSide Right side
*/
public StringAddActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "add", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "add", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionStringEquals;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class StringEqActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringEqActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "eq", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "eq", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -45,7 +46,7 @@ public class StringGeActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringGeActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "ge", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "ge", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
import com.jpexs.decompiler.flash.action.swf6.ActionStringGreater;
@@ -46,7 +47,7 @@ public class StringGtActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringGtActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "gt", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "gt", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
@@ -47,7 +48,7 @@ public class StringLeActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringLeActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "le", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "le", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionStringLess;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class StringLtActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringLtActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "lt", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_RELATIONAL, leftSide, rightSide, "lt", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.swf4.ActionNot;
import com.jpexs.decompiler.flash.action.swf4.ActionStringEquals;
import com.jpexs.decompiler.graph.CompilationException;
@@ -44,7 +45,7 @@ public class StringNeActionItem extends BinaryOpItem implements Inverted {
* @param rightSide Right side
*/
public StringNeActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "ne", "String", "String");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_EQUALITY, leftSide, rightSide, "ne", "String", "String");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.swf4.ActionSubtract;
@@ -47,7 +48,7 @@ public class SubtractActionItem extends BinaryOpItem implements CompoundableBina
* @param rightSide Right side
*/
public SubtractActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-", "Number", "Number");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-", "Number", "Number");
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.CompoundableBinaryOpAs12;
import com.jpexs.decompiler.flash.action.swf5.ActionBitURShift;
import com.jpexs.decompiler.graph.CompilationException;
@@ -43,7 +44,7 @@ public class URShiftActionItem extends BinaryOpItem implements CompoundableBinar
* @param rightSide Right side
*/
public URShiftActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>", "Number", "Number");
super(ActionGraphTargetDialect.INSTANCE, instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>", "Number", "Number");
}
@Override
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.action.parser.script;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.model.AsciiToCharActionItem;
import com.jpexs.decompiler.flash.action.model.CallActionItem;
import com.jpexs.decompiler.flash.action.model.CallFunctionActionItem;
@@ -141,6 +142,7 @@ import com.jpexs.decompiler.flash.types.CLIPACTIONRECORD;
import com.jpexs.decompiler.flash.types.CLIPEVENTFLAGS;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.AndItem;
@@ -181,6 +183,8 @@ import java.util.Map;
*/
public class ActionScript2Parser {
private static final GraphTargetDialect DIALECT = ActionGraphTargetDialect.INSTANCE;
/**
* Builtin classes that can be casted to
*/
@@ -1145,7 +1149,7 @@ public class ActionScript2Parser {
}
break;
case CURLY_OPEN:
ret = new BlockItem(null, null, commands(inFunction, inMethod, forinlevel, inTellTarget, variables, functions, hasEval));
ret = new BlockItem(DIALECT, null, null, commands(inFunction, inMethod, forinlevel, inTellTarget, variables, functions, hasEval));
expectedType(SymbolType.CURLY_CLOSE);
break;
case INCREMENT: //preincrement
@@ -1184,7 +1188,7 @@ public class ActionScript2Parser {
} else {
lexer.pushback(s);
}
ret = new IfItem(null, null, ifExpr, onTrueList, onFalseList);
ret = new IfItem(DIALECT, null, null, ifExpr, onTrueList, onFalseList);
break;
case WHILE:
expectedType(SymbolType.PARENT_OPEN);
@@ -1193,7 +1197,7 @@ public class ActionScript2Parser {
expectedType(SymbolType.PARENT_CLOSE);
List<GraphTargetItem> whileBody = new ArrayList<>();
whileBody.add(command(inFunction, inMethod, forinlevel, inTellTarget, true, variables, functions, hasEval));
ret = new WhileItem(null, null, null, whileExpr, whileBody);
ret = new WhileItem(DIALECT, null, null, null, whileExpr, whileBody);
break;
case DO:
List<GraphTargetItem> doBody = new ArrayList<>();
@@ -1203,7 +1207,7 @@ public class ActionScript2Parser {
List<GraphTargetItem> doExpr = new ArrayList<>();
doExpr.add(expression(inFunction, inMethod, inTellTarget, true, variables, functions, true, hasEval));
expectedType(SymbolType.PARENT_CLOSE);
ret = new DoWhileItem(null, null, null, doBody, doExpr);
ret = new DoWhileItem(DIALECT, null, null, null, doBody, doExpr);
break;
case FOR:
expectedType(SymbolType.PARENT_OPEN);
@@ -1240,7 +1244,7 @@ public class ActionScript2Parser {
item = new VariableActionItem(objIdent, null, define);
item.setStoreValue(new GraphTargetItem() {
item.setStoreValue(new GraphTargetItem(DIALECT) {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
@@ -1290,7 +1294,7 @@ public class ActionScript2Parser {
}
forExpr = expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval);
if (forExpr == null) {
forExpr = new TrueItem(null, null);
forExpr = new TrueItem(DIALECT, null, null);
}
expectedType(SymbolType.SEMICOLON);
GraphTargetItem fcom = command(inFunction, inMethod, forinlevel, inTellTarget, true, variables, functions, hasEval);
@@ -1304,7 +1308,7 @@ public class ActionScript2Parser {
if (forin) {
ret = new ForInActionItem(null, null, null, item, collection, forBody);
} else {
ret = new ForItem(null, null, null, forFirstCommands, forExpr, forFinalCommands, forBody);
ret = new ForItem(DIALECT, null, null, null, forFirstCommands, forExpr, forFinalCommands, forBody);
}
break;
case SWITCH:
@@ -1330,7 +1334,7 @@ public class ActionScript2Parser {
while (s.type == SymbolType.CASE || s.type == SymbolType.DEFAULT) {
//List<GraphTargetItem> caseExprs; = new ArrayList<>();
while (s.type == SymbolType.CASE || s.type == SymbolType.DEFAULT) {
GraphTargetItem curCaseExpr = s.type == SymbolType.DEFAULT ? new DefaultItem() : expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval);
GraphTargetItem curCaseExpr = s.type == SymbolType.DEFAULT ? new DefaultItem(DIALECT) : expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval);
//caseExprs.add(curCaseExpr);
expectedType(SymbolType.COLON);
s = lex();
@@ -1344,13 +1348,13 @@ public class ActionScript2Parser {
s = lex();
}
expected(s, lexer.yyline(), SymbolType.CURLY_CLOSE);
ret = new SwitchItem(null, null, null, switchExpr, caseExprsAll, caseCmds, valueMapping);
ret = new SwitchItem(DIALECT, null, null, null, switchExpr, caseExprsAll, caseCmds, valueMapping);
break;
case BREAK:
ret = new BreakItem(null, null, 0); //? There is no more than 1 level continue/break in AS1/2
ret = new BreakItem(DIALECT, null, null, 0); //? There is no more than 1 level continue/break in AS1/2
break;
case CONTINUE:
ret = new ContinueItem(null, null, 0); //? There is no more than 1 level continue/break in AS1/2
ret = new ContinueItem(DIALECT, null, null, 0); //? There is no more than 1 level continue/break in AS1/2
break;
case RETURN:
GraphTargetItem retexpr = expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval);
@@ -1407,7 +1411,7 @@ public class ActionScript2Parser {
if (debugMode) {
System.out.println("/command");
}
return new EmptyCommand();
return new EmptyCommand(DIALECT);
case DIRECTIVE:
switch ((String) s.value) {
case "strict":
@@ -1462,7 +1466,7 @@ public class ActionScript2Parser {
if (commaItems.size() == 1) {
return commaItems.get(0);
}
return new CommaExpressionItem(null, null, commaItems);
return new CommaExpressionItem(DIALECT, null, null, commaItems);
}
private ParsedSymbol peekLex() throws IOException, ActionParseException, InterruptedException {
@@ -1541,7 +1545,7 @@ public class ActionScript2Parser {
switch (op.type) {
case TERNAR:
lhs = new TernarOpItem(null, null, lhs, mhs, rhs);
lhs = new TernarOpItem(DIALECT, null, null, lhs, mhs, rhs);
break;
case SHIFT_LEFT:
lhs = new LShiftActionItem(null, null, lhs, rhs);
@@ -1589,10 +1593,10 @@ public class ActionScript2Parser {
lhs = new GeActionItem(null, null, lhs, rhs, true/*FIXME SWF version?*/);
break;
case AND:
lhs = new AndItem(null, null, lhs, rhs);
lhs = new AndItem(DIALECT, null, null, lhs, rhs);
break;
case OR:
lhs = new OrItem(null, null, lhs, rhs);
lhs = new OrItem(DIALECT, null, null, lhs, rhs);
break;
case FULLAND:
lhs = new AndActionItem(null, null, lhs, rhs);
@@ -1752,7 +1756,7 @@ public class ActionScript2Parser {
private GraphTargetItem handleVariable(ParsedSymbol s, GraphTargetItem ret, List<VariableActionItem> variables, Reference<Boolean> allowMemberOrCall, boolean inFunction, boolean inMethod, boolean inTellTarget, List<FunctionActionItem> functions, Reference<Boolean> hasEval) throws IOException, ActionParseException, InterruptedException {
if (s.value.equals("not")) {
ret = new NotItem(null, null, expressionPrimary(false, inFunction, inMethod, inTellTarget, false, variables, functions, true, hasEval));
ret = new NotItem(DIALECT, null, null, expressionPrimary(false, inFunction, inMethod, inTellTarget, false, variables, functions, true, hasEval));
} else {
String varName = s.value.toString();
/*if (s.type == SymbolType.PATH) { //only with slash syntax
@@ -1797,13 +1801,13 @@ public class ActionScript2Parser {
break;
//Both ASs
case "dup":
ret = new DuplicateItem(null, null, expression(inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, false, hasEval));
ret = new DuplicateItem(DIALECT, null, null, expression(inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, false, hasEval));
break;
case "push":
ret = new PushItem(expression(inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, false, hasEval));
break;
case "pop":
ret = new PopItem(null, null);
ret = new PopItem(DIALECT, null, null);
break;
case "strict":
s = lexer.lex();
@@ -1953,7 +1957,7 @@ public class ActionScript2Parser {
break;
case NOT:
ret = new NotItem(null, null, expressionPrimary(false, inFunction, inMethod, inTellTarget, false, variables, functions, true, hasEval));
ret = new NotItem(DIALECT, null, null, expressionPrimary(false, inFunction, inMethod, inTellTarget, false, variables, functions, true, hasEval));
break;
case PARENT_OPEN:
@@ -1961,7 +1965,7 @@ public class ActionScript2Parser {
if (pexpr == null) {
throw new ActionParseException("Expression expected", lexer.yyline());
}
ret = new ParenthesisItem(null, null, pexpr);
ret = new ParenthesisItem(DIALECT, null, null, pexpr);
expectedType(SymbolType.PARENT_CLOSE);
allowMemberOrCall = true;
break;
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.EndOfStreamException;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.ActionList;
import com.jpexs.decompiler.flash.action.LocalDataArea;
import com.jpexs.decompiler.flash.action.as2.Trait;
@@ -501,9 +502,9 @@ public class ActionPush extends Action {
if (o instanceof Boolean) {
Boolean b = (Boolean) o;
if (b) {
toPush = new TrueItem(this, lineStartAction);
toPush = new TrueItem(ActionGraphTargetDialect.INSTANCE, this, lineStartAction);
} else {
toPush = new FalseItem(this, lineStartAction);
toPush = new FalseItem(ActionGraphTargetDialect.INSTANCE, this, lineStartAction);
}
} else {
DirectValueActionItem dvt = new DirectValueActionItem(this, lineStartAction, pos, o, constantPool);
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.BaseLocalData;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphTargetDialect;
import com.jpexs.decompiler.flash.action.LocalDataArea;
import com.jpexs.decompiler.flash.action.as2.Trait;
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
@@ -65,7 +66,7 @@ public class ActionPushDuplicate extends Action {
@Override
public void translate(Map<String, Map<String, Trait>> uninitializedClassTraits, SecondPassData secondPassData, boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) {
GraphTargetItem value = stack.peek();
stack.push(new DuplicateItem(this, lineStartAction, value));
stack.push(new DuplicateItem(ActionGraphTargetDialect.INSTANCE, this, lineStartAction, value));
value.getMoreSrc().add(new GraphSourceItemPos(this, 0));
}
@@ -86,6 +86,11 @@ public class Graph {
* Graph entry points
*/
public List<GraphPart> heads;
/**
* Graph target dialect
*/
protected GraphTargetDialect dialect;
/**
* Graph source code
@@ -144,10 +149,12 @@ public class Graph {
/**
* Constructs a new Graph.
*
* @param dialect Dialect
* @param code Graph source
* @param exceptions Exceptions in the graph
*/
public Graph(GraphSource code, List<GraphException> exceptions) {
public Graph(GraphTargetDialect dialect, GraphSource code, List<GraphException> exceptions) {
this.dialect = dialect;
this.code = code;
this.exceptions = exceptions;
}
@@ -1165,7 +1172,7 @@ public class Graph {
ContinueItem cnt = (ContinueItem) commands.get(commands.size() - 1);
if (cnt.loopId == lastLoopId) {
hasContinues = true;
commands.set(commands.size() - 1, new BreakItem(null, null, swi.loop.id));
commands.set(commands.size() - 1, new BreakItem(dialect, null, null, swi.loop.id));
if (c == swi.caseCommands.size() - 1) {
if (commands.size() == 1) {
commands.remove(0);
@@ -1187,7 +1194,7 @@ public class Graph {
}
targetCommands.addAll(toAdd);
if (toAdd.isEmpty() || (!((toAdd.get(toAdd.size() - 1) instanceof ExitItem) || (toAdd.get(toAdd.size() - 1) instanceof BreakItem)))) {
targetCommands.add(new BreakItem(null, null, swi.loop.id));
targetCommands.add(new BreakItem(dialect, null, null, swi.loop.id));
}
}
} else if (item instanceof IfItem) {
@@ -1501,7 +1508,7 @@ public class Graph {
} else {
GraphTargetItem lastExpr = whi.expression.remove(whi.expression.size() - 1);
forFirstCommands.addAll(whi.expression);
list.set(i, new ForItem(whi.getSrc(), whi.getLineStartItem(), whi.loop, forFirstCommands, lastExpr, forFinalCommands, whi.commands));
list.set(i, new ForItem(dialect, whi.getSrc(), whi.getLineStartItem(), whi.loop, forFirstCommands, lastExpr, forFinalCommands, whi.commands));
}
}
}
@@ -1526,7 +1533,7 @@ public class Graph {
if (gi.targetCommands != null) {
list.remove(gi);
if (gi.labelName != null) {
list.add(new LabelItem(null, gi.lineStartItem, gi.labelName));
list.add(new LabelItem(dialect, null, gi.lineStartItem, gi.labelName));
}
list.addAll(gi.targetCommands);
}
@@ -2043,10 +2050,10 @@ public class Graph {
continue;
}
if (l.loopContinue == part) {
return (new ContinueItem(null, firstIns, l.id));
return (new ContinueItem(dialect, null, firstIns, l.id));
}
if (l.loopBreak == part) {
return (new BreakItem(null, firstIns, l.id));
return (new BreakItem(dialect, null, firstIns, l.id));
}
}
return null;
@@ -2840,7 +2847,7 @@ public class Graph {
if (debugPrintGraph) {
System.err.println("Adding break");
}
ret.add(new BreakItem(null, localData.lineStartInstruction, el.id));
ret.add(new BreakItem(dialect, null, localData.lineStartInstruction, el.id));
return ret;
}
if (el.loopPreContinue == part) {
@@ -2850,7 +2857,7 @@ public class Graph {
if (debugPrintGraph) {
System.err.println("Adding precontinue");
}
ret.add(new ContinueItem(null, localData.lineStartInstruction, el.id));
ret.add(new ContinueItem(dialect, null, localData.lineStartInstruction, el.id));
return ret;
}
if (el.loopContinue == part) {
@@ -2860,7 +2867,7 @@ public class Graph {
if (debugPrintGraph) {
System.err.println("Adding continue");
}
ret.add(new ContinueItem(null, localData.lineStartInstruction, el.id));
ret.add(new ContinueItem(dialect, null, localData.lineStartInstruction, el.id));
return ret;
}
}
@@ -2899,7 +2906,7 @@ public class Graph {
}
if (code.size() <= part.start) {
ret.add(new ScriptEndItem());
ret.add(new ScriptEndItem(dialect));
return ret;
}
@@ -2925,9 +2932,9 @@ public class Graph {
if (firstCode.size() > firstCodePos && (firstCode.get(firstCodePos) instanceof LabelItem)) {
labelName = ((LabelItem) firstCode.get(firstCodePos)).labelName;
} else {
firstCode.add(firstCodePos, new LabelItem(null, localData.lineStartInstruction, labelName));
firstCode.add(firstCodePos, new LabelItem(dialect, null, localData.lineStartInstruction, labelName));
}
ret.add(new GotoItem(null, localData.lineStartInstruction, labelName));
ret.add(new GotoItem(dialect, null, localData.lineStartInstruction, labelName));
return ret;
} else {
visited.add(part);
@@ -2951,7 +2958,7 @@ public class Graph {
if (topBsr != null) {
stack.push(topBsr);
}
loopItem = new UniversalLoopItem(null, localData.lineStartInstruction, currentLoop, new ArrayList<>());
loopItem = new UniversalLoopItem(dialect, null, localData.lineStartInstruction, currentLoop, new ArrayList<>());
//loopItem.commands=printGraph(visited, localData, stack, allParts, parent, part, stopPart, loops);
currentRet.add(loopItem);
currentRet = loopItem.commands;
@@ -3058,7 +3065,7 @@ public class Graph {
}
} while (exHappened);
if ((part.end >= code.size() - 1) && getNextParts(localData, part).isEmpty()) {
output.add(new ScriptEndItem());
output.add(new ScriptEndItem(dialect));
}
}
@@ -3236,13 +3243,13 @@ public class Graph {
pos++;
continue;
}
caseValues.add(new IntegerValueItem(null, localData.lineStartInstruction, pos));
caseValues.add(new IntegerValueItem(dialect, null, localData.lineStartInstruction, pos));
} else if (caseExpressions.containsKey(pos)) {
GraphTargetItem expr = caseExpressions.get(pos);
if (caseCommaCommands.get(pos).size() > 0) {
List<GraphTargetItem> exprCommaCommands = new ArrayList<>(caseCommaCommands.get(pos));
exprCommaCommands.add(expr);
expr = new CommaExpressionItem(null, expr.lineStartItem, exprCommaCommands);
expr = new CommaExpressionItem(dialect, null, expr.lineStartItem, exprCommaCommands);
}
caseValues.add(expr);
} else {
@@ -3342,18 +3349,18 @@ public class Graph {
GraphTargetItem ternarOnTrue;
if (filteredOnTrue.size() > 1) {
filteredOnTrue.set(filteredOnTrue.size() - 1, filteredOnTrue.get(filteredOnTrue.size() - 1).value); // replace Pushitem with its value
ternarOnTrue = new CommaExpressionItem(null, null, filteredOnTrue);
ternarOnTrue = new CommaExpressionItem(dialect, null, null, filteredOnTrue);
} else {
ternarOnTrue = filteredOnTrue.get(0).value;
}
GraphTargetItem ternarOnFalse;
if (filteredOnFalse.size() > 1) {
filteredOnFalse.set(filteredOnFalse.size() - 1, filteredOnFalse.get(filteredOnFalse.size() - 1).value); // replace Pushitem with its value
ternarOnFalse = new CommaExpressionItem(null, null, filteredOnFalse);
ternarOnFalse = new CommaExpressionItem(dialect, null, null, filteredOnFalse);
} else {
ternarOnFalse = filteredOnFalse.get(0).value;
}
TernarOpItem top = new TernarOpItem(null, localData.lineStartInstruction, expr.invert(null), ternarOnTrue, ternarOnFalse);
TernarOpItem top = new TernarOpItem(dialect, null, localData.lineStartInstruction, expr.invert(null), ternarOnTrue, ternarOnFalse);
stack.push(handleTernar(top, localData));
} else {
boolean isIf = true;
@@ -3382,7 +3389,7 @@ public class Graph {
} else if (hideEmptyTrueFalse && rightSide.getNotCoercedNoDup() instanceof FalseItem) {
stack.push(prevExpr);
} else {
stack.push(new OrItem(null, localData.lineStartInstruction, prevExpr, rightSide));
stack.push(new OrItem(dialect, null, localData.lineStartInstruction, prevExpr, rightSide));
}
} else if (leftSide.invert(null).getNotCoercedNoDup() instanceof DuplicateItem) {
isIf = false;
@@ -3391,7 +3398,7 @@ public class Graph {
} else if (hideEmptyTrueFalse && rightSide.getNotCoercedNoDup() instanceof TrueItem) {
stack.push(prevExpr);
} else {
stack.push(new AndItem(null, localData.lineStartInstruction, prevExpr, rightSide));
stack.push(new AndItem(dialect, null, localData.lineStartInstruction, prevExpr, rightSide));
}
} else if (prevExpr instanceof FalseItem) {
isIf = false;
@@ -3402,7 +3409,7 @@ public class Graph {
} else if (hideEmptyTrueFalse && rightSide.getNotCoercedNoDup() instanceof TrueItem) {
stack.push(leftSide);
} else {
stack.push(new AndItem(null, localData.lineStartInstruction, leftSide, rightSide));
stack.push(new AndItem(dialect, null, localData.lineStartInstruction, leftSide, rightSide));
}
} else if (prevExpr instanceof TrueItem) {
isIf = false;
@@ -3411,7 +3418,7 @@ public class Graph {
} else if (hideEmptyTrueFalse && rightSide.getNotCoercedNoDup() instanceof FalseItem) {
stack.push(leftSide);
} else {
stack.push(new OrItem(null, localData.lineStartInstruction, leftSide, rightSide));
stack.push(new OrItem(dialect, null, localData.lineStartInstruction, leftSide, rightSide));
}
} else {
stack.push(prevExpr); //push it back
@@ -3424,13 +3431,13 @@ public class Graph {
if (isIf) {
makeAllCommands(currentRet, stack);
IfItem b = new IfItem(null, localData.lineStartInstruction, expr.invert(null), onTrue, onFalse);
IfItem b = new IfItem(dialect, null, localData.lineStartInstruction, expr.invert(null), onTrue, onFalse);
b.decisionPart = part;
b.onTruePart = nps.get(0);
b.onFalsePart = nps.get(1);
currentRet.add(b);
if (processSubBlk(b, null)) {
stack.push(new PopItem(null, localData.lineStartInstruction));
stack.push(new PopItem(dialect, null, localData.lineStartInstruction));
}
}
}
@@ -3485,7 +3492,7 @@ public class Graph {
expr = expr.invert(null);
}
exprList.add(expr);
ret.add(index, li = new DoWhileItem(null, expr.getLineStartItem(), currentLoop, loopItem.commands, exprList));
ret.add(index, li = new DoWhileItem(dialect, null, expr.getLineStartItem(), currentLoop, loopItem.commands, exprList));
loopTypeFound = true;
}
}
@@ -3530,7 +3537,7 @@ public class Graph {
if (expr instanceof LogicalOpItem) {
expr = ((LogicalOpItem) expr).invert(null);
} else {
expr = new NotItem(null, expr.getLineStartItem(), expr);
expr = new NotItem(dialect, null, expr.getLineStartItem(), expr);
}
}
exprList.add(expr);
@@ -3566,9 +3573,9 @@ public class Graph {
finalComm.addAll(precontinueCommands);
}
if (!finalComm.isEmpty()) {
ret.add(index, li = new ForItem(expr.getSrc(), expr.getLineStartItem(), currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands));
ret.add(index, li = new ForItem(dialect, expr.getSrc(), expr.getLineStartItem(), currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands));
} else {
ret.add(index, li = new WhileItem(expr.getSrc(), expr.getLineStartItem(), currentLoop, exprList, commands));
ret.add(index, li = new WhileItem(dialect, expr.getSrc(), expr.getLineStartItem(), currentLoop, exprList, commands));
}
if (addBreakItem != null) {
ret.add(index + 1, addBreakItem);
@@ -3623,7 +3630,7 @@ public class Graph {
commands.addAll(bodyBranch);
exprList.add(expr);
checkContinueAtTheEnd(commands, currentLoop);
ret.add(index, li = new DoWhileItem(null, exprList.get(0).getLineStartItem(), currentLoop, commands, exprList));
ret.add(index, li = new DoWhileItem(dialect, null, exprList.get(0).getLineStartItem(), currentLoop, commands, exprList));
}
loopTypeFound = true;
@@ -4054,7 +4061,7 @@ public class Graph {
//must go backwards to hit case 5, not case 4
for (int i = caseBodyParts.size() - 1; i >= 0; i--) {
if (caseBodyParts.get(i) == defaultPart) {
DefaultItem di = new DefaultItem();
DefaultItem di = new DefaultItem(dialect);
caseValuesMap.add(i + 1, di);
caseBodyParts.add(i + 1, defaultPart);
hasDefault = true;
@@ -4076,7 +4083,7 @@ public class Graph {
//must go backwards to hit case 2, not case 1
for (int i = caseBodyParts.size() - 1; i >= 0; i--) {
if (caseBodyParts.get(i).leadsTo(localData, this, code, defaultPart, loops, throwStates, false)) {
DefaultItem di = new DefaultItem();
DefaultItem di = new DefaultItem(dialect);
caseValuesMap.add(i + 1, di);
caseBodyParts.add(i + 1, defaultPart);
hasDefault = true;
@@ -4097,7 +4104,7 @@ public class Graph {
*/
for (int i = 0; i < caseBodyParts.size(); i++) {
if (defaultPart.leadsTo(localData, this, code, caseBodyParts.get(i), loops, throwStates, false)) {
DefaultItem di = new DefaultItem();
DefaultItem di = new DefaultItem(dialect);
caseValuesMap.add(i, di);
caseBodyParts.add(i, defaultPart);
hasDefault = true;
@@ -4115,7 +4122,7 @@ public class Graph {
default:
trace("def");
*/
caseValuesMap.add(new DefaultItem());
caseValuesMap.add(new DefaultItem(dialect));
caseBodyParts.add(defaultPart);
}
@@ -4197,7 +4204,7 @@ public class Graph {
if (!currentCaseCommands.isEmpty()) {
GraphTargetItem last = currentCaseCommands.get(currentCaseCommands.size() - 1);
if (!(last instanceof ContinueItem) && !(last instanceof BreakItem) && !(last instanceof GotoItem) && !(last instanceof ExitItem) && !(last instanceof ScriptEndItem)) {
currentCaseCommands.add(new BreakItem(null, localData.lineStartInstruction, currentLoop.id));
currentCaseCommands.add(new BreakItem(dialect, null, localData.lineStartInstruction, currentLoop.id));
}
}
}
@@ -4280,7 +4287,7 @@ public class Graph {
GraphTargetItem ti = checkLoop(new ArrayList<>() /*??*/, next, stopPart, loops, throwStates);
tiRef.setVal(ti);
return new SwitchItem(null, switchStartItem, currentLoop, switchedObject, caseValuesMap, caseCommands, valuesMapping);
return new SwitchItem(dialect, null, switchStartItem, currentLoop, switchedObject, caseValuesMap, caseCommands, valuesMapping);
}
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2010-2024 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.
*/
package com.jpexs.decompiler.graph;
/**
*
* @author JPEXS
*/
public abstract class GraphTargetDialect {
/**
* Identifier of the dialect.
* @return Name
*/
public abstract String getName();
/**
* Conversion of ECMA value (that's used in simplifications)
* back to GraphTarget item.
* @param value
* @return
*/
public abstract GraphTargetItem valToItem(Object value);
}
@@ -136,6 +136,11 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
* ASM Position
*/
protected int pos = 0;
/**
* Dialect
*/
public GraphTargetDialect dialect;
/**
* Gets the line start item
@@ -145,64 +150,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
public GraphSourceItem getLineStartItem() {
return lineStartItem;
}
/**
* Converts a value to an item
*
* FIXME!!! This should only convert to values relatable to current Graph type,
* e.g. ActionItems for AS1/2, AVM2Items for AS3
*
* @param r Value
* @return Graph target item
*/
protected static GraphTargetItem valToItem(Object r) {
if (r == null) {
return null;
}
if (r instanceof Boolean) {
if ((Boolean) r) {
return new TrueItem(null, null);
} else {
return new FalseItem(null, null);
}
}
if (r instanceof String) {
return new StringAVM2Item(null, null, (String) r);
}
if (r instanceof Long) {
return new DoubleValueAVM2Item(null, null, (double) (Long) r);
}
if (r instanceof Integer) {
return new IntegerValueAVM2Item(null, null, (Integer) r);
}
if (r instanceof Double) {
return new DoubleValueAVM2Item(null, null, (Double) r);
}
if (r instanceof Null) {
return new NullAVM2Item(null, null);
}
if (r instanceof Undefined) {
return new UndefinedAVM2Item(null, null);
}
if (r instanceof ArrayType) {
List<GraphTargetItem> vals = new ArrayList<>();
ArrayType at = (ArrayType) r;
for (Object v : at.values) {
vals.add(valToItem(v));
}
return new NewArrayAVM2Item(null, null, vals);
}
if (r instanceof ObjectType) {
List<NameValuePair> props = new ArrayList<>();
ObjectType ot = (ObjectType) r;
for (String k : ot.getAttributeNames()) {
props.add(new NameValuePair(valToItem(k), valToItem(ot.getAttribute(k))));
}
return new NewObjectAVM2Item(null, null, props);
}
return null;
}
/**
* Simplifies something
@@ -237,7 +185,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
break;
}
GraphTargetItem it2 = valToItem(r);
GraphTargetItem it2 = it.dialect == null ? null : it.dialect.valToItem(r);
if (it2 == null) {
return it;
}
@@ -297,8 +245,8 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Constructs GraphTargetItem
*/
public GraphTargetItem() {
this(null, null, NOPRECEDENCE);
public GraphTargetItem(GraphTargetDialect dialect) {
this(dialect, null, null, NOPRECEDENCE);
}
/**
@@ -308,8 +256,8 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
* @param lineStartItem Line start item
* @param precedence Precedence
*/
public GraphTargetItem(GraphSourceItem src, GraphSourceItem lineStartItem, int precedence) {
this(src, lineStartItem, precedence, null);
public GraphTargetItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartItem, int precedence) {
this(dialect, src, lineStartItem, precedence, null);
}
/**
@@ -320,7 +268,8 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
* @param precedence Precedence
* @param value Value
*/
public GraphTargetItem(GraphSourceItem src, GraphSourceItem lineStartItem, int precedence, GraphTargetItem value) {
public GraphTargetItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartItem, int precedence, GraphTargetItem value) {
this.dialect = dialect;
this.src = src;
this.lineStartItem = lineStartItem;
this.precedence = precedence;
@@ -1064,7 +1013,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
* @return Inverted item
*/
public GraphTargetItem invert(GraphSourceItem src) {
return new NotItem(src, getLineStartItem(), this);
return new NotItem(dialect, src, getLineStartItem(), this);
}
/**
@@ -38,7 +38,7 @@ public class MarkItem extends GraphTargetItem {
* @param mark Mark string
*/
public MarkItem(String mark) {
super(null, null, NOPRECEDENCE);
super(null, null, null, NOPRECEDENCE);
this.mark = mark;
}
@@ -40,7 +40,7 @@ public class NotCompileTimeItem extends GraphTargetItem {
* @param object Object that cannot be statically computed
*/
public NotCompileTimeItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem object) {
super(instruction, lineStartIns, NOPRECEDENCE);
super(null, instruction, lineStartIns, NOPRECEDENCE);
this.object = object;
}
@@ -95,7 +95,7 @@ public class TranslateStack extends Stack<GraphTargetItem> {
*/
private PopItem getPop() {
if (pop == null) {
pop = new PopItem(null, null); //TODO: linestart?
pop = new PopItem(null, null, null); //TODO: linestart?
}
return pop;
@@ -46,7 +46,7 @@ public class TypeFunctionItem extends GraphTargetItem {
* @param fullTypeName Full type name
*/
public TypeFunctionItem(String fullTypeName) {
super(null, null, NOPRECEDENCE);
super(null, null, null, NOPRECEDENCE);
this.fullTypeName = fullTypeName;
}
@@ -108,7 +108,7 @@ public class TypeItem extends GraphTargetItem {
* @param ns Namespace
*/
public TypeItem(DottedChain fullTypeName, List<GraphTargetItem> subtypes, String ns) {
super(null, null, NOPRECEDENCE);
super(null, null, null, NOPRECEDENCE);
this.fullTypeName = fullTypeName;
this.ns = ns;
}
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphSourceItemPos;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
@@ -43,13 +44,14 @@ public class AndItem extends BinaryOpItem implements CompoundableBinaryOp {
/**
* Constructor.
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
* @param leftSide Left side
* @param rightSide Right side
*/
public AndItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(src, lineStartIns, PRECEDENCE_LOGICALAND, leftSide, rightSide, "&&", "Boolean", "Boolean");
public AndItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(dialect, src, lineStartIns, PRECEDENCE_LOGICALAND, leftSide, rightSide, "&&", "Boolean", "Boolean");
this.leftSide = leftSide;
this.rightSide = rightSide;
}
@@ -31,7 +31,7 @@ public class AnyItem extends GraphTargetItem {
* Constructor.
*/
public AnyItem() {
super(null);
}
@Override
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.GraphPart;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphSourceItemPos;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SimpleValue;
@@ -71,6 +72,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
/**
* Constructor.
*
* @param dialect Dialect
* @param instruction Instruction
* @param lineStartItem Line start item
* @param precedence Precedence
@@ -80,8 +82,8 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp {
* @param coerceLeft Coerce left
* @param coerceRight Coerce right
*/
public BinaryOpItem(GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem leftSide, GraphTargetItem rightSide, String operator, String coerceLeft, String coerceRight) {
super(instruction, lineStartItem, precedence);
public BinaryOpItem(GraphTargetDialect dialect, GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem leftSide, GraphTargetItem rightSide, String operator, String coerceLeft, String coerceRight) {
super(dialect, instruction, lineStartItem, precedence);
this.leftSide = leftSide;
this.rightSide = rightSide;
this.operator = operator;
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.Graph;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
@@ -41,13 +42,14 @@ public class BlockItem extends GraphTargetItem {
/**
* Constructor.
*
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
* @param commands Commands
*/
public BlockItem(GraphSourceItem src, GraphSourceItem lineStartIns, List<GraphTargetItem> commands) {
super(src, lineStartIns, PRECEDENCE_PRIMARY);
public BlockItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, List<GraphTargetItem> commands) {
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
this.commands = commands;
}
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.NulWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
@@ -46,12 +47,13 @@ public class BreakItem extends GraphTargetItem {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source item
* @param lineStartIns Line start instruction
* @param loopId Loop id
*/
public BreakItem(GraphSourceItem src, GraphSourceItem lineStartIns, long loopId) {
super(src, lineStartIns, NOPRECEDENCE);
public BreakItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, long loopId) {
super(dialect, src, lineStartIns, NOPRECEDENCE);
this.loopId = loopId;
}
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
@@ -41,12 +42,13 @@ public class CommaExpressionItem extends GraphTargetItem {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
* @param commands Commands
*/
public CommaExpressionItem(GraphSourceItem src, GraphSourceItem lineStartIns, List<GraphTargetItem> commands) {
super(src, lineStartIns, PRECEDENCE_COMMA);
public CommaExpressionItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, List<GraphTargetItem> commands) {
super(dialect, src, lineStartIns, PRECEDENCE_COMMA);
this.commands = commands;
}
@@ -37,7 +37,7 @@ public class CommentItem extends GraphTargetItem {
* @param comment Comment
*/
public CommentItem(String comment) {
super(null, null, NOPRECEDENCE);
super(null, null, null, NOPRECEDENCE);
this.commentLines = new String[]{comment};
}
@@ -46,7 +46,7 @@ public class CommentItem extends GraphTargetItem {
* @param commentLines Comment lines
*/
public CommentItem(String[] commentLines) {
super(null, null, NOPRECEDENCE);
super(null, null, null, NOPRECEDENCE);
this.commentLines = commentLines;
}
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.NulWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
@@ -46,12 +47,13 @@ public class ContinueItem extends GraphTargetItem {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source item
* @param lineStartIns Line start instruction
* @param loopId Loop id
*/
public ContinueItem(GraphSourceItem src, GraphSourceItem lineStartIns, long loopId) {
super(src, lineStartIns, NOPRECEDENCE);
public ContinueItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, long loopId) {
super(dialect, src, lineStartIns, NOPRECEDENCE);
this.loopId = loopId;
}
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.graph.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
@@ -25,6 +26,16 @@ import com.jpexs.decompiler.graph.TypeItem;
*/
public class DefaultItem extends GraphTargetItem {
/**
* Constructor
* @param dialect Dialect
*/
public DefaultItem(GraphTargetDialect dialect) {
super(dialect);
}
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
return writer.append("default");
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.helpers.NulWriter;
import com.jpexs.decompiler.graph.Block;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.Loop;
@@ -96,8 +97,8 @@ public class DoWhileItem extends LoopItem implements Block {
* @param commands Commands
* @param expression Expression
*/
public DoWhileItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> commands, List<GraphTargetItem> expression) {
super(src, lineStartIns, loop);
public DoWhileItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> commands, List<GraphTargetItem> expression) {
super(dialect, src, lineStartIns, loop);
this.expression = expression;
this.commands = commands;
}
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SimpleValue;
import com.jpexs.decompiler.graph.SourceGenerator;
@@ -36,12 +37,14 @@ public class DuplicateItem extends GraphTargetItem implements SimpleValue {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start item
* @param value Value
*/
public DuplicateItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(src, lineStartIns, value.getPrecedence(), value);
public DuplicateItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem value) {
super(dialect, src, lineStartIns, value.getPrecedence(), value);
}
@Override
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.graph.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
@@ -27,6 +28,13 @@ import com.jpexs.decompiler.graph.TypeItem;
*/
public class EmptyCommand extends GraphTargetItem {
/**
* @param dialect Dialect
*/
public EmptyCommand(GraphTargetDialect dialect) {
super(dialect);
}
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
return writer;
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SimpleValue;
import com.jpexs.decompiler.graph.SourceGenerator;
@@ -36,11 +37,13 @@ public class FalseItem extends GraphTargetItem implements LogicalOpItem, SimpleV
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
*/
public FalseItem(GraphSourceItem src, GraphSourceItem lineStartIns) {
super(src, lineStartIns, PRECEDENCE_PRIMARY);
public FalseItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns) {
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
}
@Override
@@ -65,7 +68,7 @@ public class FalseItem extends GraphTargetItem implements LogicalOpItem, SimpleV
@Override
public GraphTargetItem invert(GraphSourceItem neqSrc) {
return new TrueItem(getSrc(), getLineStartItem());
return new TrueItem(dialect, getSrc(), getLineStartItem());
}
@Override
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.helpers.NulWriter;
import com.jpexs.decompiler.graph.Block;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.Loop;
@@ -100,6 +101,7 @@ public class ForItem extends LoopItem implements Block {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
* @param loop Loop
@@ -108,8 +110,8 @@ public class ForItem extends LoopItem implements Block {
* @param finalCommands Final commands
* @param commands Commands
*/
public ForItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> firstCommands, GraphTargetItem expression, List<GraphTargetItem> finalCommands, List<GraphTargetItem> commands) {
super(src, lineStartIns, loop);
public ForItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> firstCommands, GraphTargetItem expression, List<GraphTargetItem> finalCommands, List<GraphTargetItem> commands) {
super(dialect, src, lineStartIns, loop);
this.firstCommands = firstCommands;
this.expression = expression;
this.finalCommands = finalCommands;
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.Block;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetDialect;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
@@ -45,12 +46,13 @@ public class GotoItem extends GraphTargetItem implements Block {
/**
* Constructor.
*
* @param dialect Dialect
* @param src Source
* @param lineStartIns Line start instruction
* @param labelName Label name
*/
public GotoItem(GraphSourceItem src, GraphSourceItem lineStartIns, String labelName) {
super(src, lineStartIns, PRECEDENCE_PRIMARY);
public GotoItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, String labelName) {
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
this.labelName = labelName;
}

Some files were not shown because too many files have changed in this diff Show More