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
@@ -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));
}