From 692ebfaac58ced766bf14a32c1c8c55864171203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 23 Mar 2014 23:03:55 +0100 Subject: [PATCH] AS3 parser stub improved --- .../com/jpexs/decompiler/flash/abc/ABC.java | 7 + .../decompiler/flash/abc/ABCInputStream.java | 2 +- .../decompiler/flash/abc/ABCOutputStream.java | 2 +- .../decompiler/flash/abc/avm2/AVM2Code.java | 2 +- .../flash/abc/avm2/ConstantPool.java | 2 +- .../flash/abc/avm2/model/AVM2Item.java | 20 +- .../abc/avm2/model/AlchemyLoadAVM2Item.java | 5 + .../avm2/model/AlchemySignExtendAVM2Item.java | 5 + .../abc/avm2/model/AlchemyStoreAVM2Item.java | 5 + .../abc/avm2/model/ApplyTypeAVM2Item.java | 5 + .../flash/abc/avm2/model/BooleanAVM2Item.java | 5 + .../flash/abc/avm2/model/CallAVM2Item.java | 5 + .../abc/avm2/model/CallMethodAVM2Item.java | 4 + .../abc/avm2/model/CallPropertyAVM2Item.java | 5 + .../abc/avm2/model/CallStaticAVM2Item.java | 5 + .../abc/avm2/model/CallSuperAVM2Item.java | 5 + .../flash/abc/avm2/model/ClassAVM2Item.java | 5 + .../flash/abc/avm2/model/CoerceAVM2Item.java | 39 +- .../abc/avm2/model/ConstructAVM2Item.java | 5 + .../abc/avm2/model/ConstructPropAVM2Item.java | 5 + .../avm2/model/ConstructSuperAVM2Item.java | 5 + .../flash/abc/avm2/model/ConvertAVM2Item.java | 5 + .../abc/avm2/model/DecLocalAVM2Item.java | 5 + .../abc/avm2/model/DecrementAVM2Item.java | 5 + .../abc/avm2/model/DefaultXMLNamespace.java | 5 + .../abc/avm2/model/EscapeXAttrAVM2Item.java | 5 + .../abc/avm2/model/EscapeXElemAVM2Item.java | 5 + .../abc/avm2/model/FilteredCheckAVM2Item.java | 5 + .../flash/abc/avm2/model/FindDefAVM2Item.java | 5 + .../abc/avm2/model/FindPropertyAVM2Item.java | 5 + .../abc/avm2/model/FloatValueAVM2Item.java | 5 + .../abc/avm2/model/FullMultinameAVM2Item.java | 5 + .../avm2/model/GetDescendantsAVM2Item.java | 5 + .../flash/abc/avm2/model/GetLexAVM2Item.java | 5 + .../abc/avm2/model/GetPropertyAVM2Item.java | 5 + .../flash/abc/avm2/model/GetSlotAVM2Item.java | 5 + .../abc/avm2/model/GetSuperAVM2Item.java | 5 + .../flash/abc/avm2/model/HasNextAVM2Item.java | 5 + .../flash/abc/avm2/model/InAVM2Item.java | 5 + .../abc/avm2/model/IncLocalAVM2Item.java | 5 + .../abc/avm2/model/IncrementAVM2Item.java | 5 + .../abc/avm2/model/InitPropertyAVM2Item.java | 5 + .../abc/avm2/model/IntegerValueAVM2Item.java | 5 + .../abc/avm2/model/LocalRegAVM2Item.java | 5 + .../abc/avm2/model/NameSpaceAVM2Item.java | 5 + .../flash/abc/avm2/model/NameValuePair.java | 5 + .../flash/abc/avm2/model/NanAVM2Item.java | 5 + .../abc/avm2/model/NewActivationAVM2Item.java | 5 + .../abc/avm2/model/NewArrayAVM2Item.java | 18 + .../abc/avm2/model/NewFunctionAVM2Item.java | 5 + .../abc/avm2/model/NewObjectAVM2Item.java | 24 + .../abc/avm2/model/NextNameAVM2Item.java | 5 + .../abc/avm2/model/NextValueAVM2Item.java | 5 + .../flash/abc/avm2/model/NullAVM2Item.java | 5 + .../abc/avm2/model/PostDecrementAVM2Item.java | 5 + .../abc/avm2/model/PostIncrementAVM2Item.java | 5 + .../abc/avm2/model/ReturnValueAVM2Item.java | 5 + .../abc/avm2/model/ReturnVoidAVM2Item.java | 5 + .../flash/abc/avm2/model/ScriptAVM2Item.java | 5 + .../abc/avm2/model/SetGlobalSlotAVM2Item.java | 5 + .../abc/avm2/model/SetLocalAVM2Item.java | 33 + .../abc/avm2/model/SetPropertyAVM2Item.java | 4 + .../flash/abc/avm2/model/SetSlotAVM2Item.java | 5 + .../abc/avm2/model/SetSuperAVM2Item.java | 5 + .../flash/abc/avm2/model/StringAVM2Item.java | 4 + .../flash/abc/avm2/model/ThisAVM2Item.java | 5 + .../flash/abc/avm2/model/ThrowAVM2Item.java | 5 + .../abc/avm2/model/UndefinedAVM2Item.java | 18 + .../abc/avm2/model/UnparsedAVM2Item.java | 5 + .../flash/abc/avm2/model/WithAVM2Item.java | 5 + .../flash/abc/avm2/model/WithEndAVM2Item.java | 5 + .../abc/avm2/model/WithObjectAVM2Item.java | 5 + .../flash/abc/avm2/model/XMLAVM2Item.java | 5 + .../model/clauses/DeclarationAVM2Item.java | 5 + .../avm2/model/clauses/ExceptionAVM2Item.java | 8 +- .../avm2/model/clauses/FilterAVM2Item.java | 5 + .../abc/avm2/model/clauses/TryAVM2Item.java | 5 + .../operations/DeletePropertyAVM2Item.java | 5 + .../parser/script/AVM2SourceGenerator.java | 307 +- .../avm2/parser/script/ActionScriptLexer.java | 3307 ++++++++--------- .../parser/script/ActionScriptParser.java | 349 +- .../abc/avm2/parser/script/CallAVM2Item.java | 12 +- .../abc/avm2/parser/script/ClassAVM2Item.java | 6 +- .../abc/avm2/parser/script/ConstAVM2Item.java | 5 +- .../script/ConstructSomethingAVM2Item.java | 67 + .../avm2/parser/script/FunctionAVM2Item.java | 5 +- .../avm2/parser/script/GetterAVM2Item.java | 5 +- .../avm2/parser/script/InterfaceAVM2Item.java | 4 +- .../avm2/parser/script/MethodAVM2Item.java | 16 +- .../abc/avm2/parser/script/NameAVM2Item.java | 88 +- .../avm2/parser/script/PackageAVM2Item.java | 4 + .../avm2/parser/script/PropertyAVM2Item.java | 307 +- .../abc/avm2/parser/script/Reference.java | 46 + .../avm2/parser/script/SetterAVM2Item.java | 4 +- .../abc/avm2/parser/script/SlotAVM2Item.java | 5 + .../abc/avm2/parser/script/SymbolType.java | 3 +- .../abc/avm2/parser/script/actionscript.flex | 1 + .../decompiler/flash/abc/types/ClassInfo.java | 2 +- .../flash/abc/types/InstanceInfo.java | 2 +- .../flash/abc/types/traits/TraitFunction.java | 6 +- .../com/jpexs/decompiler/flash/gui/Main.java | 4 +- .../decompiler/graph/GraphTargetItem.java | 3 + .../com/jpexs/decompiler/graph/TypeItem.java | 32 + .../graph/model/UnboundedTypeItem.java | 12 + 104 files changed, 3087 insertions(+), 2017 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java index c8d39e95b..3bb3c6226 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -91,6 +91,13 @@ public class ABC { public ABC(SWF swf) { this.deobfuscation = null; this.swf = swf; + constants.constant_double.add(null); + constants.constant_int.add(null); + constants.constant_uint.add(null); + constants.constant_string.add(""); + constants.constant_multiname.add(null); + constants.constant_namespace.add(null); + constants.constant_namespace_set.add(null); } public int addMethodBody(MethodBody body) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java index 1c1fc007f..ecde8dbf8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java @@ -312,7 +312,7 @@ public class ABCInputStream extends InputStream { break; case 5: //function TraitFunction t4 = new TraitFunction(); - t4.slot_index = readU30(); + t4.slot_id = readU30(); t4.method_info = readU30(); trait = t4; break; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java index d7ca2a054..0cb74ea55 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java @@ -242,7 +242,7 @@ public class ABCOutputStream extends OutputStream { } if (t instanceof TraitFunction) { TraitFunction t4 = (TraitFunction) t; - writeU30(t4.slot_index); + writeU30(t4.slot_id); writeU30(t4.method_info); } if ((t.kindFlags & 4) == 4) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 615f67f72..2768bfe10 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -891,7 +891,7 @@ public class AVM2Code implements Serializable { writer.hilightSpecial("function ", "traittype"); writer.hilightSpecial(constants.multinameToString(tf.name_index), "traitname"); writer.appendNoHilight(" slotid "); - writer.hilightSpecial("" + tf.slot_index, "slotid"); + writer.hilightSpecial("" + tf.slot_id, "slotid"); writer.newLine(); } if (trait instanceof TraitMethodGetterSetter) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java index 3b269bb67..2f3dbb864 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java @@ -287,7 +287,7 @@ public class ConstantPool { public int getNamespaceSetId(NamespaceSet val) { loopi: - for (int i = 0; i < constant_namespace_set.size(); i++) { + for (int i = 1; i < constant_namespace_set.size(); i++) { NamespaceSet ts = constant_namespace_set.get(i); if (ts.namespaces.length != val.namespaces.length) { continue; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index cabdb8860..971a185b2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -16,13 +16,17 @@ */ package com.jpexs.decompiler.flash.abc.avm2.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import java.util.HashMap; +import java.util.List; public abstract class AVM2Item extends GraphTargetItem { @@ -91,8 +95,20 @@ public abstract class AVM2Item extends GraphTargetItem { } } - @Override + /*@Override public boolean hasReturnValue() { - throw new UnsupportedOperationException(); //Not supported in AVM2 yet + return false; + }*/ + + @Override + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { + if(!hasReturnValue()){ + return toSource(localData, generator); + } + List ret=toSource(localData, generator); + ret.add(new AVM2Instruction(0, new PopIns(), new int[]{}, new byte[0])); + return ret; } + + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index d9e51d3d0..3f94d8944 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -48,4 +48,9 @@ public class AlchemyLoadAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index 118dd5f72..dc476d858 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -47,4 +47,9 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java index 660b27c4f..2ab27db44 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java @@ -51,4 +51,9 @@ public class AlchemyStoreAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java index 623b44921..42040e6da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java @@ -59,4 +59,9 @@ public class ApplyTypeAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java index dc3ebe6f2..d3dda5f13 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/BooleanAVM2Item.java @@ -64,4 +64,9 @@ public class BooleanAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.BOOLEAN; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java index 407f0389c..3938c2236 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java @@ -66,4 +66,9 @@ public class CallAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java index 8dd368720..2d79968c2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java @@ -55,4 +55,8 @@ public class CallMethodAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; //FIXME } + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java index 06b5dafcb..4a16b892e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java @@ -68,4 +68,9 @@ public class CallPropertyAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java index 9d74579b3..069237a29 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java @@ -55,4 +55,9 @@ public class CallStaticAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java index 8e85b7acc..5bd867356 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java @@ -61,4 +61,9 @@ public class CallSuperAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java index 170e94d2e..8376cedd3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ClassAVM2Item.java @@ -40,4 +40,9 @@ public class ClassAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java index 9d46b847d..489a55098 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java @@ -16,13 +16,21 @@ */ package com.jpexs.decompiler.flash.abc.avm2.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceAIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceSIns; +import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; +import java.util.List; import java.util.Set; public class CoerceAVM2Item extends AVM2Item { @@ -81,9 +89,38 @@ public class CoerceAVM2Item extends AVM2Item { return ret; } - + @Override public GraphTargetItem returnType() { return new TypeItem(type); } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + + if (value.returnType().toString().equals(type)) { + return toSourceMerge(localData, generator, value); + } + + AVM2Instruction ins; + switch (type) { + case "*": + ins = new AVM2Instruction(0, new CoerceAIns(), new int[]{}, new byte[0]); + break; + case "String": + ins = new AVM2Instruction(0, new CoerceSIns(), new int[]{}, new byte[0]); + break; + default: + int type_index = new TypeItem(type).resolveClass(((AVM2SourceGenerator) generator).abc); + ins = new AVM2Instruction(0, new CoerceIns(), new int[]{type_index}, new byte[0]); + break; + } + return toSourceMerge(localData, generator, value, ins); + } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java index ec0cfaaf6..1e1ff1d12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java @@ -55,4 +55,9 @@ public class ConstructAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return object.returnType(); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java index d873ca64c..60de67ee0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java @@ -59,4 +59,9 @@ public class ConstructPropAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java index 598172bfe..8f5306209 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java @@ -54,4 +54,9 @@ public class ConstructSuperAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java index 1f3b962f1..ddc84044b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java @@ -78,4 +78,9 @@ public class ConvertAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem(type); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java index 31105eef1..89b85ef09 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecLocalAVM2Item.java @@ -41,4 +41,9 @@ public class DecLocalAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java index c58594348..59adbcbb7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java @@ -55,4 +55,9 @@ public class DecrementAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java index 27309d6ac..06e8b61e8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java @@ -45,4 +45,9 @@ public class DefaultXMLNamespace extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java index 451e4f514..b7cd7fb0c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java @@ -44,4 +44,9 @@ public class EscapeXAttrAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java index 00d9b193c..ff4691195 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java @@ -46,4 +46,9 @@ public class EscapeXElemAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java index a20e73a0e..fba6b85ba 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java @@ -44,4 +44,9 @@ public class FilteredCheckAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java index f9ac99eef..ecbbe9ab1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java @@ -41,4 +41,9 @@ public class FindDefAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java index 0483d0101..1dceca589 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FindPropertyAVM2Item.java @@ -40,4 +40,9 @@ public class FindPropertyAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java index 275c45776..b360e00ab 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FloatValueAVM2Item.java @@ -64,4 +64,9 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index f27c93534..5a50a564f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -159,4 +159,9 @@ public class FullMultinameAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java index 78680b228..df433febc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java @@ -44,4 +44,9 @@ public class GetDescendantsAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java index 41f985103..e000046d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetLexAVM2Item.java @@ -41,4 +41,9 @@ public class GetLexAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java index d0961be9e..bd736297a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java @@ -55,4 +55,9 @@ public class GetPropertyAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java index 94404d0d7..8aa222426 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSlotAVM2Item.java @@ -46,4 +46,9 @@ public class GetSlotAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java index cd3ba4452..c6341c427 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java @@ -50,4 +50,9 @@ public class GetSuperAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java index d23ff4991..d01bd0e34 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java @@ -48,4 +48,9 @@ public class HasNextAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java index 594cb1c25..f7d5159c8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java @@ -44,4 +44,9 @@ public class InAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.BOOLEAN; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java index 9bbdb0b85..d39e85a3a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncLocalAVM2Item.java @@ -41,4 +41,9 @@ public class IncLocalAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java index 33325eed5..cd1aab7c8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java @@ -55,4 +55,9 @@ public class IncrementAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java index 39c22600a..99041313f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java @@ -57,4 +57,9 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index e93d0dc62..c235281f4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -73,4 +73,9 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java index b404341e3..6b2eea6f7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java @@ -114,4 +114,9 @@ public class LocalRegAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java index 5d90d78b5..c10c0c2de 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameSpaceAVM2Item.java @@ -45,4 +45,9 @@ public class NameSpaceAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java index 9e67ea445..9eb86a4f8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java @@ -51,4 +51,9 @@ public class NameValuePair extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java index b9c828e0a..b45148f27 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java @@ -49,4 +49,9 @@ public class NanAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java index cfeffcc85..956b263b5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java @@ -40,4 +40,9 @@ public class NewActivationAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java index 91f45bee7..ee57536b5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java @@ -16,9 +16,13 @@ */ package com.jpexs.decompiler.flash.abc.avm2.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewArrayIns; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; @@ -48,4 +52,18 @@ public class NewArrayAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.ARRAY; } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + return toSourceMerge(localData, generator, values, + new AVM2Instruction(0, new NewArrayIns(), new int[]{values.size()}, new byte[0]) + ); + } + + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index 7ef081fcf..c80ec87a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -84,4 +84,9 @@ public class NewFunctionAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("Function"); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java index 2301b987e..6cf3b357e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java @@ -16,11 +16,16 @@ */ package com.jpexs.decompiler.flash.abc.avm2.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewObjectIns; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; +import java.util.ArrayList; import java.util.List; public class NewObjectAVM2Item extends AVM2Item { @@ -65,4 +70,23 @@ public class NewObjectAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("Object"); } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + List args=new ArrayList<>(); + for(NameValuePair p:pairs){ + args.add(p.name); + args.add(p.value); + } + return toSourceMerge(localData, generator, args, + new AVM2Instruction(0, new NewObjectIns(), new int[]{pairs.size()}, new byte[0]) + ); + } + + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java index 0b1f73604..637e5678c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java @@ -50,4 +50,9 @@ public class NextNameAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java index 881300071..2cfecf0d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java @@ -50,4 +50,9 @@ public class NextValueAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java index 22646bc6b..5cceef3f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java @@ -61,4 +61,9 @@ public class NullAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("null"); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java index 7291e6acc..3d4b31cc8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java @@ -46,4 +46,9 @@ public class PostDecrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite public GraphTargetItem returnType() { return object.returnType(); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java index 175c38d40..4ee760ce2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java @@ -46,4 +46,9 @@ public class PostIncrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite public GraphTargetItem returnType() { return object.returnType(); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java index 8c77a8806..3e35ca721 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java @@ -53,4 +53,9 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java index fbee32db4..37ce16e81 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnVoidAVM2Item.java @@ -49,4 +49,9 @@ public class ReturnVoidAVM2Item extends AVM2Item implements ExitItem { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java index 807fd957c..cb56249c3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ScriptAVM2Item.java @@ -43,4 +43,9 @@ public class ScriptAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java index c7b1d0542..c501f92b7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java @@ -55,4 +55,9 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java index 084231013..847971dfa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal1Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal2Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal3Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.AssignmentAVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -66,6 +67,31 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + AVM2Instruction ins; + switch(regIndex){ + case 0: + ins = new AVM2Instruction(0, new SetLocal0Ins(), new int[]{},new byte[0]); + break; + case 1: + ins = new AVM2Instruction(0, new SetLocal1Ins(), new int[]{},new byte[0]); + break; + case 2: + ins = new AVM2Instruction(0, new SetLocal2Ins(), new int[]{},new byte[0]); + break; + case 3: + ins = new AVM2Instruction(0, new SetLocal3Ins(), new int[]{},new byte[0]); + break; + default: + ins = new AVM2Instruction(0, new SetLocalIns(), new int[]{regIndex},new byte[0]); + break; + } + return toSourceMerge(localData, generator, value, + new AVM2Instruction(0, new DupIns(), new int[]{},new byte[0]) + ,ins); + } + + @Override + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { AVM2Instruction ins; switch(regIndex){ case 0: @@ -87,8 +113,15 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig return toSourceMerge(localData, generator, value, ins); } + + @Override public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java index 0e13e3e53..74861f0fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java @@ -81,4 +81,8 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java index 28e86dd08..e1e50cde3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java @@ -87,4 +87,9 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java index ce0271b52..747b5ed40 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java @@ -62,4 +62,9 @@ public class SetSuperAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java index 10dc3364e..f4f307450 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java @@ -65,4 +65,8 @@ public class StringAVM2Item extends AVM2Item { return TypeItem.STRING; } + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java index 214c7b04c..a621aca7f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThisAVM2Item.java @@ -57,4 +57,9 @@ public class ThisAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java index bae90d2c3..77228d244 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java @@ -40,4 +40,9 @@ public class ThrowAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java index 37d05f7dc..0cc618e8d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java @@ -16,12 +16,18 @@ */ package com.jpexs.decompiler.flash.abc.avm2.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNullIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushUndefinedIns; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; +import java.util.List; import java.util.Set; public class UndefinedAVM2Item extends AVM2Item { @@ -49,4 +55,16 @@ public class UndefinedAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("Undefined"); } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + return toSourceMerge(localData, generator, + new AVM2Instruction(0, new PushUndefinedIns(), new int[]{}, new byte[0]) + ); + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java index 3679cc7bb..3cefc45c2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/UnparsedAVM2Item.java @@ -40,4 +40,9 @@ public class UnparsedAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java index c49c16726..5fa82cf80 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java @@ -64,4 +64,9 @@ public class WithAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java index 9c4721ff2..2ffc0339b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithEndAVM2Item.java @@ -45,4 +45,9 @@ public class WithEndAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java index 939245ba2..18637defd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithObjectAVM2Item.java @@ -40,4 +40,9 @@ public class WithObjectAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java index d671e561c..3df2710ce 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java @@ -52,4 +52,9 @@ public class XMLAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("XML"); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index 8de212451..9aa9e3821 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -77,4 +77,9 @@ public class DeclarationAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem(type); } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java index 7950107c8..05f163ebd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ExceptionAVM2Item.java @@ -40,5 +40,11 @@ public class ExceptionAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; - } + } + + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java index 712a3eacb..f9480cf3d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java @@ -50,4 +50,9 @@ public class FilterAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java index 73f0af4b3..3890a46f3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java @@ -143,4 +143,9 @@ public class TryAVM2Item extends AVM2Item implements Block { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index 072981a82..3ae6dbca9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -61,4 +61,9 @@ public class DeletePropertyAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return new TypeItem("Boolean"); } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 66b6ebcdc..f6dda4578 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -30,6 +30,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal0Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetLexIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetPropertyIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.InitPropertyIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; @@ -65,6 +66,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.AndItem; import com.jpexs.decompiler.graph.model.BreakItem; import com.jpexs.decompiler.graph.model.CommaExpressionItem; @@ -73,6 +75,7 @@ import com.jpexs.decompiler.graph.model.DoWhileItem; import com.jpexs.decompiler.graph.model.DuplicateItem; import com.jpexs.decompiler.graph.model.ForItem; import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.decompiler.graph.model.NotItem; import com.jpexs.decompiler.graph.model.OrItem; import com.jpexs.decompiler.graph.model.SwitchItem; @@ -556,21 +559,24 @@ public class AVM2SourceGenerator implements SourceGenerator { return abc; } - public void generateClass(ClassInfo classInfo, InstanceInfo instanceInfo, SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List traitItems) { + public void generateClass(PackageAVM2Item pkg, ClassInfo classInfo, InstanceInfo instanceInfo, SourceGeneratorLocalData localData, boolean isInterface, String name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List traitItems) { List ret = new ArrayList<>(); ParsedSymbol s = null; + instanceInfo.name_index = abc.constants.addMultiname(new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), + abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg.packageName, true)), 0, true), 0, 0, new ArrayList())); + if (constructor == null) { - instanceInfo.iinit_index = method(localData, new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), name/*?? FIXME*/); + instanceInfo.iinit_index = method(localData, new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), TypeItem.UNBOUNDED/*?? FIXME*/); } else { MethodAVM2Item m = (MethodAVM2Item) constructor; - calcRegisters(m); - instanceInfo.iinit_index = method(localData, m.paramTypes, m.paramNames, m.paramValues, m.body, name/*?? FIXME*/); + calcRegisters(localData, m); + instanceInfo.iinit_index = method(localData, m.paramTypes, m.paramNames, m.paramValues, m.body, TypeItem.UNBOUNDED/*?? FIXME*/); } - generateTraits(false, localData, traitItems, instanceInfo.instance_traits); - generateTraits(true, localData, traitItems, classInfo.static_traits); + generateTraits(pkg, false, localData, traitItems, instanceInfo.instance_traits); + generateTraits(pkg, true, localData, traitItems, classInfo.static_traits); if (extendsVal != null) { instanceInfo.super_index = typeName(localData, extendsVal); @@ -582,6 +588,8 @@ public class AVM2SourceGenerator implements SourceGenerator { MethodInfo mi = new MethodInfo(new int[0], 0, str(""), 0, new ValueKind[0], new int[0]); MethodBody mb = new MethodBody(); mb.method_info = abc.addMethodInfo(mi); + mb.code = new AVM2Code(); + mb.code.code = new ArrayList<>(); mb.code.code.add(ins(new GetLocal0Ins())); mb.code.code.add(ins(new PushScopeIns())); for (GraphTargetItem ti : traitItems) { @@ -597,6 +605,8 @@ public class AVM2SourceGenerator implements SourceGenerator { mb.code.code.add(ins(new ReturnVoidIns())); mb.autoFillStats(abc); + abc.addMethodBody(mb); + classInfo.cinit_index = mb.method_info; instanceInfo.interfaces = new int[implementsStr.size()]; @@ -621,8 +631,26 @@ public class AVM2SourceGenerator implements SourceGenerator { return ret; } - public int generateClass(AVM2Item cls) { - return -1; //TODO + public int generateClass(PackageAVM2Item pkg, SourceGeneratorLocalData localData, AVM2Item cls) { + ClassInfo ci = new ClassInfo(); + InstanceInfo ii = new InstanceInfo(); + abc.class_info.add(ci); + abc.instance_info.add(ii); + + if (cls instanceof ClassAVM2Item) { + ClassAVM2Item cai = (ClassAVM2Item) cls; + generateClass(pkg, ci, ii, localData, false, cai.className, cai.extendsOp, cai.implementsOp, cai.constructor, cai.traits); + if(!cai.isDynamic){ + ii.flags |= InstanceInfo.CLASS_SEALED; + } + } + if (cls instanceof InterfaceAVM2Item) { + InterfaceAVM2Item iai = (InterfaceAVM2Item) cls; + generateClass(pkg, ci, ii, localData, true, iai.name, null, iai.superInterfaces, null, iai.methods); + ii.flags |= InstanceInfo.CLASS_INTERFACE; + } + + return abc.instance_info.size() - 1; } public int traitName(int nsKind, String var) { @@ -636,46 +664,45 @@ public class AVM2SourceGenerator implements SourceGenerator { String pkg = ""; String name = type.toString(); - NameAVM2Item nameItem = (NameAVM2Item) type; + TypeItem nameItem = (TypeItem) type; if (name.contains(".")) { pkg = name.substring(0, name.lastIndexOf(".")); name = name.substring(name.lastIndexOf(".") + 1); } - int nsKind = Namespace.KIND_PACKAGE; - if (pkg.equals("")) { - for (int i = 0; i < nameItem.openedNamespaces.size(); i++) { - String ns = nameItem.openedNamespaces.get(i); - String nspkg = ns; - String nsclass = null; - if (nspkg.contains(":")) { - nsclass = nspkg.substring(nspkg.indexOf(":") + 1); - nspkg = nspkg.substring(0, nspkg.indexOf(":")); - } - if (nsclass == null) { - List abcs = new ArrayList<>(); - abcs.add(abc); - abcs.addAll(allABCs); - loopabc: - for (ABC a : abcs) { - for (InstanceInfo ii : a.instance_info) { - Multiname n = a.constants.constant_multiname.get(ii.name_index); - if (n.getNamespace(a.constants).getName(a.constants).equals(nspkg) && n.getName(a.constants, new ArrayList()).equals(name)) { - pkg = nspkg; - nsKind = n.getNamespace(a.constants).kind; - break loopabc; - } - } - } - } else if (name.equals(nsclass)) { - pkg = nspkg; - nsKind = nameItem.openedNamespacesKind.get(i); - break; - } - } - } - - return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(name), namespace(nsKind, pkg), 0, 0, new ArrayList()), true); + /*int nsKind = Namespace.KIND_PACKAGE; + if (pkg.equals("")) { + for (int i = 0; i < nameItem.openedNamespaces.size(); i++) { + String ns = nameItem.openedNamespaces.get(i); + String nspkg = ns; + String nsclass = null; + if (nspkg.contains(":")) { + nsclass = nspkg.substring(nspkg.indexOf(":") + 1); + nspkg = nspkg.substring(0, nspkg.indexOf(":")); + } + if (nsclass == null) { + List abcs = new ArrayList<>(); + abcs.add(abc); + abcs.addAll(allABCs); + loopabc: + for (ABC a : abcs) { + for (InstanceInfo ii : a.instance_info) { + Multiname n = a.constants.constant_multiname.get(ii.name_index); + if (n.getNamespace(a.constants).getName(a.constants).equals(nspkg) && n.getName(a.constants, new ArrayList()).equals(name)) { + pkg = nspkg; + nsKind = n.getNamespace(a.constants).kind; + break loopabc; + } + } + } + } else if (name.equals(nsclass)) { + pkg = nspkg; + nsKind = nameItem.openedNamespacesKind.get(i); + break; + } + } + }*/ + return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(name), namespace(Namespace.KIND_PACKAGE/*?*/, pkg), 0, 0, new ArrayList()), true); } public int ident(GraphTargetItem name) { @@ -701,6 +728,30 @@ public class AVM2SourceGenerator implements SourceGenerator { throw new RuntimeException("no prop"); //FIXME } + public int getFreeRegister(SourceGeneratorLocalData localData) { + for (int i = 0;; i++) { + if (!localData.registerVars.containsValue(i)) { + localData.registerVars.put("__TEMP__" + i, i); + return i; + } + } + } + + public boolean killRegister(SourceGeneratorLocalData localData, int i) { + String key = null; + for (String k : localData.registerVars.keySet()) { + if (localData.registerVars.get(k) == i) { + key = k; + break; + } + } + if (key != null) { + localData.registerVars.remove(key); + return true; + } + return false; + } + public int method(SourceGeneratorLocalData localData, List paramTypes, List paramNames, List paramValues, List body, GraphTargetItem retType) { int param_types[] = new int[paramTypes.size()]; ValueKind optional[] = new ValueKind[paramValues.size()]; @@ -720,7 +771,10 @@ public class AVM2SourceGenerator implements SourceGenerator { List src = generate(localData, body); mbody.code = new AVM2Code(); mbody.code.code = toInsList(src); + mbody.code.code.add(0, new AVM2Instruction(0, new GetLocal0Ins(), new int[]{}, new byte[0])); + mbody.code.code.add(1, new AVM2Instruction(0, new PushScopeIns(), new int[]{}, new byte[0])); mbody.autoFillStats(abc); + abc.addMethodBody(mbody); //TODO: Exceptions return mbody.method_info; @@ -766,24 +820,28 @@ public class AVM2SourceGenerator implements SourceGenerator { return null; } - public void generateTraits(boolean generateStatic, SourceGeneratorLocalData localData, List items, Traits ts) { + public void generateTraits(PackageAVM2Item pkg, boolean generateStatic, SourceGeneratorLocalData localData, List items, Traits ts) { Trait[] traits = new Trait[items.size()]; + int slot_id = 1; for (int k = 0; k < items.size(); k++) { GraphTargetItem item = items.get(k); if (item instanceof InterfaceAVM2Item) { TraitClass tc = new TraitClass(); - //tc.class_info = generateClass((InterfaceAVM2Item) item); + tc.kindType = Trait.TRAIT_CLASS; tc.name_index = traitName(((InterfaceAVM2Item) item).namespaceKind, ((InterfaceAVM2Item) item).name); + tc.slot_id = slot_id++; ts.traits.add(tc); traits[k] = tc; } if (item instanceof ClassAVM2Item) { TraitClass tc = new TraitClass(); - //tc.class_info = generateClass((ClassAVM2Item) item); + tc.kindType = Trait.TRAIT_CLASS; tc.name_index = traitName(((ClassAVM2Item) item).namespaceKind, ((ClassAVM2Item) item).className); + tc.slot_id = slot_id++; ts.traits.add(tc); traits[k] = tc; + } if ((item instanceof SlotAVM2Item) || (item instanceof ConstAVM2Item)) { TraitSlotConst tsc = new TraitSlotConst(); @@ -822,6 +880,7 @@ public class AVM2SourceGenerator implements SourceGenerator { tsc.value_kind = vk.value_kind; tsc.value_index = vk.value_index; } + tsc.slot_id = slot_id++; ts.traits.add(tsc); traits[k] = tsc; } @@ -833,14 +892,20 @@ public class AVM2SourceGenerator implements SourceGenerator { TraitMethodGetterSetter tmgs = new TraitMethodGetterSetter(); tmgs.kindType = (item instanceof MethodAVM2Item) ? Trait.TRAIT_METHOD : ((item instanceof GetterAVM2Item) ? Trait.TRAIT_GETTER : Trait.TRAIT_SETTER); tmgs.name_index = traitName(((MethodAVM2Item) item).namespaceKind, ((MethodAVM2Item) item).functionName); - - //tmgs.method_info = method(localData, mai.paramTypes, mai.paramNames, mai.paramValues, mai.body, mai.retType); + tmgs.disp_id = 0; //0 = disable override optimization; TODO: handle this + if(mai.isFinal()){ + tmgs.kindFlags |= Trait.ATTR_Final; + } + if(mai.isOverride()){ + tmgs.kindFlags |= Trait.ATTR_Override; + } ts.traits.add(tmgs); + traits[k] = tmgs; } else if (item instanceof FunctionAVM2Item) { TraitFunction tf = new TraitFunction(); - FunctionAVM2Item fai = (FunctionAVM2Item) item; - //tf.method_info = method(localData, fai.paramTypes, fai.paramNames, fai.paramValues, fai.body, fai.retType); + tf.slot_id = slot_id++; + tf.kindType = Trait.TRAIT_FUNCTION; tf.name_index = traitName(Namespace.KIND_PACKAGE, ((FunctionAVM2Item) item).functionName); ts.traits.add(tf); traits[k] = tf; @@ -854,32 +919,32 @@ public class AVM2SourceGenerator implements SourceGenerator { continue; } if (item instanceof InterfaceAVM2Item) { - ((TraitClass) traits[k]).class_info = generateClass((InterfaceAVM2Item) item); + ((TraitClass) traits[k]).class_info = generateClass(pkg, localData, (InterfaceAVM2Item) item); } if (item instanceof ClassAVM2Item) { - ((TraitClass) traits[k]).class_info = generateClass((ClassAVM2Item) item); + ((TraitClass) traits[k]).class_info = generateClass(pkg, localData, (ClassAVM2Item) item); } if ((item instanceof MethodAVM2Item) || (item instanceof GetterAVM2Item) || (item instanceof SetterAVM2Item)) { MethodAVM2Item mai = (MethodAVM2Item) item; if (mai.isStatic() != generateStatic) { continue; } - calcRegisters(mai); + calcRegisters(localData, mai); ((TraitMethodGetterSetter) traits[k]).method_info = method(localData, mai.paramTypes, mai.paramNames, mai.paramValues, mai.body, mai.retType); } else if (item instanceof FunctionAVM2Item) { FunctionAVM2Item fai = (FunctionAVM2Item) item; - calcRegisters(fai); + calcRegisters(localData, fai); ((TraitFunction) traits[k]).method_info = method(localData, fai.paramTypes, fai.paramNames, fai.paramValues, fai.body, fai.retType); } } } - public ScriptInfo generateScriptInfo(SourceGeneratorLocalData localData, List commands) { + public ScriptInfo generateScriptInfo(PackageAVM2Item pkg, SourceGeneratorLocalData localData, List commands) { ScriptInfo si = new ScriptInfo(); - generateTraits(false, localData, commands, si.traits); + generateTraits(pkg, false, localData, commands, si.traits); - MethodInfo mi = new MethodInfo(new int[0], 0, str(""), 0, new ValueKind[0], new int[0]); + MethodInfo mi = new MethodInfo(new int[0], 0, 0, 0, new ValueKind[0], new int[0]); MethodBody mb = new MethodBody(); mb.method_info = abc.addMethodInfo(mi); mb.code = new AVM2Code(); @@ -889,37 +954,104 @@ public class AVM2SourceGenerator implements SourceGenerator { for (Trait t : si.traits.traits) { if (t instanceof TraitClass) { TraitClass tc = (TraitClass) t; - List parents = parentNames(abc.instance_info.get(tc.class_info).name_index); + List parents = new ArrayList<>(); + parentNamesAddNames(abc, allABCs, abc.instance_info.get(tc.class_info).name_index, parents, new ArrayList(), new ArrayList()); NamespaceSet nsset = new NamespaceSet(new int[]{abc.constants.constant_multiname.get(tc.name_index).namespace_index}); mb.code.code.add(ins(new FindPropertyStrictIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(tc.name_index).name_index, 0, abc.constants.getNamespaceSetId(nsset, true), 0, new ArrayList()), true))); for (int i = parents.size() - 1; i >= 1; i--) { - mb.code.code.add(ins(new FindPropertyStrictIns(), parents.get(i))); - mb.code.code.add(ins(new GetPropertyIns(), parents.get(i))); + mb.code.code.add(ins(new GetLexIns(), parents.get(i))); mb.code.code.add(ins(new PushScopeIns())); } - mb.code.code.add(ins(new FindPropertyStrictIns(), parents.get(1))); - mb.code.code.add(ins(new GetPropertyIns(), parents.get(1))); + mb.code.code.add(ins(new GetLexIns(), parents.get(1))); mb.code.code.add(ins(new NewClassIns(), tc.class_info)); for (int i = parents.size() - 1; i >= 1; i--) { mb.code.code.add(ins(new PopScopeIns())); } - mb.code.code.add(ins(new InitPropertyIns(), tc.name_index)); + mb.code.code.add(ins(new InitPropertyIns(), tc.name_index)); } } mb.code.code.add(ins(new ReturnVoidIns())); - abc.addMethodBody(mb); - + mb.autoFillStats(abc); + abc.addMethodBody(mb); si.init_index = mb.method_info; return si; } - public List parentNames(int name_index) { - List ret = new ArrayList<>(); - ret.add(name_index); + public static void parentNamesAddNames(ABC abc, List allABCs, int name_index, List indices, List names, List namespaces) { + List cindices = new ArrayList<>(); + List outABCs = new ArrayList<>(); + parentNames(abc, allABCs, name_index, cindices, names, namespaces, outABCs); + for (int i = 0; i < cindices.size(); i++) { + ABC a = outABCs.get(i); + int m = cindices.get(i); + if (a == abc) { + indices.add(m); + continue; + } + Multiname superName = a.constants.constant_multiname.get(m); + indices.add( + abc.constants.getMultinameId( + new Multiname(Multiname.QNAME, + abc.constants.getStringId(superName.getName(a.constants, new ArrayList()), true), + abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList()), true) + ); + } + } + + public static boolean searchProperty(List abcs, String pkg, String obj, String propertyName, Reference outName, Reference outNs, Reference outPropNs, Reference outPropNsKind) { + for (ABC abc : abcs) { + for (ScriptInfo ii : abc.script_info) { + for (Trait t : ii.traits.traits) { + if (pkg.equals(t.getName(abc).getNamespace(abc.constants).getName(abc.constants))) { + if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList()))) { + outName.setVal(obj); + outNs.setVal(pkg); + outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants)); + outPropNsKind.setVal(t.getName(abc).getNamespace(abc.constants).kind); + return true; + } + } + } + } + for (InstanceInfo ii : abc.instance_info) { + Multiname clsName = ii.getName(abc.constants); + if (obj.equals(clsName.getName(abc.constants, new ArrayList()))) { + if (pkg.equals(clsName.getNamespace(abc.constants).getName(abc.constants))) { + //class found + + for (Trait t : ii.instance_traits.traits) { + if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList()))) { + outName.setVal(obj); + outNs.setVal(pkg); + outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants)); + outPropNsKind.setVal(t.getName(abc).getNamespace(abc.constants).kind); + return true; + } + } + + Multiname superName = abc.constants.constant_multiname.get(ii.super_index); + if (superName != null) { + return searchProperty(abcs, superName.getNamespace(abc.constants).getName(abc.constants), superName.getName(abc.constants, new ArrayList()), propertyName, outName, outNs, outPropNs, outPropNsKind); + } else { + return false; + } + } + } + } + } + return false; + } + + public static void parentNames(ABC abc, List allABCs, int name_index, List indices, List names, List namespaces, List outABCs) { + indices.add(name_index); + names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, new ArrayList())); + namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants)); Multiname mname = abc.constants.constant_multiname.get(name_index); + outABCs.add(abc); + List abcs = new ArrayList<>(); abcs.add(abc); abcs.addAll(allABCs); @@ -929,20 +1061,27 @@ public class AVM2SourceGenerator implements SourceGenerator { Multiname m = a.constants.constant_multiname.get(a.instance_info.get(i).name_index); if (m.getName(a.constants, new ArrayList()).equals(mname.getName(abc.constants, new ArrayList()))) { if (m.getNamespace(a.constants).getName(a.constants).equals(mname.getNamespace(abc.constants).getName(abc.constants))) { - Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index); - ret.addAll(parentNames(abc.constants.getMultinameId(new Multiname(superName.kind, str(superName.getName(a.constants, new ArrayList())), namespace(superName.getNamespace(a.constants).kind, superName.getNamespace(a.constants).getName(a.constants)), 0, 0, new ArrayList()), true))); - return ret; + //Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index); + abcs.remove(a); + if (a.instance_info.get(i).super_index != 0) { + parentNames(a, abcs, a.instance_info.get(i).super_index, indices, names, namespaces, outABCs); + } + /*parentNames(abc,allABCs,abc.constants.getMultinameId( + new Multiname(superName.kind, + abc.constants.getStringId(superName.getName(a.constants, new ArrayList()),true), + abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants),true)),0,true), 0, 0, new ArrayList()), true),indices,names,namespaces,outABCs);*/ + return; } } } } - return ret; } - public void calcRegisters(FunctionAVM2Item fun) { + public void calcRegisters(SourceGeneratorLocalData localData, FunctionAVM2Item fun) { List registerNames = new ArrayList<>(); registerNames.add("this"); registerNames.addAll(fun.paramNames); + localData.registerVars.clear(); for (NameAVM2Item n : fun.subvariables) { if (n.getVariableName().equals("arguments")) { registerNames.add("arguments"); @@ -957,5 +1096,27 @@ public class AVM2SourceGenerator implements SourceGenerator { for (NameAVM2Item n : fun.subvariables) { n.setRegNumber(registerNames.indexOf(n.getVariableName())); } + for (int i = 0; i < registerNames.size(); i++) { + localData.registerVars.put(registerNames.get(i), i); + } + } + + public int resolveType(String objType) { + if (objType.equals("*")) { + return 0; + } + List abcs = new ArrayList<>(); + abcs.add(abc); + abcs.addAll(allABCs); + for (ABC a : abcs) { + int ci = a.findClassByName(objType); + if (ci != -1) { + Multiname tname = a.instance_info.get(ci).getName(a.constants); + return abc.constants.getMultinameId(new Multiname(tname.kind, + abc.constants.getStringId(tname.getName(a.constants, new ArrayList()), true), + abc.constants.getNamespaceId(new Namespace(tname.getNamespace(a.constants).kind, abc.constants.getStringId(tname.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList()), true); + } + } + return 0; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java index c71cb0349..f60a391b3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.3 on 20.3.14 15:36 */ +/* The following code was generated by JFlex 1.5.0-SNAPSHOT */ /* * Copyright (C) 2010-2014 JPEXS @@ -17,812 +17,823 @@ * along with this program. If not, see . */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; - import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; -import java.util.ArrayList; -import java.util.List; import java.util.Stack; +import java.util.List; +import java.util.ArrayList; + /** - * This class is a scanner generated by - * JFlex 1.4.3 on 20.3.14 15:36 from the - * specification file - * C:/Dropbox/Programovani/JavaSE/FFDec/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex + * This class is a scanner generated by + * JFlex 1.5.0-SNAPSHOT + * from the specification file D:/Dropbox/Programovani/JavaSE/FFDec/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex */ public final class ActionScriptLexer { - /** - * This character denotes the end of file - */ - public static final int YYEOF = -1; + /** This character denotes the end of file */ + public static final int YYEOF = -1; - /** - * initial size of the lookahead buffer - */ - private static final int ZZ_BUFFERSIZE = 16384; + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; - /** - * lexical states - */ - public static final int XML = 8; - public static final int XMLSTARTTAG = 6; - public static final int STRING = 2; - public static final int YYINITIAL = 0; - public static final int CHARLITERAL = 4; + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int CHARLITERAL = 4; + public static final int XMLSTARTTAG = 6; + public static final int XML = 8; - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the - * beginning of a line l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 - }; + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED - = "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\14\1\72" - + "\1\16\1\0\1\6\1\101\1\75\1\30\1\62\1\63\1\5\1\77" - + "\1\71\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\70" - + "\1\12\1\15\1\13\1\74\1\102\4\22\1\25\1\22\2\6\1\60" - + "\4\6\1\61\11\6\1\21\2\6\1\66\1\27\1\67\1\100\1\6" - + "\1\0\1\34\1\31\1\36\1\45\1\33\1\46\1\57\1\51\1\43" - + "\1\6\1\35\1\47\1\54\1\41\1\40\1\52\1\6\1\32\1\37" - + "\1\42\1\44\1\55\1\50\1\56\1\53\1\6\1\64\1\76\1\65" - + "\1\73\41\7\2\0\4\6\4\0\1\6\2\0\1\7\7\0\1\6" - + "\4\0\1\6\5\0\27\6\1\0\37\6\1\0\u01ca\6\4\0\14\6" - + "\16\0\5\6\7\0\1\6\1\0\1\6\21\0\160\7\5\6\1\0" - + "\2\6\2\0\4\6\10\0\1\6\1\0\3\6\1\0\1\6\1\0" - + "\24\6\1\0\123\6\1\0\213\6\1\0\5\7\2\0\236\6\11\0" - + "\46\6\2\0\1\6\7\0\47\6\11\0\55\7\1\0\1\7\1\0" - + "\2\7\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\15\0" - + "\4\7\7\0\1\6\4\0\13\7\5\0\53\6\37\7\4\0\2\6" - + "\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6\2\7\1\0" - + "\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7\1\6\1\7" - + "\36\6\33\7\2\0\131\6\13\7\1\6\16\0\12\7\41\6\11\7" - + "\2\6\4\0\1\6\5\0\26\6\4\7\1\6\11\7\1\6\3\7" - + "\1\6\5\7\22\0\31\6\3\7\244\0\4\7\66\6\3\7\1\6" - + "\22\7\1\6\7\7\12\6\2\7\2\0\12\7\1\0\7\6\1\0" - + "\7\6\1\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0" - + "\7\6\1\0\1\6\3\0\4\6\2\0\1\7\1\6\7\7\2\0" - + "\2\7\2\0\3\7\1\6\10\0\1\7\4\0\2\6\1\0\3\6" - + "\2\7\2\0\12\7\4\6\7\0\1\6\5\0\3\7\1\0\6\6" - + "\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0\2\6" - + "\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0\3\7" - + "\3\0\1\7\7\0\4\6\1\0\1\6\7\0\14\7\3\6\1\7" - + "\13\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6\1\0\7\6" - + "\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7\1\0\3\7" - + "\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0\12\7\1\0" - + "\1\6\17\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0" - + "\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7\2\0" - + "\2\7\2\0\3\7\10\0\2\7\4\0\2\6\1\0\3\6\2\7" - + "\2\0\12\7\1\0\1\6\20\0\1\7\1\6\1\0\6\6\3\0" - + "\3\6\1\0\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0" - + "\2\6\3\0\3\6\3\0\14\6\4\0\5\7\3\0\3\7\1\0" - + "\4\7\2\0\1\6\6\0\1\7\16\0\12\7\11\0\1\6\7\0" - + "\3\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0" - + "\5\6\3\0\1\6\7\7\1\0\3\7\1\0\4\7\7\0\2\7" - + "\1\0\2\6\6\0\2\6\2\7\2\0\12\7\22\0\2\7\1\0" - + "\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0\5\6\2\0" - + "\1\7\1\6\7\7\1\0\3\7\1\0\4\7\7\0\2\7\7\0" - + "\1\6\1\0\2\6\2\7\2\0\12\7\1\0\2\6\17\0\2\7" - + "\1\0\10\6\1\0\3\6\1\0\51\6\2\0\1\6\7\7\1\0" - + "\3\7\1\0\4\7\1\6\10\0\1\7\10\0\2\6\2\7\2\0" - + "\12\7\12\0\6\6\2\0\2\7\1\0\22\6\3\0\30\6\1\0" - + "\11\6\1\0\1\6\2\0\7\6\3\0\1\7\4\0\6\7\1\0" - + "\1\7\1\0\10\7\22\0\2\7\15\0\60\6\1\7\2\6\7\7" - + "\4\0\10\6\10\7\1\0\12\7\47\0\2\6\1\0\1\6\2\0" - + "\2\6\1\0\1\6\2\0\1\6\6\0\4\6\1\0\7\6\1\0" - + "\3\6\1\0\1\6\1\0\1\6\2\0\2\6\1\0\4\6\1\7" - + "\2\6\6\7\1\0\2\7\1\6\2\0\5\6\1\0\1\6\1\0" - + "\6\7\2\0\12\7\2\0\2\6\42\0\1\6\27\0\2\7\6\0" - + "\12\7\13\0\1\7\1\0\1\7\1\0\1\7\4\0\2\7\10\6" - + "\1\0\44\6\4\0\24\7\1\0\2\7\5\6\13\7\1\0\44\7" - + "\11\0\1\7\71\0\53\6\24\7\1\6\12\7\6\0\6\6\4\7" - + "\4\6\3\7\1\6\3\7\2\6\7\7\3\6\4\7\15\6\14\7" - + "\1\6\17\7\2\0\46\6\12\0\53\6\1\0\1\6\3\0\u0149\6" - + "\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6" - + "\1\0\4\6\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6" - + "\1\0\4\6\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6" - + "\2\0\3\7\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6" - + "\1\0\32\6\5\0\113\6\3\0\3\6\17\0\15\6\1\0\4\6" - + "\3\7\13\0\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0" - + "\3\6\1\0\2\7\14\0\64\6\40\7\3\0\1\6\3\0\2\6" - + "\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0" - + "\51\6\1\7\1\6\5\0\106\6\12\0\35\6\3\0\14\7\4\0" - + "\14\7\12\0\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7" - + "\7\6\2\7\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7" - + "\1\0\35\7\2\0\13\7\6\0\12\7\15\0\1\6\130\0\5\7" - + "\57\6\21\7\7\6\4\0\12\7\21\0\11\7\14\0\3\7\36\6" - + "\12\7\3\0\2\6\12\7\6\0\46\6\16\7\14\0\44\6\24\7" - + "\10\0\12\7\3\0\3\6\12\7\44\6\122\0\3\7\1\0\25\7" - + "\4\6\1\7\4\6\1\7\15\0\300\6\47\7\25\0\4\7\u0116\6" - + "\2\0\6\6\2\0\46\6\2\0\6\6\2\0\10\6\1\0\1\6" - + "\1\0\1\6\1\0\1\6\1\0\37\6\2\0\65\6\1\0\7\6" - + "\1\0\1\6\3\0\3\6\1\0\7\6\3\0\4\6\2\0\6\6" - + "\4\0\15\6\5\0\3\6\1\0\7\6\16\0\5\7\32\0\5\7" - + "\20\0\2\6\23\0\1\6\13\0\5\7\5\0\6\7\1\0\1\6" - + "\15\0\1\6\20\0\15\6\3\0\32\6\26\0\15\7\4\0\1\7" - + "\3\0\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6" - + "\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6" - + "\1\0\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\51\6" - + "\u0a77\0\57\6\1\0\57\6\1\0\205\6\6\0\4\6\3\7\16\0" - + "\46\6\12\0\66\6\11\0\1\6\17\0\1\7\27\6\11\0\7\6" - + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6" - + "\1\0\7\6\1\0\7\6\1\0\40\7\57\0\1\6\u01d5\0\3\6" - + "\31\0\11\6\6\7\1\0\5\6\2\0\5\6\4\0\126\6\2\0" - + "\2\7\2\0\3\6\1\0\132\6\1\0\4\6\5\0\51\6\3\0" - + "\136\6\21\0\33\6\65\0\20\6\u0200\0\u19b6\6\112\0\u51cc\6\64\0" - + "\u048d\6\103\0\56\6\2\0\u010d\6\3\0\20\6\12\7\2\6\24\0" - + "\57\6\1\7\14\0\2\7\1\0\31\6\10\0\120\6\2\7\45\0" - + "\11\6\2\0\147\6\2\0\4\6\1\0\2\6\16\0\12\6\120\0" - + "\10\6\1\7\3\6\1\7\4\6\1\7\27\6\5\7\20\0\1\6" - + "\7\0\64\6\14\0\2\7\62\6\21\7\13\0\12\7\6\0\22\7" - + "\6\6\3\0\1\6\4\0\12\7\34\6\10\7\2\0\27\6\15\7" - + "\14\0\35\6\3\0\4\7\57\6\16\7\16\0\1\6\12\7\46\0" - + "\51\6\16\7\11\0\3\6\1\7\10\6\2\7\2\0\12\7\6\0" - + "\27\6\3\0\1\6\1\7\4\0\60\6\1\7\1\6\3\7\2\6" - + "\2\7\5\6\2\7\1\6\1\7\1\6\30\0\3\6\43\0\6\6" - + "\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\221\0\43\6" - + "\10\7\1\0\2\7\2\0\12\7\6\0\u2ba4\6\14\0\27\6\4\0" - + "\61\6\u2104\0\u012e\6\2\0\76\6\2\0\152\6\46\0\7\6\14\0" - + "\5\6\5\0\1\6\1\7\12\6\1\0\15\6\1\0\5\6\1\0" - + "\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0" - + "\100\6\2\0\66\6\50\0\15\6\3\0\20\7\20\0\7\7\14\0" - + "\2\6\30\0\3\6\31\0\1\6\6\0\5\6\1\0\207\6\2\0" - + "\1\7\4\0\1\6\13\0\12\7\7\0\32\6\4\0\1\6\1\0" - + "\32\6\13\0\131\6\3\0\6\6\2\0\6\6\2\0\6\6\2\0" - + "\3\6\3\0\2\6\3\0\2\6\22\0\3\7\4\0"; + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\103\1\104\1\1\16\7\4\0\1\14\1\72"+ + "\1\16\1\0\1\6\1\101\1\75\1\30\1\62\1\63\1\5\1\77"+ + "\1\71\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\70"+ + "\1\12\1\15\1\13\1\74\1\102\4\22\1\25\1\22\2\6\1\60"+ + "\4\6\1\61\11\6\1\21\2\6\1\66\1\27\1\67\1\100\1\6"+ + "\1\0\1\34\1\31\1\36\1\45\1\33\1\46\1\57\1\51\1\43"+ + "\1\6\1\35\1\47\1\54\1\41\1\40\1\52\1\6\1\32\1\37"+ + "\1\42\1\44\1\55\1\50\1\56\1\53\1\6\1\64\1\76\1\65"+ + "\1\73\6\7\1\105\32\7\2\0\4\6\4\0\1\6\2\0\1\7"+ + "\7\0\1\6\4\0\1\6\5\0\27\6\1\0\37\6\1\0\u01ca\6"+ + "\4\0\14\6\16\0\5\6\7\0\1\6\1\0\1\6\21\0\160\7"+ + "\5\6\1\0\2\6\2\0\4\6\10\0\1\6\1\0\3\6\1\0"+ + "\1\6\1\0\24\6\1\0\123\6\1\0\213\6\1\0\5\7\2\0"+ + "\236\6\11\0\46\6\2\0\1\6\7\0\47\6\11\0\55\7\1\0"+ + "\1\7\1\0\2\7\1\0\2\7\1\0\1\7\10\0\33\6\5\0"+ + "\3\6\15\0\4\7\7\0\1\6\4\0\13\7\5\0\53\6\37\7"+ + "\4\0\2\6\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6"+ + "\2\7\1\0\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7"+ + "\1\6\1\7\36\6\33\7\2\0\131\6\13\7\1\6\16\0\12\7"+ + "\41\6\11\7\2\6\4\0\1\6\5\0\26\6\4\7\1\6\11\7"+ + "\1\6\3\7\1\6\5\7\22\0\31\6\3\7\244\0\4\7\66\6"+ + "\3\7\1\6\22\7\1\6\7\7\12\6\2\7\2\0\12\7\1\0"+ + "\7\6\1\0\7\6\1\0\3\7\1\0\10\6\2\0\2\6\2\0"+ + "\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0\1\7\1\6"+ + "\7\7\2\0\2\7\2\0\3\7\1\6\10\0\1\7\4\0\2\6"+ + "\1\0\3\6\2\7\2\0\12\7\4\6\7\0\1\6\5\0\3\7"+ + "\1\0\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6"+ + "\1\0\2\6\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7"+ + "\2\0\3\7\3\0\1\7\7\0\4\6\1\0\1\6\7\0\14\7"+ + "\3\6\1\7\13\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6"+ + "\1\0\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7"+ + "\1\0\3\7\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0"+ + "\12\7\1\0\1\6\17\0\3\7\1\0\10\6\2\0\2\6\2\0"+ + "\26\6\1\0\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6"+ + "\7\7\2\0\2\7\2\0\3\7\10\0\2\7\4\0\2\6\1\0"+ + "\3\6\2\7\2\0\12\7\1\0\1\6\20\0\1\7\1\6\1\0"+ + "\6\6\3\0\3\6\1\0\4\6\3\0\2\6\1\0\1\6\1\0"+ + "\2\6\3\0\2\6\3\0\3\6\3\0\14\6\4\0\5\7\3\0"+ + "\3\7\1\0\4\7\2\0\1\6\6\0\1\7\16\0\12\7\11\0"+ + "\1\6\7\0\3\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0"+ + "\12\6\1\0\5\6\3\0\1\6\7\7\1\0\3\7\1\0\4\7"+ + "\7\0\2\7\1\0\2\6\6\0\2\6\2\7\2\0\12\7\22\0"+ + "\2\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0"+ + "\5\6\2\0\1\7\1\6\7\7\1\0\3\7\1\0\4\7\7\0"+ + "\2\7\7\0\1\6\1\0\2\6\2\7\2\0\12\7\1\0\2\6"+ + "\17\0\2\7\1\0\10\6\1\0\3\6\1\0\51\6\2\0\1\6"+ + "\7\7\1\0\3\7\1\0\4\7\1\6\10\0\1\7\10\0\2\6"+ + "\2\7\2\0\12\7\12\0\6\6\2\0\2\7\1\0\22\6\3\0"+ + "\30\6\1\0\11\6\1\0\1\6\2\0\7\6\3\0\1\7\4\0"+ + "\6\7\1\0\1\7\1\0\10\7\22\0\2\7\15\0\60\6\1\7"+ + "\2\6\7\7\4\0\10\6\10\7\1\0\12\7\47\0\2\6\1\0"+ + "\1\6\2\0\2\6\1\0\1\6\2\0\1\6\6\0\4\6\1\0"+ + "\7\6\1\0\3\6\1\0\1\6\1\0\1\6\2\0\2\6\1\0"+ + "\4\6\1\7\2\6\6\7\1\0\2\7\1\6\2\0\5\6\1\0"+ + "\1\6\1\0\6\7\2\0\12\7\2\0\2\6\42\0\1\6\27\0"+ + "\2\7\6\0\12\7\13\0\1\7\1\0\1\7\1\0\1\7\4\0"+ + "\2\7\10\6\1\0\44\6\4\0\24\7\1\0\2\7\5\6\13\7"+ + "\1\0\44\7\11\0\1\7\71\0\53\6\24\7\1\6\12\7\6\0"+ + "\6\6\4\7\4\6\3\7\1\6\3\7\2\6\7\7\3\6\4\7"+ + "\15\6\14\7\1\6\17\7\2\0\46\6\12\0\53\6\1\0\1\6"+ + "\3\0\u0149\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6"+ + "\2\0\51\6\1\0\4\6\2\0\41\6\1\0\4\6\2\0\7\6"+ + "\1\0\1\6\1\0\4\6\2\0\17\6\1\0\71\6\1\0\4\6"+ + "\2\0\103\6\2\0\3\7\40\0\20\6\20\0\125\6\14\0\u026c\6"+ + "\2\0\21\6\1\0\32\6\5\0\113\6\3\0\3\6\17\0\15\6"+ + "\1\0\4\6\3\7\13\0\22\6\3\7\13\0\22\6\2\7\14\0"+ + "\15\6\1\0\3\6\1\0\2\7\14\0\64\6\40\7\3\0\1\6"+ + "\3\0\2\6\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0"+ + "\130\6\10\0\51\6\1\7\1\6\5\0\106\6\12\0\35\6\3\0"+ + "\14\7\4\0\14\7\12\0\12\7\36\6\2\0\5\6\13\0\54\6"+ + "\4\0\21\7\7\6\2\7\6\0\12\7\46\0\27\6\5\7\4\0"+ + "\65\6\12\7\1\0\35\7\2\0\13\7\6\0\12\7\15\0\1\6"+ + "\130\0\5\7\57\6\21\7\7\6\4\0\12\7\21\0\11\7\14\0"+ + "\3\7\36\6\12\7\3\0\2\6\12\7\6\0\46\6\16\7\14\0"+ + "\44\6\24\7\10\0\12\7\3\0\3\6\12\7\44\6\122\0\3\7"+ + "\1\0\25\7\4\6\1\7\4\6\1\7\15\0\300\6\47\7\25\0"+ + "\4\7\u0116\6\2\0\6\6\2\0\46\6\2\0\6\6\2\0\10\6"+ + "\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6\2\0\65\6"+ + "\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6\3\0\4\6"+ + "\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6\16\0\5\7"+ + "\30\0\1\103\1\103\5\7\20\0\2\6\23\0\1\6\13\0\5\7"+ + "\5\0\6\7\1\0\1\6\15\0\1\6\20\0\15\6\3\0\32\6"+ + "\26\0\15\7\4\0\1\7\3\0\14\7\21\0\1\6\4\0\1\6"+ + "\2\0\12\6\1\0\1\6\3\0\5\6\6\0\1\6\1\0\1\6"+ + "\1\0\1\6\1\0\4\6\1\0\13\6\2\0\4\6\5\0\5\6"+ + "\4\0\1\6\21\0\51\6\u0a77\0\57\6\1\0\57\6\1\0\205\6"+ + "\6\0\4\6\3\7\16\0\46\6\12\0\66\6\11\0\1\6\17\0"+ + "\1\7\27\6\11\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6"+ + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\40\7"+ + "\57\0\1\6\u01d5\0\3\6\31\0\11\6\6\7\1\0\5\6\2\0"+ + "\5\6\4\0\126\6\2\0\2\7\2\0\3\6\1\0\132\6\1\0"+ + "\4\6\5\0\51\6\3\0\136\6\21\0\33\6\65\0\20\6\u0200\0"+ + "\u19b6\6\112\0\u51cc\6\64\0\u048d\6\103\0\56\6\2\0\u010d\6\3\0"+ + "\20\6\12\7\2\6\24\0\57\6\1\7\14\0\2\7\1\0\31\6"+ + "\10\0\120\6\2\7\45\0\11\6\2\0\147\6\2\0\4\6\1\0"+ + "\2\6\16\0\12\6\120\0\10\6\1\7\3\6\1\7\4\6\1\7"+ + "\27\6\5\7\20\0\1\6\7\0\64\6\14\0\2\7\62\6\21\7"+ + "\13\0\12\7\6\0\22\7\6\6\3\0\1\6\4\0\12\7\34\6"+ + "\10\7\2\0\27\6\15\7\14\0\35\6\3\0\4\7\57\6\16\7"+ + "\16\0\1\6\12\7\46\0\51\6\16\7\11\0\3\6\1\7\10\6"+ + "\2\7\2\0\12\7\6\0\27\6\3\0\1\6\1\7\4\0\60\6"+ + "\1\7\1\6\3\7\2\6\2\7\5\6\2\7\1\6\1\7\1\6"+ + "\30\0\3\6\43\0\6\6\2\0\6\6\2\0\6\6\11\0\7\6"+ + "\1\0\7\6\221\0\43\6\10\7\1\0\2\7\2\0\12\7\6\0"+ + "\u2ba4\6\14\0\27\6\4\0\61\6\u2104\0\u012e\6\2\0\76\6\2\0"+ + "\152\6\46\0\7\6\14\0\5\6\5\0\1\6\1\7\12\6\1\0"+ + "\15\6\1\0\5\6\1\0\1\6\1\0\2\6\1\0\2\6\1\0"+ + "\154\6\41\0\u016b\6\22\0\100\6\2\0\66\6\50\0\15\6\3\0"+ + "\20\7\20\0\7\7\14\0\2\6\30\0\3\6\31\0\1\6\6\0"+ + "\5\6\1\0\207\6\2\0\1\7\4\0\1\6\13\0\12\7\7\0"+ + "\32\6\4\0\1\6\1\0\32\6\13\0\131\6\3\0\6\6\2\0"+ + "\6\6\2\0\6\6\2\0\3\6\3\0\2\6\3\0\2\6\22\0"+ + "\3\7\4\0"; - /** - * Translates characters to character classes - */ - private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - /** - * Translates DFA states to action switch labels. - */ - private static final int[] ZZ_ACTION = zzUnpackAction(); + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); - private static final String ZZ_ACTION_PACKED_0 - = "\5\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7" - + "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17" - + "\23\6\1\20\1\21\1\22\1\23\1\24\1\25\1\26" - + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36" - + "\1\37\1\40\1\41\2\42\1\43\1\1\1\41\2\44" - + "\1\41\1\1\1\45\3\41\1\3\1\0\1\46\1\47" - + "\1\50\2\0\1\51\1\0\1\52\1\53\1\54\1\55" - + "\1\56\1\57\1\51\1\0\2\57\1\0\1\60\1\61" - + "\5\6\1\62\16\6\1\63\1\64\1\65\4\6\1\66" - + "\17\6\1\67\1\70\1\71\1\72\1\73\1\74\1\75" - + "\1\76\1\77\1\100\1\101\2\102\1\103\1\104\1\105" - + "\1\106\1\107\1\110\1\111\6\0\2\3\2\0\1\112" - + "\3\0\1\113\1\0\1\114\1\115\1\116\1\117\2\120" - + "\1\57\1\51\1\0\11\6\1\121\4\6\1\122\3\6" - + "\1\123\6\6\1\124\5\6\1\125\10\6\1\126\1\6" - + "\1\127\1\6\1\130\1\131\1\102\7\0\1\132\5\0" - + "\1\133\1\120\1\57\2\6\1\134\1\135\1\6\1\136" - + "\11\6\1\137\1\140\1\6\1\141\14\6\1\142\5\6" - + "\1\143\1\6\1\41\1\0\1\144\12\0\1\120\1\57" - + "\1\145\2\6\1\146\1\147\1\6\1\150\1\6\1\151" - + "\3\6\1\152\11\6\1\153\2\6\1\154\5\6\10\0" - + "\1\120\1\57\1\155\2\6\1\156\1\157\2\6\1\160" - + "\3\6\1\161\3\6\1\162\6\6\1\163\1\6\2\0" - + "\1\113\1\120\1\57\1\164\10\6\1\165\1\166\1\167" - + "\2\6\1\170\1\171\1\6\1\41\1\120\1\57\1\172" - + "\1\173\2\6\1\174\3\6\1\175\1\6\1\176\1\120" - + "\1\57\1\177\1\6\1\200\1\6\1\201\1\202\1\120" - + "\1\57\1\203\1\204\6\57"; + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"+ + "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17"+ + "\23\6\1\20\1\21\1\22\1\23\1\24\1\25\1\26"+ + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"+ + "\1\37\1\40\1\41\2\42\1\43\1\1\1\41\2\44"+ + "\1\41\1\1\1\45\3\41\1\3\1\0\1\46\1\47"+ + "\1\50\2\0\1\51\1\0\1\52\1\53\1\54\1\55"+ + "\1\56\1\57\1\51\1\0\2\57\1\0\1\60\1\61"+ + "\5\6\1\62\16\6\1\63\1\64\1\65\4\6\1\66"+ + "\17\6\1\67\1\70\1\71\1\72\1\73\1\74\1\75"+ + "\1\76\1\77\1\100\1\101\2\102\1\103\1\104\1\105"+ + "\1\106\1\107\1\110\1\111\6\0\2\3\2\0\1\112"+ + "\3\0\1\113\1\0\1\114\1\115\1\116\1\117\2\120"+ + "\1\57\1\51\1\0\11\6\1\121\4\6\1\122\3\6"+ + "\1\123\6\6\1\124\5\6\1\125\10\6\1\126\1\6"+ + "\1\127\1\6\1\130\1\131\1\102\7\0\1\132\5\0"+ + "\1\133\1\120\1\57\2\6\1\134\1\135\1\6\1\136"+ + "\11\6\1\137\1\140\1\6\1\141\14\6\1\142\5\6"+ + "\1\143\1\6\1\41\1\0\1\144\12\0\1\120\1\57"+ + "\1\145\2\6\1\146\1\147\1\6\1\150\1\6\1\151"+ + "\3\6\1\152\11\6\1\153\1\154\1\6\1\155\5\6"+ + "\10\0\1\120\1\57\1\156\2\6\1\157\1\160\2\6"+ + "\1\161\3\6\1\162\3\6\1\163\6\6\1\164\1\6"+ + "\2\0\1\113\1\120\1\57\1\165\10\6\1\166\1\167"+ + "\1\170\2\6\1\171\1\172\1\6\1\41\1\120\1\57"+ + "\1\173\1\174\2\6\1\175\3\6\1\176\1\6\1\177"+ + "\1\120\1\57\1\200\1\6\1\201\1\6\1\202\1\203"+ + "\1\120\1\57\1\204\1\205\6\57"; - private static int[] zzUnpackAction() { - int[] result = new int[418]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; + private static int [] zzUnpackAction() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackAction(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do { - result[j++] = value; - } while (--count > 0); - } - return j; + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\106\0\214\0\322\0\u0118\0\u015e\0\u01a4\0\u015e"+ + "\0\u01ea\0\u0230\0\u0276\0\u02bc\0\u0302\0\u0348\0\u038e\0\u03d4"+ + "\0\u041a\0\u015e\0\u0460\0\u04a6\0\u04ec\0\u015e\0\u0532\0\u0578"+ + "\0\u05be\0\u0604\0\u064a\0\u0690\0\u06d6\0\u071c\0\u0762\0\u07a8"+ + "\0\u07ee\0\u0834\0\u087a\0\u08c0\0\u0906\0\u094c\0\u0992\0\u09d8"+ + "\0\u0a1e\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e"+ + "\0\u015e\0\u0a64\0\u015e\0\u015e\0\u0aaa\0\u0af0\0\u0b36\0\u0b7c"+ + "\0\u0bc2\0\u015e\0\u0c08\0\u0c4e\0\u015e\0\u015e\0\u0c94\0\u0cda"+ + "\0\u0d20\0\u015e\0\u0d66\0\u0dac\0\u015e\0\u0df2\0\u015e\0\u0e38"+ + "\0\u0e7e\0\u0ec4\0\u015e\0\u015e\0\u015e\0\u0f0a\0\u0f50\0\u0f96"+ + "\0\u0fdc\0\u1022\0\u015e\0\u1068\0\u015e\0\u10ae\0\u10f4\0\u113a"+ + "\0\u1180\0\u11c6\0\u120c\0\u1252\0\u015e\0\u015e\0\u1298\0\u12de"+ + "\0\u1324\0\u136a\0\u13b0\0\u02bc\0\u13f6\0\u143c\0\u1482\0\u14c8"+ + "\0\u150e\0\u1554\0\u159a\0\u15e0\0\u1626\0\u166c\0\u16b2\0\u16f8"+ + "\0\u173e\0\u1784\0\u02bc\0\u17ca\0\u02bc\0\u1810\0\u1856\0\u189c"+ + "\0\u18e2\0\u02bc\0\u1928\0\u196e\0\u19b4\0\u19fa\0\u1a40\0\u1a86"+ + "\0\u1acc\0\u1b12\0\u1b58\0\u1b9e\0\u1be4\0\u1c2a\0\u1c70\0\u1cb6"+ + "\0\u1cfc\0\u1d42\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e"+ + "\0\u015e\0\u015e\0\u015e\0\u015e\0\u1d88\0\u1dce\0\u015e\0\u015e"+ + "\0\u015e\0\u015e\0\u015e\0\u015e\0\u015e\0\u0dac\0\u1e14\0\u1e5a"+ + "\0\u1ea0\0\u1ee6\0\u1f2c\0\u1f72\0\u015e\0\u1fb8\0\u1ffe\0\u015e"+ + "\0\u2044\0\u208a\0\u20d0\0\u015e\0\u2116\0\u015e\0\u215c\0\u015e"+ + "\0\u015e\0\u1180\0\u21a2\0\u21e8\0\u222e\0\u222e\0\u2274\0\u22ba"+ + "\0\u2300\0\u2346\0\u238c\0\u23d2\0\u2418\0\u245e\0\u24a4\0\u02bc"+ + "\0\u24ea\0\u2530\0\u2576\0\u25bc\0\u02bc\0\u2602\0\u2648\0\u268e"+ + "\0\u02bc\0\u26d4\0\u271a\0\u2760\0\u27a6\0\u27ec\0\u2832\0\u02bc"+ + "\0\u2878\0\u28be\0\u2904\0\u294a\0\u2990\0\u02bc\0\u29d6\0\u2a1c"+ + "\0\u2a62\0\u2aa8\0\u2aee\0\u2b34\0\u2b7a\0\u2bc0\0\u02bc\0\u2c06"+ + "\0\u02bc\0\u2c4c\0\u02bc\0\u015e\0\u015e\0\u2c92\0\u2cd8\0\u2d1e"+ + "\0\u2d64\0\u2daa\0\u2df0\0\u2e36\0\u015e\0\u2e7c\0\u2ec2\0\u2f08"+ + "\0\u2f4e\0\u2f94\0\u015e\0\u2fda\0\u3020\0\u3066\0\u30ac\0\u02bc"+ + "\0\u02bc\0\u30f2\0\u02bc\0\u3138\0\u317e\0\u31c4\0\u320a\0\u3250"+ + "\0\u3296\0\u32dc\0\u3322\0\u3368\0\u02bc\0\u02bc\0\u33ae\0\u02bc"+ + "\0\u33f4\0\u343a\0\u3480\0\u34c6\0\u350c\0\u3552\0\u3598\0\u35de"+ + "\0\u3624\0\u366a\0\u36b0\0\u36f6\0\u02bc\0\u373c\0\u3782\0\u37c8"+ + "\0\u380e\0\u3854\0\u02bc\0\u389a\0\u38e0\0\u3926\0\u015e\0\u396c"+ + "\0\u39b2\0\u39f8\0\u3a3e\0\u3a84\0\u3aca\0\u3b10\0\u3b56\0\u3b9c"+ + "\0\u3be2\0\u3c28\0\u3c6e\0\u02bc\0\u3cb4\0\u3cfa\0\u02bc\0\u02bc"+ + "\0\u3d40\0\u02bc\0\u3d86\0\u02bc\0\u3dcc\0\u3e12\0\u3e58\0\u02bc"+ + "\0\u3e9e\0\u3ee4\0\u3f2a\0\u3f70\0\u3fb6\0\u3ffc\0\u4042\0\u4088"+ + "\0\u40ce\0\u02bc\0\u4114\0\u415a\0\u02bc\0\u41a0\0\u41e6\0\u422c"+ + "\0\u4272\0\u42b8\0\u42fe\0\u4344\0\u438a\0\u43d0\0\u4416\0\u445c"+ + "\0\u44a2\0\u44e8\0\u452e\0\u4574\0\u02bc\0\u45ba\0\u4600\0\u02bc"+ + "\0\u02bc\0\u4646\0\u468c\0\u02bc\0\u46d2\0\u4718\0\u475e\0\u02bc"+ + "\0\u47a4\0\u47ea\0\u4830\0\u02bc\0\u4876\0\u48bc\0\u4902\0\u4948"+ + "\0\u498e\0\u49d4\0\u02bc\0\u4a1a\0\u4a60\0\u4aa6\0\u3b10\0\u4aec"+ + "\0\u4b32\0\u02bc\0\u4b78\0\u4bbe\0\u4c04\0\u4c4a\0\u4c90\0\u4cd6"+ + "\0\u4d1c\0\u4d62\0\u02bc\0\u02bc\0\u02bc\0\u4da8\0\u4dee\0\u02bc"+ + "\0\u02bc\0\u4e34\0\u438a\0\u4e7a\0\u4ec0\0\u02bc\0\u02bc\0\u4f06"+ + "\0\u4f4c\0\u02bc\0\u4f92\0\u4fd8\0\u501e\0\u02bc\0\u5064\0\u02bc"+ + "\0\u50aa\0\u50f0\0\u02bc\0\u5136\0\u02bc\0\u517c\0\u02bc\0\u02bc"+ + "\0\u015e\0\u51c2\0\u02bc\0\u02bc\0\u5208\0\u524e\0\u5294\0\u52da"+ + "\0\u5320\0\u113a"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); } + return j; + } - /** - * Translates a state to a row index in the transition table - */ - private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); - private static final String ZZ_ROWMAP_PACKED_0 - = "\0\0\0\103\0\206\0\311\0\u010c\0\u014f\0\u0192\0\u014f" - + "\0\u01d5\0\u0218\0\u025b\0\u029e\0\u02e1\0\u0324\0\u0367\0\u03aa" - + "\0\u03ed\0\u014f\0\u0430\0\u0473\0\u04b6\0\u014f\0\u04f9\0\u053c" - + "\0\u057f\0\u05c2\0\u0605\0\u0648\0\u068b\0\u06ce\0\u0711\0\u0754" - + "\0\u0797\0\u07da\0\u081d\0\u0860\0\u08a3\0\u08e6\0\u0929\0\u096c" - + "\0\u09af\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f" - + "\0\u014f\0\u09f2\0\u014f\0\u014f\0\u0a35\0\u0a78\0\u0abb\0\u0afe" - + "\0\u0b41\0\u014f\0\u0b84\0\u0bc7\0\u014f\0\u014f\0\u0c0a\0\u0c4d" - + "\0\u0c90\0\u014f\0\u0cd3\0\u0d16\0\u014f\0\u0d59\0\u014f\0\u0d9c" - + "\0\u0ddf\0\u0e22\0\u014f\0\u014f\0\u014f\0\u0e65\0\u0ea8\0\u0eeb" - + "\0\u0f2e\0\u0f71\0\u014f\0\u0fb4\0\u014f\0\u0ff7\0\u103a\0\u107d" - + "\0\u10c0\0\u1103\0\u1146\0\u1189\0\u014f\0\u014f\0\u11cc\0\u120f" - + "\0\u1252\0\u1295\0\u12d8\0\u029e\0\u131b\0\u135e\0\u13a1\0\u13e4" - + "\0\u1427\0\u146a\0\u14ad\0\u14f0\0\u1533\0\u1576\0\u15b9\0\u15fc" - + "\0\u163f\0\u1682\0\u029e\0\u16c5\0\u029e\0\u1708\0\u174b\0\u178e" - + "\0\u17d1\0\u029e\0\u1814\0\u1857\0\u189a\0\u18dd\0\u1920\0\u1963" - + "\0\u19a6\0\u19e9\0\u1a2c\0\u1a6f\0\u1ab2\0\u1af5\0\u1b38\0\u1b7b" - + "\0\u1bbe\0\u1c01\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f" - + "\0\u014f\0\u014f\0\u014f\0\u014f\0\u1c44\0\u1c87\0\u014f\0\u014f" - + "\0\u014f\0\u014f\0\u014f\0\u014f\0\u014f\0\u0d16\0\u1cca\0\u1d0d" - + "\0\u1d50\0\u1d93\0\u1dd6\0\u1e19\0\u014f\0\u1e5c\0\u1e9f\0\u014f" - + "\0\u1ee2\0\u1f25\0\u1f68\0\u014f\0\u1fab\0\u014f\0\u1fee\0\u014f" - + "\0\u014f\0\u10c0\0\u2031\0\u2074\0\u20b7\0\u20b7\0\u20fa\0\u213d" - + "\0\u2180\0\u21c3\0\u2206\0\u2249\0\u228c\0\u22cf\0\u2312\0\u029e" - + "\0\u2355\0\u2398\0\u23db\0\u241e\0\u029e\0\u2461\0\u24a4\0\u24e7" - + "\0\u029e\0\u252a\0\u256d\0\u25b0\0\u25f3\0\u2636\0\u2679\0\u029e" - + "\0\u26bc\0\u26ff\0\u2742\0\u2785\0\u27c8\0\u029e\0\u280b\0\u284e" - + "\0\u2891\0\u28d4\0\u2917\0\u295a\0\u299d\0\u29e0\0\u029e\0\u2a23" - + "\0\u029e\0\u2a66\0\u029e\0\u014f\0\u014f\0\u2aa9\0\u2aec\0\u2b2f" - + "\0\u2b72\0\u2bb5\0\u2bf8\0\u2c3b\0\u014f\0\u2c7e\0\u2cc1\0\u2d04" - + "\0\u2d47\0\u2d8a\0\u014f\0\u2dcd\0\u2e10\0\u2e53\0\u2e96\0\u029e" - + "\0\u029e\0\u2ed9\0\u029e\0\u2f1c\0\u2f5f\0\u2fa2\0\u2fe5\0\u3028" - + "\0\u306b\0\u30ae\0\u30f1\0\u3134\0\u029e\0\u029e\0\u3177\0\u029e" - + "\0\u31ba\0\u31fd\0\u3240\0\u3283\0\u32c6\0\u3309\0\u334c\0\u338f" - + "\0\u33d2\0\u3415\0\u3458\0\u349b\0\u029e\0\u34de\0\u3521\0\u3564" - + "\0\u35a7\0\u35ea\0\u029e\0\u362d\0\u3670\0\u36b3\0\u014f\0\u36f6" - + "\0\u3739\0\u377c\0\u37bf\0\u3802\0\u3845\0\u3888\0\u38cb\0\u390e" - + "\0\u3951\0\u3994\0\u39d7\0\u029e\0\u3a1a\0\u3a5d\0\u029e\0\u029e" - + "\0\u3aa0\0\u029e\0\u3ae3\0\u029e\0\u3b26\0\u3b69\0\u3bac\0\u029e" - + "\0\u3bef\0\u3c32\0\u3c75\0\u3cb8\0\u3cfb\0\u3d3e\0\u3d81\0\u3dc4" - + "\0\u3e07\0\u029e\0\u3e4a\0\u3e8d\0\u029e\0\u3ed0\0\u3f13\0\u3f56" - + "\0\u3f99\0\u3fdc\0\u401f\0\u4062\0\u40a5\0\u40e8\0\u412b\0\u416e" - + "\0\u41b1\0\u41f4\0\u4237\0\u427a\0\u029e\0\u42bd\0\u4300\0\u029e" - + "\0\u029e\0\u4343\0\u4386\0\u029e\0\u43c9\0\u440c\0\u444f\0\u029e" - + "\0\u4492\0\u44d5\0\u4518\0\u029e\0\u455b\0\u459e\0\u45e1\0\u4624" - + "\0\u4667\0\u46aa\0\u029e\0\u46ed\0\u4730\0\u4773\0\u3888\0\u47b6" - + "\0\u47f9\0\u029e\0\u483c\0\u487f\0\u48c2\0\u4905\0\u4948\0\u498b" - + "\0\u49ce\0\u4a11\0\u029e\0\u029e\0\u029e\0\u4a54\0\u4a97\0\u029e" - + "\0\u029e\0\u4ada\0\u40a5\0\u4b1d\0\u4b60\0\u029e\0\u029e\0\u4ba3" - + "\0\u4be6\0\u029e\0\u4c29\0\u4c6c\0\u4caf\0\u029e\0\u4cf2\0\u029e" - + "\0\u4d35\0\u4d78\0\u029e\0\u4dbb\0\u029e\0\u4dfe\0\u029e\0\u029e" - + "\0\u014f\0\u4e41\0\u029e\0\u029e\0\u4e84\0\u4ec7\0\u4f0a\0\u4f4d" - + "\0\u4f90\0\u107d"; + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\6"+ + "\1\15\1\16\1\17\1\20\1\11\1\21\1\22\1\23"+ + "\1\24\2\14\2\24\1\14\1\25\1\6\1\26\1\27"+ + "\1\30\1\31\1\32\1\14\1\33\1\34\1\35\1\36"+ + "\1\37\1\40\1\41\1\42\1\43\1\14\1\44\1\14"+ + "\1\45\2\14\1\46\1\14\1\47\1\50\1\51\1\52"+ + "\1\53\1\54\1\55\1\56\1\57\1\60\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72"+ + "\1\0\1\11\1\0\1\73\1\74\1\75\13\73\1\76"+ + "\10\73\1\77\56\73\1\100\1\74\1\75\24\100\1\77"+ + "\1\76\55\100\1\6\1\101\1\102\1\103\2\6\1\104"+ + "\4\6\1\105\1\106\4\6\2\104\2\6\1\104\3\6"+ + "\31\104\21\6\1\0\1\103\1\0\1\107\1\101\1\102"+ + "\7\107\1\110\70\107\113\0\1\10\106\0\1\11\10\0"+ + "\1\11\67\0\1\11\5\0\1\111\1\112\7\0\1\113"+ + "\105\0\1\114\76\0\2\14\7\0\7\14\3\0\31\14"+ + "\23\0\1\14\10\0\1\115\106\0\1\116\1\117\4\0"+ + "\2\120\2\0\2\120\67\0\1\121\3\0\1\122\2\0"+ + "\1\123\3\0\2\121\2\0\1\121\3\0\31\121\37\0"+ + "\1\124\1\0\1\125\105\0\1\126\101\0\1\120\5\0"+ + "\1\127\1\130\1\131\1\0\1\132\1\133\1\134\5\0"+ + "\1\134\22\0\1\131\40\0\1\120\5\0\2\24\2\0"+ + "\2\24\1\134\5\0\1\134\67\0\1\135\10\0\1\136"+ + "\65\0\2\14\7\0\7\14\3\0\1\14\1\137\27\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\2\14"+ + "\1\140\26\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\141\12\14\1\142\6\14\1\143\3\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\6\14"+ + "\1\144\22\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\145\3\14\1\146\6\14\1\147\12\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\2\14"+ + "\1\150\6\14\1\151\1\14\1\152\3\14\1\153\11\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\24\14"+ + "\1\154\4\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\155\1\156\7\14\1\157\15\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\1\14\1\160"+ + "\16\14\1\161\1\14\1\162\6\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\163\1\14\1\164"+ + "\4\14\1\165\5\14\1\166\5\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\6\14\1\167\1\14\1\170"+ + "\20\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\171\4\14\1\172\12\14\1\173\6\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\3\14\1\174"+ + "\3\14\1\175\2\14\1\176\1\177\15\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\12\14\1\200\5\14"+ + "\1\201\10\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\1\14\1\202\1\14\1\203\7\14\1\204\15\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\3\14"+ + "\1\205\3\14\1\206\21\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\207\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\10\14\1\210\20\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\3\14"+ + "\1\211\25\14\23\0\1\14\15\0\1\212\105\0\1\213"+ + "\57\0\1\214\25\0\1\215\60\0\1\216\24\0\1\217"+ + "\61\0\1\220\23\0\1\221\105\0\1\222\70\0\1\73"+ + "\2\0\13\73\1\0\10\73\1\0\56\73\2\0\1\75"+ + "\103\0\1\223\2\0\13\223\1\224\1\225\3\223\1\225"+ + "\1\226\2\223\1\227\1\230\1\231\1\232\6\223\1\233"+ + "\1\234\3\223\1\235\34\223\3\0\1\100\2\0\24\100"+ + "\2\0\55\100\2\0\1\102\106\0\1\103\10\0\1\103"+ + "\67\0\1\103\7\0\2\236\1\237\3\0\1\240\1\241"+ + "\1\0\7\236\3\0\31\236\23\0\1\236\3\0\1\103"+ + "\2\0\1\236\5\0\1\106\4\0\2\236\2\0\1\236"+ + "\3\0\31\236\22\0\1\103\5\0\1\242\1\0\1\243"+ + "\12\0\2\243\2\0\1\243\3\0\31\243\24\0\1\111"+ + "\1\244\1\245\103\111\5\246\1\247\100\246\11\0\1\250"+ + "\102\0\1\251\12\0\2\251\2\0\1\251\3\0\31\251"+ + "\43\0\2\120\2\0\2\120\1\134\5\0\1\134\60\0"+ + "\1\252\1\121\1\253\2\0\1\254\1\255\2\0\2\121"+ + "\2\252\2\121\1\252\3\0\31\252\23\0\1\121\15\0"+ + "\1\256\103\0\1\257\1\0\1\260\105\0\1\261\101\0"+ + "\1\120\5\0\1\127\1\130\2\0\1\132\1\133\1\134"+ + "\5\0\1\134\63\0\1\120\5\0\2\130\2\0\2\130"+ + "\1\134\5\0\1\134\71\0\1\262\1\263\1\0\4\263"+ + "\3\0\1\263\1\0\2\263\1\0\1\263\6\0\2\263"+ + "\50\0\1\120\5\0\1\133\1\130\2\0\2\133\1\134"+ + "\5\0\1\134\63\0\1\120\5\0\1\264\1\130\2\0"+ + "\2\264\1\134\5\0\1\134\71\0\2\265\2\0\2\265"+ + "\1\0\1\266\50\0\1\266\14\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\267\26\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\11\14\1\270\17\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\5\14\1\271\23\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\6\14"+ + "\1\272\22\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\11\14\1\273\17\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\6\14\1\274\2\14\1\275\17\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\10\14"+ + "\1\276\20\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\277\25\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\11\14\1\300\17\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\3\14\1\301\25\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\21\14"+ + "\1\302\7\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\12\14\1\303\16\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\304\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\17\14\1\305\11\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\23\14"+ + "\1\306\5\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\16\14\1\307\12\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\13\14\1\310\6\14\1\311\6\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\1\14"+ + "\1\312\10\14\1\313\16\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\21\14\1\314\7\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\6\14\1\315\2\14"+ + "\1\316\17\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\21\14\1\317\7\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\320\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\14\14\1\321\14\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\15\14"+ + "\1\322\1\323\12\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\324\20\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\16\14\1\325\12\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\1\14\1\326"+ + "\27\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\10\14\1\327\20\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\330\20\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\331\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\12\14\1\332"+ + "\16\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\7\14\1\333\2\14\1\334\16\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\335\23\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\1\336\30\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\1\14"+ + "\1\337\27\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\12\14\1\340\16\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\11\14\1\341\17\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\15\14\1\342\13\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\30\14"+ + "\1\343\23\0\1\14\15\0\1\344\107\0\1\226\3\0"+ + "\2\226\100\0\1\345\3\0\2\345\67\0\1\346\12\0"+ + "\2\346\2\0\1\346\3\0\31\346\40\0\1\240\1\241"+ + "\104\0\1\241\1\0\1\347\75\0\1\350\12\0\2\350"+ + "\2\0\1\350\3\0\31\350\32\0\1\351\1\243\1\352"+ + "\2\0\1\107\1\353\2\0\2\243\2\351\2\243\1\351"+ + "\3\0\31\351\23\0\1\243\2\0\1\245\103\0\5\246"+ + "\1\354\100\246\4\0\1\245\1\247\106\0\2\251\3\0"+ + "\1\355\3\0\7\251\3\0\31\251\23\0\1\251\6\0"+ + "\2\252\1\356\2\0\1\254\1\357\1\360\1\0\7\252"+ + "\3\0\31\252\23\0\1\252\6\0\1\361\12\0\2\361"+ + "\2\0\1\361\3\0\31\361\32\0\1\362\5\0\1\255"+ + "\4\0\2\362\2\0\1\362\3\0\31\362\41\0\1\363"+ + "\107\0\2\364\1\0\4\364\3\0\1\364\1\0\2\364"+ + "\1\0\1\364\6\0\2\364\50\0\1\120\5\0\1\365"+ + "\1\130\2\0\2\365\1\134\5\0\1\134\71\0\2\265"+ + "\2\0\2\265\67\0\2\14\7\0\7\14\3\0\3\14"+ + "\1\366\25\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\13\14\1\367\15\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\20\14\1\370\10\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\2\14\1\371\26\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\2\14"+ + "\1\372\26\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\373\26\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\5\14\1\374\23\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\6\14\1\375\2\14"+ + "\1\376\17\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\6\14\1\377\22\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\11\14\1\u0100\17\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\2\14\1\u0101\26\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\11\14"+ + "\1\u0102\17\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\1\14\1\u0103\27\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\u0104\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\16\14\1\u0105\12\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\2\14"+ + "\1\u0106\26\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\7\14\1\u0107\21\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\6\14\1\u0108\22\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\2\14\1\u0109\26\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\11\14"+ + "\1\u010a\17\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\2\14\1\u010b\26\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\7\14\1\u010c\6\14\1\u010d\12\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\2\14"+ + "\1\u010e\26\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\u010f\25\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\u0110\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\3\14\1\u0111\25\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\6\14"+ + "\1\u0112\22\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\u0113\25\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\5\14\1\u0114\23\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\20\14\1\u0115\10\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\16\14"+ + "\1\u0116\12\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\11\14\1\u0117\17\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\24\14\1\u0118\4\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\4\14\1\u0119\24\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\16\14"+ + "\1\u011a\12\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\14\14\1\u011b\14\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\12\14\1\u011c\16\14\23\0\1\14"+ + "\6\0\2\346\4\0\1\240\1\241\1\0\7\346\3\0"+ + "\31\346\23\0\1\346\1\347\2\0\13\347\1\u011d\67\347"+ + "\6\0\2\350\1\u011e\2\0\1\u011f\3\0\7\350\3\0"+ + "\31\350\23\0\1\350\6\0\2\351\1\u0120\2\0\1\107"+ + "\1\u0121\1\u0122\1\0\7\351\3\0\31\351\23\0\1\351"+ + "\6\0\1\u0123\12\0\2\u0123\2\0\1\u0123\3\0\31\u0123"+ + "\32\0\1\u0124\5\0\1\353\4\0\2\u0124\2\0\1\u0124"+ + "\3\0\31\u0124\24\0\4\246\1\245\1\354\100\246\6\0"+ + "\1\u0125\12\0\2\u0125\2\0\1\u0125\3\0\31\u0125\32\0"+ + "\1\362\5\0\1\357\1\360\3\0\2\362\2\0\1\362"+ + "\3\0\31\362\40\0\1\360\1\0\1\u0126\75\0\1\u0127"+ + "\1\361\3\0\1\254\1\255\2\0\2\361\2\u0127\2\361"+ + "\1\u0127\3\0\31\u0127\23\0\1\361\6\0\2\362\1\u0128"+ + "\3\0\1\u0129\1\360\1\0\7\362\3\0\31\362\23\0"+ + "\1\362\17\0\2\u012a\1\0\4\u012a\3\0\1\u012a\1\0"+ + "\2\u012a\1\0\1\u012a\6\0\2\u012a\50\0\1\120\5\0"+ + "\1\u012b\1\130\2\0\2\u012b\1\134\5\0\1\134\60\0"+ + "\2\14\7\0\7\14\3\0\4\14\1\u012c\24\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\1\14\1\u012d"+ + "\27\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\10\14\1\u012e\20\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\20\14\1\u012f\10\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0130\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\12\14\1\u0131"+ + "\16\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\6\14\1\u0132\22\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\12\14\1\u0133\16\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u0134\27\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\5\14\1\u0135"+ + "\23\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\1\14\1\u0136\27\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\6\14\1\u0137\22\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\17\14\1\u0138\11\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\7\14\1\u0139"+ + "\21\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\3\14\1\u013a\25\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\1\14\1\u013b\27\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\1\14\1\u013c\27\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\2\14\1\u013d"+ + "\26\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\15\14\1\u013e\13\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\13\14\1\u013f\15\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0140\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\23\14\1\u0141"+ + "\5\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\u0142\26\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\16\14\1\u0143\12\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0144\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\2\14\1\u0145"+ + "\26\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\u0146\26\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\3\14\1\u0147\25\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\3\14\1\u0148\25\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\12\14\1\u0149"+ + "\16\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\10\14\1\u014a\20\14\23\0\1\14\1\347\2\0\11\347"+ + "\1\u011d\1\347\1\u011d\67\347\6\0\1\u014b\12\0\2\u014b"+ + "\2\0\1\u014b\3\0\31\u014b\32\0\1\u014c\12\0\2\u014c"+ + "\2\0\1\u014c\3\0\31\u014c\32\0\1\u0124\5\0\1\u0121"+ + "\1\u0122\3\0\2\u0124\2\0\1\u0124\3\0\31\u0124\40\0"+ + "\1\u0122\1\0\1\u014d\75\0\1\u014e\1\u0123\3\0\1\107"+ + "\1\353\2\0\2\u0123\2\u014e\2\u0123\1\u014e\3\0\31\u014e"+ + "\23\0\1\u0123\6\0\2\u0124\1\u014f\3\0\1\u0150\1\u0122"+ + "\1\0\7\u0124\3\0\31\u0124\23\0\1\u0124\6\0\1\u0127"+ + "\1\u0125\3\0\1\254\1\357\1\360\1\0\2\u0125\2\u0127"+ + "\2\u0125\1\u0127\3\0\31\u0127\23\0\1\u0125\1\u0126\2\0"+ + "\13\u0126\1\u0151\67\u0126\6\0\2\u0127\1\u0128\2\0\1\254"+ + "\1\357\1\360\1\0\7\u0127\3\0\31\u0127\23\0\1\u0127"+ + "\6\0\1\u0152\12\0\2\u0152\2\0\1\u0152\3\0\31\u0152"+ + "\40\0\1\u0129\1\360\107\0\2\u0153\1\0\4\u0153\3\0"+ + "\1\u0153\1\0\2\u0153\1\0\1\u0153\6\0\2\u0153\50\0"+ + "\1\120\5\0\1\u0154\1\130\2\0\2\u0154\1\134\5\0"+ + "\1\134\60\0\2\14\7\0\7\14\3\0\10\14\1\u0155"+ + "\20\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\14\14\1\u0156\14\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u0157\20\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u0158\23\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\20\14\1\u0159"+ + "\10\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\12\14\1\u015a\16\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\21\14\1\u015b\7\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\15\14\1\u015c\13\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\10\14\1\u015d"+ + "\20\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\10\14\1\u015e\4\14\1\u015f\13\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0160\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\23\14\1\u0161"+ + "\5\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\12\14\1\u0162\16\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\16\14\1\u0163\12\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0164\26\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\12\14\1\u0165"+ + "\16\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\16\14\1\u0166\12\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\12\14\1\u0167\16\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u0168\23\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\11\14\1\u0169"+ + "\17\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\26\14\1\u016a\2\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\5\14\1\u016b\23\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\12\14\1\u016c\16\14\23\0"+ + "\1\14\6\0\2\u014b\3\0\1\u011f\3\0\7\u014b\3\0"+ + "\31\u014b\23\0\1\u014b\6\0\1\u014e\1\u014c\3\0\1\107"+ + "\1\u0121\1\u0122\1\0\2\u014c\2\u014e\2\u014c\1\u014e\3\0"+ + "\31\u014e\23\0\1\u014c\1\u014d\2\0\13\u014d\1\u016d\67\u014d"+ + "\6\0\2\u014e\1\u014f\2\0\1\107\1\u0121\1\u0122\1\0"+ + "\7\u014e\3\0\31\u014e\23\0\1\u014e\6\0\1\u016e\12\0"+ + "\2\u016e\2\0\1\u016e\3\0\31\u016e\40\0\1\u0150\1\u0122"+ + "\70\0\1\u0126\2\0\10\u0126\1\u016f\1\u0151\1\u0126\1\u0151"+ + "\67\u0126\6\0\2\u0152\4\0\1\u0129\1\360\1\0\7\u0152"+ + "\3\0\31\u0152\23\0\1\u0152\17\0\2\u0170\1\0\4\u0170"+ + "\3\0\1\u0170\1\0\2\u0170\1\0\1\u0170\6\0\2\u0170"+ + "\50\0\1\120\5\0\1\u0171\1\130\2\0\2\u0171\1\134"+ + "\5\0\1\134\60\0\2\14\7\0\7\14\3\0\6\14"+ + "\1\u0172\22\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\13\14\1\u0173\15\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\14\14\1\u0174\14\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\3\14\1\u0175\25\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\5\14"+ + "\1\u0176\23\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\3\14\1\u0177\25\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\3\14\1\u0178\25\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\2\14\1\u0179\26\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\10\14"+ + "\1\u017a\20\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\11\14\1\u017b\17\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\5\14\1\u017c\23\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\22\14\1\u017d\6\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\7\14"+ + "\1\u017e\21\14\23\0\1\14\6\0\2\14\7\0\7\14"+ + "\3\0\11\14\1\u017f\17\14\23\0\1\14\6\0\2\14"+ + "\7\0\7\14\3\0\2\14\1\u0180\26\14\23\0\1\14"+ + "\6\0\2\14\7\0\7\14\3\0\2\14\1\u0181\26\14"+ + "\23\0\1\14\6\0\2\14\7\0\7\14\3\0\11\14"+ + "\1\u0182\17\14\23\0\1\14\1\u014d\2\0\10\u014d\1\u0183"+ + "\1\u016d\1\u014d\1\u016d\67\u014d\6\0\2\u016e\4\0\1\u0150"+ + "\1\u0122\1\0\7\u016e\3\0\31\u016e\23\0\1\u016e\17\0"+ + "\2\u0184\1\0\4\u0184\3\0\1\u0184\1\0\2\u0184\1\0"+ + "\1\u0184\6\0\2\u0184\50\0\1\120\5\0\1\u0185\1\130"+ + "\2\0\2\u0185\1\134\5\0\1\134\60\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\u0186\26\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u0187\26\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\5\14\1\u0188"+ + "\23\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\u0189\26\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\16\14\1\u018a\12\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\5\14\1\u018b\23\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\10\14\1\u018c"+ + "\20\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\2\14\1\u018d\26\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\10\14\1\u018e\20\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\2\14\1\u018f\26\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\22\14\1\u0190"+ + "\6\14\23\0\1\14\17\0\2\u0191\1\0\4\u0191\3\0"+ + "\1\u0191\1\0\2\u0191\1\0\1\u0191\6\0\2\u0191\50\0"+ + "\1\120\5\0\1\u0192\1\130\2\0\2\u0192\1\134\5\0"+ + "\1\134\60\0\2\14\7\0\7\14\3\0\2\14\1\u0193"+ + "\26\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\7\14\1\u0194\21\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\2\14\1\u0195\26\14\23\0\1\14\6\0"+ + "\2\14\7\0\7\14\3\0\11\14\1\u0196\17\14\23\0"+ + "\1\14\6\0\2\14\7\0\7\14\3\0\14\14\1\u0197"+ + "\14\14\23\0\1\14\6\0\2\14\7\0\7\14\3\0"+ + "\14\14\1\u0198\14\14\23\0\1\14\17\0\2\u0199\1\0"+ + "\4\u0199\3\0\1\u0199\1\0\2\u0199\1\0\1\u0199\6\0"+ + "\2\u0199\50\0\1\120\5\0\1\u019a\1\130\2\0\2\u019a"+ + "\1\134\5\0\1\134\60\0\2\14\7\0\7\14\3\0"+ + "\15\14\1\u019b\13\14\23\0\1\14\6\0\2\14\7\0"+ + "\7\14\3\0\6\14\1\u019c\22\14\23\0\1\14\11\0"+ + "\1\120\5\0\1\u019d\1\130\2\0\2\u019d\1\134\5\0"+ + "\1\134\63\0\1\120\5\0\1\u019e\1\130\2\0\2\u019e"+ + "\1\134\5\0\1\134\63\0\1\120\5\0\1\u019f\1\130"+ + "\2\0\2\u019f\1\134\5\0\1\134\63\0\1\120\5\0"+ + "\1\u01a0\1\130\2\0\2\u01a0\1\134\5\0\1\134\63\0"+ + "\1\120\5\0\1\u01a1\1\130\2\0\2\u01a1\1\134\5\0"+ + "\1\134\63\0\1\120\5\0\1\u01a2\1\130\2\0\2\u01a2"+ + "\1\134\5\0\1\134\52\0"; - private static int[] zzUnpackRowMap() { - int[] result = new int[418]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; + private static int [] zzUnpackTrans() { + int [] result = new int[21350]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackRowMap(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11"+ + "\23\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11"+ + "\3\1\1\11\2\1\1\11\1\1\1\11\2\1\1\0"+ + "\3\11\2\0\1\1\1\0\1\1\1\11\1\1\1\11"+ + "\3\1\1\0\2\1\1\0\2\11\54\1\12\11\2\1"+ + "\7\11\6\0\1\1\1\11\2\0\1\11\3\0\1\11"+ + "\1\0\1\11\1\1\2\11\4\1\1\0\55\1\2\11"+ + "\7\0\1\11\5\0\1\11\52\1\1\0\1\11\12\0"+ + "\41\1\10\0\32\1\2\0\52\1\1\11\11\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[418]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - /** - * The transition table of the DFA - */ - private static final int[] ZZ_TRANS = zzUnpackTrans(); + /** the input device */ + private java.io.Reader zzReader; - private static final String ZZ_TRANS_PACKED_0 - = "\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\6" - + "\1\15\1\16\1\17\1\20\1\11\1\21\1\22\1\23" - + "\1\24\2\14\2\24\1\14\1\25\1\6\1\26\1\27" - + "\1\30\1\31\1\32\1\14\1\33\1\34\1\35\1\36" - + "\1\37\1\40\1\41\1\42\1\43\1\14\1\44\1\14" - + "\1\45\2\14\1\46\1\14\1\47\1\50\1\51\1\52" - + "\1\53\1\54\1\55\1\56\1\57\1\60\1\61\1\62" - + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72" - + "\1\73\1\74\1\75\13\73\1\76\10\73\1\77\53\73" - + "\1\100\1\74\1\75\24\100\1\77\1\76\52\100\1\6" - + "\1\101\1\102\1\103\2\6\1\104\4\6\1\105\1\106" - + "\4\6\2\104\2\6\1\104\3\6\31\104\21\6\1\107" - + "\1\101\1\102\7\107\1\110\70\107\105\0\1\10\103\0" - + "\1\11\10\0\1\11\72\0\1\111\1\112\7\0\1\113" - + "\102\0\1\114\73\0\2\14\7\0\7\14\3\0\31\14" - + "\31\0\1\115\103\0\1\116\1\117\4\0\2\120\2\0" - + "\2\120\64\0\1\121\3\0\1\122\2\0\1\123\3\0" - + "\2\121\2\0\1\121\3\0\31\121\34\0\1\124\1\0" - + "\1\125\102\0\1\126\76\0\1\120\5\0\1\127\1\130" - + "\1\131\1\0\1\132\1\133\1\134\5\0\1\134\22\0" - + "\1\131\35\0\1\120\5\0\2\24\2\0\2\24\1\134" - + "\5\0\1\134\64\0\1\135\10\0\1\136\62\0\2\14" - + "\7\0\7\14\3\0\1\14\1\137\27\14\27\0\2\14" - + "\7\0\7\14\3\0\2\14\1\140\26\14\27\0\2\14" - + "\7\0\7\14\3\0\3\14\1\141\12\14\1\142\6\14" - + "\1\143\3\14\27\0\2\14\7\0\7\14\3\0\6\14" - + "\1\144\22\14\27\0\2\14\7\0\7\14\3\0\3\14" - + "\1\145\3\14\1\146\6\14\1\147\12\14\27\0\2\14" - + "\7\0\7\14\3\0\2\14\1\150\6\14\1\151\1\14" - + "\1\152\3\14\1\153\11\14\27\0\2\14\7\0\7\14" - + "\3\0\24\14\1\154\4\14\27\0\2\14\7\0\7\14" - + "\3\0\2\14\1\155\1\156\7\14\1\157\15\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\160\16\14\1\161" - + "\1\14\1\162\6\14\27\0\2\14\7\0\7\14\3\0" - + "\6\14\1\163\1\14\1\164\4\14\1\165\5\14\1\166" - + "\5\14\27\0\2\14\7\0\7\14\3\0\6\14\1\167" - + "\1\14\1\170\20\14\27\0\2\14\7\0\7\14\3\0" - + "\2\14\1\171\4\14\1\172\12\14\1\173\6\14\27\0" - + "\2\14\7\0\7\14\3\0\3\14\1\174\3\14\1\175" - + "\2\14\1\176\1\177\15\14\27\0\2\14\7\0\7\14" - + "\3\0\12\14\1\200\5\14\1\201\10\14\27\0\2\14" - + "\7\0\7\14\3\0\1\14\1\202\1\14\1\203\7\14" - + "\1\204\15\14\27\0\2\14\7\0\7\14\3\0\3\14" - + "\1\205\3\14\1\206\21\14\27\0\2\14\7\0\7\14" - + "\3\0\2\14\1\207\26\14\27\0\2\14\7\0\7\14" - + "\3\0\10\14\1\210\20\14\27\0\2\14\7\0\7\14" - + "\3\0\3\14\1\211\25\14\36\0\1\212\102\0\1\213" - + "\57\0\1\214\22\0\1\215\60\0\1\216\21\0\1\217" - + "\61\0\1\220\20\0\1\221\102\0\1\222\65\0\1\73" - + "\2\0\13\73\1\0\10\73\1\0\53\73\2\0\1\75" - + "\100\0\2\223\1\0\13\223\1\224\1\225\3\223\1\225" - + "\1\226\2\223\1\227\1\230\1\231\1\232\6\223\1\233" - + "\1\234\3\223\1\235\34\223\1\100\2\0\24\100\2\0" - + "\52\100\2\0\1\102\103\0\1\103\10\0\1\103\74\0" - + "\2\236\1\237\3\0\1\240\1\241\1\0\7\236\3\0" - + "\31\236\24\0\1\103\2\0\1\236\5\0\1\106\4\0" - + "\2\236\2\0\1\236\3\0\31\236\25\0\1\242\1\0" - + "\1\243\12\0\2\243\2\0\1\243\3\0\31\243\21\0" - + "\1\111\1\244\1\245\100\111\5\246\1\247\75\246\11\0" - + "\1\250\77\0\1\251\12\0\2\251\2\0\1\251\3\0" - + "\31\251\40\0\2\120\2\0\2\120\1\134\5\0\1\134" - + "\55\0\1\252\1\121\1\253\2\0\1\254\1\255\2\0" - + "\2\121\2\252\2\121\1\252\3\0\31\252\36\0\1\256" - + "\100\0\1\257\1\0\1\260\102\0\1\261\76\0\1\120" - + "\5\0\1\127\1\130\2\0\1\132\1\133\1\134\5\0" - + "\1\134\60\0\1\120\5\0\2\130\2\0\2\130\1\134" - + "\5\0\1\134\66\0\1\262\1\263\1\0\4\263\3\0" - + "\1\263\1\0\2\263\1\0\1\263\6\0\2\263\45\0" - + "\1\120\5\0\1\133\1\130\2\0\2\133\1\134\5\0" - + "\1\134\60\0\1\120\5\0\1\264\1\130\2\0\2\264" - + "\1\134\5\0\1\134\66\0\2\265\2\0\2\265\1\0" - + "\1\266\50\0\1\266\11\0\2\14\7\0\7\14\3\0" - + "\2\14\1\267\26\14\27\0\2\14\7\0\7\14\3\0" - + "\11\14\1\270\17\14\27\0\2\14\7\0\7\14\3\0" - + "\5\14\1\271\23\14\27\0\2\14\7\0\7\14\3\0" - + "\6\14\1\272\22\14\27\0\2\14\7\0\7\14\3\0" - + "\11\14\1\273\17\14\27\0\2\14\7\0\7\14\3\0" - + "\6\14\1\274\2\14\1\275\17\14\27\0\2\14\7\0" - + "\7\14\3\0\10\14\1\276\20\14\27\0\2\14\7\0" - + "\7\14\3\0\3\14\1\277\25\14\27\0\2\14\7\0" - + "\7\14\3\0\11\14\1\300\17\14\27\0\2\14\7\0" - + "\7\14\3\0\3\14\1\301\25\14\27\0\2\14\7\0" - + "\7\14\3\0\21\14\1\302\7\14\27\0\2\14\7\0" - + "\7\14\3\0\12\14\1\303\16\14\27\0\2\14\7\0" - + "\7\14\3\0\2\14\1\304\26\14\27\0\2\14\7\0" - + "\7\14\3\0\17\14\1\305\11\14\27\0\2\14\7\0" - + "\7\14\3\0\23\14\1\306\5\14\27\0\2\14\7\0" - + "\7\14\3\0\16\14\1\307\12\14\27\0\2\14\7\0" - + "\7\14\3\0\13\14\1\310\6\14\1\311\6\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\312\10\14\1\313" - + "\16\14\27\0\2\14\7\0\7\14\3\0\21\14\1\314" - + "\7\14\27\0\2\14\7\0\7\14\3\0\6\14\1\315" - + "\2\14\1\316\17\14\27\0\2\14\7\0\7\14\3\0" - + "\21\14\1\317\7\14\27\0\2\14\7\0\7\14\3\0" - + "\2\14\1\320\26\14\27\0\2\14\7\0\7\14\3\0" - + "\14\14\1\321\14\14\27\0\2\14\7\0\7\14\3\0" - + "\15\14\1\322\1\323\12\14\27\0\2\14\7\0\7\14" - + "\3\0\10\14\1\324\20\14\27\0\2\14\7\0\7\14" - + "\3\0\16\14\1\325\12\14\27\0\2\14\7\0\7\14" - + "\3\0\1\14\1\326\27\14\27\0\2\14\7\0\7\14" - + "\3\0\10\14\1\327\20\14\27\0\2\14\7\0\7\14" - + "\3\0\10\14\1\330\20\14\27\0\2\14\7\0\7\14" - + "\3\0\11\14\1\331\17\14\27\0\2\14\7\0\7\14" - + "\3\0\12\14\1\332\16\14\27\0\2\14\7\0\7\14" - + "\3\0\7\14\1\333\2\14\1\334\16\14\27\0\2\14" - + "\7\0\7\14\3\0\5\14\1\335\23\14\27\0\2\14" - + "\7\0\7\14\3\0\1\336\30\14\27\0\2\14\7\0" - + "\7\14\3\0\1\14\1\337\27\14\27\0\2\14\7\0" - + "\7\14\3\0\12\14\1\340\16\14\27\0\2\14\7\0" - + "\7\14\3\0\11\14\1\341\17\14\27\0\2\14\7\0" - + "\7\14\3\0\15\14\1\342\13\14\27\0\2\14\7\0" - + "\7\14\3\0\30\14\1\343\36\0\1\344\104\0\1\226" - + "\3\0\2\226\75\0\1\345\3\0\2\345\64\0\1\346" - + "\12\0\2\346\2\0\1\346\3\0\31\346\35\0\1\240" - + "\1\241\101\0\1\241\1\0\1\347\72\0\1\350\12\0" - + "\2\350\2\0\1\350\3\0\31\350\27\0\1\351\1\243" - + "\1\352\2\0\1\107\1\353\2\0\2\243\2\351\2\243" - + "\1\351\3\0\31\351\23\0\1\245\100\0\5\246\1\354" - + "\75\246\4\0\1\245\1\247\103\0\2\251\3\0\1\355" - + "\3\0\7\251\3\0\31\251\27\0\2\252\1\356\2\0" - + "\1\254\1\357\1\360\1\0\7\252\3\0\31\252\27\0" - + "\1\361\12\0\2\361\2\0\1\361\3\0\31\361\27\0" - + "\1\362\5\0\1\255\4\0\2\362\2\0\1\362\3\0" - + "\31\362\36\0\1\363\104\0\2\364\1\0\4\364\3\0" - + "\1\364\1\0\2\364\1\0\1\364\6\0\2\364\45\0" - + "\1\120\5\0\1\365\1\130\2\0\2\365\1\134\5\0" - + "\1\134\66\0\2\265\2\0\2\265\64\0\2\14\7\0" - + "\7\14\3\0\3\14\1\366\25\14\27\0\2\14\7\0" - + "\7\14\3\0\13\14\1\367\15\14\27\0\2\14\7\0" - + "\7\14\3\0\20\14\1\370\10\14\27\0\2\14\7\0" - + "\7\14\3\0\2\14\1\371\26\14\27\0\2\14\7\0" - + "\7\14\3\0\2\14\1\372\26\14\27\0\2\14\7\0" - + "\7\14\3\0\2\14\1\373\26\14\27\0\2\14\7\0" - + "\7\14\3\0\5\14\1\374\23\14\27\0\2\14\7\0" - + "\7\14\3\0\6\14\1\375\2\14\1\376\17\14\27\0" - + "\2\14\7\0\7\14\3\0\6\14\1\377\22\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0100\17\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0101\26\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0102\17\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u0103\27\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0104\26\14\27\0" - + "\2\14\7\0\7\14\3\0\16\14\1\u0105\12\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0106\26\14\27\0" - + "\2\14\7\0\7\14\3\0\7\14\1\u0107\21\14\27\0" - + "\2\14\7\0\7\14\3\0\6\14\1\u0108\22\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0109\26\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u010a\17\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u010b\26\14\27\0" - + "\2\14\7\0\7\14\3\0\7\14\1\u010c\6\14\1\u010d" - + "\12\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u010e" - + "\26\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u010f" - + "\25\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0110" - + "\26\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0111" - + "\25\14\27\0\2\14\7\0\7\14\3\0\6\14\1\u0112" - + "\22\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0113" - + "\25\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0114" - + "\23\14\27\0\2\14\7\0\7\14\3\0\20\14\1\u0115" - + "\10\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u0116" - + "\12\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u0117" - + "\17\14\27\0\2\14\7\0\7\14\3\0\24\14\1\u0118" - + "\4\14\27\0\2\14\7\0\7\14\3\0\4\14\1\u0119" - + "\24\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u011a" - + "\12\14\27\0\2\14\7\0\7\14\3\0\14\14\1\u011b" - + "\14\14\27\0\2\14\7\0\7\14\3\0\12\14\1\u011c" - + "\16\14\27\0\2\346\4\0\1\240\1\241\1\0\7\346" - + "\3\0\31\346\21\0\1\347\2\0\13\347\1\u011d\64\347" - + "\6\0\2\350\1\u011e\2\0\1\u011f\3\0\7\350\3\0" - + "\31\350\27\0\2\351\1\u0120\2\0\1\107\1\u0121\1\u0122" - + "\1\0\7\351\3\0\31\351\27\0\1\u0123\12\0\2\u0123" - + "\2\0\1\u0123\3\0\31\u0123\27\0\1\u0124\5\0\1\353" - + "\4\0\2\u0124\2\0\1\u0124\3\0\31\u0124\21\0\4\246" - + "\1\245\1\354\75\246\6\0\1\u0125\12\0\2\u0125\2\0" - + "\1\u0125\3\0\31\u0125\27\0\1\362\5\0\1\357\1\360" - + "\3\0\2\362\2\0\1\362\3\0\31\362\35\0\1\360" - + "\1\0\1\u0126\72\0\1\u0127\1\361\3\0\1\254\1\255" - + "\2\0\2\361\2\u0127\2\361\1\u0127\3\0\31\u0127\27\0" - + "\2\362\1\u0128\3\0\1\u0129\1\360\1\0\7\362\3\0" - + "\31\362\40\0\2\u012a\1\0\4\u012a\3\0\1\u012a\1\0" - + "\2\u012a\1\0\1\u012a\6\0\2\u012a\45\0\1\120\5\0" - + "\1\u012b\1\130\2\0\2\u012b\1\134\5\0\1\134\55\0" - + "\2\14\7\0\7\14\3\0\4\14\1\u012c\24\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u012d\27\14\27\0" - + "\2\14\7\0\7\14\3\0\10\14\1\u012e\20\14\27\0" - + "\2\14\7\0\7\14\3\0\20\14\1\u012f\10\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0130\17\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0131\16\14\27\0" - + "\2\14\7\0\7\14\3\0\6\14\1\u0132\22\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0133\16\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u0134\27\14\27\0" - + "\2\14\7\0\7\14\3\0\5\14\1\u0135\23\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u0136\27\14\27\0" - + "\2\14\7\0\7\14\3\0\6\14\1\u0137\22\14\27\0" - + "\2\14\7\0\7\14\3\0\17\14\1\u0138\11\14\27\0" - + "\2\14\7\0\7\14\3\0\7\14\1\u0139\21\14\27\0" - + "\2\14\7\0\7\14\3\0\3\14\1\u013a\25\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u013b\27\14\27\0" - + "\2\14\7\0\7\14\3\0\1\14\1\u013c\27\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u013d\26\14\27\0" - + "\2\14\7\0\7\14\3\0\15\14\1\u013e\13\14\27\0" - + "\2\14\7\0\7\14\3\0\13\14\1\u013f\15\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0140\17\14\27\0" - + "\2\14\7\0\7\14\3\0\23\14\1\u0141\5\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0142\26\14\27\0" - + "\2\14\7\0\7\14\3\0\16\14\1\u0143\12\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0144\17\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0145\26\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0146\26\14\27\0" - + "\2\14\7\0\7\14\3\0\3\14\1\u0147\25\14\27\0" - + "\2\14\7\0\7\14\3\0\3\14\1\u0148\25\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0149\16\14\27\0" - + "\2\14\7\0\7\14\3\0\10\14\1\u014a\20\14\21\0" - + "\1\347\2\0\11\347\1\u011d\1\347\1\u011d\64\347\6\0" - + "\1\u014b\12\0\2\u014b\2\0\1\u014b\3\0\31\u014b\27\0" - + "\1\u014c\12\0\2\u014c\2\0\1\u014c\3\0\31\u014c\27\0" - + "\1\u0124\5\0\1\u0121\1\u0122\3\0\2\u0124\2\0\1\u0124" - + "\3\0\31\u0124\35\0\1\u0122\1\0\1\u014d\72\0\1\u014e" - + "\1\u0123\3\0\1\107\1\353\2\0\2\u0123\2\u014e\2\u0123" - + "\1\u014e\3\0\31\u014e\27\0\2\u0124\1\u014f\3\0\1\u0150" - + "\1\u0122\1\0\7\u0124\3\0\31\u0124\27\0\1\u0127\1\u0125" - + "\3\0\1\254\1\357\1\360\1\0\2\u0125\2\u0127\2\u0125" - + "\1\u0127\3\0\31\u0127\21\0\1\u0126\2\0\13\u0126\1\u0151" - + "\64\u0126\6\0\2\u0127\1\u0128\2\0\1\254\1\357\1\360" - + "\1\0\7\u0127\3\0\31\u0127\27\0\1\u0152\12\0\2\u0152" - + "\2\0\1\u0152\3\0\31\u0152\35\0\1\u0129\1\360\104\0" - + "\2\u0153\1\0\4\u0153\3\0\1\u0153\1\0\2\u0153\1\0" - + "\1\u0153\6\0\2\u0153\45\0\1\120\5\0\1\u0154\1\130" - + "\2\0\2\u0154\1\134\5\0\1\134\55\0\2\14\7\0" - + "\7\14\3\0\10\14\1\u0155\20\14\27\0\2\14\7\0" - + "\7\14\3\0\14\14\1\u0156\14\14\27\0\2\14\7\0" - + "\7\14\3\0\10\14\1\u0157\20\14\27\0\2\14\7\0" - + "\7\14\3\0\5\14\1\u0158\23\14\27\0\2\14\7\0" - + "\7\14\3\0\20\14\1\u0159\10\14\27\0\2\14\7\0" - + "\7\14\3\0\12\14\1\u015a\16\14\27\0\2\14\7\0" - + "\7\14\3\0\21\14\1\u015b\7\14\27\0\2\14\7\0" - + "\7\14\3\0\15\14\1\u015c\13\14\27\0\2\14\7\0" - + "\7\14\3\0\10\14\1\u015d\20\14\27\0\2\14\7\0" - + "\7\14\3\0\10\14\1\u015e\4\14\1\u015f\13\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0160\17\14\27\0" - + "\2\14\7\0\7\14\3\0\23\14\1\u0161\5\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0162\16\14\27\0" - + "\2\14\7\0\7\14\3\0\16\14\1\u0163\12\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0164\26\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0165\16\14\27\0" - + "\2\14\7\0\7\14\3\0\16\14\1\u0166\12\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u0167\16\14\27\0" - + "\2\14\7\0\7\14\3\0\5\14\1\u0168\23\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0169\17\14\27\0" - + "\2\14\7\0\7\14\3\0\26\14\1\u016a\2\14\27\0" - + "\2\14\7\0\7\14\3\0\5\14\1\u016b\23\14\27\0" - + "\2\14\7\0\7\14\3\0\12\14\1\u016c\16\14\27\0" - + "\2\u014b\3\0\1\u011f\3\0\7\u014b\3\0\31\u014b\27\0" - + "\1\u014e\1\u014c\3\0\1\107\1\u0121\1\u0122\1\0\2\u014c" - + "\2\u014e\2\u014c\1\u014e\3\0\31\u014e\21\0\1\u014d\2\0" - + "\13\u014d\1\u016d\64\u014d\6\0\2\u014e\1\u014f\2\0\1\107" - + "\1\u0121\1\u0122\1\0\7\u014e\3\0\31\u014e\27\0\1\u016e" - + "\12\0\2\u016e\2\0\1\u016e\3\0\31\u016e\35\0\1\u0150" - + "\1\u0122\65\0\1\u0126\2\0\10\u0126\1\u016f\1\u0151\1\u0126" - + "\1\u0151\64\u0126\6\0\2\u0152\4\0\1\u0129\1\360\1\0" - + "\7\u0152\3\0\31\u0152\40\0\2\u0170\1\0\4\u0170\3\0" - + "\1\u0170\1\0\2\u0170\1\0\1\u0170\6\0\2\u0170\45\0" - + "\1\120\5\0\1\u0171\1\130\2\0\2\u0171\1\134\5\0" - + "\1\134\55\0\2\14\7\0\7\14\3\0\6\14\1\u0172" - + "\22\14\27\0\2\14\7\0\7\14\3\0\13\14\1\u0173" - + "\15\14\27\0\2\14\7\0\7\14\3\0\14\14\1\u0174" - + "\14\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0175" - + "\25\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0176" - + "\23\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0177" - + "\25\14\27\0\2\14\7\0\7\14\3\0\3\14\1\u0178" - + "\25\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0179" - + "\26\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u017a" - + "\20\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u017b" - + "\17\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u017c" - + "\23\14\27\0\2\14\7\0\7\14\3\0\22\14\1\u017d" - + "\6\14\27\0\2\14\7\0\7\14\3\0\7\14\1\u017e" - + "\21\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u017f" - + "\17\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0180" - + "\26\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0181" - + "\26\14\27\0\2\14\7\0\7\14\3\0\11\14\1\u0182" - + "\17\14\21\0\1\u014d\2\0\10\u014d\1\u0183\1\u016d\1\u014d" - + "\1\u016d\64\u014d\6\0\2\u016e\4\0\1\u0150\1\u0122\1\0" - + "\7\u016e\3\0\31\u016e\40\0\2\u0184\1\0\4\u0184\3\0" - + "\1\u0184\1\0\2\u0184\1\0\1\u0184\6\0\2\u0184\45\0" - + "\1\120\5\0\1\u0185\1\130\2\0\2\u0185\1\134\5\0" - + "\1\134\55\0\2\14\7\0\7\14\3\0\2\14\1\u0186" - + "\26\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0187" - + "\26\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u0188" - + "\23\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u0189" - + "\26\14\27\0\2\14\7\0\7\14\3\0\16\14\1\u018a" - + "\12\14\27\0\2\14\7\0\7\14\3\0\5\14\1\u018b" - + "\23\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u018c" - + "\20\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u018d" - + "\26\14\27\0\2\14\7\0\7\14\3\0\10\14\1\u018e" - + "\20\14\27\0\2\14\7\0\7\14\3\0\2\14\1\u018f" - + "\26\14\27\0\2\14\7\0\7\14\3\0\22\14\1\u0190" - + "\6\14\40\0\2\u0191\1\0\4\u0191\3\0\1\u0191\1\0" - + "\2\u0191\1\0\1\u0191\6\0\2\u0191\45\0\1\120\5\0" - + "\1\u0192\1\130\2\0\2\u0192\1\134\5\0\1\134\55\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0193\26\14\27\0" - + "\2\14\7\0\7\14\3\0\7\14\1\u0194\21\14\27\0" - + "\2\14\7\0\7\14\3\0\2\14\1\u0195\26\14\27\0" - + "\2\14\7\0\7\14\3\0\11\14\1\u0196\17\14\27\0" - + "\2\14\7\0\7\14\3\0\14\14\1\u0197\14\14\27\0" - + "\2\14\7\0\7\14\3\0\14\14\1\u0198\14\14\40\0" - + "\2\u0199\1\0\4\u0199\3\0\1\u0199\1\0\2\u0199\1\0" - + "\1\u0199\6\0\2\u0199\45\0\1\120\5\0\1\u019a\1\130" - + "\2\0\2\u019a\1\134\5\0\1\134\55\0\2\14\7\0" - + "\7\14\3\0\15\14\1\u019b\13\14\27\0\2\14\7\0" - + "\7\14\3\0\6\14\1\u019c\22\14\32\0\1\120\5\0" - + "\1\u019d\1\130\2\0\2\u019d\1\134\5\0\1\134\60\0" - + "\1\120\5\0\1\u019e\1\130\2\0\2\u019e\1\134\5\0" - + "\1\134\60\0\1\120\5\0\1\u019f\1\130\2\0\2\u019f" - + "\1\134\5\0\1\134\60\0\1\120\5\0\1\u01a0\1\130" - + "\2\0\2\u01a0\1\134\5\0\1\134\60\0\1\120\5\0" - + "\1\u01a1\1\130\2\0\2\u01a1\1\134\5\0\1\134\60\0" - + "\1\120\5\0\1\u01a2\1\130\2\0\2\u01a2\1\134\5\0" - + "\1\134\47\0"; + /** the current state of the DFA */ + private int zzState; - private static int[] zzUnpackTrans() { - int[] result = new int[20435]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; - private static int zzUnpackTrans(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - int j = offset; /* index in unpacked array */ + /** the textposition at the last accepting state */ + private int zzMarkedPos; - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do { - result[j++] = value; - } while (--count > 0); - } - return j; - } + /** the current text position in the buffer */ + private int zzCurrentPos; + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; + /** number of newlines encountered up to the start of the matched text */ + private int yyline; - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + /** the number of characters up to the start of the matched text */ + private int yychar; - private static final String ZZ_ATTRIBUTE_PACKED_0 - = "\5\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11" - + "\23\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11" - + "\3\1\1\11\2\1\1\11\1\1\1\11\2\1\1\0" - + "\3\11\2\0\1\1\1\0\1\1\1\11\1\1\1\11" - + "\3\1\1\0\2\1\1\0\2\11\54\1\12\11\2\1" - + "\7\11\6\0\1\1\1\11\2\0\1\11\3\0\1\11" - + "\1\0\1\11\1\1\2\11\4\1\1\0\55\1\2\11" - + "\7\0\1\11\5\0\1\11\52\1\1\0\1\11\12\0" - + "\41\1\10\0\32\1\2\0\52\1\1\11\11\1"; + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; - private static int[] zzUnpackAttribute() { - int[] result = new int[418]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; - private static int zzUnpackAttribute(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; - int j = offset; /* index in unpacked array */ + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do { - result[j++] = value; - } while (--count > 0); - } - return j; - } + /* user code: */ - /** - * the input device - */ - private java.io.Reader zzReader; - - /** - * the current state of the DFA - */ - private int zzState; - - /** - * the current lexical state - */ - private int zzLexicalState = YYINITIAL; - - /** - * this buffer contains the current text to be matched and is the source of - * the yytext() string - */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - - /** - * the textposition at the last accepting state - */ - private int zzMarkedPos; - - /** - * the current text position in the buffer - */ - private int zzCurrentPos; - - /** - * startRead marks the beginning of the yytext() string in the buffer - */ - private int zzStartRead; - - /** - * endRead marks the last character in the buffer, that has been read from - * input - */ - private int zzEndRead; - - /** - * number of newlines encountered up to the start of the matched text - */ - private int yyline; - - /** - * the number of characters up to the start of the matched text - */ - private int yychar; - - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** - * zzAtEOF == true <=> the scanner is at the EOF - */ - private boolean zzAtEOF; - - /** - * denotes if the user-EOF-code has already been executed - */ - private boolean zzEOFDone; - - /* user code: */ StringBuffer string = new StringBuffer(); - private static String xmlTagName = ""; + private static String xmlTagName=""; public int yychar() { return yychar; } - private Stack pushedBack = new Stack(); + private Stack pushedBack=new Stack(); public int yyline() { - return yyline + 1; + return yyline+1; } - private List listeners = new ArrayList<>(); + private List listeners=new ArrayList<>(); - public void addListener(LexListener listener) { + public void addListener(LexListener listener){ listeners.add(listener); } - public void removeListener(LexListener listener) { + public void removeListener(LexListener listener){ listeners.remove(listener); } - public void informListenersLex(ParsedSymbol s) { - for (LexListener l : listeners) { + public void informListenersLex(ParsedSymbol s){ + for(LexListener l:listeners){ l.onLex(s); } } - public void informListenersPushBack(ParsedSymbol s) { - for (LexListener l : listeners) { + public void informListenersPushBack(ParsedSymbol s){ + for(LexListener l:listeners){ l.onPushBack(s); } } @@ -833,1005 +844,893 @@ public final class ActionScriptLexer { informListenersPushBack(symb); } ParsedSymbol last; - - public ParsedSymbol lex() throws java.io.IOException, ParseException { - ParsedSymbol ret = null; - if (!pushedBack.isEmpty()) { + public ParsedSymbol lex() throws java.io.IOException, ParseException{ + ParsedSymbol ret=null; + if(!pushedBack.isEmpty()){ ret = last = pushedBack.pop(); - } else { + }else{ ret = last = yylex(); } informListenersLex(ret); return ret; } - /** - * Creates a new scanner There is also a java.io.InputStream version of this - * constructor. - * - * @param in the java.io.Reader to read input from. - */ - public ActionScriptLexer(java.io.Reader in) { - this.zzReader = in; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ActionScriptLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader + (in, java.nio.charset.Charset.forName("UTF-8"))); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 2244) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; } - /** - * Creates a new scanner. There is also java.io.Reader version of this - * constructor. - * - * @param in the java.io.Inputstream to read input from. - */ - public ActionScriptLexer(java.io.InputStream in) { - this(new java.io.InputStreamReader(in)); + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; } - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table - */ - private static char[] zzUnpackCMap(String packed) { - char[] map = new char[0x10000]; - int i = 0; /* index in packed string */ + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); - int j = 0; /* index in unpacked array */ - - while (i < 2236) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do { - map[j++] = value; - } while (--count > 0); - } - return map; + if (numRead > 0) { + zzEndRead+= numRead; + return false; } - - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - - /* first: make room (if you can) */ - if (zzStartRead > 0) { - System.arraycopy(zzBuffer, zzStartRead, - zzBuffer, 0, - zzEndRead - zzStartRead); - - /* translate stored positions */ - zzEndRead -= zzStartRead; - zzCurrentPos -= zzStartRead; - zzMarkedPos -= zzStartRead; - zzStartRead = 0; - } - - /* is the buffer big enough? */ - if (zzCurrentPos >= zzBuffer.length) { - /* if not: blow it up */ - char newBuffer[] = new char[zzCurrentPos * 2]; - System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); - zzBuffer = newBuffer; - } - - /* finally: fill the buffer with new input */ - int numRead = zzReader.read(zzBuffer, zzEndRead, - zzBuffer.length - zzEndRead); - - if (numRead > 0) { - zzEndRead += numRead; - return false; - } - // unlikely but not impossible: read 0 characters, but not at end of stream - if (numRead == 0) { - int c = zzReader.read(); - if (c == -1) { - return true; - } else { - zzBuffer[zzEndRead++] = (char) c; - return false; - } - } - - // numRead < 0 + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } } - /** - * Closes the input stream. - */ - public final void yyclose() throws java.io.IOException { - zzAtEOF = true; /* indicate end of file */ + // numRead < 0 + return true; + } - zzEndRead = zzStartRead; /* invalidate buffer */ + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ - if (zzReader != null) { - zzReader.close(); - } + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + if (zzBuffer.length > ZZ_BUFFERSIZE) + zzBuffer = new char[ZZ_BUFFERSIZE]; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } - /** - * Resets the scanner to read from a new input stream. Does not close the - * old reader. - * - * All internal variables are reset, the old input stream - * cannot be reused (internal buffer is discarded and lost). Lexical - * state is set to ZZ_INITIAL. - * - * @param reader the new input stream - */ - public final void yyreset(java.io.Reader reader) { - zzReader = reader; - zzAtBOL = true; - zzAtEOF = false; - zzEOFDone = false; - zzEndRead = zzStartRead = 0; - zzCurrentPos = zzMarkedPos = 0; - yyline = yychar = yycolumn = 0; - zzLexicalState = YYINITIAL; - } + throw new Error(message); + } - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); - /** - * Returns the text matched by the current regular expression. - */ - public final String yytext() { - return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); - } + zzMarkedPos -= number; + } - /** - * Returns the character at position pos from the matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. A value from 0 to - * yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBuffer[zzStartRead + pos]; - } - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos - zzStartRead; - } + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public ParsedSymbol yylex() throws java.io.IOException, ParseException { + int zzInput; + int zzAction; - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of yypushback(int) and - * a match-all fallback rule) this method will only be called with things - * that "Can't Possibly Happen". If this method is called, something is - * seriously wrong (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done in error - * fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; - throw new Error(message); - } + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. This number must - * not be greater than yylength()! - */ - public void yypushback(int number) { - if (number > yylength()) { - zzScanError(ZZ_PUSHBACK_2BIG); - } + while (true) { + zzMarkedPosL = zzMarkedPos; - zzMarkedPos -= number; - } + yychar+= zzMarkedPosL-zzStartRead; - /** - * Resumes scanning until the next regular expression is matched, the end of - * input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public ParsedSymbol yylex() throws java.io.IOException, ParseException { - int zzInput; - int zzAction; + zzAction = -1; - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - char[] zzBufferL = zzBuffer; - char[] zzCMapL = ZZ_CMAP; + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; - int[] zzTransL = ZZ_TRANS; - int[] zzRowMapL = ZZ_ROWMAP; - int[] zzAttrL = ZZ_ATTRIBUTE; + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + zzForAction: { while (true) { - zzMarkedPosL = zzMarkedPos; - - yychar += zzMarkedPosL - zzStartRead; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - zzForAction: - { - while (true) { - - if (zzCurrentPosL < zzEndReadL) { - zzInput = zzBufferL[zzCurrentPosL++]; - } else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } else { - zzInput = zzBufferL[zzCurrentPosL++]; - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput]]; - if (zzNext == -1) { - break zzForAction; - } - zzState = zzNext; - - int zzAttributes = zzAttrL[zzState]; - if ((zzAttributes & 1) == 1) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ((zzAttributes & 8) == 8) { - break zzForAction; - } - } - - } + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 27: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); - } - case 133: - break; - case 58: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); - } - case 134: - break; - case 60: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); - } - case 135: - break; - case 105: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); - } - case 136: - break; - case 109: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); - } - case 137: - break; - case 20: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); - } - case 138: - break; - case 42: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); - } - case 139: - break; - case 11: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); - } - case 140: - break; - case 100: { - string.append(yytext()); - String endtagname = yytext(); - endtagname = endtagname.substring(2, endtagname.length() - 1); - if (endtagname.equals(xmlTagName)) { - yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML, string.toString()); - } - } - case 141: - break; - case 51: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); - } - case 142: - break; - case 84: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); - } - case 143: - break; - case 5: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); - } - case 144: - break; - case 131: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); - } - case 145: - break; - case 52: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); - } - case 146: - break; - case 125: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); - } - case 147: - break; - case 120: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); - } - case 148: - break; - case 22: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); - } - case 149: - break; - case 99: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); - } - case 150: - break; - case 85: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); - } - case 151: - break; - case 3: { /*ignore*/ - - } - case 152: - break; - case 123: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.OVERRIDE, yytext()); - } - case 153: - break; - case 72: { - string.append('\t'); - } - case 154: - break; - case 66: { - char val = (char) Integer.parseInt(yytext().substring(1), 8); - string.append(val); - } - case 155: - break; - case 132: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); - } - case 156: - break; - case 49: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); - } - case 157: - break; - case 18: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); - } - case 158: - break; - case 64: { - throw new ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); - } - case 159: - break; - case 59: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); - } - case 160: - break; - case 10: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); - } - case 161: - break; - case 34: { - yybegin(YYINITIAL); - yyline++; - } - case 162: - break; - case 106: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); - } - case 163: - break; - case 98: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); - } - case 164: - break; - case 75: { - string.setLength(0); - yybegin(XML); - String s = yytext(); - s = s.substring(1, s.length() - 1); - if (s.contains(" ")) { - s = s.substring(0, s.indexOf(" ")); - } - xmlTagName = s; - string.append(yytext()); - } - case 165: - break; - case 13: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong((yytext())))); - } - case 166: - break; - case 15: { - string.setLength(0); - yybegin(CHARLITERAL); - } - case 167: - break; - case 54: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); - } - case 168: - break; - case 53: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); - } - case 169: - break; - case 81: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SET, yytext()); - } - case 170: - break; - case 29: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); - } - case 171: - break; - case 21: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); - } - case 172: - break; - case 103: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); - } - case 173: - break; - case 71: { - string.append('\n'); - } - case 174: - break; - case 76: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); - } - case 175: - break; - case 43: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); - } - case 176: - break; - case 56: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); - } - case 177: - break; - case 41: { - return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, new Double(Double.parseDouble((yytext())))); - } - case 178: - break; - case 87: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.GET, yytext()); - } - case 179: - break; - case 35: { - yybegin(YYINITIAL); - // length also includes the trailing quote - return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); - } - case 180: - break; - case 130: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); - } - case 181: - break; - case 114: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); - } - case 182: - break; - case 94: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); - } - case 183: - break; - case 89: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); - } - case 184: - break; - case 107: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); - } - case 185: - break; - case 4: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); - } - case 186: - break; - case 40: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); - } - case 187: - break; - case 17: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); - } - case 188: - break; - case 31: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); - } - case 189: - break; - case 118: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DYNAMIC, yytext()); - } - case 190: - break; - case 93: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); - } - case 191: - break; - case 79: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); - } - case 192: - break; - case 88: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); - } - case 193: - break; - case 126: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); - } - case 194: - break; - case 116: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); - } - case 195: - break; - case 110: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.STATIC, yytext()); - } - case 196: - break; - case 14: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); - } - case 197: - break; - case 82: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); - } - case 198: - break; - case 19: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); - } - case 199: - break; - case 92: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EACH, yytext()); - } - case 200: - break; - case 28: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); - } - case 201: - break; - case 113: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); - } - case 202: - break; - case 70: { - string.append('\r'); - } - case 203: - break; - case 26: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); - } - case 204: - break; - case 2: { - yyline++; - } - case 205: - break; - case 86: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); - } - case 206: - break; - case 69: { - string.append('\b'); - } - case 207: - break; - case 83: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); - } - case 208: - break; - case 46: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); - } - case 209: - break; - case 62: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); - } - case 210: - break; - case 102: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); - } - case 211: - break; - case 65: { - string.append('\"'); - } - case 212: - break; - case 8: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); - } - case 213: - break; - case 30: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); - } - case 214: - break; - case 9: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); - } - case 215: - break; - case 78: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); - } - case 216: - break; - case 50: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); - } - case 217: - break; - case 68: { - string.append('\''); - } - case 218: - break; - case 67: { - string.append('\\'); - } - case 219: - break; - case 129: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); - } - case 220: - break; - case 128: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); - } - case 221: - break; - case 115: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); - } - case 222: - break; - case 108: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); - } - case 223: - break; - case 38: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); - } - case 224: - break; - case 121: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); - } - case 225: - break; - case 112: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); - } - case 226: - break; - case 63: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); - } - case 227: - break; - case 111: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); - } - case 228: - break; - case 77: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); - } - case 229: - break; - case 124: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); - } - case 230: - break; - case 37: { - yybegin(XML); - string.append(yytext()); - } - case 231: - break; - case 117: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); - } - case 232: - break; - case 32: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); - } - case 233: - break; - case 16: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); - } - case 234: - break; - case 44: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); - } - case 235: - break; - case 104: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); - } - case 236: - break; - case 73: { - string.append('\f'); - } - case 237: - break; - case 91: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); - } - case 238: - break; - case 39: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); - } - case 239: - break; - case 80: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext().substring(2), 16))); - } - case 240: - break; - case 96: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); - } - case 241: - break; - case 23: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); - } - case 242: - break; - case 74: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); - } - case 243: - break; - case 61: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); - } - case 244: - break; - case 47: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext(), 8))); - } - case 245: - break; - case 95: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); - } - case 246: - break; - case 33: { - string.append(yytext()); - } - case 247: - break; - case 12: { - string.setLength(0); - yybegin(STRING); - } - case 248: - break; - case 101: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); - } - case 249: - break; - case 57: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); - } - case 250: - break; - case 7: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); - } - case 251: - break; - case 127: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.NAMESPACE, yytext()); - } - case 252: - break; - case 122: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); - } - case 253: - break; - case 6: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); - } - case 254: - break; - case 119: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); - } - case 255: - break; - case 90: { - String t = yytext(); - return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, t.substring(2, t.length() - 1)); - } - case 256: - break; - case 24: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); - } - case 257: - break; - case 25: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); - } - case 258: - break; - case 45: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); - } - case 259: - break; - case 48: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); - } - case 260: - break; - case 55: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); - } - case 261: - break; - case 36: { - string.append(yytext()); - yyline++; - } - case 262: - break; - case 97: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); - } - case 263: - break; - case 1: { - } - case 264: - break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - { - return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); - } - } else { - zzScanError(ZZ_NO_MATCH); - } + else { + zzInput = zzBufferL[zzCurrentPosL++]; } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { + } + case 134: break; + case 2: + { yyline++; + } + case 135: break; + case 3: + { /*ignore*/ + } + case 136: break; + case 4: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DIVIDE,yytext()); + } + case 137: break; + case 5: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MULTIPLY,yytext()); + } + case 138: break; + case 6: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER, yytext()); + } + case 139: break; + case 7: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COLON,yytext()); + } + case 140: break; + case 8: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DOT,yytext()); + } + case 141: break; + case 9: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_THAN,yytext()); + } + case 142: break; + case 10: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_THAN,yytext()); + } + case 143: break; + case 11: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN,yytext()); + } + case 144: break; + case 12: + { string.setLength(0); + yybegin(STRING); + } + case 145: break; + case 13: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong((yytext())))); + } + case 146: break; + case 14: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MINUS,yytext()); + } + case 147: break; + case 15: + { string.setLength(0); + yybegin(CHARLITERAL); + } + case 148: break; + case 16: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_OPEN,yytext()); + } + case 149: break; + case 17: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PARENT_CLOSE,yytext()); + } + case 150: break; + case 18: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_OPEN,yytext()); + } + case 151: break; + case 19: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.CURLY_CLOSE,yytext()); + } + case 152: break; + case 20: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_OPEN,yytext()); + } + case 153: break; + case 21: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BRACKET_CLOSE,yytext()); + } + case 154: break; + case 22: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SEMICOLON,yytext()); + } + case 155: break; + case 23: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.COMMA,yytext()); + } + case 156: break; + case 24: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT,yytext()); + } + case 157: break; + case 25: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEGATE,yytext()); + } + case 158: break; + case 26: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TERNAR,yytext()); + } + case 159: break; + case 27: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITAND,yytext()); + } + case 160: break; + case 28: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.BITOR,yytext()); + } + case 161: break; + case 29: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.PLUS,yytext()); + } + case 162: break; + case 30: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.XOR,yytext()); + } + case 163: break; + case 31: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.MODULO,yytext()); + } + case 164: break; + case 32: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ATTRIBUTE,yytext()); + } + case 165: break; + case 33: + { string.append( yytext() ); + } + case 166: break; + case 34: + { yybegin(YYINITIAL); yyline++; + } + case 167: break; + case 35: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString()); + } + case 168: break; + case 36: + { string.append( yytext() ); yyline++; + } + case 169: break; + case 37: + { yybegin(XML); string.append( yytext() ); + } + case 170: break; + case 38: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_DIVIDE,yytext()); + } + case 171: break; + case 39: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MULTIPLY,yytext()); + } + case 172: break; + case 40: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NAMESPACE_OP,yytext()); + } + case 173: break; + case 41: + { return new ParsedSymbol(SymbolGroup.DOUBLE,SymbolType.DOUBLE,new Double(Double.parseDouble((yytext())))); + } + case 174: break; + case 42: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_LEFT,yytext()); + } + case 175: break; + case 43: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.LOWER_EQUAL,yytext()); + } + case 176: break; + case 44: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.SHIFT_RIGHT,yytext()); + } + case 177: break; + case 45: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.GREATER_EQUAL,yytext()); + } + case 178: break; + case 46: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.EQUALS,yytext()); + } + case 179: break; + case 47: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext(),8))); + } + case 180: break; + case 48: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MINUS,yytext()); + } + case 181: break; + case 49: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DECREMENT,yytext()); + } + case 182: break; + case 50: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AS,yytext()); + } + case 183: break; + case 51: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.IS,yytext()); + } + case 184: break; + case 52: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN,yytext()); + } + case 185: break; + case 53: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF,yytext()); + } + case 186: break; + case 54: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DO,yytext()); + } + case 187: break; + case 55: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NOT_EQUAL,yytext()); + } + case 188: break; + case 56: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITAND,yytext()); + } + case 189: break; + case 57: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.AND,yytext()); + } + case 190: break; + case 58: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_BITOR,yytext()); + } + case 191: break; + case 59: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.OR,yytext()); + } + case 192: break; + case 60: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_PLUS,yytext()); + } + case 193: break; + case 61: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INCREMENT,yytext()); + } + case 194: break; + case 62: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_XOR,yytext()); + } + case 195: break; + case 63: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_MODULO,yytext()); + } + case 196: break; + case 64: + { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); + } + case 197: break; + case 65: + { string.append( '\"' ); + } + case 198: break; + case 66: + { char val = (char) Integer.parseInt(yytext().substring(1),8); + string.append( val ); + } + case 199: break; + case 67: + { string.append( '\\' ); + } + case 200: break; + case 68: + { string.append( '\'' ); + } + case 201: break; + case 69: + { string.append( '\b' ); + } + case 202: break; + case 70: + { string.append( '\r' ); + } + case 203: break; + case 71: + { string.append( '\n' ); + } + case 204: break; + case 72: + { string.append( '\t' ); + } + case 205: break; + case 73: + { string.append( '\f' ); + } + case 206: break; + case 74: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.REST,yytext()); + } + case 207: break; + case 75: + { string.setLength(0); + yybegin(XML); + String s=yytext(); + s=s.substring(1,s.length()-1); + if(s.contains(" ")){ + s=s.substring(0,s.indexOf(" ")); + } + xmlTagName = s; + string.append(yytext()); + } + case 208: break; + case 76: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_LEFT,yytext()); + } + case 209: break; + case 77: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.USHIFT_RIGHT,yytext()); + } + case 210: break; + case 78: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_SHIFT_RIGHT,yytext()); + } + case 211: break; + case 79: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_EQUALS,yytext()); + } + case 212: break; + case 80: + { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext().substring(2),16))); + } + case 213: break; + case 81: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SET,yytext()); + } + case 214: break; + case 82: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.NEW,yytext()); + } + case 215: break; + case 83: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRY,yytext()); + } + case 216: break; + case 84: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE,yytext()); + } + case 217: break; + case 85: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR,yytext()); + } + case 218: break; + case 86: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR,yytext()); + } + case 219: break; + case 87: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.GET,yytext()); + } + case 220: break; + case 88: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN,yytext()); + } + case 221: break; + case 89: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.STRICT_NOT_EQUAL,yytext()); + } + case 222: break; + case 90: + { String t=yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME,SymbolType.TYPENAME,t.substring(2,t.length()-1)); + } + case 223: break; + case 91: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.ASSIGN_USHIFT_RIGHT,yytext()); + } + case 224: break; + case 92: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EACH,yytext()); + } + case 225: break; + case 93: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE,yytext()); + } + case 226: break; + case 94: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CASE,yytext()); + } + case 227: break; + case 95: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NULL,yytext()); + } + case 228: break; + case 96: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRUE,yytext()); + } + case 229: break; + case 97: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THIS,yytext()); + } + case 230: break; + case 98: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH,yytext()); + } + case 231: break; + case 99: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.VOID,yytext()); + } + case 232: break; + case 100: + { string.append( yytext() ); + String endtagname=yytext(); + endtagname=endtagname.substring(2,endtagname.length()-1); + if(endtagname.equals(xmlTagName)){ + yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML, string.toString()); + } + } + case 233: break; + case 101: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.BREAK,yytext()); + } + case 234: break; + case 102: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CATCH,yytext()); + } + case 235: break; + case 103: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST,yytext()); + } + case 236: break; + case 104: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS,yytext()); + } + case 237: break; + case 105: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SUPER,yytext()); + } + case 238: break; + case 106: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THROW,yytext()); + } + case 239: break; + case 107: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FALSE,yytext()); + } + case 240: break; + case 108: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINAL,yytext()); + } + case 241: break; + case 109: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); + } + case 242: break; + case 110: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN,yytext()); + } + case 243: break; + case 111: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.STATIC,yytext()); + } + case 244: break; + case 112: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SWITCH,yytext()); + } + case 245: break; + case 113: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.TYPEOF,yytext()); + } + case 246: break; + case 114: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT,yytext()); + } + case 247: break; + case 115: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DELETE,yytext()); + } + case 248: break; + case 116: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC,yytext()); + } + case 249: break; + case 117: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS,yytext()); + } + case 250: break; + case 118: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DEFAULT,yytext()); + } + case 251: break; + case 119: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DYNAMIC,yytext()); + } + case 252: break; + case 120: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY,yytext()); + } + case 253: break; + case 121: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE,yytext()); + } + case 254: break; + case 122: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE,yytext()); + } + case 255: break; + case 123: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONTINUE,yytext()); + } + case 256: break; + case 124: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.OVERRIDE,yytext()); + } + case 257: break; + case 125: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL,yytext()); + } + case 258: break; + case 126: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION,yytext()); + } + case 259: break; + case 127: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY,yytext()); + } + case 260: break; + case 128: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.NAMESPACE,yytext()); + } + case 261: break; + case 129: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE,yytext()); + } + case 262: break; + case 130: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED,yytext()); + } + case 263: break; + case 131: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED,yytext()); + } + case 264: break; + case 132: + { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.INSTANCEOF,yytext()); + } + case 265: break; + case 133: + { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS,yytext()); + } + case 266: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return new ParsedSymbol(SymbolGroup.EOF,SymbolType.EOF,null); + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } } + } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java index 6f05aaf7d..96e50398f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptParser.java @@ -16,13 +16,13 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.SWC; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.ConstructAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.ConstructPropAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ConstructSuperAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FloatValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; @@ -38,6 +38,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ReturnValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ReturnVoidAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.StringAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ThrowAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item; @@ -72,8 +73,10 @@ import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; -import com.jpexs.decompiler.flash.abc.types.ScriptInfo; import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.Loop; import com.jpexs.decompiler.graph.TypeItem; @@ -93,6 +96,10 @@ import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.TernarOpItem; import com.jpexs.decompiler.graph.model.UnboundedTypeItem; import com.jpexs.decompiler.graph.model.WhileItem; +import com.jpexs.helpers.Helper; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; @@ -100,6 +107,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Stack; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -181,12 +190,12 @@ public class ActionScriptParser { List allAbcs = new ArrayList<>(); allAbcs.add(abc); allAbcs.addAll(otherABCs); - ret = new PropertyAVM2Item(ret, propName, index, allAbcs,openedNamespaces,openedNamespacesKinds); + ret = new PropertyAVM2Item(ret, propName, index, allAbcs, openedNamespaces, openedNamespacesKinds); } lexer.pushback(s); return ret; } - + private GraphTargetItem name(boolean typeOnly, List openedNamespaces, List openedNamespacesKinds, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, ParseException { ParsedSymbol s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP); @@ -198,6 +207,7 @@ public class ActionScriptParser { s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); parts.add(s.value.toString()); + s = lex(); } GraphTargetItem index = null; if (s.type == SymbolType.BRACKET_OPEN) { @@ -212,29 +222,84 @@ public class ActionScriptParser { if (!typeOnly) { for (NameAVM2Item n : variables) { if (n.getVariableName().equals(parts.get(0))) { - GraphTargetItem ret = new NameAVM2Item(n.type, lexer.yyline(), n.getVariableName(), null, false, openedNamespaces, openedNamespacesKinds); + NameAVM2Item ni = new NameAVM2Item(n.type, lexer.yyline(), n.getVariableName(), null, false, openedNamespaces, openedNamespacesKinds); + variables.add(ni); + GraphTargetItem ret = ni; if (parts.size() == 1) { ((NameAVM2Item) ret).setIndex(index); } for (int i = 1; i < parts.size(); i++) { - ret = new PropertyAVM2Item(ret, parts.get(i), i == parts.size() - 1 ? index : null, allAbcs,openedNamespaces,openedNamespacesKinds); + ret = new PropertyAVM2Item(ret, parts.get(i), i == parts.size() - 1 ? index : null, allAbcs, openedNamespaces, openedNamespacesKinds); } + return ret; } } } + if (parts.get(0).equals("addChild")) { + //System.out.println("ss"); + } + //search for variable in openedNamespaces + if (!typeOnly) { + for (int i = 0; i < openedNamespaces.size(); i++) { + String ns = openedNamespaces.get(i); + String nspkg = ns; + String nsclass = null; + int nsKind = openedNamespacesKinds.get(i); + if (nspkg.contains(":") && nsKind != Namespace.KIND_NAMESPACE) { + nsclass = nspkg.substring(nspkg.indexOf(":") + 1); + nspkg = nspkg.substring(0, nspkg.indexOf(":")); + } + loopabc: + for (ABC a : allAbcs) { + for (int h = 0; h < a.instance_info.size(); h++) { + InstanceInfo ii = a.instance_info.get(h); + Multiname n = a.constants.constant_multiname.get(ii.name_index); + if (n.getNamespace(a.constants).getName(a.constants).equals(nspkg) && (nsclass == null || (n.getName(a.constants, new ArrayList()).equals(nsclass)))) { + + //found opened class + Reference outName = new Reference<>(""); + Reference outNs = new Reference<>(""); + Reference outPropNs = new Reference<>(""); + Reference outPropNsKind = new Reference<>(1); + if (AVM2SourceGenerator.searchProperty(allAbcs, nspkg, n.getName(a.constants, new ArrayList()), parts.get(0), outName, outNs, outPropNs, outPropNsKind)) { + return new PropertyAVM2Item(null, parts.get(0), index, allAbcs, openedNamespaces, openedNamespacesKinds); + } + + /*for (int g = 0; g < a.instance_info.size(); g++) { + InstanceInfo iii = a.instance_info.get(g); + System.out.println("check " + iii.getName(a.constants).getNameWithNamespace(a.constants) + " - search " + parts.get(0)); + for (Trait t : iii.instance_traits.traits) { + n = t.getName(a); + if (n.getNamespace(a.constants).kind == nsKind && n.getName(a.constants, new ArrayList()).equals(parts.get(0))) { + return new PropertyAVM2Item(null, parts.get(0), index, allAbcs, openedNamespaces, openedNamespacesKinds); + } + } + for (Trait t : a.class_info.get(g).static_traits.traits) { + n = t.getName(a); + if (n.getNamespace(a.constants).kind == nsKind && n.getName(a.constants, new ArrayList()).equals(parts.get(0))) { + return new PropertyAVM2Item(null, parts.get(0), index, allAbcs, openedNamespaces, openedNamespacesKinds); + } + } + }*/ + } + } + } + + } + } //variable not found, gonna search types String pkg = ""; String name = null; String type = null; - int nsKind = Namespace.KIND_PACKAGE; + int foundNsKind = Namespace.KIND_PACKAGE; int k; loopk: for (k = parts.size() - 1; k >= 0; k--) { - if(typeOnly){ - if(k()).equals(name)) { - nsKind = n.getNamespace(a.constants).kind; + if (n.getNamespace(a.constants).kind == nsKind && n.getNamespace(a.constants).getName(a.constants).equals(nspkg) && n.getName(a.constants, new ArrayList()).equals(name)) { + foundNsKind = n.getNamespace(a.constants).kind; type = n.getNameWithNamespace(a.constants); break loopk; } } } } else if (name.equals(nsclass)) { - nsKind = openedNamespacesKinds.get(i); + pkg = nspkg; + foundNsKind = openedNamespacesKinds.get(i); break loopk; } } - } + } } - - if(k==-1){ - throw new ParseException("Cannot find variable or type", lexer.yyline()); - } - GraphTargetItem ret=new TypeItem("".equals(pkg)?name:pkg+"."+name); + + if (k == -1) { + throw new ParseException("Cannot find variable or type:" + String.join(".", parts), lexer.yyline()); + } + GraphTargetItem ret = new TypeItem("".equals(pkg) ? name : pkg + "." + name); for (int i = 1; i < parts.size(); i++) { - ret = new PropertyAVM2Item(ret, parts.get(i), i == parts.size() - 1 ? index : null, allAbcs,openedNamespaces,openedNamespacesKinds); + ret = new PropertyAVM2Item(ret, parts.get(i), i == parts.size() - 1 ? index : null, allAbcs, openedNamespaces, openedNamespacesKinds); } return ret; } @@ -340,12 +406,12 @@ public class ActionScriptParser { return ret; } - private MethodAVM2Item method(List openedNamespaces, List openedNamespacesKinds, boolean isStatic, int namespaceKind, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { - FunctionAVM2Item f = function(openedNamespaces, openedNamespacesKinds, withBody, functionName, isMethod, variables); - return new MethodAVM2Item(isStatic, namespaceKind, functionName, f.paramTypes, f.paramNames, f.paramValues, f.body, variables, f.retType); + private MethodAVM2Item method(boolean override, boolean isFinal, GraphTargetItem thisType, List openedNamespaces, List openedNamespacesKinds, boolean isStatic, int namespaceKind, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { + FunctionAVM2Item f = function(thisType, openedNamespaces, openedNamespacesKinds, withBody, functionName, isMethod, variables); + return new MethodAVM2Item(override, isFinal, isStatic, namespaceKind, functionName, f.paramTypes, f.paramNames, f.paramValues, f.body, f.subvariables, f.retType); } - private FunctionAVM2Item function(List openedNamespaces, List openedNamespacesKinds, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { + private FunctionAVM2Item function(GraphTargetItem thisType, List openedNamespaces, List openedNamespacesKinds, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { ParsedSymbol s; expectedType(SymbolType.PARENT_OPEN); s = lex(); @@ -389,6 +455,11 @@ public class ActionScriptParser { } List body = null; List subvariables = new ArrayList<>(); + subvariables.add(new NameAVM2Item(thisType, lexer.yyline(), "this", null, true, openedNamespaces, openedNamespacesKinds)); + for (int i = 0; i < paramNames.size(); i++) { + subvariables.add(new NameAVM2Item(paramTypes.get(i), lexer.yyline(), paramNames.get(i), null, true, openedNamespaces, openedNamespacesKinds)); + } + int parCnt = subvariables.size(); if (withBody) { expectedType(SymbolType.CURLY_OPEN); @@ -396,6 +467,9 @@ public class ActionScriptParser { expectedType(SymbolType.CURLY_CLOSE); } + for (int i = 0; i < parCnt; i++) { + subvariables.remove(0); + } //return new FunctionAVM2Item(null, functionName, paramNames, body, constantPool, -1, subvariables); return new FunctionAVM2Item(functionName, paramTypes, paramNames, paramValues, body, subvariables, retType); } @@ -404,6 +478,7 @@ public class ActionScriptParser { ParsedSymbol s; GraphTargetItem constr = null; List variables = new ArrayList<>(); + TypeItem thisType = new TypeItem("".equals(packageName) ? classNameStr : packageName + "." + classNameStr); looptrait: while (true) { s = lex(); @@ -411,9 +486,30 @@ public class ActionScriptParser { int nsKind = -1; boolean isGetter = false; boolean isSetter = false; + boolean isOverride = false; + boolean isFinal = false; + boolean isDynamic = false; //TODO: namespace name //TODO: final, dynamic - while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.GET, SymbolType.SET)) { + while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC)) { + if (s.type == SymbolType.FINAL) { + if (isFinal) { + throw new ParseException("Only one final keyword allowed", lexer.yyline()); + } + isFinal = true; + } + if(s.type == SymbolType.DYNAMIC){ + if (isDynamic) { + throw new ParseException("Only one dynamic keyword allowed", lexer.yyline()); + } + isDynamic = true; + } + if (s.type == SymbolType.OVERRIDE) { + if (isOverride) { + throw new ParseException("Only one override keyword allowed", lexer.yyline()); + } + isOverride = true; + } if (s.type == SymbolType.STATIC) { if (isInterface) { throw new ParseException("Interface cannot have static traits", lexer.yyline()); @@ -422,25 +518,9 @@ public class ActionScriptParser { throw new ParseException("No static keyword allowed here", lexer.yyline()); } if (isStatic) { - throw new ParseException("Only one static identifier allowed", lexer.yyline()); + throw new ParseException("Only one static keyword allowed", lexer.yyline()); } isStatic = true; - } else if (s.type == SymbolType.GET) { - if (classNameStr == null) { - throw new ParseException("No get keyword allowed here", lexer.yyline()); - } - if (isGetter || isSetter) { - throw new ParseException("Only one get/set keyword allowed", lexer.yyline()); - } - isGetter = true; - } else if (s.type == SymbolType.SET) { - if (classNameStr == null) { - throw new ParseException("No set keyword allowed here", lexer.yyline()); - } - if (isGetter || isSetter) { - throw new ParseException("Only one get/set keyword allowed", lexer.yyline()); - } - isSetter = true; } else { if (nsKind != -1) { throw new ParseException("Only one access identifier allowed", lexer.yyline()); @@ -470,9 +550,16 @@ public class ActionScriptParser { if (classNameStr != null) { throw new ParseException("Nested classes not supported", lexer.yyline()); } - GraphTargetItem classTypeStr = type(openedNamespaces, openedNamespacesKinds, variables); + if (isOverride) { + throw new ParseException("Override flag not allowed for classes", lexer.yyline()); + } + + //GraphTargetItem classTypeStr = type(openedNamespaces, openedNamespacesKinds, variables); s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + String classTypeStr = s.value.toString(); GraphTargetItem extendsTypeStr = null; + s = lex(); if (s.type == SymbolType.EXTENDS) { extendsTypeStr = type(openedNamespaces, openedNamespacesKinds, variables); s = lex(); @@ -486,14 +573,26 @@ public class ActionScriptParser { } while (s.type == SymbolType.COMMA); } expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); - traits.add((classTraits(openedNamespaces, openedNamespacesKinds, packageName, nsKind, false, classTypeStr, extendsTypeStr, implementsTypeStrs, variables))); + traits.add((classTraits(isDynamic,isFinal,openedNamespaces, openedNamespacesKinds, packageName, nsKind, false, classTypeStr, extendsTypeStr, implementsTypeStrs, variables))); expectedType(SymbolType.CURLY_CLOSE); break; case INTERFACE: if (classNameStr != null) { throw new ParseException("Nested interfaces not supported", lexer.yyline()); } - GraphTargetItem interfaceTypeStr = type(openedNamespaces, openedNamespacesKinds, variables); + if (isOverride) { + throw new ParseException("Override flag not allowed for interfaces", lexer.yyline()); + } + if (isFinal) { + throw new ParseException("Final flag not allowed for interfaces", lexer.yyline()); + } + if(isDynamic){ + throw new ParseException("Dynamic flag not allowed for interfaces", lexer.yyline()); + } + //GraphTargetItem interfaceTypeStr = type(openedNamespaces, openedNamespacesKinds, variables); + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + String intTypeStr = s.value.toString(); s = lex(); List intExtendsTypeStrs = new ArrayList<>(); @@ -505,35 +604,68 @@ public class ActionScriptParser { } while (s.type == SymbolType.COMMA); } expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); - traits.add((classTraits(openedNamespaces, openedNamespacesKinds, packageName, nsKind, true, interfaceTypeStr, null, intExtendsTypeStrs, variables))); + traits.add((classTraits(false,isFinal,openedNamespaces, openedNamespacesKinds, packageName, nsKind, true, intTypeStr, null, intExtendsTypeStrs, variables))); expectedType(SymbolType.CURLY_CLOSE); break; case FUNCTION: + + if(isDynamic){ + throw new ParseException("Dynamic flag not allowed for methods", lexer.yyline()); + } s = lex(); + if (s.type == SymbolType.GET) { + if (classNameStr == null) { + throw new ParseException("No get keyword allowed here", lexer.yyline()); + } + isGetter = true; + s = lex(); + } else if (s.type == SymbolType.SET) { + if (classNameStr == null) { + throw new ParseException("No set keyword allowed here", lexer.yyline()); + } + isSetter = true; + s = lex(); + } + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); String fname = s.value.toString(); if (classNameStr != null && fname.equals(classNameStr)) { //constructor if (isStatic) { throw new ParseException("Constructor cannot be static", lexer.yyline()); } - constr = (method(openedNamespaces, openedNamespacesKinds, false, nsKind, !isInterface, "", true, variables)); + if (isStatic) { + throw new ParseException("Constructor cannot be static", lexer.yyline()); + } + if (isOverride) { + throw new ParseException("Override flag not allowed for constructor", lexer.yyline()); + } + if (isFinal) { + throw new ParseException("Final flag not allowed for constructor", lexer.yyline()); + } + constr = (method(false, false, thisType, openedNamespaces, openedNamespacesKinds, false, nsKind, !isInterface, "", true, variables)); } else { if (isStatic) { GraphTargetItem t; - MethodAVM2Item ft = method(openedNamespaces, openedNamespacesKinds, isStatic, nsKind, !isInterface, fname, true, variables); + MethodAVM2Item ft = method(isOverride, isFinal, thisType, openedNamespaces, openedNamespacesKinds, isStatic, nsKind, !isInterface, fname, true, variables); traits.add(ft); if (isGetter || isSetter) { throw new ParseException("Getter or Setter cannot be static", lexer.yyline()); } } else { - MethodAVM2Item ft = method(openedNamespaces, openedNamespacesKinds, isStatic, nsKind, !isInterface, fname, true, variables); + MethodAVM2Item ft = method(isOverride, isFinal, thisType, openedNamespaces, openedNamespacesKinds, isStatic, nsKind, !isInterface, fname, true, variables); GraphTargetItem t; if (isGetter) { - GetterAVM2Item g = new GetterAVM2Item(isStatic, ft.namespaceKind, ft.functionName, ft.paramTypes, ft.paramNames, ft.paramValues, ft.body, ft.subvariables, ft.retType); + if(!ft.paramTypes.isEmpty()){ + throw new ParseException("Getter can't have any parameters", lexer.yyline()); + } + GetterAVM2Item g = new GetterAVM2Item(ft.isOverride(), ft.isFinal(), isStatic, ft.namespaceKind, ft.functionName, ft.paramTypes, ft.paramNames, ft.paramValues, ft.body, ft.subvariables, ft.retType); t = g; } else if (isSetter) { - SetterAVM2Item st = new SetterAVM2Item(isStatic, ft.namespaceKind, ft.functionName, ft.paramTypes, ft.paramNames, ft.paramValues, ft.body, ft.subvariables, ft.retType); + if(ft.paramTypes.size()!=1){ + throw new ParseException("Getter must have exactly one parameter", lexer.yyline()); + } + SetterAVM2Item st = new SetterAVM2Item(ft.isOverride(), ft.isFinal(), isStatic, ft.namespaceKind, ft.functionName, ft.paramTypes, ft.paramNames, ft.paramValues, ft.body, ft.subvariables, ft.retType); t = st; } else { t = ft; @@ -547,6 +679,17 @@ public class ActionScriptParser { case CONST: case VAR: boolean isConst = s.type == SymbolType.CONST; + + if (isOverride) { + throw new ParseException("Override flag not allowed for " + (isConst ? "consts" : "vars"), lexer.yyline()); + } + if (isFinal) { + throw new ParseException("Final flag not allowed for " + (isConst ? "consts" : "vars"), lexer.yyline()); + } + if(isDynamic){ + throw new ParseException("Dynamic flag not allowed for "+(isConst ? "consts":"vars"), lexer.yyline()); + } + s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); String vcname = s.value.toString(); @@ -579,42 +722,55 @@ public class ActionScriptParser { return constr; } - private GraphTargetItem classTraits(List openedNamespaces, List openedNamespacesKinds, String packageName, int namespaceKind, boolean isInterface, GraphTargetItem nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, ParseException { + private GraphTargetItem classTraits(boolean isDynamic,boolean isFinal,List openedNamespaces, List openedNamespacesKinds, String packageName, int namespaceKind, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, ParseException { GraphTargetItem ret = null; ParsedSymbol s = null; - MethodAVM2Item constr = null; List traits = new ArrayList<>(); - String classNameStr = nameStr.toString(); + String classNameStr = nameStr; openedNamespaces = new ArrayList<>(openedNamespaces); openedNamespacesKinds = new ArrayList<>(openedNamespacesKinds); openedNamespacesKinds.add(Namespace.KIND_PRIVATE); - openedNamespaces.add(packageName + ":" + classNameStr); + openedNamespaces.add("".equals(packageName) ? classNameStr : packageName + ":" + classNameStr); openedNamespacesKinds.add(Namespace.KIND_PACKAGE); openedNamespaces.add(""); openedNamespacesKinds.add(Namespace.KIND_PRIVATE); openedNamespaces.add(classNameStr + ".as$"); - openedNamespacesKinds.add(Namespace.KIND_PACKAGE); - openedNamespaces.add(packageName); + if (!packageName.equals("")) { + openedNamespacesKinds.add(Namespace.KIND_PACKAGE); + openedNamespaces.add(packageName); + } openedNamespacesKinds.add(Namespace.KIND_PACKAGE_INTERNAL); openedNamespaces.add(packageName); openedNamespacesKinds.add(Namespace.KIND_NAMESPACE); openedNamespaces.add(AS3_NAMESPACE); openedNamespacesKinds.add(Namespace.KIND_PROTECTED); - openedNamespaces.add(packageName + ":" + classNameStr); + openedNamespaces.add("".equals(packageName) ? classNameStr : packageName + ":" + classNameStr); openedNamespacesKinds.add(Namespace.KIND_STATIC_PROTECTED); - openedNamespaces.add(packageName + ":" + classNameStr); + openedNamespaces.add("".equals(packageName) ? classNameStr : packageName + ":" + classNameStr); + List indices = new ArrayList<>(); + List names = new ArrayList<>(); + List namespaces = new ArrayList<>(); + AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, ((TypeItem) extendsStr).resolveClass(abc), indices, names, namespaces); + for (int i = 0; i < names.size(); i++) { + if (namespaces.get(i).equals("")) { + continue; + } + openedNamespacesKinds.add(Namespace.KIND_STATIC_PROTECTED); - traits(openedNamespaces, openedNamespacesKinds, packageName, classNameStr, isInterface, traits); + openedNamespaces.add(namespaces.get(i) + ":" + names.get(i)); + } + + GraphTargetItem constr = traits(openedNamespaces, openedNamespacesKinds, packageName, classNameStr, isInterface, traits); if (isInterface) { - return new InterfaceAVM2Item(namespaceKind, classNameStr, implementsStr, traits); + return new InterfaceAVM2Item(isFinal,namespaceKind, classNameStr, implementsStr, traits); } else { - return new ClassAVM2Item(namespaceKind, classNameStr, extendsStr, implementsStr, constr, traits); + return new ClassAVM2Item(isDynamic,isFinal,namespaceKind, classNameStr, extendsStr, implementsStr, constr, traits); } } @@ -707,7 +863,7 @@ public class ActionScriptParser { case FUNCTION: s = lexer.lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); - ret = (function(openedNamespaces, openedNamespacesKinds, true, s.value.toString(), false, variables)); + ret = (function(TypeItem.UNBOUNDED, openedNamespaces, openedNamespacesKinds, true, s.value.toString(), false, variables)); break; case VAR: s = lex(); @@ -1243,7 +1399,7 @@ public class ActionScriptParser { ((NameAVM2Item) expr).setDefinition(false); ret = expr; } else if (expr instanceof PropertyAVM2Item) { - ((PropertyAVM2Item)expr).setStoreValue(assigned); + ((PropertyAVM2Item) expr).setStoreValue(assigned); } else { throw new ParseException("Invalid assignment", lexer.yyline()); } @@ -1351,6 +1507,10 @@ public class ActionScriptParser { boolean existsRemainder = false; boolean assocRight = false; switch (s.type) { + case STRING: + ret = new StringAVM2Item(null, s.value.toString()); + existsRemainder = true; + break; case MINUS: s = lex(); if (s.isType(SymbolType.DOUBLE)) { @@ -1407,8 +1567,11 @@ public class ActionScriptParser { if (s.type != SymbolType.COMMA) { lexer.pushback(s); } + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING); - GraphTargetItem n = expression(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, allowRemainder, variables); + GraphTargetItem n = new StringAVM2Item(null, s.value.toString()); +//expression(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, allowRemainder, variables); expectedType(SymbolType.COLON); GraphTargetItem v = expression(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, allowRemainder, variables); @@ -1435,7 +1598,8 @@ public class ActionScriptParser { } else { lexer.pushback(s); } - ret = function(openedNamespaces, openedNamespacesKinds, true, fname, false, variables); + ret = function(TypeItem.UNBOUNDED, openedNamespaces, openedNamespacesKinds, true, fname, false, variables); + //TODO break; case NAN: ret = new NanAVM2Item(null); @@ -1486,14 +1650,7 @@ public class ActionScriptParser { case NEW: GraphTargetItem newvar = name(true, openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, variables); expectedType(SymbolType.PARENT_OPEN); - if (newvar instanceof GetPropertyAVM2Item) { - GetPropertyAVM2Item mem = (GetPropertyAVM2Item) newvar; - ret = new ConstructPropAVM2Item(null, mem.object, mem.propertyName, call(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, variables)); - } else if (newvar instanceof NameAVM2Item) { - ret = new ConstructAVM2Item(null, newvar, call(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, variables)); - } else { - throw new ParseException("Invalid new item", lexer.yyline()); - } + ret = new ConstructSomethingAVM2Item(newvar, call(openedNamespaces, openedNamespacesKinds, registerVars, inFunction, inMethod, variables)); existsRemainder = true; break; case IDENTIFIER: @@ -1580,7 +1737,8 @@ public class ActionScriptParser { openedNamespaces.add(fullImp); openedNamespacesKinds.add(Namespace.KIND_PACKAGE); - expectedType(SymbolType.SEMICOLON); + expected(s, lexer.yyline(), SymbolType.SEMICOLON); + s = lex(); } lexer.pushback(s); @@ -1600,7 +1758,7 @@ public class ActionScriptParser { return ret; } - public ScriptInfo scriptFromTree(PackageAVM2Item pkg) { + public void addScriptFromTree(PackageAVM2Item pkg) { AVM2SourceGenerator gen = new AVM2SourceGenerator(abc, otherABCs); List ret = new ArrayList<>(); SourceGeneratorLocalData localData = new SourceGeneratorLocalData( @@ -1611,12 +1769,12 @@ public class ActionScriptParser { className = ((ClassAVM2Item) it).className; } } - return gen.generateScriptInfo(localData, pkg.items); + abc.script_info.add(gen.generateScriptInfo(pkg, localData, pkg.items)); } - public ScriptInfo scriptFromString(String s) throws ParseException, IOException { + public void addScript(String s) throws ParseException, IOException { PackageAVM2Item pkg = packageFromString(s); - return scriptFromTree(pkg); + addScriptFromTree(pkg); } public ActionScriptParser(ABC abc, List otherABCs) { @@ -1624,4 +1782,29 @@ public class ActionScriptParser { this.otherABCs = otherABCs; } + public static void main(String[] args) { + if(args.length<2){ + return; + } + try { + String src = args[0]; + String dst = args[1]; + SWC swc = new SWC(new FileInputStream(Configuration.getPlayerSWC())); + SWF swf = new SWF(swc.getSWF("library.swf"), true); + List playerABCs = new ArrayList<>(); + for (Tag t : swf.tags) { + if (t instanceof ABCContainerTag) { + playerABCs.add(((ABCContainerTag) t).getABC()); + } + } + ABC abc = new ABC(swf); + ActionScriptParser parser = new ActionScriptParser(abc, playerABCs); + parser.addScript(new String(Helper.readFile(src), "UTF-8")); + abc.saveToStream(new FileOutputStream(new File(dst))); + } catch (Exception ex) { + Logger.getLogger(ActionScriptParser.class.getName()).log(Level.SEVERE, null, ex); + } + System.exit(0); + } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index cf982d5c3..b5829e3d9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -20,6 +20,7 @@ package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -55,7 +56,11 @@ public class CallAVM2Item extends AVM2Item { public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { if(name instanceof PropertyAVM2Item){ PropertyAVM2Item prop=(PropertyAVM2Item)name; - return toSourceMerge(localData, generator, prop.object,prop.index,arguments, + Object obj = prop.object; + if(obj == null){ + obj = new AVM2Instruction(0, new FindPropertyStrictIns(), new int[]{prop.resolveProperty()}, new byte[0]); + } + return toSourceMerge(localData, generator, obj,prop.index,arguments, new AVM2Instruction(0, new CallPropertyIns(), new int[]{prop.resolveProperty(),arguments.size()}, new byte[0]) ); } @@ -75,5 +80,8 @@ public class CallAVM2Item extends AVM2Item { return ti; } - + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java index b98b9bd73..b9eb7d527 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java @@ -34,6 +34,8 @@ public class ClassAVM2Item extends AVM2Item implements Block { public String className; public GraphTargetItem constructor; public int namespaceKind; + public boolean isDynamic; + public boolean isFinal; @Override public List> getSubs() { @@ -44,7 +46,7 @@ public class ClassAVM2Item extends AVM2Item implements Block { return ret; } - public ClassAVM2Item(int namespaceKind, String className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List traits) { + public ClassAVM2Item(boolean isDynamic,boolean isFinal, int namespaceKind, String className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List traits) { super(null, NOPRECEDENCE); this.className = className; this.traits = traits; @@ -52,6 +54,8 @@ public class ClassAVM2Item extends AVM2Item implements Block { this.implementsOp = implementsOp; this.constructor = constructor; this.namespaceKind = namespaceKind; + this.isDynamic = isDynamic; + this.isFinal = isFinal; } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java index bc92809c2..62781e5ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java @@ -59,6 +59,9 @@ public class ConstAVM2Item extends AVM2Item { return type; } - + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java new file mode 100644 index 000000000..58d0f561a --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructPropIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.TypeItem; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class ConstructSomethingAVM2Item extends CallAVM2Item{ + + public ConstructSomethingAVM2Item(GraphTargetItem name, List arguments) { + super(name, arguments); + } + + @Override + public GraphTargetItem returnType() { + return name.returnType(); + } + + + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { + + if(name instanceof TypeItem){ + TypeItem prop=(TypeItem)name; + int type_index = ((AVM2SourceGenerator)generator).resolveType(name.toString()); + return toSourceMerge(localData, generator, + new AVM2Instruction(0, new FindPropertyStrictIns(), new int[]{type_index,arguments.size()}, new byte[0]) + ,arguments, + new AVM2Instruction(0, new ConstructPropIns(), new int[]{type_index,arguments.size()}, new byte[0]) + ); + } + if(name instanceof NameAVM2Item){ + //TODO + } + return new ArrayList<>(); + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java index 964877fb8..0c191e7b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java @@ -58,6 +58,9 @@ public class FunctionAVM2Item extends AVM2Item { return retType; } - + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java index a5013e2bf..eca70b064 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java @@ -25,8 +25,9 @@ import java.util.List; */ public class GetterAVM2Item extends MethodAVM2Item { - public GetterAVM2Item(boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { - super(isStatic, namespaceKind, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); + public GetterAVM2Item(boolean override, boolean isFinal, boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + super(override, isFinal, isStatic, namespaceKind, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java index 75ea24cc6..1d751dfb6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java @@ -33,13 +33,15 @@ public class InterfaceAVM2Item extends AVM2Item { public List superInterfaces; public List methods; public int namespaceKind; + public boolean isFinal; - public InterfaceAVM2Item(int namespaceKind, String name, List superInterfaces, List traits) { + public InterfaceAVM2Item(boolean isFinal,int namespaceKind, String name, List superInterfaces, List traits) { super(null, NOPRECEDENCE); this.name = name; this.superInterfaces = superInterfaces; this.methods = traits; this.namespaceKind = namespaceKind; + this.isFinal = isFinal; } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java index d4c21ade3..a82285ce4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java @@ -29,16 +29,30 @@ public class MethodAVM2Item extends FunctionAVM2Item { public int namespaceKind; private boolean isStatic; + private boolean isFinal; + private boolean override; - public MethodAVM2Item(boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + public MethodAVM2Item(boolean override,boolean isFinal,boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); this.namespaceKind = namespaceKind; this.isStatic = isStatic; + this.override = override; + this.isFinal = isFinal; } + public boolean isOverride() { + return override; + } + + + public boolean isStatic() { return isStatic; } + + public boolean isFinal() { + return isFinal; + } @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java index ba5a02cdf..b3db44f28 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java @@ -28,7 +28,12 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal1Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal2Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal3Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -44,7 +49,6 @@ import java.util.List; */ public class NameAVM2Item extends AVM2Item { - private String variableName; private GraphTargetItem storeValue; private boolean definition; @@ -55,7 +59,7 @@ public class NameAVM2Item extends AVM2Item { public int line; public GraphTargetItem type; private String ns = ""; - private int regNumber=-1; + private int regNumber = -1; public void setNs(String ns) { this.ns = ns; @@ -64,13 +68,11 @@ public class NameAVM2Item extends AVM2Item { public void setRegNumber(int regNumber) { this.regNumber = regNumber; } - - public String getNs() { return ns; - } - + } + public void appendName(String name) { this.variableName += "." + name; } @@ -103,7 +105,7 @@ public class NameAVM2Item extends AVM2Item { return variableName; } - public NameAVM2Item(GraphTargetItem type, int line,String variableName, GraphTargetItem storeValue, boolean definition, List openedNamespaces, List openedNamespacesKind) { + public NameAVM2Item(GraphTargetItem type, int line, String variableName, GraphTargetItem storeValue, boolean definition, List openedNamespaces, List openedNamespacesKind) { super(null, PRECEDENCE_PRIMARY); this.variableName = variableName; this.storeValue = storeValue; @@ -127,55 +129,35 @@ public class NameAVM2Item extends AVM2Item { @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { - if(regNumber==-1){ - throw new RuntimeException("No register set"); + if (regNumber == -1) { + throw new RuntimeException("No register set for " + variableName); } - if(definition && storeValue==null){ + if (definition && storeValue == null) { return new ArrayList<>(); } - AVM2Instruction ins; - if(storeValue!=null){ - switch(regNumber){ - case 0: - ins = new AVM2Instruction(0, new GetLocal0Ins(), new int[]{}, new byte[0]); - break; - case 1: - ins = new AVM2Instruction(0, new GetLocal1Ins(), new int[]{}, new byte[0]); - break; - case 2: - ins = new AVM2Instruction(0, new GetLocal2Ins(), new int[]{}, new byte[0]); - break; - case 3: - ins = new AVM2Instruction(0, new GetLocal3Ins(), new int[]{}, new byte[0]); - break; - default: - ins = new AVM2Instruction(0, new GetLocalIns(), new int[]{regNumber}, new byte[0]); - break; - } - return toSourceMerge(localData, generator, ins); - }else{ - switch(regNumber){ - case 0: - ins = new AVM2Instruction(0, new SetLocal0Ins(), new int[]{}, new byte[0]); - break; - case 1: - ins = new AVM2Instruction(0, new SetLocal1Ins(), new int[]{}, new byte[0]); - break; - case 2: - ins = new AVM2Instruction(0, new SetLocal2Ins(), new int[]{}, new byte[0]); - break; - case 3: - ins = new AVM2Instruction(0, new SetLocal3Ins(), new int[]{}, new byte[0]); - break; - default: - ins = new AVM2Instruction(0, new SetLocalIns(), new int[]{regNumber}, new byte[0]); - break; - } - return toSourceMerge(localData, generator,storeValue, ins); + if (storeValue == null) { + return toSourceMerge(localData, generator, new LocalRegAVM2Item(null, regNumber, null)); + } else { + return toSourceMerge(localData, generator, new SetLocalAVM2Item(null, regNumber, new CoerceAVM2Item(null, storeValue, type.toString()))); } - + } + @Override + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { + if (regNumber == -1) { + throw new RuntimeException("No register set for " + variableName); + } + if (definition && storeValue == null) { + return new ArrayList<>(); + } + if (storeValue == null) { + return toSourceMerge(localData, generator, new LocalRegAVM2Item(null, regNumber, null), + new AVM2Instruction(0, new PopIns(), new int[]{}, new byte[0])); + } else { + return toSourceMerge(localData, generator, new SetLocalAVM2Item(null, regNumber, new CoerceAVM2Item(null, storeValue, type.toString())).toSourceIgnoreReturnValue(localData, generator)); + } + } @Override public boolean hasReturnValue() { @@ -197,13 +179,13 @@ public class NameAVM2Item extends AVM2Item { public String toString() { return variableName; } - + @Override public GraphTargetItem returnType() { - if(index!=null){ + if (index != null) { return TypeItem.UNBOUNDED; } return type; } - + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java index 51dda0ed4..804da6ce3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java @@ -48,4 +48,8 @@ public class PackageAVM2Item extends AVM2Item { return new UnboundedTypeItem(); //FIXME } + @Override + public boolean hasReturnValue() { + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 48aab23e7..96208138c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -14,17 +14,26 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.KillIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrictIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.SetPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; +import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.NamespaceSet; +import com.jpexs.decompiler.flash.abc.types.ScriptInfo; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; @@ -52,9 +61,9 @@ public class PropertyAVM2Item extends AVM2Item { private GraphTargetItem storeValue; private List openedNamespaces; private List openedNamespacesKind; - + public PropertyAVM2Item(GraphTargetItem object, String propertyName, GraphTargetItem index, List abcs, List openedNamespaces, List openedNamespacesKind) { - super(null,PRECEDENCE_PRIMARY); + super(null, PRECEDENCE_PRIMARY); this.propertyName = propertyName; this.object = object; this.abcs = abcs; @@ -66,97 +75,241 @@ public class PropertyAVM2Item extends AVM2Item { public void setStoreValue(GraphTargetItem storeValue) { this.storeValue = storeValue; } - - @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return writer; } - - private int allNsSet(){ - int nssa[]=new int[openedNamespaces.size()]; - for(int i=0;i()), true); - } - - String objType = object.returnType().toString(); - for(ABC a:abcs){ - int ci = a.findClassByName(objType); - if(ci!=-1){ - for(Trait t:a.instance_info.get(ci).instance_traits.traits){ - String tname = t.getName(a).getName(a.constants, new ArrayList()); - if(tname.equals(propertyName)){ - return t.name_index; - } - } - break; - } - } - return abcs.get(0).constants.getMultinameId(new Multiname(Multiname.MULTINAME, - abcs.get(0).constants.getStringId(propertyName, true), 0, - allNsSet(), 0, new ArrayList()), true); + + private String resolveObjectType() { + String objType = object == null ? null : object.returnType().toString(); + if (objType == null) { + loopo: + for (int i = 0; i < openedNamespaces.size(); i++) { + String ns = openedNamespaces.get(i); + String nspkg = ns; + String nsclass = null; + int nsKind = openedNamespacesKind.get(i); + if (nspkg.contains(":") && nsKind != Namespace.KIND_NAMESPACE) { + nsclass = nspkg.substring(nspkg.indexOf(":") + 1); + nspkg = nspkg.substring(0, nspkg.indexOf(":")); + } + loopabc: + for (ABC a : abcs) { + for (int h = 0; h < a.instance_info.size(); h++) { + InstanceInfo ii = a.instance_info.get(h); + Multiname n = a.constants.constant_multiname.get(ii.name_index); + if (n.getNamespace(a.constants).getName(a.constants).equals(nspkg) && (nsclass == null || (n.getName(a.constants, new ArrayList()).equals(nsclass)))) { + Reference outName = new Reference<>(""); + Reference outNs = new Reference<>(""); + Reference outPropNs = new Reference<>(""); + Reference outPropNsKind = new Reference<>(1); + if (AVM2SourceGenerator.searchProperty(abcs, nspkg, n.getName(a.constants, new ArrayList()), propertyName, outName, outNs, outPropNs, outPropNsKind)) { + objType = "".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal(); + break loopo; + } + } + } + } + } + } + if (objType == null) { + throw new RuntimeException("Unresolved object type"); + } + return objType; } - + + public GraphTargetItem resolvePropertyType() { + if (index != null) { + return TypeItem.UNBOUNDED; + } + + String objType = resolveObjectType(); + for (ABC a : abcs) { + int ci = a.findClassByName(objType); + if (ci != -1) { + for (Trait t : a.instance_info.get(ci).instance_traits.traits) { + String tnames = t.getName(a).getName(a.constants, new ArrayList()); + if (tnames.equals(propertyName)) { + if (t instanceof TraitSlotConst) { + TraitSlotConst tsc = (TraitSlotConst) t; + if (tsc.type_index == 0) { + return TypeItem.UNBOUNDED; + } + return new TypeItem(a.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(a.constants)); + } + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tmgs = (TraitMethodGetterSetter) t; + if (tmgs.kindType == Trait.TRAIT_GETTER) { + return new TypeItem(a.constants.constant_multiname.get(a.method_info.get(tmgs.method_info).ret_type).getNameWithNamespace(a.constants)); + } + if (tmgs.kindType == Trait.TRAIT_SETTER) { + return new TypeItem(a.constants.constant_multiname.get(a.method_info.get(tmgs.method_info).param_types[0]).getNameWithNamespace(a.constants)); + } + } + if (t instanceof TraitFunction) { + return new TypeItem("Function"); + } + return TypeItem.UNBOUNDED; + } + } + break; + } + } + return TypeItem.UNBOUNDED; + } + + public int resolveProperty() { + if (index != null) { + return abcs.get(0).constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, + abcs.get(0).constants.getStringId(propertyName, true), 0, + allNsSet(), 0, new ArrayList()), true); + } + + String objType = resolveObjectType(); + for (ABC a : abcs) { + int ci = a.findClassByName(objType); + if (ci != -1) { + for (Trait t : a.instance_info.get(ci).instance_traits.traits) { + Multiname tname = t.getName(a); + String tnames = t.getName(a).getName(a.constants, new ArrayList()); + if (tnames.equals(propertyName)) { + return abcs.get(0).constants.getMultinameId(new Multiname(tname.kind, + abcs.get(0).constants.getStringId(tnames, true), + abcs.get(0).constants.getNamespaceId(new Namespace(tname.getNamespace(a.constants).kind, abcs.get(0).constants.getStringId(tname.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList()), true); + } + } + for (Trait t : a.class_info.get(ci).static_traits.traits) { + Multiname tname = t.getName(a); + String tnames = t.getName(a).getName(a.constants, new ArrayList()); + if (tnames.equals(propertyName)) { + return abcs.get(0).constants.getMultinameId(new Multiname(tname.kind, + abcs.get(0).constants.getStringId(tnames, true), + abcs.get(0).constants.getNamespaceId(new Namespace(tname.getNamespace(a.constants).kind, abcs.get(0).constants.getStringId(tname.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList()), true); + } + } + break; + } + } + + for (ABC a : abcs) { + for(ScriptInfo si:a.script_info){ + for (Trait t : si.traits.traits) { + Multiname tname = t.getName(a); + String tnames = t.getName(a).getName(a.constants, new ArrayList()); + if (tnames.equals(propertyName)) { + return abcs.get(0).constants.getMultinameId(new Multiname(tname.kind, + abcs.get(0).constants.getStringId(tnames, true), + abcs.get(0).constants.getNamespaceId(new Namespace(tname.getNamespace(a.constants).kind, abcs.get(0).constants.getStringId(tname.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList()), true); + } + } + } + } + + return abcs.get(0).constants.getMultinameId(new Multiname(Multiname.MULTINAME, + abcs.get(0).constants.getStringId(propertyName, true), 0, + allNsSet(), 0, new ArrayList()), true); + } + @Override public GraphTargetItem returnType() { - if(index!=null){ - return TypeItem.UNBOUNDED; - } - String objType = object.returnType().toString(); - for(ABC a:abcs){ - int ci = a.findClassByName(objType); - if(ci!=-1){ - for(Trait t:a.instance_info.get(ci).instance_traits.traits){ - String tname = t.getName(a).getName(a.constants, new ArrayList()); - if(tname.equals(propertyName)){ - if(t instanceof TraitSlotConst){ - TraitSlotConst tsc=(TraitSlotConst)t; - if(tsc.type_index == 0){ - return TypeItem.UNBOUNDED; - } - return new TypeItem(a.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(a.constants)); - } - if(t instanceof TraitMethodGetterSetter){ - TraitMethodGetterSetter tmgs=(TraitMethodGetterSetter)t; - return new TypeFunctionItem(a.constants.constant_multiname.get(a.method_info.get(tmgs.method_info).ret_type).getNameWithNamespace(a.constants)); - } - if(t instanceof TraitFunction){ - TraitFunction tf=(TraitFunction)t; - return new TypeFunctionItem(a.constants.constant_multiname.get(a.method_info.get(tf.method_info).ret_type).getNameWithNamespace(a.constants)); - } - } - } - break; - } - } - return TypeItem.UNBOUNDED; + if (index != null) { + return TypeItem.UNBOUNDED; + } + String objType = resolveObjectType(); + + if (objType == null) { + return TypeItem.UNBOUNDED; + } + for (ABC a : abcs) { + int ci = a.findClassByName(objType); + if (ci != -1) { + for (Trait t : a.instance_info.get(ci).instance_traits.traits) { + String tname = t.getName(a).getName(a.constants, new ArrayList()); + if (tname.equals(propertyName)) { + if (t instanceof TraitSlotConst) { + TraitSlotConst tsc = (TraitSlotConst) t; + if (tsc.type_index == 0) { + return TypeItem.UNBOUNDED; + } + return new TypeItem(a.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(a.constants)); + } + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tmgs = (TraitMethodGetterSetter) t; + return new TypeFunctionItem(a.constants.constant_multiname.get(a.method_info.get(tmgs.method_info).ret_type).getNameWithNamespace(a.constants)); + } + if (t instanceof TraitFunction) { + TraitFunction tf = (TraitFunction) t; + return new TypeFunctionItem(a.constants.constant_multiname.get(a.method_info.get(tf.method_info).ret_type).getNameWithNamespace(a.constants)); + } + } + } + break; + } + } + + return TypeItem.UNBOUNDED; } @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { - AVM2SourceGenerator g=(AVM2SourceGenerator)generator; + AVM2SourceGenerator g = (AVM2SourceGenerator) generator; + int propertyId = resolveProperty(); - if(index!=null){ - return toSourceMerge(localData, generator, object, index, + Object obj = object; + if (obj == null) { + obj = new AVM2Instruction(0, new FindPropertyStrictIns(), new int[]{propertyId}, new byte[0]); + } + if (storeValue != null) { + int temp_reg = g.getFreeRegister(localData); + List ret = toSourceMerge(localData, generator, obj, index, new CoerceAVM2Item(null, storeValue, resolvePropertyType().toString()), + new AVM2Instruction(0, new DupIns(), new int[]{}, new byte[0]), + new AVM2Instruction(0, new SetLocalIns(), new int[]{temp_reg}, new byte[0]), + new AVM2Instruction(0, new SetPropertyIns(), new int[]{propertyId}, new byte[0]), + new AVM2Instruction(0, new GetLocalIns(), new int[]{temp_reg}, new byte[0]), + new AVM2Instruction(0, new KillIns(), new int[]{temp_reg}, new byte[0]) + ); + g.killRegister(localData, temp_reg); + return ret; + } else { + return toSourceMerge(localData, generator, obj, index, new AVM2Instruction(0, new GetPropertyIns(), new int[]{propertyId}, new byte[0]) ); } - return toSourceMerge(localData, generator, object, - new AVM2Instruction(0, new GetPropertyIns(), new int[]{propertyId}, new byte[0]) - ); } - - - + + @Override + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { + AVM2SourceGenerator g = (AVM2SourceGenerator) generator; + + int propertyId = resolveProperty(); + Object obj = object; + if (obj == null) { + obj = new AVM2Instruction(0, new FindPropertyStrictIns(), new int[]{propertyId}, new byte[0]); + } + if (storeValue != null) { + return toSourceMerge(localData, generator, obj, index, new CoerceAVM2Item(null, storeValue, resolvePropertyType().toString()), + new AVM2Instruction(0, new SetPropertyIns(), new int[]{propertyId}, new byte[0]) + ); + } else { + return toSourceMerge(localData, generator, obj, index, + new AVM2Instruction(0, new GetPropertyIns(), new int[]{propertyId}, new byte[0]), + new AVM2Instruction(0, new PopIns(), new int[]{}, new byte[0]) + ); + } + } + + @Override + public boolean hasReturnValue() { + return true; + } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java new file mode 100644 index 000000000..e63d8fc6b --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/Reference.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.jpexs.decompiler.flash.abc.avm2.parser.script; + +/** + * + * @author JPEXS + */ +public class Reference { + + private T val; + + public Reference(T val) { + this.val = val; + } + + public T getVal() { + return val; + } + + public void setVal(T val) { + this.val = val; + } + + @Override + public String toString() { + return val.toString(); + } + + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java index 5c0f5e781..4f8a5634d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java @@ -25,8 +25,8 @@ import java.util.List; */ public class SetterAVM2Item extends MethodAVM2Item { - public SetterAVM2Item(boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { - super(isStatic, namespaceKind, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); + public SetterAVM2Item(boolean override, boolean isFinal, boolean isStatic, int namespaceKind, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + super(override, isFinal, isStatic, namespaceKind, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java index ba9c71870..715722346 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java @@ -58,5 +58,10 @@ public class SlotAVM2Item extends AVM2Item { public GraphTargetItem returnType() { return type; } + + @Override + public boolean hasReturnValue() { + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java index 62a11177c..caaf4c33b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java @@ -180,5 +180,6 @@ public enum SymbolType { //PRINTASBITMAP, //PRINTASBITMAPNUM, //UNLOADMOVIE, - //UNLOADMOVIENUM + //UNLOADMOVIENUM, + FINAL } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex index c16962c81..66cb87aaf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/actionscript.flex @@ -188,6 +188,7 @@ SingleCharacter = [^\r\n\'\\] "undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED,yytext()); } "Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY,yytext()); } "NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN,yytext()); } + "final" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINAL,yytext()); } /* operators */ diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java index 869b9f9bc..7a8076ff5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java @@ -23,7 +23,7 @@ import java.util.List; public class ClassInfo { public int cinit_index; //MethodInfo - static initializer - public Traits static_traits; + public Traits static_traits = new Traits();; @Override public String toString() { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java index 137226e20..d4408d74d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java @@ -31,7 +31,7 @@ public class InstanceInfo { public int protectedNS; //if flags & 8 public int[] interfaces; public int iinit_index; // MethodInfo - constructor - public Traits instance_traits; + public Traits instance_traits = new Traits(); public static final int CLASS_SEALED = 1; //not dynamic public static final int CLASS_FINAL = 2; public static final int CLASS_INTERFACE = 4; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java index 84640aa13..089bc1fa1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java @@ -29,17 +29,17 @@ import java.util.Stack; public class TraitFunction extends Trait implements TraitWithSlot { - public int slot_index; + public int slot_id; public int method_info; @Override public int getSlotIndex() { - return slot_index; + return slot_id; } @Override public String toString(ABC abc, List fullyQualifiedNames) { - return "Function " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_index + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); + return "Function " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index 72791b7b7..36631cd5b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -883,11 +883,11 @@ public class Main { * @param args the command line arguments * @throws IOException */ - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws IOException { startFreeMemThread(); initLogging(Configuration.debugMode.get()); initLang(); - + if (Configuration.cacheOnDisk.get()) { Cache.setStorageType(Cache.STORAGE_FILES); } else { diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java index cfacca3ae..5f8ac24c5 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -240,6 +240,9 @@ public abstract class GraphTargetItem implements Serializable { if (o2 instanceof GraphSourceItem) { ret.add((GraphSourceItem) o2); } + if(o2 instanceof GraphTargetItem){ + ret.addAll(((GraphTargetItem) o2).toSource(localData, gen)); + } } } } diff --git a/trunk/src/com/jpexs/decompiler/graph/TypeItem.java b/trunk/src/com/jpexs/decompiler/graph/TypeItem.java index 55f8f5e23..918f8b3a5 100644 --- a/trunk/src/com/jpexs/decompiler/graph/TypeItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/TypeItem.java @@ -17,9 +17,15 @@ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.types.InstanceInfo; +import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.decompiler.graph.model.UnboundedTypeItem; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** @@ -88,6 +94,32 @@ public class TypeItem extends GraphTargetItem{ return fullTypeName; } + public int resolveClass(ABC abc){ + String name = fullTypeName; + String pkg = ""; + if(name.contains(".")){ + pkg = name.substring(0,name.lastIndexOf(".")); + name = name.substring(name.lastIndexOf(".")+1); + } + for(InstanceInfo ii:abc.instance_info){ + Multiname mname=abc.constants.constant_multiname.get(ii.name_index); + if(mname.getName(abc.constants, new ArrayList()).equals(name)){ + if(mname.getNamespace(abc.constants).getName(abc.constants).equals(pkg)){ + return ii.name_index; + } + } + } + for(int i=1;i()))){ + if(pkg.equals(mname.getNamespace(abc.constants).getName(abc.constants))){ + return i; + } + } + } + return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0,true), 0,0, new ArrayList()), true); + } + } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UnboundedTypeItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UnboundedTypeItem.java index 87adf1788..28d32da84 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UnboundedTypeItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UnboundedTypeItem.java @@ -40,4 +40,16 @@ public class UnboundedTypeItem extends AVM2Item { public GraphTargetItem returnType() { return this; } + + @Override + public String toString() { + return "*"; + } + + + + @Override + public boolean hasReturnValue() { + return true; + } }