mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 16:50:46 +00:00
Fixed: #2355 AS1/2 Simplify expressions feature colliding with some other features like hex values
- introducing GraphTarget dialect
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.Block;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphPart;
|
||||
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.SimpleValue;
|
||||
@@ -110,14 +111,15 @@ public class IfItem extends GraphTargetItem implements Block {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param expression Expression
|
||||
* @param onTrue On true
|
||||
* @param onFalse On false
|
||||
*/
|
||||
public IfItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem expression, List<GraphTargetItem> onTrue, List<GraphTargetItem> onFalse) {
|
||||
super(src, lineStartIns, NOPRECEDENCE);
|
||||
public IfItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem expression, List<GraphTargetItem> onTrue, List<GraphTargetItem> onFalse) {
|
||||
super(dialect, src, lineStartIns, NOPRECEDENCE);
|
||||
this.expression = expression;
|
||||
this.onTrue = onTrue;
|
||||
this.onFalse = onFalse;
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
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 java.util.Set;
|
||||
@@ -36,12 +37,14 @@ public class IntegerValueItem extends GraphTargetItem implements IntegerValueTyp
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param value Value
|
||||
*/
|
||||
public IntegerValueItem(GraphSourceItem src, GraphSourceItem lineStartIns, int value) {
|
||||
super(src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
public IntegerValueItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, int value) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
this.intValue = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetDialect;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TypeItem;
|
||||
|
||||
@@ -35,12 +36,14 @@ public class LabelItem extends GraphTargetItem {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param labelName Label name
|
||||
*/
|
||||
public LabelItem(GraphSourceItem src, GraphSourceItem lineStartIns, String labelName) {
|
||||
super(src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
public LabelItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, String labelName) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
this.labelName = labelName;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetDialect;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.Loop;
|
||||
import java.util.List;
|
||||
@@ -36,12 +37,13 @@ public abstract class LoopItem extends GraphTargetItem {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source item
|
||||
* @param lineStartItem Line start item
|
||||
* @param loop Loop
|
||||
*/
|
||||
public LoopItem(GraphSourceItem src, GraphSourceItem lineStartItem, Loop loop) {
|
||||
super(src, lineStartItem, NOPRECEDENCE);
|
||||
public LoopItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartItem, Loop loop) {
|
||||
super(dialect, src, lineStartItem, NOPRECEDENCE);
|
||||
this.loop = loop;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
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;
|
||||
@@ -38,12 +39,14 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param instruction Instruction
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param value Value
|
||||
*/
|
||||
public NotItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_UNARY, value, "!", "Boolean");
|
||||
public NotItem(GraphTargetDialect dialect, GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value) {
|
||||
super(dialect, instruction, lineStartIns, PRECEDENCE_UNARY, value, "!", "Boolean");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +114,7 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted {
|
||||
}
|
||||
//If it is not a boolean, put !! there for toBoolean conversion
|
||||
if (!TypeItem.BOOLEAN.equals(value.returnType()) && !(value instanceof DuplicateItem)) {
|
||||
return new NotItem(null, null, this);
|
||||
return new NotItem(dialect, null, null, this);
|
||||
}
|
||||
|
||||
//can be inverted
|
||||
|
||||
@@ -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;
|
||||
@@ -35,13 +36,15 @@ public class OrItem 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 OrItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
|
||||
super(src, lineStartIns, PRECEDENCE_LOGICALOR, leftSide, rightSide, "||", "Boolean", "Boolean");
|
||||
public OrItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_LOGICALOR, leftSide, rightSide, "||", "Boolean", "Boolean");
|
||||
this.leftSide = leftSide;
|
||||
this.rightSide = rightSide;
|
||||
}
|
||||
|
||||
@@ -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.SourceGenerator;
|
||||
import java.util.List;
|
||||
@@ -33,12 +34,14 @@ public class ParenthesisItem extends GraphTargetItem {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param value Value
|
||||
*/
|
||||
public ParenthesisItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem value) {
|
||||
super(src, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
public ParenthesisItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem value) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.ecma.Null;
|
||||
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.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.TypeItem;
|
||||
@@ -35,11 +36,13 @@ public class PopItem extends GraphTargetItem {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
*/
|
||||
public PopItem(GraphSourceItem src, GraphSourceItem lineStartIns) {
|
||||
super(src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
public PopItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PushItem extends GraphTargetItem {
|
||||
* @param value Value to push
|
||||
*/
|
||||
public PushItem(GraphTargetItem value) {
|
||||
super(value.getSrc(), value.getLineStartItem(), value.getPrecedence(), value);
|
||||
super(value.dialect, value.getSrc(), value.getLineStartItem(), 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;
|
||||
|
||||
@@ -29,9 +30,11 @@ public class ScriptEndItem extends GraphTargetItem implements ExitItem {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
*/
|
||||
public ScriptEndItem() {
|
||||
super(null, null, NOPRECEDENCE);
|
||||
public ScriptEndItem(GraphTargetDialect dialect) {
|
||||
super(dialect, null, null, NOPRECEDENCE);
|
||||
}
|
||||
|
||||
@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;
|
||||
@@ -87,6 +88,7 @@ public class SwitchItem extends LoopItem implements Block {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param dialect Dialect
|
||||
* @param instruction Instruction
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param loop Loop
|
||||
@@ -95,8 +97,8 @@ public class SwitchItem extends LoopItem implements Block {
|
||||
* @param caseCommands Case commands
|
||||
* @param valuesMapping Values mapping
|
||||
*/
|
||||
public SwitchItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, Loop loop, GraphTargetItem switchedObject, List<GraphTargetItem> caseValues, List<List<GraphTargetItem>> caseCommands, List<Integer> valuesMapping) {
|
||||
super(instruction, lineStartIns, loop);
|
||||
public SwitchItem(GraphTargetDialect dialect, GraphSourceItem instruction, GraphSourceItem lineStartIns, Loop loop, GraphTargetItem switchedObject, List<GraphTargetItem> caseValues, List<List<GraphTargetItem>> caseCommands, List<Integer> valuesMapping) {
|
||||
super(dialect, instruction, lineStartIns, loop);
|
||||
this.switchedObject = switchedObject;
|
||||
this.caseValues = caseValues;
|
||||
this.caseCommands = caseCommands;
|
||||
|
||||
@@ -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;
|
||||
@@ -52,14 +53,15 @@ public class TernarOpItem extends GraphTargetItem {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param expression Expression
|
||||
* @param onTrue On true
|
||||
* @param onFalse On false
|
||||
*/
|
||||
public TernarOpItem(GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem expression, GraphTargetItem onTrue, GraphTargetItem onFalse) {
|
||||
super(src, lineStartIns, PRECEDENCE_CONDITIONAL);
|
||||
public TernarOpItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, GraphTargetItem expression, GraphTargetItem onTrue, GraphTargetItem onFalse) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_CONDITIONAL);
|
||||
this.expression = expression;
|
||||
this.onTrue = onTrue;
|
||||
this.onFalse = onFalse;
|
||||
|
||||
@@ -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 TrueItem extends GraphTargetItem implements LogicalOpItem, SimpleVa
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
*/
|
||||
public TrueItem(GraphSourceItem src, GraphSourceItem lineStartIns) {
|
||||
super(src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
public TrueItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns) {
|
||||
super(dialect, src, lineStartIns, PRECEDENCE_PRIMARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,7 +68,7 @@ public class TrueItem extends GraphTargetItem implements LogicalOpItem, SimpleVa
|
||||
|
||||
@Override
|
||||
public GraphTargetItem invert(GraphSourceItem neqSrc) {
|
||||
return new FalseItem(getSrc(), getLineStartItem());
|
||||
return new FalseItem(dialect, getSrc(), getLineStartItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph.model;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
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 java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -44,6 +45,7 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param instruction Instruction
|
||||
* @param lineStartItem Line start item
|
||||
* @param precedence Precedence
|
||||
@@ -51,8 +53,8 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp {
|
||||
* @param operator Operator
|
||||
* @param coerce Coerce
|
||||
*/
|
||||
public UnaryOpItem(GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem value, String operator, String coerce) {
|
||||
super(instruction, lineStartItem, precedence, value);
|
||||
public UnaryOpItem(GraphTargetDialect dialect, GraphSourceItem instruction, GraphSourceItem lineStartItem, int precedence, GraphTargetItem value, String operator, String coerce) {
|
||||
super(dialect, instruction, lineStartItem, precedence, value);
|
||||
this.operator = operator;
|
||||
this.coerce = coerce;
|
||||
}
|
||||
|
||||
@@ -18,9 +18,10 @@ package com.jpexs.decompiler.graph.model;
|
||||
|
||||
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.Loop;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -30,24 +31,16 @@ import java.util.List;
|
||||
*/
|
||||
public class UniversalLoopItem extends WhileItem implements Block {
|
||||
|
||||
/**
|
||||
* True expression.
|
||||
*/
|
||||
static final List<GraphTargetItem> TRUE_EXPRESSION = new ArrayList<>();
|
||||
|
||||
static {
|
||||
TRUE_EXPRESSION.add(new TrueItem(null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param loop Loop
|
||||
* @param commands Commands
|
||||
*/
|
||||
public UniversalLoopItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> commands) {
|
||||
super(src, lineStartIns, loop, TRUE_EXPRESSION, commands);
|
||||
public UniversalLoopItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> commands) {
|
||||
super(dialect, src, lineStartIns, loop, Arrays.asList(new TrueItem(dialect, src, lineStartIns)), commands);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -85,14 +86,15 @@ public class WhileItem extends LoopItem implements Block {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dialect Dialect
|
||||
* @param src Source
|
||||
* @param lineStartIns Line start instruction
|
||||
* @param loop Loop
|
||||
* @param expression Expression
|
||||
* @param commands Commands
|
||||
*/
|
||||
public WhileItem(GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> expression, List<GraphTargetItem> commands) {
|
||||
super(src, lineStartIns, loop);
|
||||
public WhileItem(GraphTargetDialect dialect, GraphSourceItem src, GraphSourceItem lineStartIns, Loop loop, List<GraphTargetItem> expression, List<GraphTargetItem> commands) {
|
||||
super(dialect, src, lineStartIns, loop);
|
||||
this.expression = expression;
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user