From 0c97e3dc30d750e8a8825d5938b4f89b738466cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 22 Mar 2014 14:31:48 +0100 Subject: [PATCH] AS3 parser stub improved --- trunk/src/com/jpexs/decompiler/flash/SWF.java | 117 +- .../decompiler/flash/SWFInputStream.java | 4 +- .../flash/SourceGeneratorLocalData.java | 15 + .../com/jpexs/decompiler/flash/abc/ABC.java | 80 +- .../decompiler/flash/abc/ABCInputStream.java | 4 +- .../decompiler/flash/abc/ABCOutputStream.java | 6 +- .../decompiler/flash/abc/ScriptPack.java | 16 +- .../decompiler/flash/abc/avm2/AVM2Code.java | 18 +- .../flash/abc/avm2/ConstantPool.java | 32 + .../construction/ConstructIns.java | 2 +- .../instructions/other/GetGlobalSlotIns.java | 8 +- .../avm2/instructions/other/GetSlotIns.java | 12 +- .../instructions/other/SetPropertyIns.java | 4 +- .../avm2/instructions/other/SetSlotIns.java | 20 +- .../flash/abc/avm2/model/CoerceAVM2Item.java | 2 +- .../abc/avm2/model/clauses/TryAVM2Item.java | 2 + .../operations/DeletePropertyAVM2Item.java | 1 - .../abc/avm2/parser/pcode/ASM3Parser.java | 2 +- .../parser/script/AVM2SourceGenerator.java | 549 ++- .../avm2/parser/script/ActionScriptLexer.java | 3282 +++++++++-------- .../parser/script/ActionScriptParser.java | 335 +- .../abc/avm2/parser/script/BreakJumpIns.java | 36 + .../abc/avm2/parser/script/ClassAVM2Item.java | 28 +- .../abc/avm2/parser/script/ConstAVM2Item.java | 21 +- .../avm2/parser/script/ContinueJumpIns.java | 37 + .../script/ExceptionMarkAVM2Instruction.java | 41 + .../parser/script/ExceptionSAVM2item.java | 44 + .../avm2/parser/script/FunctionAVM2Item.java | 19 +- .../avm2/parser/script/GetterAVM2Item.java | 13 +- .../avm2/parser/script/InterfaceAVM2Item.java | 26 +- .../avm2/parser/script/MethodAVM2Item.java | 29 +- .../avm2/parser/script/PackageAVM2Item.java | 45 + .../abc/avm2/parser/script/ParsedSymbol.java | 1 - .../avm2/parser/script/SetterAVM2Item.java | 13 +- .../abc/avm2/parser/script/SlotAVM2Item.java | 21 +- .../avm2/parser/script/UnboundedAVM2Item.java | 38 + .../avm2/parser/script/VariableAVM2Item.java | 12 +- .../flash/abc/types/ScriptInfo.java | 10 +- .../flash/abc/types/traits/TraitClass.java | 4 +- .../abc/types/traits/TraitSlotConst.java | 4 +- .../flash/abc/types/traits/Traits.java | 32 +- .../abc/usages/ConstVarMultinameUsage.java | 12 +- .../abc/usages/MethodMultinameUsage.java | 12 +- .../flash/configuration/Configuration.java | 31 + .../console/CommandLineArgumentParser.java | 2 +- .../flash/exporters/modes/FontExportMode.java | 2 +- .../jpexs/decompiler/flash/gui/MainPanel.java | 12 +- .../decompiler/flash/gui/PreviewImage.java | 2 +- .../decompiler/flash/gui/abc/ABCPanel.java | 4 +- .../flash/gui/abc/ASMSourceEditorPane.java | 2 +- .../gui/abc/SlotConstTraitDetailPanel.java | 2 +- .../flash/gui/abc/TraitsListItem.java | 18 +- .../flash/gui/abc/TraitsListModel.java | 8 +- .../decompiler/flash/gui/abc/UsageFrame.java | 4 +- .../flash/gui/timeline/TimelineBodyPanel.java | 2 +- .../flash/tags/DefineButtonTag.java | 2 +- .../decompiler/flash/tags/DefineFont3Tag.java | 2 +- .../decompiler/flash/tags/DoActionTag.java | 2 +- .../flash/tags/DoInitActionTag.java | 2 +- .../com/jpexs/decompiler/flash/tags/Tag.java | 6 +- .../decompiler/flash/tags/base/ASMSource.java | 2 +- .../decompiler/flash/tags/base/FontTag.java | 26 +- .../tags/base/MissingCharacterHandler.java | 2 - .../flash/types/BUTTONCONDACTION.java | 2 +- .../flash/types/CLIPACTIONRECORD.java | 2 +- .../decompiler/flash/types/TEXTRECORD.java | 2 - 66 files changed, 2956 insertions(+), 2192 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/BreakJumpIns.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ContinueJumpIns.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionSAVM2item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnboundedAVM2Item.java diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 7703145fc..802090cdf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -55,7 +55,6 @@ import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.exporters.ExportRectangle; import com.jpexs.decompiler.flash.exporters.Matrix; import com.jpexs.decompiler.flash.exporters.PathExporter; -import com.jpexs.decompiler.flash.exporters.ShapeExporterBase; import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode; import com.jpexs.decompiler.flash.exporters.modes.FontExportMode; import com.jpexs.decompiler.flash.exporters.modes.FramesExportMode; @@ -121,10 +120,8 @@ import com.jpexs.decompiler.flash.treenodes.TagNode; import com.jpexs.decompiler.flash.treenodes.TreeNode; import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA; import com.jpexs.decompiler.flash.types.ColorTransform; -import com.jpexs.decompiler.flash.types.GRADRECORD; import com.jpexs.decompiler.flash.types.MATRIX; import com.jpexs.decompiler.flash.types.RECT; -import com.jpexs.decompiler.flash.types.RGB; import com.jpexs.decompiler.flash.types.SHAPE; import com.jpexs.decompiler.flash.types.filters.BlendComposite; import com.jpexs.decompiler.flash.types.filters.FILTER; @@ -319,8 +316,7 @@ public final class SWF implements TreeItem, Timelined { public void resetTimeline() { timeline = null; } - - + /** * Gets all tags with specified id * @@ -608,7 +604,7 @@ public final class SWF implements TreeItem, Timelined { createTagMap(tagMap, tagPositionsInFrames, tags); addInnerTagsForShowFrameTags(tagPositionsInFrames, tagMap, tags); } - + private void createTagMap(Map tagMap, Map> tagPositionsInFrames, List tags) { List tagPositionsInFrame = new ArrayList<>(); for (Tag tag : tags) { @@ -620,13 +616,13 @@ public final class SWF implements TreeItem, Timelined { tagPositionsInFrames.put(pos, tagPositionsInFrame); tagPositionsInFrame = new ArrayList<>(); } - + if (tag instanceof DefineSpriteTag) { createTagMap(tagMap, tagPositionsInFrames, tag.getSubTags()); } } } - + private void addInnerTagsForShowFrameTags(Map> tagPositionsInFrames, Map tagMap, List tags) { for (Tag tag : tags) { if (tag instanceof ShowFrameTag) { @@ -644,7 +640,7 @@ public final class SWF implements TreeItem, Timelined { } } } - + @Override public SWF getSwf() { return this; @@ -1270,12 +1266,11 @@ public final class SWF implements TreeItem, Timelined { exportSound(baos, t, mode); return baos.toByteArray(); } - - + public void exportFonts(AbortRetryIgnoreHandler handler, String outdir, FontExportMode mode) throws IOException { exportFonts(handler, outdir, tags, mode); } - + public List exportFonts(AbortRetryIgnoreHandler handler, String outdir, List tags, final FontExportMode mode) throws IOException { List ret = new ArrayList<>(); if (tags.isEmpty()) { @@ -1291,7 +1286,7 @@ public final class SWF implements TreeItem, Timelined { } for (Tag t : tags) { File newfile = null; - if (t instanceof FontTag) { + if (t instanceof FontTag) { final FontTag st = (FontTag) t; final File file = new File(outdir + File.separator + st.getCharacterExportFileName() + ".ttf"); newfile = file; @@ -1309,95 +1304,93 @@ public final class SWF implements TreeItem, Timelined { } return ret; } - + public void exportFont(final FontTag t, FontExportMode mode, File file) throws IOException { - List shapes=t.getGlyphShapeTable(); - Fontastic f = new Fontastic(t.getFontName(),file); - String cop=t.getCopyright(); - - f.getEngine().setCopyrightYear(cop==null?"":cop); + List shapes = t.getGlyphShapeTable(); + Fontastic f = new Fontastic(t.getFontName(), file); + String cop = t.getCopyright(); + + f.getEngine().setCopyrightYear(cop == null ? "" : cop); f.setAuthor(ApplicationInfo.shortApplicationVerName); f.setVersion("1.0"); - f.setAscender(t.getAscent()/t.getDivider()); - f.setDescender(t.getDescent()/t.getDivider()); + f.setAscender(t.getAscent() / t.getDivider()); + f.setDescender(t.getDescent() / t.getDivider()); //f.set - - - for(int i=0;i contours=new ArrayList<>(); - PathExporter seb=new PathExporter(s,new ColorTransform()){ - private double transformX(double x){ - return Math.ceil((double)(x/t.getDivider())); + for (int i = 0; i < shapes.size(); i++) { + SHAPE s = shapes.get(i); + final List contours = new ArrayList<>(); + PathExporter seb = new PathExporter(s, new ColorTransform()) { + + private double transformX(double x) { + return Math.ceil((double) (x / t.getDivider())); } - - private double transformY(double y){ - return -Math.ceil((double)(y/t.getDivider())); + + private double transformY(double y) { + return -Math.ceil((double) (y / t.getDivider())); } - - List path=new ArrayList<>(); - private double lastX=0; - private double lastY=0; - + + List path = new ArrayList<>(); + private double lastX = 0; + private double lastY = 0; + @Override protected void finalizePath() { - FPoint[] points=path.toArray(new FPoint[path.size()]); - if(points.length>0){ + FPoint[] points = path.toArray(new FPoint[path.size()]); + if (points.length > 0) { contours.add(points); } path.clear(); } @Override - public void moveTo(double x, double y) { + public void moveTo(double x, double y) { finalizePath(); lastX = x; lastY = y; - path.add(new FPoint(new PVector(transformX(x),transformY(y)))); - } - + path.add(new FPoint(new PVector(transformX(x), transformY(y)))); + } + @Override public void lineTo(double x, double y) { lastX = x; lastY = y; - path.add(new FPoint(new PVector(transformX(x),transformY(y)))); + path.add(new FPoint(new PVector(transformX(x), transformY(y)))); } @Override public void curveTo(double controlX, double controlY, double anchorX, double anchorY) { lastX = anchorX; - lastY = anchorY; + lastY = anchorY; path.add(new FPoint( - new PVector(transformX(anchorX),transformY(anchorY)), - new PVector(transformX(controlX),transformY(controlY)) + new PVector(transformX(anchorX), transformY(anchorY)), + new PVector(transformX(controlX), transformY(controlY)) )); - - - } + + } }; seb.export(); - char c=t.glyphToChar(i); - if(contours.isEmpty()){ + char c = t.glyphToChar(i); + if (contours.isEmpty()) { continue; } - if(c=='.'){ + if (c == '.') { continue; } - final FGlyph g=f.addGlyph(c); - double adv=t.getGlyphAdvance(i); - if(adv!=-1){ - g.setAdvanceWidth((int)adv); - }else{ - g.setAdvanceWidth(t.getGlyphWidth(i)/t.getDivider()+100); + final FGlyph g = f.addGlyph(c); + double adv = t.getGlyphAdvance(i); + if (adv != -1) { + g.setAdvanceWidth((int) adv); + } else { + g.setAdvanceWidth(t.getGlyphWidth(i) / t.getDivider() + 100); } - for(FPoint[] cnt:contours){ - if(cnt.length==0){ + for (FPoint[] cnt : contours) { + if (cnt.length == 0) { continue; } g.addContour(cnt); } - + } f.buildFont(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index d0371c84d..e7c4f7476 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -862,7 +862,7 @@ public class SWFInputStream extends InputStream { if (tag == null) { break; } - + tag.setTimelined(timelined); if (!parallel) { tags.add(tag); @@ -1270,7 +1270,7 @@ public class SWFInputStream extends InputStream { } catch (EndOfStreamException ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, null, ex); } - + if (Configuration.debugMode.get()) { byte[] dataNew = ret.getData(); int ignoreFirst = 0; diff --git a/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java index 3d93bcef3..ab2ffd567 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java +++ b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java @@ -16,8 +16,11 @@ */ package com.jpexs.decompiler.flash; +import com.jpexs.decompiler.flash.abc.types.ABCException; import java.io.Serializable; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; /** * @@ -29,6 +32,18 @@ public class SourceGeneratorLocalData implements Serializable { public Integer inFunction; public Boolean inMethod; public Integer forInLevel; + public List openedNamespaces = new ArrayList<>(); + public List openedNamespacesKinds = new ArrayList<>(); + public List exceptions = new ArrayList<>(); + + public void addNamespace(int kind, String ns) { + addNamespace(kind, ns, openedNamespaces.size() - 1); + } + + public void addNamespace(int kind, String ns, int index) { + openedNamespaces.add(index, ns); + openedNamespacesKinds.add(index, kind); + } public SourceGeneratorLocalData(HashMap registerVars, Integer inFunction, Boolean inMethod, Integer forInLevel) { this.registerVars = registerVars; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java index 71293b80e..c8d39e95b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -60,7 +60,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -73,10 +72,10 @@ public class ABC { public int major_version = 46; public int minor_version = 16; - public ConstantPool constants=new ConstantPool(); + public ConstantPool constants = new ConstantPool(); public List method_info = new ArrayList<>(); public List metadata_info = new ArrayList<>(); - public List instance_info=new ArrayList<>(); + public List instance_info = new ArrayList<>(); public List class_info = new ArrayList<>(); public List script_info = new ArrayList<>(); public List bodies = new ArrayList<>(); @@ -90,12 +89,10 @@ public class ABC { public ABCContainerTag parentTag; public ABC(SWF swf) { - this.deobfuscation = null; - this.swf = swf; + this.deobfuscation = null; + this.swf = swf; } - - public int addMethodBody(MethodBody body) { bodies.add(body); if (body.method_info >= bodyIdxFromMethodIdx.size()) { @@ -104,7 +101,7 @@ public class ABC { for (int i = oldlen; i < newlen; i++) { bodyIdxFromMethodIdx.add(-1); } - bodyIdxFromMethodIdx.set(body.method_info,bodies.size() - 1); + bodyIdxFromMethodIdx.set(body.method_info, bodies.size() - 1); } return bodies.size() - 1; } @@ -262,7 +259,7 @@ public class ABC { getStringUsageTypes(stringUsageTypes, classesOnly); for (int i = 0; i < instance_info.size(); i++) { informListeners("deobfuscate", "class " + i + "/" + instance_info.size()); - InstanceInfo insti=instance_info.get(i); + InstanceInfo insti = instance_info.get(i); if (insti.name_index != 0) { constants.getMultiname(insti.name_index).name_index = deobfuscation.deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, constants.getMultiname(insti.name_index).name_index, true, renameType); if (constants.getMultiname(insti.name_index).namespace_index != 0) { @@ -511,9 +508,20 @@ public class ABC { mb.traits = ais.readTraits(); bodies.add(mb); method_info.get(mb.method_info).setBody(mb); - bodyIdxFromMethodIdx.set(mb.method_info,i); + bodyIdxFromMethodIdx.set(mb.method_info, i); } loadNamespaceMap(); + /*for(int i=0;i(), false, t ,new ArrayList(), null); + } catch (InterruptedException ex) { + Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, null, ex); + } + System.out.println(""+t.toString()); + } + System.exit(0);*/ } public void saveToStream(OutputStream os) throws IOException { @@ -566,12 +574,12 @@ public class ABC { } aos.writeU30(method_info.size()); - for (MethodInfo mi:method_info) { + for (MethodInfo mi : method_info) { aos.writeMethodInfo(mi); } aos.writeU30(metadata_info.size()); - for (MetadataInfo mi:metadata_info) { + for (MetadataInfo mi : metadata_info) { aos.writeU30(mi.name_index); aos.writeU30(mi.values.length); for (int j = 0; j < mi.values.length; j++) { @@ -583,21 +591,21 @@ public class ABC { } aos.writeU30(class_info.size()); - for (InstanceInfo ii:instance_info) { + for (InstanceInfo ii : instance_info) { aos.writeInstanceInfo(ii); } - for (ClassInfo ci:class_info) { + for (ClassInfo ci : class_info) { aos.writeU30(ci.cinit_index); aos.writeTraits(ci.static_traits); } aos.writeU30(script_info.size()); - for (ScriptInfo si:script_info) { + for (ScriptInfo si : script_info) { aos.writeU30(si.init_index); aos.writeTraits(si.traits); } aos.writeU30(bodies.size()); - for (MethodBody mb: bodies) { + for (MethodBody mb : bodies) { aos.writeU30(mb.method_info); aos.writeU30(mb.max_stack); aos.writeU30(mb.max_regs); @@ -672,9 +680,9 @@ public class ABC { } public boolean isStaticTraitId(int classIndex, int traitId) { - if (traitId < class_info.get(classIndex).static_traits.traits.length) { + if (traitId < class_info.get(classIndex).static_traits.traits.size()) { return true; - } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { + } else if (traitId < class_info.get(classIndex).static_traits.traits.size() + instance_info.get(classIndex).instance_traits.traits.size()) { return false; } else { return true; //Can be class or instance initializer @@ -685,11 +693,11 @@ public class ABC { if (classIndex == -1) { return null; } - if (traitId < class_info.get(classIndex).static_traits.traits.length) { - return class_info.get(classIndex).static_traits.traits[traitId]; - } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { - traitId -= class_info.get(classIndex).static_traits.traits.length; - return instance_info.get(classIndex).instance_traits.traits[traitId]; + if (traitId < class_info.get(classIndex).static_traits.traits.size()) { + return class_info.get(classIndex).static_traits.traits.get(traitId); + } else if (traitId < class_info.get(classIndex).static_traits.traits.size() + instance_info.get(classIndex).instance_traits.traits.size()) { + traitId -= class_info.get(classIndex).static_traits.traits.size(); + return instance_info.get(classIndex).instance_traits.traits.get(traitId); } else { return null; //Can be class or instance initializer } @@ -699,21 +707,21 @@ public class ABC { if (classIndex == -1) { return -1; } - if (traitId < class_info.get(classIndex).static_traits.traits.length) { - if (class_info.get(classIndex).static_traits.traits[traitId] instanceof TraitMethodGetterSetter) { - return ((TraitMethodGetterSetter) class_info.get(classIndex).static_traits.traits[traitId]).method_info; + if (traitId < class_info.get(classIndex).static_traits.traits.size()) { + if (class_info.get(classIndex).static_traits.traits.get(traitId) instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) class_info.get(classIndex).static_traits.traits.get(traitId)).method_info; } else { return -1; } - } else if (traitId < class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length) { - traitId -= class_info.get(classIndex).static_traits.traits.length; - if (instance_info.get(classIndex).instance_traits.traits[traitId] instanceof TraitMethodGetterSetter) { - return ((TraitMethodGetterSetter) instance_info.get(classIndex).instance_traits.traits[traitId]).method_info; + } else if (traitId < class_info.get(classIndex).static_traits.traits.size() + instance_info.get(classIndex).instance_traits.traits.size()) { + traitId -= class_info.get(classIndex).static_traits.traits.size(); + if (instance_info.get(classIndex).instance_traits.traits.get(traitId) instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) instance_info.get(classIndex).instance_traits.traits.get(traitId)).method_info; } else { return -1; } } else { - traitId -= class_info.get(classIndex).static_traits.traits.length + instance_info.get(classIndex).instance_traits.traits.length; + traitId -= class_info.get(classIndex).static_traits.traits.size() + instance_info.get(classIndex).instance_traits.traits.size(); if (traitId == 0) { return instance_info.get(classIndex).iinit_index; } else if (traitId == 1) { @@ -820,9 +828,9 @@ public class ABC { } private void findMultinameUsageInTraits(Traits traits, int multinameIndex, boolean isStatic, int classIndex, List ret, int parentTraitIndex) { - for (int t = 0; t < traits.traits.length; t++) { - if (traits.traits[t] instanceof TraitSlotConst) { - TraitSlotConst tsc = (TraitSlotConst) traits.traits[t]; + for (int t = 0; t < traits.traits.size(); t++) { + if (traits.traits.get(t) instanceof TraitSlotConst) { + TraitSlotConst tsc = (TraitSlotConst) traits.traits.get(t); if (tsc.name_index == multinameIndex) { ret.add(new ConstVarNameMultinameUsage(multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex)); } @@ -830,8 +838,8 @@ public class ABC { ret.add(new ConstVarTypeMultinameUsage(multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex)); } } - if (traits.traits[t] instanceof TraitMethodGetterSetter) { - TraitMethodGetterSetter tmgs = (TraitMethodGetterSetter) traits.traits[t]; + if (traits.traits.get(t) instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tmgs = (TraitMethodGetterSetter) traits.traits.get(t); if (tmgs.name_index == multinameIndex) { ret.add(new MethodNameMultinameUsage(multinameIndex, classIndex, t, isStatic, false, traits, parentTraitIndex)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java index 7cfb8acd9..1c1fc007f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java @@ -337,9 +337,9 @@ public class ABCInputStream extends InputStream { public Traits readTraits() throws IOException { int count = readU30(); Traits traits = new Traits(); - traits.traits = new Trait[count]; + traits.traits = new ArrayList<>(); for (int i = 0; i < count; i++) { - traits.traits[i] = readTrait(); + traits.traits.add(readTrait()); } return traits; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java index a64719f8b..d7ca2a054 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java @@ -254,9 +254,9 @@ public class ABCOutputStream extends OutputStream { } public void writeTraits(Traits t) throws IOException { - writeU30(t.traits.length); - for (int i = 0; i < t.traits.length; i++) { - writeTrait(t.traits[i]); + writeU30(t.traits.size()); + for (int i = 0; i < t.traits.size(); i++) { + writeTrait(t.traits.get(i)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 990c406e9..169787913 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -72,7 +72,7 @@ public class ScriptPack implements TreeElementItem { public String getPathPackage() { String packageName = ""; for (int t : traitIndices) { - Multiname name = abc.script_info.get(scriptIndex).traits.traits[t].getName(abc); + Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { packageName = ns.getName(abc.constants); @@ -84,7 +84,7 @@ public class ScriptPack implements TreeElementItem { public String getPathScriptName() { String scriptName = ""; for (int t : traitIndices) { - Multiname name = abc.script_info.get(scriptIndex).traits.traits[t].getName(abc); + Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { scriptName = name.getName(abc.constants, new ArrayList()); @@ -97,7 +97,7 @@ public class ScriptPack implements TreeElementItem { String packageName = ""; String scriptName = ""; for (int t : traitIndices) { - Multiname name = abc.script_info[scriptIndex].traits.traits[t].getName(abc); + Multiname name = abc.script_info[scriptIndex].traits.traits.get(t).getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { packageName = ns.getName(abc.constants); @@ -122,9 +122,9 @@ public class ScriptPack implements TreeElementItem { return Helper.joinStrings(pathParts, File.separator); } - public void convert(final NulWriter writer, final List abcList, final Trait[] traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { + public void convert(final NulWriter writer, final List abcList, final List traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { for (int t : traitIndices) { - Trait trait = traits[t]; + Trait trait = traits.get(t); Multiname name = trait.getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { @@ -135,9 +135,9 @@ public class ScriptPack implements TreeElementItem { } } - public void appendTo(GraphTextWriter writer, List abcList, Trait[] traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException { + public void appendTo(GraphTextWriter writer, List abcList, List traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException { for (int t : traitIndices) { - Trait trait = traits[t]; + Trait trait = traits.get(t); Multiname name = trait.getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { @@ -148,7 +148,7 @@ public class ScriptPack implements TreeElementItem { } } - public void toSource(GraphTextWriter writer, final List abcList, final Trait[] traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { + public void toSource(GraphTextWriter writer, final List abcList, final List traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { writer.suspendMeasure(); int timeout = Configuration.decompilationTimeoutFile.get(); try { 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 5cbf88ed7..615f67f72 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -200,8 +200,8 @@ import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.SetSlotAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.DeclarationAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; @@ -250,7 +250,7 @@ public class AVM2Code implements Serializable { public static final long serialVersionUID = 1L; private static final boolean DEBUG_MODE = false; public static int toSourceLimit = -1; - public ArrayList code = new ArrayList<>(); + public List code = new ArrayList<>(); public static boolean DEBUG_REWRITE = false; public static final int OPT_U30 = 0x100; public static final int OPT_U8 = 0x200; @@ -829,7 +829,9 @@ public class AVM2Code implements Serializable { } public void compact() { - code.trimToSize(); + if (code instanceof ArrayList) { + ((ArrayList) code).trimToSize(); + } } public byte[] getBytes() { @@ -1582,7 +1584,7 @@ public class AVM2Code implements Serializable { value = ((InitPropertyAVM2Item) ti).value; } if (ti instanceof SetPropertyAVM2Item) { - multinameIndex = ((FullMultinameAVM2Item)((SetPropertyAVM2Item) ti).propertyName).multinameIndex; + multinameIndex = ((FullMultinameAVM2Item) ((SetPropertyAVM2Item) ti).propertyName).multinameIndex; value = ((SetPropertyAVM2Item) ti).value; } for (Trait t : initTraits.traits) { @@ -1640,10 +1642,10 @@ public class AVM2Code implements Serializable { Slot sl = new Slot(ssti.scope, ssti.slotName); if (!declaredSlots.contains(sl)) { String type = "*"; - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t].getName(abc) == sl.multiname) { - if (body.traits.traits[t] instanceof TraitSlotConst) { - type = ((TraitSlotConst) body.traits.traits[t]).getType(constants, fullyQualifiedNames); + for (int t = 0; t < body.traits.traits.size(); t++) { + if (body.traits.traits.get(t).getName(abc) == sl.multiname) { + if (body.traits.traits.get(t) instanceof TraitSlotConst) { + type = ((TraitSlotConst) body.traits.traits.get(t)).getType(constants, fullyQualifiedNames); } } } 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 f072599a4..3b269bb67 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/ConstantPool.java @@ -285,6 +285,38 @@ public class ConstantPool { return id; } + public int getNamespaceSetId(NamespaceSet val) { + loopi: + for (int i = 0; i < constant_namespace_set.size(); i++) { + NamespaceSet ts = constant_namespace_set.get(i); + if (ts.namespaces.length != val.namespaces.length) { + continue; + } + for (int j = 0; j < val.namespaces.length; j++) { + boolean found = false; + for (int k = 0; k < val.namespaces.length; k++) { + if (ts.namespaces[j] == val.namespaces[k]) { + found = true; + break; + } + } + if (!found) { + continue loopi; + } + } + return i; + } + return 0; + } + + public int getNamespaceSetId(NamespaceSet val, boolean add) { + int id = getNamespaceSetId(val); + if (add && id == 0) { + id = addNamespaceSet(val); + } + return id; + } + public int getUIntId(long val, boolean add) { int id = getUIntId(val); if (add && id == 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index 8522b8f50..b13d44e58 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -89,7 +89,7 @@ public class ConstructIns extends InstructionDefinition { GetPropertyAVM2Item gpt = (GetPropertyAVM2Item) obj; if (gpt.object instanceof FindPropertyAVM2Item) { FindPropertyAVM2Item fpt = (FindPropertyAVM2Item) gpt.object; - xmlMult = (FullMultinameAVM2Item)fpt.propertyName; + xmlMult = (FullMultinameAVM2Item) fpt.propertyName; isXML = xmlMult.isXML(constants, localRegNames, fullyQualifiedNames) && xmlMult.isXML(constants, localRegNames, fullyQualifiedNames); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java index 0619483c7..cbfe5d1f3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java @@ -47,10 +47,10 @@ public class GetGlobalSlotIns extends InstructionDefinition { slotname = constants.getMultiname(((ExceptionAVM2Item) obj).exception.name_index); } else { - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t] instanceof TraitSlotConst) { - if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { - slotname = body.traits.traits[t].getName(abc); + for (int t = 0; t < body.traits.traits.size(); t++) { + if (body.traits.traits.get(t) instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits.get(t)).slot_id == slotIndex) { + slotname = body.traits.traits.get(t).getName(abc); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java index 15bc53d93..cacaf34e8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java @@ -56,8 +56,8 @@ public class GetSlotIns extends InstructionDefinition { } else if (obj instanceof ThisAVM2Item) { slotname = ((ThisAVM2Item) obj).className; } else if (obj instanceof ScriptAVM2Item) { - for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.length; t++) { - Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits[t]; + for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.size(); t++) { + Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.get(t); if (tr instanceof TraitWithSlot) { if (((TraitWithSlot) tr).getSlotIndex() == slotIndex) { slotname = tr.getName(abc); @@ -66,10 +66,10 @@ public class GetSlotIns extends InstructionDefinition { } } else if (obj instanceof NewActivationAVM2Item) { - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t] instanceof TraitWithSlot) { - if (((TraitWithSlot) body.traits.traits[t]).getSlotIndex() == slotIndex) { - slotname = body.traits.traits[t].getName(abc); + for (int t = 0; t < body.traits.traits.size(); t++) { + if (body.traits.traits.get(t) instanceof TraitWithSlot) { + if (((TraitWithSlot) body.traits.traits.get(t)).getSlotIndex() == slotIndex) { + slotname = body.traits.traits.get(t).getName(abc); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java index 70c82d255..c72b14b31 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java @@ -56,7 +56,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns GraphTargetItem inside = ((IncrementAVM2Item) value.getThroughDuplicate().getThroughRegister().getThroughDuplicate()).value.getThroughRegister().getNotCoerced().getThroughDuplicate(); if (inside instanceof GetPropertyAVM2Item) { GetPropertyAVM2Item insideProp = ((GetPropertyAVM2Item) inside); - if (((FullMultinameAVM2Item)insideProp.propertyName).compareSame(multiname)) { + if (((FullMultinameAVM2Item) insideProp.propertyName).compareSame(multiname)) { GraphTargetItem insideObj = obj.getThroughDuplicate(); if (insideObj instanceof LocalRegAVM2Item) { if (((LocalRegAVM2Item) insideObj).computedValue != null) { @@ -88,7 +88,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns GraphTargetItem inside = ((DecrementAVM2Item) value.getThroughDuplicate().getThroughRegister().getThroughDuplicate()).value.getThroughRegister().getNotCoerced().getThroughDuplicate(); if (inside instanceof GetPropertyAVM2Item) { GetPropertyAVM2Item insideProp = ((GetPropertyAVM2Item) inside); - if (((FullMultinameAVM2Item)insideProp.propertyName).compareSame(multiname)) { + if (((FullMultinameAVM2Item) insideProp.propertyName).compareSame(multiname)) { GraphTargetItem insideObj = obj.getThroughDuplicate(); if (insideObj instanceof LocalRegAVM2Item) { if (((LocalRegAVM2Item) insideObj).computedValue != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java index 4a0483021..4e966be9c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java @@ -73,8 +73,8 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } else if (obj instanceof ThisAVM2Item) { slotname = ((ThisAVM2Item) obj).className; } else if (obj instanceof ScriptAVM2Item) { - for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.length; t++) { - Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits[t]; + for (int t = 0; t < abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.size(); t++) { + Trait tr = abc.script_info.get(((ScriptAVM2Item) obj).scriptIndex).traits.traits.get(t); if (tr instanceof TraitWithSlot) { if (((TraitWithSlot) tr).getSlotIndex() == slotIndex) { slotname = tr.getName(abc); @@ -83,10 +83,10 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } } else if (obj instanceof NewActivationAVM2Item) { - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t] instanceof TraitWithSlot) { - if (((TraitWithSlot) body.traits.traits[t]).getSlotIndex() == slotIndex) { - slotname = body.traits.traits[t].getName(abc); + for (int t = 0; t < body.traits.traits.size(); t++) { + if (body.traits.traits.get(t) instanceof TraitWithSlot) { + if (((TraitWithSlot) body.traits.traits.get(t)).getSlotIndex() == slotIndex) { + slotname = body.traits.traits.get(t).getName(abc); } } @@ -163,10 +163,10 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { int slotIndex = ins.operands[0]; ////String obj = stack.get(1); String slotname = ""; - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t] instanceof TraitSlotConst) { - if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { - slotname = body.traits.traits[t].getName(abc).getName(abc.constants, fullyQualifiedNames); + for (int t = 0; t < body.traits.traits.size(); t++) { + if (body.traits.traits.get(t) instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits.get(t)).slot_id == slotIndex) { + slotname = body.traits.traits.get(t).getName(abc).getName(abc.constants, fullyQualifiedNames); } } 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 fe1742f1f..07e2c39f1 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 @@ -35,7 +35,7 @@ public class CoerceAVM2Item extends AVM2Item { this.value = value; this.type = type; } - + public CoerceAVM2Item(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem typeObj) { super(instruction, NOPRECEDENCE); this.value = value; 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 1863b9541..0576af444 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 @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.abc.avm2.model.clauses; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.parser.script.ExceptionSAVM2item; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.Block; @@ -30,6 +31,7 @@ public class TryAVM2Item extends AVM2Item implements Block { public List tryCommands; public List catchExceptions; + public List catchExceptions2; public List> catchCommands; public List finallyCommands; 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 5654ee9e0..1ca37131b 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 @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index b11939718..39c4a2a35 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.pcode; -import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.DeobfuscatePopIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; 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 c8933d6a9..3d9b35ab6 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 @@ -16,37 +16,53 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; -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.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.NotIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.StrictEqualsIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewClassIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfTrueIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns; +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.GetPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.InitPropertyIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; 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.instructions.stack.PopScopeIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushScopeIns; +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FloatValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.StringAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.clauses.TryAVM2Item; +import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.ClassInfo; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +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.ValueKind; import com.jpexs.decompiler.flash.abc.types.traits.Trait; +import com.jpexs.decompiler.flash.abc.types.traits.TraitClass; +import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.abc.types.traits.Traits; -import com.jpexs.decompiler.flash.action.swf4.ActionPush; -import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; -import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; -import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; -import com.jpexs.decompiler.flash.action.swf5.ActionGetMember; import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; -import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; -import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; -import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; -import com.jpexs.decompiler.flash.helpers.collections.MyEntry; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -63,7 +79,6 @@ import com.jpexs.decompiler.graph.model.OrItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.TernarOpItem; import com.jpexs.decompiler.graph.model.WhileItem; -import com.jpexs.helpers.Helper; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; @@ -78,11 +93,13 @@ import java.util.logging.Logger; */ public class AVM2SourceGenerator implements SourceGenerator { - private AVM2Instruction ins(InstructionDefinition def,int...operands) - { + private final ABC abc; + private List allABCs; + + private AVM2Instruction ins(InstructionDefinition def, int... operands) { return new AVM2Instruction(0, def, operands, new byte[0]); } - + @Override public List generate(SourceGeneratorLocalData localData, AndItem item) { List ret = new ArrayList<>(); @@ -92,24 +109,24 @@ public class AVM2SourceGenerator implements SourceGenerator { List andExpr = generateToActionList(localData, item.rightSide); andExpr.add(0, ins(new PopIns())); int andExprLen = insToBytes(andExpr).length; - ret.add(ins(new IfTrueIns(),andExprLen)); + ret.add(ins(new IfTrueIns(), andExprLen)); ret.addAll(andExpr); return ret; } - - private byte[] insToBytes(List code){ + + private byte[] insToBytes(List code) { try { - ByteArrayOutputStream baos=new ByteArrayOutputStream(); - for (AVM2Instruction instruction : code) { - + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (AVM2Instruction instruction : code) { + baos.write(instruction.getBytes()); - + } - return baos.toByteArray(); + return baos.toByteArray(); } catch (IOException ex) { - Logger.getLogger(AVM2SourceGenerator.class.getName()).log(Level.SEVERE, null, ex); - } + Logger.getLogger(AVM2SourceGenerator.class.getName()).log(Level.SEVERE, null, ex); + } return new byte[0]; } @@ -121,12 +138,12 @@ public class AVM2SourceGenerator implements SourceGenerator { List orExpr = generateToActionList(localData, item.rightSide); orExpr.add(0, ins(new PopIns())); int orExprLen = insToBytes(orExpr).length; - ret.add(ins(new IfTrueIns(),orExprLen)); + ret.add(ins(new IfTrueIns(), orExprLen)); ret.addAll(orExpr); return ret; } - public List toActionList(List items) { + public List toInsList(List items) { List ret = new ArrayList<>(); for (GraphSourceItem s : items) { if (s instanceof AVM2Instruction) { @@ -145,7 +162,7 @@ public class AVM2SourceGenerator implements SourceGenerator { private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) { List ret = new ArrayList<>(); - if (false){//expression instanceof Inverted) { + if (false) {//expression instanceof Inverted) { //ret.addAll(((Inverted) expression).invert().toSource(localData, this)); } else { ret.addAll(expression.toSource(localData, this)); @@ -154,14 +171,14 @@ public class AVM2SourceGenerator implements SourceGenerator { List onTrue = null; List onFalse = null; if (ternar) { - onTrue = toActionList(onTrueCmds.get(0).toSource(localData, this)); + onTrue = toInsList(onTrueCmds.get(0).toSource(localData, this)); } else { onTrue = generateToActionList(localData, onTrueCmds); } if (onFalseCmds != null && !onFalseCmds.isEmpty()) { if (ternar) { - onFalse = toActionList(onFalseCmds.get(0).toSource(localData, this)); + onFalse = toInsList(onFalseCmds.get(0).toSource(localData, this)); } else { onFalse = generateToActionList(localData, onFalseCmds); } @@ -169,27 +186,24 @@ public class AVM2SourceGenerator implements SourceGenerator { byte[] onTrueBytes = insToBytes(onTrue); int onTrueLen = onTrueBytes.length; - AVM2Instruction ifaif = ins(new IfTrueIns(),0); + AVM2Instruction ifaif = ins(new IfTrueIns(), 0); ret.add(ifaif); ret.addAll(onTrue); - ifaif.operands[0]=(onTrueLen); + ifaif.operands[0] = (onTrueLen); AVM2Instruction ajmp = null; if (onFalse != null) { if (!((!nonempty(onTrue).isEmpty()) - && (onTrue.get(onTrue.size() - 1).definition instanceof JumpIns) - //&& ((((ActionJump) onTrue.get(onTrue.size() - 1)).isContinue) - //|| (((ActionJump) onTrue.get(onTrue.size() - 1)).isBreak)) //TODO - ) - ) { - ajmp = ins(new JumpIns(),0); + && ((onTrue.get(onTrue.size() - 1).definition instanceof ContinueJumpIns) + || ((onTrue.get(onTrue.size() - 1).definition instanceof BreakJumpIns))))) { + ajmp = ins(new JumpIns(), 0); ret.add(ajmp); onTrueLen += ajmp.getBytes().length; } - ifaif.operands[0]=onTrueLen; + ifaif.operands[0] = onTrueLen; byte[] onFalseBytes = insToBytes(onFalse); int onFalseLen = onFalseBytes.length; if (ajmp != null) { - ajmp.operands[0]=onFalseLen; + ajmp.operands[0] = onFalseLen; } ret.addAll(onFalse); } @@ -201,25 +215,26 @@ public class AVM2SourceGenerator implements SourceGenerator { return generateIf(localData, item.expression, item.onTrue, item.onFalse, false); } - private void fixLoop(List code, int breakOffset) { - fixLoop(code, breakOffset, Integer.MAX_VALUE); + private void fixSwitch(List code, int breakOffset, long loopId) { + fixLoop(code, breakOffset, Integer.MAX_VALUE, loopId); } - private void fixLoop(List code, int breakOffset, int continueOffset) { + private void fixLoop(List code, int breakOffset, int continueOffset, long loopId) { int pos = 0; - //TODO: handle loops - continue, break - for (AVM2Instruction a : code) { - pos += a.getBytes().length; - if (a.definition instanceof JumpIns) { - /*ActionJump aj = (ActionJump) a; - if (aj.isContinue && (continueOffset != Integer.MAX_VALUE)) { - aj.operands[0]=(-pos + continueOffset); - aj.isContinue = false; + for (int a = 0; a < code.size(); a++) { + AVM2Instruction ins = code.get(a); + pos += ins.getBytes().length; + if (ins.definition instanceof JumpIns) { + if (ins.definition instanceof ContinueJumpIns) { + if (continueOffset != Integer.MAX_VALUE) { + ins.operands[0] = (-pos + continueOffset); + } + code.get(a).definition = new JumpIns(); + } + if (ins.definition instanceof BreakJumpIns) { + ins.operands[0] = (-pos + breakOffset); + code.get(a).definition = new JumpIns(); } - if (aj.isBreak) { - aj.operands[0]=(-pos + breakOffset); - aj.isBreak = false; - }*/ } } } @@ -242,22 +257,22 @@ public class AVM2SourceGenerator implements SourceGenerator { if (!ex.isEmpty()) { GraphTargetItem lastItem = ex.remove(ex.size() - 1); whileExpr.addAll(generateToActionList(localData, ex)); - whileExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result + whileExpr.addAll(toInsList(lastItem.toSource(localData, this))); //Want result } List whileBody = generateToActionList(localData, item.commands); whileExpr.add(ins(new NotIns())); - AVM2Instruction whileaif = ins(new IfTrueIns(),0); + AVM2Instruction whileaif = ins(new IfTrueIns(), 0); whileExpr.add(whileaif); - AVM2Instruction whileajmp = ins(new JumpIns(),0); + AVM2Instruction whileajmp = ins(new JumpIns(), 0); whileBody.add(whileajmp); int whileExprLen = insToBytes(whileExpr).length; int whileBodyLen = insToBytes(whileBody).length; - whileajmp.operands[0]=(-(whileExprLen + whileajmp.operands[0] = (-(whileExprLen + whileBodyLen)); - whileaif.operands[0]=(whileBodyLen); + whileaif.operands[0] = (whileBodyLen); ret.addAll(whileExpr); - fixLoop(whileBody, whileBodyLen, -whileExprLen); + fixLoop(whileBody, whileBodyLen, -whileExprLen, item.loop.id); ret.addAll(whileBody); return ret; } @@ -273,10 +288,10 @@ public class AVM2SourceGenerator implements SourceGenerator { ret.addAll(doBody); ret.addAll(doExpr); - AVM2Instruction doif = ins(new IfTrueIns(),0); + AVM2Instruction doif = ins(new IfTrueIns(), 0); ret.add(doif); - doif.operands[0]=(-doBodyLen - doExprLen - doif.getBytes().length); - fixLoop(doBody, doBodyLen + doExprLen + doif.getBytes().length, doBodyLen); + doif.operands[0] = (-doBodyLen - doExprLen - doif.getBytes().length); + fixLoop(doBody, doBodyLen + doExprLen + doif.getBytes().length, doBodyLen, item.loop.id); return ret; } @@ -288,21 +303,21 @@ public class AVM2SourceGenerator implements SourceGenerator { List forFinalCommands = generateToActionList(localData, item.finalCommands); forExpr.add(ins(new NotIns())); - AVM2Instruction foraif = ins(new IfTrueIns(),0); + AVM2Instruction foraif = ins(new IfTrueIns(), 0); forExpr.add(foraif); - AVM2Instruction forajmp = ins(new JumpIns(),0); + AVM2Instruction forajmp = ins(new JumpIns(), 0); int forajmpLen = forajmp.getBytes().length; int forExprLen = insToBytes(forExpr).length; int forBodyLen = insToBytes(forBody).length; int forFinalLen = insToBytes(forFinalCommands).length; - forajmp.operands[0]=(-(forExprLen + forajmp.operands[0] = (-(forExprLen + forBodyLen + forFinalLen + forajmpLen)); - foraif.operands[0]=(forBodyLen + forFinalLen + forajmpLen); + foraif.operands[0] = (forBodyLen + forFinalLen + forajmpLen); ret.addAll(forExpr); ret.addAll(forBody); ret.addAll(forFinalCommands); ret.add(forajmp); - fixLoop(forBody, forBodyLen + forFinalLen + forajmpLen, forBodyLen); + fixLoop(forBody, forBodyLen + forFinalLen + forajmpLen, forBodyLen, item.loop.id); return ret; } private long uniqLast = 0; @@ -325,7 +340,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } } - ret.addAll(toActionList(item.switchedObject.toSource(localData, this))); + ret.addAll(toInsList(item.switchedObject.toSource(localData, this))); boolean firstCase = true; List> caseIfs = new ArrayList<>(); @@ -346,13 +361,13 @@ public class AVM2SourceGenerator implements SourceGenerator { List curCaseExpr = generateToActionList(localData, item.caseValues.get(m)); caseExprs.add(curCaseExpr); if (firstCase) { - curCaseExpr.add(0, ins(new DupIns(),exprReg)); - curCaseExpr.add(0, ins(new SetLocalIns(),exprReg)); + curCaseExpr.add(0, ins(new DupIns(), exprReg)); + curCaseExpr.add(0, ins(new SetLocalIns(), exprReg)); } else { - curCaseExpr.add(0, ins(new GetLocalIns(),exprReg)); + curCaseExpr.add(0, ins(new GetLocalIns(), exprReg)); } curCaseExpr.add(ins(new StrictEqualsIns())); - AVM2Instruction aif = ins(new IfTrueIns(),0); + AVM2Instruction aif = ins(new IfTrueIns(), 0); caseIfsOne.add(aif); curCaseExpr.add(aif); ret.addAll(curCaseExpr); @@ -363,7 +378,7 @@ public class AVM2SourceGenerator implements SourceGenerator { List caseCmd = generateToActionList(localData, item.caseCommands.get(mapping)); caseCmds.add(caseCmd); } - AVM2Instruction defJump = ins(new JumpIns(),0); + AVM2Instruction defJump = ins(new JumpIns(), 0); ret.add(defJump); List defCmd = new ArrayList<>(); if (!item.defaultCommands.isEmpty()) { @@ -403,7 +418,7 @@ public class AVM2SourceGenerator implements SourceGenerator { for (int n = 0; n < i; n++) { jmpPos += caseLengths.get(n); } - caseIfs.get(i).get(c).operands[0]=(jmpPos); + caseIfs.get(i).get(c).operands[0] = (jmpPos); } } int defJmpPos = 0; @@ -411,7 +426,7 @@ public class AVM2SourceGenerator implements SourceGenerator { defJmpPos += caseLengths.get(i); } - defJump.operands[0]=(defJmpPos); + defJump.operands[0] = (defJmpPos); List caseCmdsAll = new ArrayList<>(); int breakOffset = 0; for (int i = 0; i < caseCmds.size(); i++) { @@ -419,16 +434,16 @@ public class AVM2SourceGenerator implements SourceGenerator { breakOffset += caseLengths.get(i); } breakOffset += defLength; - fixLoop(caseCmdsAll, breakOffset); + fixSwitch(caseCmdsAll, breakOffset, item.loop.id); return ret; } @Override public List generate(SourceGeneratorLocalData localData, NotItem item) { /*if (item.getOriginal() instanceof Inverted) { - GraphTargetItem norig = ((Inverted) item).invert(); - return norig.toSource(localData, this); - }*/ + GraphTargetItem norig = ((Inverted) item).invert(); + return norig.toSource(localData, this); + }*/ List ret = new ArrayList<>(); ret.addAll(item.getOriginal().toSource(localData, this)); ret.add(ins(new NotIns())); @@ -445,29 +460,38 @@ public class AVM2SourceGenerator implements SourceGenerator { @Override public List generate(SourceGeneratorLocalData localData, BreakItem item) { List ret = new ArrayList<>(); - AVM2Instruction abreak = ins(new JumpIns(),0); - //TODO: handle break - //abreak.isBreak = true; + AVM2Instruction abreak = ins(new BreakJumpIns(item.loopId), 0); ret.add(abreak); return ret; } + public List generate(SourceGeneratorLocalData localData, TryAVM2Item item) { + List ret = new ArrayList<>(); + for (ExceptionSAVM2item e : item.catchExceptions2) { + ABCException aex = new ABCException(); + aex.name_index = ident(e.name); + aex.type_index = typeName(e.type); + localData.exceptions.add(aex); + //TODO + } + //TODO: finally + return ret; + } + @Override public List generate(SourceGeneratorLocalData localData, ContinueItem item) { List ret = new ArrayList<>(); - AVM2Instruction acontinue = ins(new JumpIns(),0); - //TODO: handle continue - //acontinue.isContinue = true; + AVM2Instruction acontinue = ins(new ContinueJumpIns(item.loopId), 0); ret.add(acontinue); return ret; } private List generateToActionList(SourceGeneratorLocalData localData, List commands) { - return toActionList(generate(localData, commands)); + return toInsList(generate(localData, commands)); } private List generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) { - return toActionList(command.toSource(localData, this)); + return toInsList(command.toSource(localData, this)); } @Override @@ -550,78 +574,73 @@ public class AVM2SourceGenerator implements SourceGenerator { return ret; } - - private final ABC abc; - - public AVM2SourceGenerator(ABC abc) { + public AVM2SourceGenerator(ABC abc, List allABCs) { this.abc = abc; + this.allABCs = allABCs; } public ABC getABC() { return abc; } - - public void generateClass(ClassInfo classInfo,InstanceInfo instanceInfo,SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) { - List extendsStr = getVarParts(extendsVal); - List ret = new ArrayList<>(); + /*private int generateName(GraphTargetItem name){ - classInfo.cinit_index = 0; //class_initializer - + }*/ + private void generateMethod(GraphTargetItem method) { + if (method instanceof MethodAVM2Item) { + MethodAVM2Item m = (MethodAVM2Item) method; + //MethodInfo mi=new MethodInfo(param_types, ret_type, name_index, flags, optional, paramNames) + } + } + + public void generateClass(ClassInfo classInfo, InstanceInfo instanceInfo, SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List traitItems) { + List ret = new ArrayList<>(); + ParsedSymbol s = null; - List constr = new ArrayList<>(); if (constructor == null) { - instanceInfo.iinit_index = 0; //TODO - //TODO: default constr - } else { - instanceInfo.iinit_index = 0; //TODO: set constructor + instanceInfo.iinit_index = method(localData, new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), name/*?? FIXME*/); + } else { + MethodAVM2Item m = (MethodAVM2Item) constructor; + instanceInfo.iinit_index = method(localData, m.paramTypes, m.paramNames, m.paramValues, m.body, name/*?? FIXME*/); } - List staticTraits=new ArrayList(); - List instanceTraits=new ArrayList(); - if (!isInterface) { - for (GraphTargetItem f : staticFunctions) { - TraitMethodGetterSetter tmgs = new TraitMethodGetterSetter(); - tmgs.method_info = 0; //TODO - tmgs.name_index = 0; //TODO - staticTraits.add(tmgs); - } - for (GraphTargetItem f : functions) { - TraitMethodGetterSetter tmgs = new TraitMethodGetterSetter(); - tmgs.method_info = 0; //TODO - tmgs.name_index = 0; //TODO - instanceTraits.add(tmgs); - } - for (MyEntry en : staticVars) { - TraitSlotConst tsc=new TraitSlotConst(); - tsc.type_index = 0; //TODO - tsc.value_index = 0; //TODO - tsc.value_kind = 0; //TODO - staticTraits.add(tsc); - - } - for (MyEntry en : vars) { - TraitSlotConst tsc=new TraitSlotConst(); - tsc.type_index = 0; //TODO - tsc.value_index = 0; //TODO - tsc.value_kind = 0; //TODO - instanceTraits.add(tsc); + + generateTraits(false, localData, traitItems, instanceInfo.instance_traits); + generateTraits(true, localData, traitItems, classInfo.static_traits); + + if (extendsVal != null) { + instanceInfo.super_index = typeName(extendsVal); + } else if (!isInterface) { + instanceInfo.super_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str("Object"), namespace(Namespace.KIND_PACKAGE, ""), 0, 0, new ArrayList()), true); + } + + //Class initializer + 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.code.add(ins(new GetLocal0Ins())); + mb.code.code.add(ins(new PushScopeIns())); + for (GraphTargetItem ti : traitItems) { + if (ti instanceof SlotAVM2Item) { + SlotAVM2Item si = (SlotAVM2Item) ti; + mb.code.code.add(ins(new FindPropertyStrictIns(), traitName(si.getNsKind(), si.var))); + List tis = new ArrayList<>(); + tis.add(si.value); + mb.code.code.addAll(toInsList(generate(localData, tis))); + mb.code.code.add(ins(new InitPropertyIns(), traitName(si.getNsKind(), si.var))); } } - - if (!extendsStr.isEmpty()) { - instanceInfo.super_index = 0;//TODO - } - if (!isInterface) { - - } + mb.code.code.add(ins(new ReturnVoidIns())); + mb.autoFillStats(abc); + + classInfo.cinit_index = mb.method_info; if (!implementsStr.isEmpty()) { for (GraphTargetItem imp : implementsStr) { instanceInfo.interfaces[0] = 0; //TODO } } - + } @Override @@ -638,27 +657,237 @@ public class AVM2SourceGenerator implements SourceGenerator { ret.addAll(lastExpr.toSource(localData, this)); return ret; } - - - public Traits generateScriptTraits(SourceGeneratorLocalData localData, List commands){ - Traits t=new Traits(); - for(GraphTargetItem item:commands) - { - if(item instanceof ClassAVM2Item){ - - } - if(item instanceof VariableAVM2Item) - { - - } - } - return t; + + public int generateClass(AVM2Item cls) { + return -1; //TODO } - - public ScriptInfo generateScriptInfo(SourceGeneratorLocalData localData, List commands){ - ScriptInfo si=new ScriptInfo(); - si.init_index = 0; //TODO - si.traits = generateScriptTraits(localData, commands); + + public int traitName(int nsKind, String var) { + return -1; //TODO + } + + public int typeName(GraphTargetItem type) { + if (type instanceof UnboundedAVM2Item) { + return 0; + } + return -1; //TODO + } + + public int ident(GraphTargetItem name) { + if (name instanceof VariableAVM2Item) { + return str(((VariableAVM2Item) name).getVariableName()); + } + throw new RuntimeException("no ident"); //FIXME + } + + public int namespace(int nsKind, String name) { + return abc.constants.getNamespaceId(new Namespace(nsKind, str(name)), 0, true); + } + + public int str(String name) { + return abc.constants.getStringId(name, true); + } + + 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()]; + int param_names[] = new int[paramNames.size()]; + for (int i = 0; i < paramTypes.size(); i++) { + param_types[i] = typeName(paramTypes.get(i)); + param_names[i] = str(paramNames.get(i)); + } + + for (int i = 0; i < paramValues.size(); i++) { + optional[i] = getValueKind(paramTypes.get(paramTypes.size() - paramValues.size() + i), paramTypes.get(i)); + } + + MethodInfo mi = new MethodInfo(param_types, typeName(retType), 0/*name_index*/, 0/*TODO*/, optional, param_names); + MethodBody mbody = new MethodBody(); + mbody.method_info = abc.addMethodInfo(mi); + List src = generate(localData, body); + mbody.code = new AVM2Code(); + mbody.code.code = toInsList(src); + mbody.autoFillStats(abc); + abc.addMethodBody(mbody); + //TODO: Exceptions + return mbody.method_info; + } + + public ValueKind getValueKind(GraphTargetItem type, GraphTargetItem val) { + + if (val instanceof BooleanAVM2Item) { + BooleanAVM2Item bi = (BooleanAVM2Item) val; + if (bi.value) { + return new ValueKind(0, ValueKind.CONSTANT_True); + } else { + return new ValueKind(0, ValueKind.CONSTANT_False); + } + } + + boolean isNs = false; + if (type instanceof VariableAVM2Item) { + if (((VariableAVM2Item) type).getVariableName().equals("namespace")) { + isNs = true; + } + } + if (val instanceof StringAVM2Item) { + StringAVM2Item sval = (StringAVM2Item) val; + if (isNs) { + return new ValueKind(namespace(Namespace.KIND_NAMESPACE, sval.value), ValueKind.CONSTANT_Namespace); + } else { + return new ValueKind(str(sval.value), ValueKind.CONSTANT_Utf8); + } + } + if (val instanceof IntegerValueAVM2Item) { + return new ValueKind(abc.constants.getIntId(((IntegerValueAVM2Item) val).value, true), ValueKind.CONSTANT_Int); + } + if (val instanceof FloatValueAVM2Item) { + return new ValueKind(abc.constants.getIntId(((IntegerValueAVM2Item) val).value, true), ValueKind.CONSTANT_Double); + } + if (val instanceof NullAVM2Item) { + return new ValueKind(0, ValueKind.CONSTANT_Null); + } + if (val instanceof UndefinedAVM2Item) { + return new ValueKind(0, ValueKind.CONSTANT_Undefined); + } + return null; + } + + public void generateTraits(boolean generateStatic, SourceGeneratorLocalData localData, List items, Traits ts) { + for (GraphTargetItem item : items) { + if (item instanceof InterfaceAVM2Item) { + TraitClass tc = new TraitClass(); + tc.class_info = generateClass((InterfaceAVM2Item) item); + tc.name_index = traitName(((InterfaceAVM2Item) item).namespaceKind, ((InterfaceAVM2Item) item).name); + ts.traits.add(tc); + } + + if (item instanceof ClassAVM2Item) { + TraitClass tc = new TraitClass(); + tc.class_info = generateClass((ClassAVM2Item) item); + tc.name_index = traitName(((ClassAVM2Item) item).namespaceKind, ((ClassAVM2Item) item).className); + ts.traits.add(tc); + } + if ((item instanceof SlotAVM2Item) || (item instanceof ConstAVM2Item)) { + TraitSlotConst tsc = new TraitSlotConst(); + tsc.kindType = (item instanceof SlotAVM2Item) ? Trait.TRAIT_SLOT : Trait.TRAIT_CONST; + String var = null; + GraphTargetItem val = null; + GraphTargetItem type = null; + int nsKind = 0; + if (item instanceof SlotAVM2Item) { + SlotAVM2Item sai = (SlotAVM2Item) item; + if (sai.isStatic() != generateStatic) { + continue; + } + var = sai.var; + val = sai.value; + type = sai.type; + nsKind = sai.getNsKind(); + } + if (item instanceof ConstAVM2Item) { + ConstAVM2Item cai = (ConstAVM2Item) item; + if (cai.isStatic() != generateStatic) { + continue; + } + var = cai.var; + val = cai.value; + type = cai.type; + nsKind = cai.getNsKind(); + } + tsc.name_index = traitName(nsKind, var); + tsc.type_index = typeName(type); + + ValueKind vk = getValueKind(type, val); + if (vk == null) { + tsc.value_kind = ValueKind.CONSTANT_Undefined; + } else { + tsc.value_kind = vk.value_kind; + tsc.value_index = vk.value_index; + } + ts.traits.add(tsc); + } + if ((item instanceof MethodAVM2Item) || (item instanceof GetterAVM2Item) || (item instanceof SetterAVM2Item)) { + MethodAVM2Item mai = (MethodAVM2Item) item; + if (mai.isStatic() != generateStatic) { + continue; + } + 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); + ts.traits.add(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); + ts.traits.add(tf); + } + } + } + + public ScriptInfo generateScriptInfo(SourceGeneratorLocalData localData, List commands) { + ScriptInfo si = new ScriptInfo(); + generateTraits(false, localData, commands, si.traits); + + 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.add(ins(new GetLocal0Ins())); + mb.code.code.add(ins(new PushScopeIns())); + + 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); + 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 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 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 ReturnVoidIns())); + 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); + + Multiname mname = abc.constants.constant_multiname.get(name_index); + + List abcs = new ArrayList<>(); + abcs.add(abc); + abcs.addAll(allABCs); + + for (ABC a : abcs) { + for (int i = 0; i < a.instance_info.size(); i++) { + 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; + } + } + } + } + return ret; + } } 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 6858c6665..c71cb0349 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 @@ -17,771 +17,812 @@ * 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.Stack; -import java.util.List; -import java.util.ArrayList; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; /** - * This class is a scanner generated by - * JFlex 1.4.3 - * on 20.3.14 15:36 from the specification file + * 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 */ 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 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; - /** - * 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\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 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\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 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); + private static int[] zzUnpackAction() { + int[] result = new int[418]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; } - return j; - } + private static int zzUnpackAction(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + int j = offset; /* index in unpacked array */ - 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 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++); + 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; } - return j; - } - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); + /** + * Translates a state to a row index in the transition table + */ + private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); - 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"; + 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 int [] zzUnpackTrans() { - int [] result = new int[20435]; - 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); + private static int[] zzUnpackRowMap() { + int[] result = new int[418]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; } - return j; - } + private static int zzUnpackRowMap(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ - /* 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 j = offset; /* index in unpacked array */ - /* 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); + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; } - return j; - } - /** the input device */ - private java.io.Reader zzReader; + /** + * The transition table of the DFA + */ + private static final int[] ZZ_TRANS = zzUnpackTrans(); - /** the current state of the DFA */ - private int zzState; + 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 lexical state */ - private int zzLexicalState = YYINITIAL; + private static int[] zzUnpackTrans() { + int[] result = new int[20435]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + private static int zzUnpackTrans(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ - /** the textposition at the last accepting state */ - private int zzMarkedPos; + int j = offset; /* index in unpacked array */ - /** the current text position in the buffer */ - private int zzCurrentPos; + 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; + } - /** 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; + /* 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; - /** number of newlines encountered up to the start of the matched text */ - private int yyline; + /* 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" + }; - /** the number of characters up to the start of the matched text */ - private int yychar; + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; + 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"; - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; + private static int[] zzUnpackAttribute() { + int[] result = new int[418]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; + private static int zzUnpackAttribute(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ - /** denotes if the user-EOF-code has already been executed */ - private boolean zzEOFDone; + int j = offset; /* index in unpacked array */ - /* user code: */ + 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 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); } } @@ -792,878 +833,1005 @@ 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 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)); - } - - /** - * 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 < 2236) { - 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 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; } - /* 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; + /** + * 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)); } - /* finally: fill the buffer with new input */ - int numRead = zzReader.read(zzBuffer, zzEndRead, - zzBuffer.length-zzEndRead); + /** + * 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 */ - 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 - return true; - } - - - /** - * 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(); - } - - - /** - * 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; - } - - - /** - * 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]; - } - - throw new Error(message); - } - - - /** - * 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); - - zzMarkedPos -= number; - } - - - /** - * 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; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - char [] zzBufferL = zzBuffer; - char [] zzCMapL = ZZ_CMAP; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - 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; - } + 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); } - } - - // 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); - } - } + 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; + } + + /* 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 + return true; + } + + /** + * 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(); + } + } + + /** + * 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; + } + + /** + * 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]; + } + + throw new Error(message); + } + + /** + * 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); + } + + zzMarkedPos -= number; + } + + /** + * 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; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char[] zzBufferL = zzBuffer; + char[] zzCMapL = ZZ_CMAP; + + int[] zzTransL = ZZ_TRANS; + int[] zzRowMapL = ZZ_ROWMAP; + int[] zzAttrL = ZZ_ATTRIBUTE; + + 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; + } + } + + } + } + + // 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); + } + } + } + } } 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 554a54797..c044b0487 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 @@ -21,13 +21,11 @@ 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.CallPropertyAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.CallSuperAVM2Item; 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.FindPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FloatValueAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; @@ -76,12 +74,6 @@ import com.jpexs.decompiler.flash.abc.types.ABCException; 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.action.swf4.ConstantIndex; -import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; -import com.jpexs.decompiler.flash.ecma.Null; -import com.jpexs.decompiler.flash.ecma.Undefined; -import com.jpexs.decompiler.flash.helpers.collections.MyEntry; -import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.Loop; import com.jpexs.decompiler.graph.model.AndItem; @@ -93,7 +85,6 @@ import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.DoWhileItem; 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.ParenthesisItem; @@ -116,6 +107,7 @@ public class ActionScriptParser { private long uniqLast = 0; private final boolean debugMode = false; + private static final String AS3_NAMESPACE = "http://adobe.com/AS3/2006/builtin"; private long uniqId() { uniqLast++; @@ -149,7 +141,7 @@ public class ActionScriptParser { s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING_OP); VariableAVM2Item var = new VariableAVM2Item(s.value.toString(), null, false); - ret = new GetPropertyAVM2Item(null, ret, createMultiname(var)); + ret = new GetPropertyAVM2Item(null, ret, var); s = lex(); } lexer.pushback(s); @@ -274,9 +266,9 @@ public class ActionScriptParser { return ret; } - private MethodAVM2Item method(int namespaceKind, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { + private MethodAVM2Item method(boolean isStatic, int namespaceKind, boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { FunctionAVM2Item f = function(withBody, functionName, isMethod, variables); - return new MethodAVM2Item(namespaceKind, functionName, f.paramNames, f.body, variables); + return new MethodAVM2Item(isStatic, namespaceKind, functionName, f.paramTypes, f.paramNames, f.paramValues, f.body, variables, f.retType); } private FunctionAVM2Item function(boolean withBody, String functionName, boolean isMethod, List variables) throws IOException, ParseException { @@ -284,6 +276,8 @@ public class ActionScriptParser { expectedType(SymbolType.PARENT_OPEN); s = lex(); List paramNames = new ArrayList<>(); + List paramTypes = new ArrayList<>(); + List paramValues = new ArrayList<>(); while (s.type != SymbolType.PARENT_CLOSE) { if (s.type != SymbolType.COMMA) { @@ -294,14 +288,31 @@ public class ActionScriptParser { paramNames.add(s.value.toString()); s = lex(); if (s.type == SymbolType.COLON) { - type(variables); + paramTypes.add(type(variables)); s = lex(); + } else { + paramTypes.add(new UnboundedAVM2Item()); + } + if (s.type == SymbolType.ASSIGN) { + paramValues.add(expression(null, isMethod, isMethod, isMethod, variables)); + } else { + if (!paramValues.isEmpty()) { + throw new ParseException("Some of parameters do not have default values", lexer.yyline()); + } } if (!s.isType(SymbolType.COMMA, SymbolType.PARENT_CLOSE)) { expected(s, lexer.yyline(), SymbolType.COMMA, SymbolType.PARENT_CLOSE); } } + s = lex(); + GraphTargetItem retType; + if (s.type == SymbolType.COLON) { + retType = type(variables); + } else { + retType = new UnboundedAVM2Item(); + lexer.pushback(s); + } List body = null; List subvariables = new ArrayList<>(); if (withBody) { @@ -312,31 +323,13 @@ public class ActionScriptParser { } //return new FunctionAVM2Item(null, functionName, paramNames, body, constantPool, -1, subvariables); - return new FunctionAVM2Item(functionName, paramNames, body, subvariables); + return new FunctionAVM2Item(functionName, paramTypes, paramNames, paramValues, body, subvariables, retType); } - private GraphTargetItem traits(boolean isInterface, GraphTargetItem nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, ParseException { - - GraphTargetItem ret = null; - - ParsedSymbol s = null; - MethodAVM2Item constr = null; - List staticFunctions = new ArrayList<>(); - List staticVars = new ArrayList<>(); - List functions = new ArrayList<>(); - List vars = new ArrayList<>(); - - String classNameStr = ""; - if (nameStr instanceof GetPropertyAVM2Item) { - GetPropertyAVM2Item mem = (GetPropertyAVM2Item) nameStr; - if (mem.propertyName instanceof VariableAVM2Item) { - classNameStr = ((VariableAVM2Item) mem.propertyName).getVariableName(); - } - } else if (nameStr instanceof VariableAVM2Item) { - VariableAVM2Item var = (VariableAVM2Item) nameStr; - classNameStr = var.getVariableName(); - } - + private GraphTargetItem traits(String classNameStr, boolean isInterface, List traits) throws ParseException, IOException { + ParsedSymbol s; + GraphTargetItem constr = null; + List variables = new ArrayList<>(); looptrait: while (true) { s = lex(); @@ -345,18 +338,31 @@ public class ActionScriptParser { boolean isGetter = false; boolean isSetter = false; //TODO: namespace name + //TODO: final, dynamic while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.GET, SymbolType.SET)) { if (s.type == SymbolType.STATIC) { + if (isInterface) { + throw new ParseException("Interface cannot have static traits", lexer.yyline()); + } + if (classNameStr == null) { + throw new ParseException("No static keyword allowed here", lexer.yyline()); + } if (isStatic) { throw new ParseException("Only one static identifier 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()); } @@ -386,34 +392,80 @@ public class ActionScriptParser { nsKind = Namespace.KIND_STATIC_PROTECTED; } switch (s.type) { + case CLASS: + if (classNameStr != null) { + throw new ParseException("Nested classes not supported", lexer.yyline()); + } + GraphTargetItem classTypeStr = type(variables); + s = lex(); + GraphTargetItem extendsTypeStr = null; + if (s.type == SymbolType.EXTENDS) { + extendsTypeStr = type(variables); + s = lex(); + } + List implementsTypeStrs = new ArrayList<>(); + if (s.type == SymbolType.IMPLEMENTS) { + do { + GraphTargetItem implementsTypeStr = type(variables); + implementsTypeStrs.add(implementsTypeStr); + s = lex(); + } while (s.type == SymbolType.COMMA); + } + expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); + traits.add((classTraits(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(variables); + s = lex(); + List intExtendsTypeStrs = new ArrayList<>(); + + if (s.type == SymbolType.EXTENDS) { + do { + GraphTargetItem intExtendsTypeStr = type(variables); + intExtendsTypeStrs.add(intExtendsTypeStr); + s = lex(); + } while (s.type == SymbolType.COMMA); + } + expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); + traits.add((classTraits(nsKind, true, interfaceTypeStr, null, intExtendsTypeStrs, variables))); + expectedType(SymbolType.CURLY_CLOSE); + break; + case FUNCTION: s = lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); String fname = s.value.toString(); - if (fname.equals(classNameStr)) { //constructor - constr = (method(nsKind, !isInterface, "", true, variables)); - } else { - //if (!isInterface) { + if (classNameStr != null && fname.equals(classNameStr)) { //constructor + if (isStatic) { + throw new ParseException("Constructor cannot be static", lexer.yyline()); + } + constr = (method(false, nsKind, !isInterface, "", true, variables)); + } else { if (isStatic) { - //Can interfa GraphTargetItem t; - MethodAVM2Item ft = method(nsKind, !isInterface, "", true, variables); - ft.calculatedFunctionName = fname; + MethodAVM2Item ft = method(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(isStatic, nsKind, !isInterface, fname, true, variables); + GraphTargetItem t; if (isGetter) { - GetterAVM2Item g = new GetterAVM2Item(ft.namespaceKind, ft.methodName, ft.paramNames, ft.body, ft.subvariables); - g.calculatedFunctionName = fname; + GetterAVM2Item g = new GetterAVM2Item(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(ft.namespaceKind, ft.methodName, ft.paramNames, ft.body, ft.subvariables); - st.calculatedFunctionName = fname; + SetterAVM2Item st = new SetterAVM2Item(isStatic, ft.namespaceKind, ft.functionName, ft.paramTypes, ft.paramNames, ft.paramValues, ft.body, ft.subvariables, ft.retType); t = st; } else { t = ft; } - staticFunctions.add(ft); - } else { - MethodAVM2Item ft = method(nsKind, !isInterface, "", true, variables); - ft.calculatedFunctionName = fname; - functions.add(ft); + + traits.add(ft); } } //} @@ -421,25 +473,23 @@ public class ActionScriptParser { case CONST: case VAR: boolean isConst = s.type == SymbolType.CONST; - VariableAVM2Item var = qname(variables); - var.setNsKind(nsKind); s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + String vcname = s.value.toString(); + s = lex(); + GraphTargetItem type = null; if (s.type == SymbolType.COLON) { - type(variables); + type = type(variables); s = lex(); } if (s.type == SymbolType.ASSIGN) { GraphTargetItem tar; if (isConst) { - tar = new ConstAVM2Item(nsKind, var, expression(new HashMap(), false, false, true, variables)); + tar = new ConstAVM2Item(isStatic, nsKind, vcname, type, expression(new HashMap(), false, false, true, variables)); } else { - tar = new SlotAVM2Item(nsKind, var, expression(new HashMap(), false, false, true, variables)); - } - if (isStatic) { - staticVars.add(tar); - } else { - vars.add(tar); + tar = new SlotAVM2Item(isStatic, nsKind, vcname, type, expression(new HashMap(), false, false, true, variables)); } + traits.add(tar); s = lex(); } if (s.type != SymbolType.SEMICOLON) { @@ -452,11 +502,34 @@ public class ActionScriptParser { } } + return constr; + } + + private GraphTargetItem classTraits(int namespaceKind, boolean isInterface, GraphTargetItem 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 = ""; + if (nameStr instanceof GetPropertyAVM2Item) { + GetPropertyAVM2Item mem = (GetPropertyAVM2Item) nameStr; + if (mem.propertyName instanceof VariableAVM2Item) { + classNameStr = ((VariableAVM2Item) mem.propertyName).getVariableName(); + } + } else if (nameStr instanceof VariableAVM2Item) { + VariableAVM2Item var = (VariableAVM2Item) nameStr; + classNameStr = var.getVariableName(); + } + + traits(classNameStr, isInterface, traits); if (isInterface) { - return new InterfaceAVM2Item(nameStr, implementsStr, functions); + return new InterfaceAVM2Item(namespaceKind, classNameStr, implementsStr, traits); } else { - return new ClassAVM2Item(nameStr, extendsStr, implementsStr, constr, functions, vars, staticFunctions, staticVars); + return new ClassAVM2Item(namespaceKind, classNameStr, extendsStr, implementsStr, constr, traits); } } @@ -546,42 +619,6 @@ public class ActionScriptParser { throw new ParseException("Not a property", lexer.yyline()); } break; - case CLASS: - GraphTargetItem classTypeStr = type(variables); - s = lex(); - GraphTargetItem extendsTypeStr = null; - if (s.type == SymbolType.EXTENDS) { - extendsTypeStr = type(variables); - s = lex(); - } - List implementsTypeStrs = new ArrayList<>(); - if (s.type == SymbolType.IMPLEMENTS) { - do { - GraphTargetItem implementsTypeStr = type(variables); - implementsTypeStrs.add(implementsTypeStr); - s = lex(); - } while (s.type == SymbolType.COMMA); - } - expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); - ret = (traits(false, classTypeStr, extendsTypeStr, implementsTypeStrs, variables)); - expectedType(SymbolType.CURLY_CLOSE); - break; - case INTERFACE: - GraphTargetItem interfaceTypeStr = type(variables); - s = lex(); - List intExtendsTypeStrs = new ArrayList<>(); - - if (s.type == SymbolType.EXTENDS) { - do { - GraphTargetItem intExtendsTypeStr = type(variables); - intExtendsTypeStrs.add(intExtendsTypeStr); - s = lex(); - } while (s.type == SymbolType.COMMA); - } - expected(s, lexer.yyline(), SymbolType.CURLY_OPEN); - ret = (traits(true, interfaceTypeStr, null, intExtendsTypeStrs, variables)); - expectedType(SymbolType.CURLY_CLOSE); - break; case FUNCTION: s = lexer.lex(); expected(s, lexer.yyline(), SymbolType.IDENTIFIER); @@ -889,15 +926,14 @@ public class ActionScriptParser { s = lex(); boolean found = false; List> catchCommands = null; - List catchExceptions = new ArrayList<>(); + List catchExceptions = new ArrayList<>(); if (s.type == SymbolType.CATCH) { expectedType(SymbolType.PARENT_OPEN); VariableAVM2Item ename = qname(variables); expectedType(SymbolType.COLON); VariableAVM2Item etype = name(registerVars, inFunction, inMethod, variables); ABCException e = new ABCException(); - //TODO:handle exceptions !!! - catchExceptions.add(e); + catchExceptions.add(new ExceptionSAVM2item(etype, ename)); expectedType(SymbolType.PARENT_CLOSE); catchCommands = new ArrayList<>(); List cc = new ArrayList<>(); @@ -917,7 +953,9 @@ public class ActionScriptParser { expected(s, lexer.yyline(), SymbolType.CATCH, SymbolType.FINALLY); } lexer.pushback(s); - ret = new TryAVM2Item(tryCommands, catchExceptions, catchCommands, finallyCommands); + TryAVM2Item tai = new TryAVM2Item(tryCommands, null, catchCommands, finallyCommands); + tai.catchExceptions2 = catchExceptions; + ret = tai; break; case THROW: ret = new ThrowAVM2Item(null, expression(registerVars, inFunction, inMethod, true, variables)); @@ -1395,55 +1433,80 @@ public class ActionScriptParser { return ret; } - private FullMultinameAVM2Item createMultiname(VariableAVM2Item s) throws IOException, ParseException { - /*int index = constantPool.indexOf(s); - if (index == -1) { - constantPool.add(s); - index = constantPool.indexOf(s); - } - return new FullMultinameAVM2Item(null, index);*/ - return null; - } private ActionScriptLexer lexer = null; private List constantPool; - public List treeFromString(String str, List constantPool) throws ParseException, IOException { - List retTree = new ArrayList<>(); + private PackageAVM2Item parsePackage() throws IOException, ParseException { + ParsedSymbol s = lex(); + expected(s, lexer.yyline(), SymbolType.PACKAGE); + String name = ""; + s = lex(); + if (s.type != SymbolType.CURLY_OPEN) { + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + name = s.value.toString(); + } + while (s.type != SymbolType.CURLY_OPEN) { + expected(s, lexer.yyline(), SymbolType.DOT); + s = lex(); + expected(s, lexer.yyline(), SymbolType.IDENTIFIER); + name += "." + s.value.toString(); + } + List items = new ArrayList<>(); + traits(null, false, items); + expectedType(SymbolType.CURLY_CLOSE); + return new PackageAVM2Item(name, items); + } + + public PackageAVM2Item packageFromString(String str, List constantPool) throws ParseException, IOException { this.constantPool = constantPool; lexer = new ActionScriptLexer(new StringReader(str)); List vars = new ArrayList<>(); - retTree.addAll(commands(new Stack(), new HashMap(), new HashMap(), false, false, 0, vars)); - for (VariableAVM2Item v : vars) { - String varName = v.getVariableName(); - GraphTargetItem stored = v.getStoreValue(); - if (v.isDefinition()) { - //v.setBoxedValue(new DefineLocalAVM2Item(null, pushConst(varName), stored)); //FIXME!!! - } else { - if (stored != null) { - //v.setBoxedValue(new SetVariableAVM2Item(null, pushConst(varName), stored)); //FIXME!!! - } else { - //v.setBoxedValue(new GetVariableAVM2Item(null, pushConst(varName))); //FIXME!!! - } - } - } + PackageAVM2Item ret = parsePackage(); + /*for (VariableAVM2Item v : vars) { + String varName = v.getVariableName(); + GraphTargetItem stored = v.getStoreValue(); + if (v.isDefinition()) { + //v.setBoxedValue(new DefineLocalAVM2Item(null, pushConst(varName), stored)); //FIXME!!! + } else { + if (stored != null) { + //v.setBoxedValue(new SetVariableAVM2Item(null, pushConst(varName), stored)); //FIXME!!! + } else { + //v.setBoxedValue(new GetVariableAVM2Item(null, pushConst(varName))); //FIXME!!! + } + } + }*/ if (lexer.lex().type != SymbolType.EOF) { throw new ParseException("Parsing finisned before end of the file", lexer.yyline()); } - return retTree; + return ret; } - public ScriptInfo scriptFromTree(List tree, ABC abc) { - AVM2SourceGenerator gen = new AVM2SourceGenerator(abc); + public ScriptInfo scriptFromTree(PackageAVM2Item pkg, ABC abc, List otherABCs) { + AVM2SourceGenerator gen = new AVM2SourceGenerator(abc, new ArrayList()); List ret = new ArrayList<>(); SourceGeneratorLocalData localData = new SourceGeneratorLocalData( new HashMap(), 0, Boolean.FALSE, 0); - return gen.generateScriptInfo(localData, tree); + String className = ""; + for (GraphTargetItem it : pkg.items) { + if (it instanceof ClassAVM2Item) { + className = ((ClassAVM2Item) it).className.toString(); + } + } + localData.addNamespace(Namespace.KIND_PRIVATE, pkg.packageName + ":" + className); + localData.addNamespace(Namespace.KIND_PACKAGE, ""); + localData.addNamespace(Namespace.KIND_PRIVATE, className + ".as"); + localData.addNamespace(Namespace.KIND_PACKAGE, pkg.packageName); + localData.addNamespace(Namespace.KIND_PACKAGE_INTERNAL, pkg.packageName); + localData.addNamespace(Namespace.KIND_NAMESPACE, AS3_NAMESPACE); + localData.addNamespace(Namespace.KIND_PROTECTED, pkg.packageName + ":" + className); + localData.addNamespace(Namespace.KIND_STATIC_PROTECTED, pkg.packageName + ":" + className); + return gen.generateScriptInfo(localData, pkg.items); } - public ScriptInfo scriptFromString(String s,ABC abc) throws ParseException, IOException { + public ScriptInfo scriptFromString(String s, ABC abc, List otherABCs) throws ParseException, IOException { List constantPool = new ArrayList<>(); - List tree = treeFromString(s, constantPool); - return scriptFromTree(tree, abc); + PackageAVM2Item pkg = packageFromString(s, constantPool); + return scriptFromTree(pkg, abc, otherABCs); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/BreakJumpIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/BreakJumpIns.java new file mode 100644 index 000000000..e62d9ca97 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/BreakJumpIns.java @@ -0,0 +1,36 @@ +/* + * 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.abc.avm2.instructions.jumps.JumpIns; + +/** + * + * @author JPEXS + */ +public class BreakJumpIns extends JumpIns { + + private long loopId; + + public BreakJumpIns(long loopId) { + this.loopId = loopId; + } + + public long getLoopId() { + return loopId; + } +} 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 29fd25f39..227948ed8 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 @@ -27,42 +27,30 @@ import java.util.List; public class ClassAVM2Item extends AVM2Item implements Block { - public List functions; - public List staticFunctions; + public List traits; public GraphTargetItem extendsOp; public List implementsOp; - public GraphTargetItem className; + public String className; public GraphTargetItem constructor; - public List vars; - public List staticVars; + public int namespaceKind; @Override public List> getSubs() { List> ret = new ArrayList<>(); - if (functions != null) { - ret.add(functions); - } - if (staticFunctions != null) { - ret.add(staticFunctions); + if (traits != null) { + ret.add(traits); } return ret; } - public ClassAVM2Item(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List functions, List vars, List staticFunctions, List staticVars) { + public ClassAVM2Item(int namespaceKind, String className, GraphTargetItem extendsOp, List implementsOp, GraphTargetItem constructor, List traits) { super(null, NOPRECEDENCE); this.className = className; - this.functions = functions; - this.vars = vars; + this.traits = traits; this.extendsOp = extendsOp; this.implementsOp = implementsOp; - this.staticFunctions = staticFunctions; - this.staticVars = staticVars; this.constructor = constructor; - - List allFunc = new ArrayList<>(functions); - if (constructor != null) { - allFunc.add(constructor); - } + this.namespaceKind = namespaceKind; } @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 1b0bd5cdd..c07e3a684 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 @@ -14,7 +14,6 @@ * 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.abc.avm2.model.AVM2Item; @@ -27,22 +26,32 @@ import com.jpexs.decompiler.graph.model.LocalData; * @author JPEXS */ public class ConstAVM2Item extends AVM2Item { + private final int nsKind; + private boolean isStatic; + public String var; + public GraphTargetItem type; public int getNsKind() { return nsKind; } - - - public ConstAVM2Item(int nsKind,VariableAVM2Item var,GraphTargetItem value) { - super(null,NOPRECEDENCE); + + public boolean isStatic() { + return isStatic; + } + + public ConstAVM2Item(boolean isStatic, int nsKind, String var, GraphTargetItem type, GraphTargetItem value) { + super(null, NOPRECEDENCE); this.nsKind = nsKind; this.value = value; + this.isStatic = isStatic; + this.var = var; + this.type = type; } @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return writer; //TODO } - + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ContinueJumpIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ContinueJumpIns.java new file mode 100644 index 000000000..4ded30d12 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ContinueJumpIns.java @@ -0,0 +1,37 @@ +/* + * 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.abc.avm2.instructions.jumps.JumpIns; + +/** + * + * @author JPEXS + */ +public class ContinueJumpIns extends JumpIns { + + private long loopId; + + public ContinueJumpIns(long loopId) { + this.loopId = loopId; + } + + public long getLoopId() { + return loopId; + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java new file mode 100644 index 000000000..997bf79a2 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java @@ -0,0 +1,41 @@ +/* + * 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.abc.avm2.instructions.AVM2Instruction; + +/** + * + * @author JPEXS + */ +public class ExceptionMarkAVM2Instruction extends AVM2Instruction { + + public int markType; + public int exceptionId; + + public ExceptionMarkAVM2Instruction(int exceptionId, int markType) { + super(0, null, new int[0], new byte[0]); + this.markType = markType; + this.exceptionId = exceptionId; + } + + @Override + public byte[] getBytes() { + return new byte[0]; + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionSAVM2item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionSAVM2item.java new file mode 100644 index 000000000..3d9e51f7d --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionSAVM2item.java @@ -0,0 +1,44 @@ +/* + * 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.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; + +/** + * + * @author JPEXS + */ +public class ExceptionSAVM2item extends AVM2Item { + + public GraphTargetItem type; + public GraphTargetItem name; + + public ExceptionSAVM2item(GraphTargetItem type, GraphTargetItem name) { + super(null, NOPRECEDENCE); + this.type = type; + this.name = name; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; + } + +} 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 e3f411cf8..282a8f32f 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 @@ -14,7 +14,6 @@ * 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.abc.avm2.model.AVM2Item; @@ -27,27 +26,31 @@ import java.util.List; * * @author JPEXS */ -public class FunctionAVM2Item extends AVM2Item{ +public class FunctionAVM2Item extends AVM2Item { public String calculatedFunctionName; public String functionName; public List paramNames; public List body; public List subvariables; - - public FunctionAVM2Item(String functionName,List paramNames,List body, List subvariables) { + public List paramTypes; + public List paramValues; + public GraphTargetItem retType; + + public FunctionAVM2Item(String functionName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(null, NOPRECEDENCE); this.paramNames = paramNames; - this.body = body; + this.body = body; this.functionName = functionName; this.subvariables = subvariables; + this.paramTypes = paramTypes; + this.paramValues = paramValues; + this.retType = retType; } - - @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return writer; //todo? } - + } 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 d8023f693..1bc1939ce 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 petrik + * 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 @@ -14,7 +14,6 @@ * 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.graph.GraphTargetItem; @@ -22,12 +21,12 @@ import java.util.List; /** * - * @author petrik + * @author JPEXS */ -public class GetterAVM2Item extends MethodAVM2Item{ +public class GetterAVM2Item extends MethodAVM2Item { - public GetterAVM2Item(int namespaceKind, String methodName, List paramNames, List body, List subvariables) { - super(namespaceKind, methodName, paramNames, body, subvariables); + 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); } - + } 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 bce239e23..c4c3bf5e0 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 @@ -16,33 +16,29 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; -import com.jpexs.decompiler.flash.SourceGeneratorLocalData; -import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.action.model.ActionItem; -import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; 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.ArrayList; import java.util.List; /** * * @author JPEXS */ -public class InterfaceAVM2Item extends ActionItem { +public class InterfaceAVM2Item extends AVM2Item { - public GraphTargetItem name; + public String name; public List superInterfaces; public List methods; + public int namespaceKind; - public InterfaceAVM2Item(GraphTargetItem name, List superInterfaces, List methods) { + public InterfaceAVM2Item(int namespaceKind, String name, List superInterfaces, List traits) { super(null, NOPRECEDENCE); this.name = name; this.superInterfaces = superInterfaces; - this.methods = methods; + this.methods = traits; + this.namespaceKind = namespaceKind; } @Override @@ -55,14 +51,6 @@ public class InterfaceAVM2Item extends ActionItem { return false; } - @Override - public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { - List ret = new ArrayList<>(); - ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; - ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, null, null, null, null, null)); - return ret; - } - @Override public boolean hasReturnValue() { return false; 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 d3b118a95..9746bfa21 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 @@ -14,10 +14,8 @@ * 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.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -27,29 +25,24 @@ import java.util.List; * * @author JPEXS */ -public class MethodAVM2Item extends AVM2Item{ +public class MethodAVM2Item extends FunctionAVM2Item { - public String calculatedFunctionName; public int namespaceKind; - public String methodName; - public List paramNames; - public List body; - public List subvariables; - - public MethodAVM2Item(int namespaceKind,String methodName,List paramNames,List body, List subvariables) { - super(null, NOPRECEDENCE); + private boolean isStatic; + + public MethodAVM2Item(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.paramNames = paramNames; - this.body = body; - this.methodName = methodName; - this.subvariables = subvariables; + this.isStatic = isStatic; + } + + public boolean isStatic() { + return isStatic; } - - @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return writer; //todo? } - + } 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 new file mode 100644 index 000000000..8916db3d2 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java @@ -0,0 +1,45 @@ +/* + * 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.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.model.LocalData; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class PackageAVM2Item extends AVM2Item { + + public List items; + public String packageName; + + public PackageAVM2Item(String packageName, List items) { + super(null, NOPRECEDENCE); + this.items = items; + this.packageName = packageName; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java index b9d2613e6..1ea45dbfb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ParsedSymbol.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; - /** * * @author JPEXS 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 0bc83844c..f0f11f14e 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 petrik + * 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 @@ -14,7 +14,6 @@ * 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.graph.GraphTargetItem; @@ -22,12 +21,12 @@ import java.util.List; /** * - * @author petrik + * @author JPEXS */ -public class SetterAVM2Item extends MethodAVM2Item{ +public class SetterAVM2Item extends MethodAVM2Item { - public SetterAVM2Item(int namespaceKind, String methodName, List paramNames, List body, List subvariables) { - super(namespaceKind, methodName, paramNames, body, subvariables); + 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); } - + } 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 44cd27b34..77c2c0e71 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 @@ -14,7 +14,6 @@ * 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.abc.avm2.model.AVM2Item; @@ -27,22 +26,32 @@ import com.jpexs.decompiler.graph.model.LocalData; * @author JPEXS */ public class SlotAVM2Item extends AVM2Item { + private final int nsKind; + private boolean isStatic; + public String var; + public GraphTargetItem type; public int getNsKind() { return nsKind; } - - - public SlotAVM2Item(int nsKind,VariableAVM2Item var, GraphTargetItem value) { - super(null,NOPRECEDENCE); + + public boolean isStatic() { + return isStatic; + } + + public SlotAVM2Item(boolean isStatic, int nsKind, String var, GraphTargetItem type, GraphTargetItem value) { + super(null, NOPRECEDENCE); this.nsKind = nsKind; this.value = value; + this.isStatic = isStatic; + this.var = var; + this.type = type; } @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return writer; //TODO } - + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnboundedAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnboundedAVM2Item.java new file mode 100644 index 000000000..7a4b694a7 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnboundedAVM2Item.java @@ -0,0 +1,38 @@ +/* + * 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.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.model.LocalData; + +/** + * + * @author JPEXS + */ +public class UnboundedAVM2Item extends AVM2Item { + + public UnboundedAVM2Item() { + super(null, NOPRECEDENCE); + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return writer; + } + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java index f6d76cb92..c73c442a5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/VariableAVM2Item.java @@ -38,7 +38,7 @@ public class VariableAVM2Item extends AVM2Item { private GraphTargetItem storeValue; private boolean definition; private GraphTargetItem index; - private int nsKind=-1; + private int nsKind = -1; public void setDefinition(boolean definition) { this.definition = definition; @@ -59,11 +59,6 @@ public class VariableAVM2Item extends AVM2Item { public int getNsKind() { return nsKind; } - - - - - public void setStoreValue(GraphTargetItem storeValue) { this.storeValue = storeValue; @@ -139,4 +134,9 @@ public class VariableAVM2Item extends AVM2Item { return false; } + @Override + public String toString() { + return variableName; + } + } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java index c14bbebde..967f9207a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java @@ -28,14 +28,14 @@ import java.util.List; public class ScriptInfo { public int init_index; //MethodInfo - public Traits traits; + public Traits traits = new Traits(); public List> getPacks(ABC abc, int scriptIndex) { List> ret = new ArrayList<>(); List otherTraits = new ArrayList<>(); - for (int j = 0; j < traits.traits.length; j++) { - Trait t = traits.traits[j]; + for (int j = 0; j < traits.traits.size(); j++) { + Trait t = traits.traits.get(j); Multiname name = t.getName(abc); Namespace ns = name.getNamespace(abc.constants); if (!((ns.kind == Namespace.KIND_PACKAGE_INTERNAL) @@ -43,8 +43,8 @@ public class ScriptInfo { otherTraits.add(j); } } - for (int j = 0; j < traits.traits.length; j++) { - Trait t = traits.traits[j]; + for (int j = 0; j < traits.traits.size(); j++) { + Trait t = traits.traits.get(j); Multiname name = t.getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE_INTERNAL) diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 894e7e964..a9733e186 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -436,7 +436,7 @@ public class TraitClass extends Trait implements TraitWithSlot { if (bodyIndex != -1) { if (!classInitializerIsEmpty) { writer.newLine(); - writer.startTrait(abc.class_info.get(class_info).static_traits.traits.length + abc.instance_info.get(class_info).instance_traits.traits.length + 1); + writer.startTrait(abc.class_info.get(class_info).static_traits.traits.size() + abc.instance_info.get(class_info).instance_traits.traits.size() + 1); writer.appendNoHilight("{").newLine(); abc.bodies.get(bodyIndex).toString(path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", exportMode, true, scriptIndex, class_info, abc, this, abc.constants, abc.method_info, new Stack(), true, writer, fullyQualifiedNames, abc.class_info.get(class_info).static_traits); writer.appendNoHilight("}").newLine(); @@ -464,7 +464,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } writer.newLine(); - writer.startTrait(abc.class_info.get(class_info).static_traits.traits.length + abc.instance_info.get(class_info).instance_traits.traits.length); + writer.startTrait(abc.class_info.get(class_info).static_traits.traits.size() + abc.instance_info.get(class_info).instance_traits.traits.size()); writer.appendNoHilight(modifier); writer.appendNoHilight("function "); writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info.get(class_info).name_index).getName(abc.constants, new ArrayList()/*do not want full names here*/)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index 37cc3299d..1ea410656 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -90,8 +90,8 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { if (assignedValue != null) { if (parent instanceof TraitClass) { TraitClass tc = (TraitClass) parent; - int traitInitId = abc.class_info.get(tc.class_info).static_traits.traits.length - + abc.instance_info.get(tc.class_info).instance_traits.traits.length + 1; + int traitInitId = abc.class_info.get(tc.class_info).static_traits.traits.size() + + abc.instance_info.get(tc.class_info).instance_traits.traits.size() + 1; int initMethod = abc.class_info.get(tc.class_info).cinit_index; writer.startTrait(traitInitId); writer.startMethod(initMethod); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index d19137968..c9d554e69 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.tags.ABCContainerTag; import java.io.Serializable; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -36,12 +35,11 @@ import java.util.logging.Logger; public class Traits implements Serializable { - public Trait[] traits = new Trait[0]; + public List traits = new ArrayList<>(); public int addTrait(Trait t) { - traits = Arrays.copyOf(traits, traits.length + 1); - traits[traits.length - 1] = t; - return traits.length - 1; + traits.add(t); + return traits.size() - 1; } public int removeTraps(int scriptIndex, int classIndex, boolean isStatic, ABC abc, String path) throws InterruptedException { @@ -55,22 +53,22 @@ public class Traits implements Serializable { @Override public String toString() { String s = ""; - for (int t = 0; t < traits.length; t++) { + for (int t = 0; t < traits.size(); t++) { if (t > 0) { s += "\r\n"; } - s += traits[t].toString(); + s += traits.get(t).toString(); } return s; } public String toString(ABC abc, List fullyQualifiedNames) { String s = ""; - for (int t = 0; t < traits.length; t++) { + for (int t = 0; t < traits.size(); t++) { if (t > 0) { s += "\r\n"; } - s += traits[t].toString(abc, fullyQualifiedNames); + s += traits.get(t).toString(abc, fullyQualifiedNames); } return s; } @@ -121,13 +119,13 @@ public class Traits implements Serializable { } public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { - for (int t = 0; t < traits.length; t++) { + for (int t = 0; t < traits.size(); t++) { writer.newLine(); - Trait trait = traits[t]; + Trait trait = traits.get(t); int h = t; if (classIndex != -1) { if (!isStatic) { - h += abc.class_info.get(classIndex).static_traits.traits.length; + h += abc.class_info.get(classIndex).static_traits.traits.size(); } } if (trait instanceof TraitClass) { @@ -150,9 +148,9 @@ public class Traits implements Serializable { } public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { - if (!parallel || traits.length < 2) { - for (int t = 0; t < traits.length; t++) { - TraitConvertTask task = new TraitConvertTask(traits[t], parent, makePackages, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); + if (!parallel || traits.size() < 2) { + for (int t = 0; t < traits.size(); t++) { + TraitConvertTask task = new TraitConvertTask(traits.get(t), parent, makePackages, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); task.call(); } } else { @@ -160,8 +158,8 @@ public class Traits implements Serializable { List> futureResults = null; futureResults = new ArrayList<>(); - for (int t = 0; t < traits.length; t++) { - TraitConvertTask task = new TraitConvertTask(traits[t], parent, makePackages, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); + for (int t = 0; t < traits.size(); t++) { + TraitConvertTask task = new TraitConvertTask(traits.get(t), parent, makePackages, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); Future future = executor.submit(task); futureResults.add(future); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java index 8b92fb865..bcc898efa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java @@ -43,23 +43,23 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { NulWriter nulWriter = new NulWriter(); if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } } - ((TraitSlotConst) traits.traits[traitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); writer.appendNoHilight(super.toString(abcTags, abc) + " "); if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } } - ((TraitSlotConst) traits.traits[traitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); return writer.toString(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java index ce20464df..965a5f1ce 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java @@ -50,12 +50,12 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { if (!isInitializer) { if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } } - ((TraitMethodGetterSetter) traits.traits[traitIndex]).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); + ((TraitMethodGetterSetter) traits.traits.get(traitIndex)).convertHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList(), false); } HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); @@ -70,13 +70,13 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { } else { if (parentTraitIndex > -1) { if (isStatic) { - ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } else { - ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits[parentTraitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } writer.appendNoHilight(" "); } - ((TraitMethodGetterSetter) traits.traits[traitIndex]).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); + ((TraitMethodGetterSetter) traits.traits.get(traitIndex)).toStringHeader(null, "", abcTags, abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList(), false); } return writer.toString(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java index eb94a6007..f56ad28db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FilenameFilter; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -39,6 +40,7 @@ import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -592,4 +594,33 @@ public class Configuration { ret.beginBlockOnNewLine = beginBlockOnNewLine.get(); return ret; } + + public static File getPlayerSWC() { + try { + String home = getFFDecHome(); + File libsdir = new File(home + "flashlib"); + if (libsdir.exists()) { + File libs[] = libsdir.listFiles(new FilenameFilter() { + + @Override + public boolean accept(File dir, String name) { + return name.toLowerCase().startsWith("playerglobal"); + } + }); + List libnames = new ArrayList<>(); + for (File f : libs) { + libnames.add(f.getName()); + } + Collections.sort(libnames); + if (!libnames.isEmpty()) { + return new File(libsdir.getAbsolutePath() + File.separator + libnames.get(libnames.size() - 1)); + } else { + return null; + } + } + } catch (IOException ex) { + + } + return null; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index cb729fb81..737379224 100644 --- a/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -941,7 +941,7 @@ public class CommandLineArgumentParser { private static E enumFromStr(String str, Class cls) { E[] vals = cls.getEnumConstants(); - if(str == null){ + if (str == null) { return vals[0]; } for (E e : vals) { diff --git a/trunk/src/com/jpexs/decompiler/flash/exporters/modes/FontExportMode.java b/trunk/src/com/jpexs/decompiler/flash/exporters/modes/FontExportMode.java index 00fa46d13..65003b8cf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/exporters/modes/FontExportMode.java +++ b/trunk/src/com/jpexs/decompiler/flash/exporters/modes/FontExportMode.java @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - package com.jpexs.decompiler.flash.exporters.modes; /** @@ -22,5 +21,6 @@ package com.jpexs.decompiler.flash.exporters.modes; * @author JPEXS */ public enum FontExportMode { + TTF } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 090b58c8b..538cead07 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1545,7 +1545,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec FrameNodeItem fni = (FrameNodeItem) d.getItem(); Tag par = fni.getParent(); - int frame = fni.getFrame()-1; //Fix to zero based + int frame = fni.getFrame() - 1; //Fix to zero based int parentId = 0; if (par != null) { parentId = ((CharacterTag) par).getCharacterId(); @@ -1579,7 +1579,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec ret.addAll(swf.exportSounds(handler, selFile + File.separator + "sounds", sounds, export.getValue(SoundExportMode.class))); ret.addAll(SWF.exportBinaryData(handler, selFile + File.separator + "binaryData", binaryData, export.getValue(BinaryDataExportMode.class))); ret.addAll(swf.exportFonts(handler, selFile + File.separator + "fonts", fonts, export.getValue(FontExportMode.class))); - + for (Entry> entry : frames.entrySet()) { ret.addAll(swf.exportFrames(handler, selFile + File.separator + "frames", entry.getKey(), entry.getValue(), export.getValue(FramesExportMode.class))); } @@ -1634,7 +1634,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec return treeNode.getItem().getSwf(); } - + private void clearCache() { if (abcPanel != null) { abcPanel.decompiledTextArea.clearScriptCache(); @@ -2849,12 +2849,12 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec if (frameCnt > fn.getFrame()) { break; } - + if (item instanceof DoActionTag || item instanceof DoInitActionTag) { // todo: Maybe DoABC tags should be removed, too continue; } - + Tag t = (Tag) item; Set needed = t.getDeepNeededCharacters(swf.characters); for (int n : needed) { @@ -3316,7 +3316,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec tf.setVisible(true); return; } - + TimelineFrame tf = new TimelineFrame(swf); tf.setVisible(true); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java index 4b328200b..d9f4bffb7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/PreviewImage.java @@ -69,7 +69,7 @@ public class PreviewImage extends JPanel { static { executor = Executors.newFixedThreadPool(Configuration.parallelSpeedUp.get() ? Configuration.parallelThreadCount.get() : 1); } - + /** * * @param mainPanel diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 5dbf6c1dd..f31445af7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -618,7 +618,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se code.code.add(new AVM2Instruction(0, new ReturnVoidIns(), new int[0], new byte[0])); body.code = code; Traits traits = new Traits(); - traits.traits = new Trait[0]; + traits.traits = new ArrayList<>(); body.traits = traits; abc.addMethodBody(body); mi.setBody(body); @@ -640,7 +640,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se if (isStatic) { traitId = abc.class_info.get(class_index).static_traits.addTrait(t); } else { - traitId = abc.class_info.get(class_index).static_traits.traits.length + abc.instance_info.get(class_index).instance_traits.addTrait(t); + traitId = abc.class_info.get(class_index).static_traits.traits.size() + abc.instance_info.get(class_index).instance_traits.addTrait(t); } reload(); decompiledTextArea.gotoTrait(traitId); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index d1557909e..a63e87095 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -21,9 +21,9 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.UnknownInstructionCode; import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph; +import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler; -import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.configuration.Configuration; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java index db4600b4b..ea234b375 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java @@ -18,8 +18,8 @@ package com.jpexs.decompiler.flash.gui.abc; import com.jpexs.decompiler.flash.AppStrings; import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException; +import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser; import com.jpexs.decompiler.flash.abc.types.ValueKind; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.configuration.Configuration; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java index cc787ea30..b6b776e51 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java @@ -60,23 +60,23 @@ public class TraitsListItem { public int getGlobalTraitId() { if (type == Type.INITIALIZER) { if (!isStatic) { - return abc.class_info.get(classIndex).static_traits.traits.length + abc.instance_info.get(classIndex).instance_traits.traits.length; + return abc.class_info.get(classIndex).static_traits.traits.size() + abc.instance_info.get(classIndex).instance_traits.traits.size(); } else { - return abc.class_info.get(classIndex).static_traits.traits.length + abc.instance_info.get(classIndex).instance_traits.traits.length + 1; + return abc.class_info.get(classIndex).static_traits.traits.size() + abc.instance_info.get(classIndex).instance_traits.traits.size() + 1; } } if (isStatic) { return index; } else { - return abc.class_info.get(classIndex).static_traits.traits.length + index; + return abc.class_info.get(classIndex).static_traits.traits.size() + index; } } public String toStringName() { if ((type != Type.INITIALIZER) && isStatic) { - return abc.class_info.get(classIndex).static_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); + return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList()); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - return abc.instance_info.get(classIndex).instance_traits.traits[index].getName(abc).getName(abc.constants, new ArrayList()); + return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList()); } else if (!isStatic) { return "__" + STR_INSTANCE_INITIALIZER; } else { @@ -89,14 +89,14 @@ public class TraitsListItem { String s = ""; try { if ((type != Type.INITIALIZER) && isStatic) { - abc.class_info.get(classIndex).static_traits.traits[index].convertHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits.get(index).convertHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); - abc.class_info.get(classIndex).static_traits.traits[index].toStringHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits.get(index).toStringHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); s = writer.toString(); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - abc.instance_info.get(classIndex).instance_traits.traits[index].convertHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits.get(index).convertHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false); - abc.instance_info.get(classIndex).instance_traits.traits[index].toStringHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits.get(index).toStringHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); s = writer.toString(); } else if (!isStatic) { s = STR_INSTANCE_INITIALIZER; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java index 971dfa424..447f6ed82 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListModel.java @@ -48,11 +48,11 @@ public final class TraitsListModel implements ListModel { private void reset() { items = new ArrayList<>(); - for (int t = 0; t < abc.class_info.get(classIndex).static_traits.traits.length; t++) { - items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info.get(classIndex).static_traits.traits[t]), t, true, abcTags, abc, classIndex, scriptIndex)); + for (int t = 0; t < abc.class_info.get(classIndex).static_traits.traits.size(); t++) { + items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info.get(classIndex).static_traits.traits.get(t)), t, true, abcTags, abc, classIndex, scriptIndex)); } - for (int t = 0; t < abc.instance_info.get(classIndex).instance_traits.traits.length; t++) { - items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info.get(classIndex).instance_traits.traits[t]), t, false, abcTags, abc, classIndex, scriptIndex)); + for (int t = 0; t < abc.instance_info.get(classIndex).instance_traits.traits.size(); t++) { + items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info.get(classIndex).instance_traits.traits.get(t)), t, false, abcTags, abc, classIndex, scriptIndex)); } items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, false, abcTags, abc, classIndex, scriptIndex)); items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, true, abcTags, abc, classIndex, scriptIndex)); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java index ab30ec76e..b1ea37b61 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java @@ -102,12 +102,12 @@ public class UsageFrame extends AppFrame implements ActionListener, MouseListene traitIndex = tmu.traitIndex; } if (!tmu.isStatic) { - traitIndex += abc.class_info.get(tmu.classIndex).static_traits.traits.length; + traitIndex += abc.class_info.get(tmu.classIndex).static_traits.traits.size(); } if (tmu instanceof MethodMultinameUsage) { MethodMultinameUsage mmu = (MethodMultinameUsage) usage; if (mmu.isInitializer == true) { - traitIndex = abc.class_info.get(mmu.classIndex).static_traits.traits.length + abc.instance_info.get(mmu.classIndex).instance_traits.traits.length + (mmu.isStatic ? 1 : 0); + traitIndex = abc.class_info.get(mmu.classIndex).static_traits.traits.size() + abc.instance_info.get(mmu.classIndex).instance_traits.traits.size() + (mmu.isStatic ? 1 : 0); } } abcPanel.decompiledTextArea.gotoTrait(traitIndex); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/timeline/TimelineBodyPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/timeline/TimelineBodyPanel.java index 5460aabd4..f4e806f82 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/timeline/TimelineBodyPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/timeline/TimelineBodyPanel.java @@ -102,7 +102,7 @@ public class TimelineBodyPanel extends JPanel implements MouseListener { if (end_d - start_d + 1 < 0) { return; } - + boolean keyfound[] = new boolean[end_d - start_d + 1]; for (int f = start_f; f <= end_f; f++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index a19493bca..c80920d98 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -215,7 +215,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { public void setModified() { setModified(true); } - + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index 9cecff061..db8d80503 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -206,7 +206,7 @@ public class DefineFont3Tag extends FontTag { fontFlagsWideOffsets = true; } } - + sos.writeUI16(fontId); sos.writeUB(1, fontFlagsHasLayout ? 1 : 0); sos.writeUB(1, fontFlagsShiftJIS ? 1 : 0); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index 7f7c038f7..e803fca3f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -150,7 +150,7 @@ public class DoActionTag extends Tag implements ASMSource { public void setModified() { setModified(true); } - + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index b3fda9f70..ce76d289e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -163,7 +163,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { public void setModified() { setModified(true); } - + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java index 439415dd0..faa0e86a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -105,11 +105,11 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ public Timelined getTimelined() { return timelined; } - + public void setTimelined(Timelined timelined) { this.timelined = timelined; } - + /** * Constructor * @@ -125,7 +125,7 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ this.data = data; this.pos = pos; this.swf = swf; - if(data == null){//it is tag build by constructor + if (data == null) {//it is tag build by constructor this.data = new byte[0]; modified = true; } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java index 84c7a01e6..62944fd53 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java @@ -62,7 +62,7 @@ public interface ASMSource extends TreeItem { * @param actions Action list */ public void setActions(List actions); - + public void setModified(); public byte[] getActionBytes(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 4629642de..a4543a389 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -286,24 +286,24 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable @Override public String getCharacterExportFileName() { - return super.getCharacterExportFileName()+"_"+getFontName(); - } - - public DefineFontNameTag getFontNameTag(){ - for(Tag t:swf.tags){ - if(t instanceof DefineFontNameTag){ - DefineFontNameTag dfn=(DefineFontNameTag)t; - if(dfn.fontId==getFontId()){ + return super.getCharacterExportFileName() + "_" + getFontName(); + } + + public DefineFontNameTag getFontNameTag() { + for (Tag t : swf.tags) { + if (t instanceof DefineFontNameTag) { + DefineFontNameTag dfn = (DefineFontNameTag) t; + if (dfn.fontId == getFontId()) { return dfn; } } } return null; - } - - public String getCopyright(){ - DefineFontNameTag dfn=getFontNameTag(); - if(dfn==null){ + } + + public String getCopyright() { + DefineFontNameTag dfn = getFontNameTag(); + if (dfn == null) { return null; } return dfn.fontCopyright; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java index cd80dffe3..ab16703f2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/MissingCharacterHandler.java @@ -16,9 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.base; -import com.jpexs.decompiler.flash.tags.Tag; import java.awt.Font; -import java.util.List; /** * diff --git a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index 5472b591e..6d6fbf257 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -226,7 +226,7 @@ public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem, S tag.setModified(true); } } - + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index cfcdb1274..5689881c7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -235,7 +235,7 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, S tag.setModified(true); } } - + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/TEXTRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/TEXTRECORD.java index 034828833..5dc612d71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/TEXTRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/TEXTRECORD.java @@ -18,13 +18,11 @@ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.tags.DefineText2Tag; import com.jpexs.decompiler.flash.tags.DefineTextTag; -import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.types.annotations.Conditional; import com.jpexs.decompiler.flash.types.annotations.SWFArray; import com.jpexs.decompiler.flash.types.annotations.SWFType; import java.io.Serializable; -import java.util.List; /** *