diff --git a/CHANGELOG.md b/CHANGELOG.md index da2a194bd..68e3bbb66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ All notable changes to this project will be documented in this file. - Generic tag editor - display of array brackets - Generic tag editor - GRADIENT filters fields +### Changed +- AS1/2 P-code action parameters are now separated by commas, code without commas is still accepted + ## [19.0.0] - 2023-10-01 ### Added - [#1449] Updated Turkish translation diff --git a/libsrc/ffdec_lib/lexers/actionscript_pcode.flex b/libsrc/ffdec_lib/lexers/actionscript_pcode.flex index 4111486e5..918941aaf 100644 --- a/libsrc/ffdec_lib/lexers/actionscript_pcode.flex +++ b/libsrc/ffdec_lib/lexers/actionscript_pcode.flex @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.ecma.Undefined; +import java.util.Stack; %% @@ -57,6 +58,24 @@ import com.jpexs.decompiler.flash.ecma.Undefined; return yyline + 1; } + private Stack pushedBack = new Stack<>(); + + public void pushback(ASMParsedSymbol symb) { + pushedBack.push(symb); + last = null; + } + + ASMParsedSymbol last; + public ASMParsedSymbol lex() throws java.io.IOException, ActionParseException{ + ASMParsedSymbol ret = null; + if (!pushedBack.isEmpty()){ + ret = last = pushedBack.pop(); + } else { + ret = last = yylex(); + } + return ret; + } + %} /* main character classes */ @@ -139,6 +158,9 @@ Constant= constant{PositiveNumberLiteral} string.setLength(0); } + "," { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_COMMA); } + + /* numeric literals */ {NumberLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INTEGER, Long.parseLong((yytext()))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index b583bfb7d..e4162e728 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -265,7 +265,7 @@ public abstract class Action implements GraphSourceItem { * @throws ActionParseException When read object is not String */ protected String lexString(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); + ASMParsedSymbol symb = lex.lex(); if (symb.type != ASMParsedSymbol.TYPE_STRING) { throw new ActionParseException("String expected", lex.yyline()); } @@ -280,7 +280,7 @@ public abstract class Action implements GraphSourceItem { * @throws ActionParseException When read object is not Block startServer */ protected void lexBlockOpen(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); + ASMParsedSymbol symb = lex.lex(); if (symb.type != ASMParsedSymbol.TYPE_BLOCK_START) { throw new ActionParseException("Block startServer ", lex.yyline()); } @@ -295,7 +295,7 @@ public abstract class Action implements GraphSourceItem { * @throws ActionParseException When read object is not Identifier */ protected String lexIdentifier(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); + ASMParsedSymbol symb = lex.lex(); if (symb.type != ASMParsedSymbol.TYPE_IDENTIFIER) { throw new ActionParseException("Identifier expected", lex.yyline()); } @@ -311,7 +311,7 @@ public abstract class Action implements GraphSourceItem { * @throws ActionParseException When read object is not long value */ protected long lexLong(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); + ASMParsedSymbol symb = lex.lex(); if (symb.type != ASMParsedSymbol.TYPE_INTEGER) { throw new ActionParseException("Integer expected", lex.yyline()); } @@ -327,12 +327,19 @@ public abstract class Action implements GraphSourceItem { * @throws ActionParseException When read object is not boolean value */ protected boolean lexBoolean(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); + ASMParsedSymbol symb = lex.lex(); if (symb.type != ASMParsedSymbol.TYPE_BOOLEAN) { throw new ActionParseException("Boolean expected", lex.yyline()); - } + } return (Boolean) symb.value; } + + protected void lexOptionalComma(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.lex(); + if (symb.type != ASMParsedSymbol.TYPE_COMMA) { + lex.pushback(symb); + } + } /** * Gets action converted to bytes @@ -646,7 +653,7 @@ public abstract class Action implements GraphSourceItem { add = "; ofs" + Helper.formatAddress(offset) + add; add = "";*/ if ((a instanceof ActionPush) && lastPush) { - writer.appendNoHilight(" "); + writer.appendNoHilight(", "); ((ActionPush) a).paramsToStringReplaced(list, importantOffsets, exportMode, writer); } else { if (lastPush) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParsedSymbol.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParsedSymbol.java index ff7a143ab..dfcebbcd7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParsedSymbol.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParsedSymbol.java @@ -59,6 +59,8 @@ public class ASMParsedSymbol { public static final int TYPE_EOL = 16; public static final int TYPE_CONSTANT_LITERAL = 17; + + public static final int TYPE_COMMA = 18; public ASMParsedSymbol(int type, Object value) { this.type = type; @@ -68,4 +70,9 @@ public class ASMParsedSymbol { public ASMParsedSymbol(int type) { this.type = type; } + + @Override + public String toString() { + return "symbol[type="+type+", value="+value+"]"; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParser.java index 09ea866ee..a2ef3184f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/ASMParser.java @@ -373,7 +373,7 @@ public class ASMParser { Stack containers = new Stack<>(); List emptyList = new ArrayList<>(); while (true) { - ASMParsedSymbol symb = lexer.yylex(); + ASMParsedSymbol symb = lexer.lex(); if (symb.type == ASMParsedSymbol.TYPE_BLOCK_END) { if (containers.isEmpty()) { throw new ActionParseException("Block end without start", lexer.yyline()); @@ -407,7 +407,7 @@ public class ASMParser { list.add(cpool); while (true) { - ASMParsedSymbol symb = lexer.yylex(); + ASMParsedSymbol symb = lexer.lex(); if (symb.type == ASMParsedSymbol.TYPE_LABEL) { labels.add(new Label((String) symb.value, address)); } else if (symb.type == ASMParsedSymbol.TYPE_COMMENT) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/FlasmLexer.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/FlasmLexer.java index 1a5b75dc8..af0c78946 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/FlasmLexer.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/pcode/FlasmLexer.java @@ -1,5 +1,7 @@ +/* The following code was generated by JFlex 1.6.0 */ + /* - * Copyright (C) 2010-2023 JPEXS, All rights reserved. + * Copyright (C) 2010-2016 JPEXS, All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -14,6 +16,7 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library. */ +/* Flash assembler language lexer specification */ package com.jpexs.decompiler.flash.action.parser.pcode; import com.jpexs.decompiler.flash.action.parser.ActionParseException; @@ -21,619 +24,587 @@ import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.ecma.Undefined; +import java.util.Stack; + /** - * This class is a scanner generated by - * JFlex 1.6.0 from the specification file - * C:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript_pcode.flex + * This class is a scanner generated by + * JFlex 1.6.0 + * from the specification file C:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript_pcode.flex */ public final class FlasmLexer { - /** - * 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 YYINITIAL = 0; - public static final int STRING = 2; - public static final int PARAMETERS = 4; + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int PARAMETERS = 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 - }; + /** + * 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 + }; - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED - = "\11\6\1\4\1\2\1\50\1\51\1\1\16\6\4\0\1\4\1\0" - + "\1\43\1\0\1\5\2\0\1\46\3\0\1\35\1\0\1\25\1\33" - + "\1\0\1\30\11\31\1\7\1\3\5\0\4\36\1\34\1\36\2\5" - + "\1\26\4\5\1\32\14\5\1\0\1\37\2\0\1\5\1\0\1\17" - + "\1\44\1\41\1\23\1\15\1\16\1\40\1\5\1\24\2\5\1\20" - + "\1\5\1\22\1\42\2\5\1\13\1\21\1\12\1\14\2\5\1\47" - + "\1\27\1\5\1\10\1\0\1\11\1\0\6\6\1\52\32\6\2\0" - + "\4\5\1\0\1\45\2\0\1\5\2\0\1\6\7\0\1\5\4\0" - + "\1\5\5\0\27\5\1\0\37\5\1\0\u01ca\5\4\0\14\5\16\0" - + "\5\5\7\0\1\5\1\0\1\5\21\0\160\6\5\5\1\0\2\5" - + "\2\0\4\5\1\0\1\5\6\0\1\5\1\0\3\5\1\0\1\5" - + "\1\0\24\5\1\0\123\5\1\0\213\5\1\0\5\6\2\0\246\5" - + "\1\0\46\5\2\0\1\5\6\0\51\5\6\0\1\5\1\0\55\6" - + "\1\0\1\6\1\0\2\6\1\0\2\6\1\0\1\6\10\0\33\5" - + "\4\0\4\5\15\0\6\6\5\0\1\5\4\0\13\6\1\0\1\6" - + "\3\0\53\5\37\6\4\0\2\5\1\6\143\5\1\0\1\5\10\6" - + "\1\0\6\6\2\5\2\6\1\0\4\6\2\5\12\6\3\5\2\0" - + "\1\5\17\0\1\6\1\5\1\6\36\5\33\6\2\0\131\5\13\6" - + "\1\5\16\0\12\6\41\5\11\6\2\5\4\0\1\5\2\0\1\6" - + "\30\5\4\6\1\5\11\6\1\5\3\6\1\5\5\6\22\0\31\5" - + "\3\6\4\0\13\5\65\0\25\5\1\0\22\5\13\0\61\6\66\5" - + "\3\6\1\5\22\6\1\5\7\6\12\5\2\6\2\0\12\6\1\0" - + "\20\5\3\6\1\0\10\5\2\0\2\5\2\0\26\5\1\0\7\5" - + "\1\0\1\5\3\0\4\5\2\0\1\6\1\5\7\6\2\0\2\6" - + "\2\0\3\6\1\5\10\0\1\6\4\0\2\5\1\0\3\5\2\6" - + "\2\0\12\6\4\5\7\0\2\5\1\0\1\6\2\0\3\6\1\0" - + "\6\5\4\0\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0" - + "\2\5\1\0\2\5\2\0\1\6\1\0\5\6\4\0\2\6\2\0" - + "\3\6\3\0\1\6\7\0\4\5\1\0\1\5\7\0\14\6\3\5" - + "\1\6\13\0\3\6\1\0\11\5\1\0\3\5\1\0\26\5\1\0" - + "\7\5\1\0\2\5\1\0\5\5\2\0\1\6\1\5\10\6\1\0" - + "\3\6\1\0\3\6\2\0\1\5\17\0\2\5\2\6\2\0\12\6" - + "\1\0\1\5\7\0\1\5\6\6\1\0\3\6\1\0\10\5\2\0" - + "\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5\2\0" - + "\1\6\1\5\7\6\2\0\2\6\2\0\3\6\7\0\3\6\4\0" - + "\2\5\1\0\3\5\2\6\2\0\12\6\1\0\1\5\20\0\1\6" - + "\1\5\1\0\6\5\3\0\3\5\1\0\4\5\3\0\2\5\1\0" - + "\1\5\1\0\2\5\3\0\2\5\3\0\3\5\3\0\14\5\4\0" - + "\5\6\3\0\3\6\1\0\4\6\2\0\1\5\6\0\1\6\16\0" - + "\12\6\11\0\1\5\6\0\5\6\10\5\1\0\3\5\1\0\27\5" - + "\1\0\20\5\3\0\1\5\7\6\1\0\3\6\1\0\4\6\7\0" - + "\2\6\1\0\3\5\5\0\2\5\2\6\2\0\12\6\20\0\1\5" - + "\3\6\1\0\10\5\1\0\3\5\1\0\27\5\1\0\12\5\1\0" - + "\5\5\2\0\1\6\1\5\7\6\1\0\3\6\1\0\4\6\7\0" - + "\2\6\7\0\1\5\1\0\2\5\2\6\2\0\12\6\1\0\2\5" - + "\15\0\4\6\11\5\1\0\3\5\1\0\51\5\2\6\1\5\7\6" - + "\1\0\3\6\1\0\4\6\1\5\5\0\3\5\1\6\7\0\3\5" - + "\2\6\2\0\12\6\12\0\6\5\1\0\3\6\1\0\22\5\3\0" - + "\30\5\1\0\11\5\1\0\1\5\2\0\7\5\3\0\1\6\4\0" - + "\6\6\1\0\1\6\1\0\10\6\6\0\12\6\2\0\2\6\15\0" - + "\60\5\1\6\2\5\7\6\4\0\10\5\10\6\1\0\12\6\47\0" - + "\2\5\1\0\1\5\1\0\5\5\1\0\30\5\1\0\1\5\1\0" - + "\12\5\1\6\2\5\11\6\1\5\2\0\5\5\1\0\1\5\1\0" - + "\6\6\2\0\12\6\2\0\4\5\40\0\1\5\27\0\2\6\6\0" - + "\12\6\13\0\1\6\1\0\1\6\1\0\1\6\4\0\2\6\10\5" - + "\1\0\44\5\4\0\24\6\1\0\2\6\5\5\13\6\1\0\44\6" - + "\11\0\1\6\71\0\53\5\24\6\1\5\12\6\6\0\6\5\4\6" - + "\4\5\3\6\1\5\3\6\2\5\7\6\3\5\4\6\15\5\14\6" - + "\1\5\17\6\2\0\46\5\1\0\1\5\5\0\1\5\2\0\53\5" - + "\1\0\u014d\5\1\0\4\5\2\0\7\5\1\0\1\5\1\0\4\5" - + "\2\0\51\5\1\0\4\5\2\0\41\5\1\0\4\5\2\0\7\5" - + "\1\0\1\5\1\0\4\5\2\0\17\5\1\0\71\5\1\0\4\5" - + "\2\0\103\5\2\0\3\6\40\0\20\5\20\0\126\5\2\0\6\5" - + "\3\0\u026c\5\2\0\21\5\1\0\32\5\5\0\113\5\3\0\13\5" - + "\7\0\15\5\1\0\4\5\3\6\13\0\22\5\3\6\13\0\22\5" - + "\2\6\14\0\15\5\1\0\3\5\1\0\2\6\14\0\64\5\40\6" - + "\3\0\1\5\3\0\2\5\1\6\2\0\12\6\41\0\4\6\1\0" - + "\12\6\6\0\131\5\7\0\5\5\2\6\42\5\1\6\1\5\5\0" - + "\106\5\12\0\37\5\1\0\14\6\4\0\14\6\12\0\12\6\36\5" - + "\2\0\5\5\13\0\54\5\4\0\32\5\6\0\12\6\46\0\27\5" - + "\5\6\4\0\65\5\12\6\1\0\35\6\2\0\13\6\6\0\12\6" - + "\15\0\1\5\10\0\16\6\1\0\2\6\77\0\5\6\57\5\21\6" - + "\7\5\4\0\12\6\21\0\11\6\14\0\3\6\36\5\15\6\2\5" - + "\12\6\54\5\16\6\14\0\44\5\24\6\10\0\12\6\3\0\3\5" - + "\12\6\44\5\2\0\11\5\7\0\53\5\2\0\3\5\20\0\3\6" - + "\1\0\25\6\4\5\1\6\6\5\1\6\2\5\3\6\1\5\5\0" - + "\300\5\72\6\1\0\5\6\u0116\5\2\0\6\5\2\0\46\5\2\0" - + "\6\5\2\0\10\5\1\0\1\5\1\0\1\5\1\0\1\5\1\0" - + "\37\5\2\0\65\5\1\0\7\5\1\0\1\5\3\0\3\5\1\0" - + "\7\5\3\0\4\5\2\0\6\5\4\0\15\5\5\0\3\5\1\0" - + "\7\5\16\0\5\6\30\0\1\50\1\50\5\6\20\0\2\5\23\0" - + "\1\5\13\0\5\6\1\0\12\6\1\0\1\5\15\0\1\5\20\0" - + "\15\5\3\0\40\5\20\0\15\6\4\0\1\6\3\0\14\6\21\0" - + "\1\5\4\0\1\5\2\0\12\5\1\0\1\5\3\0\5\5\6\0" - + "\1\5\1\0\1\5\1\0\1\5\1\0\4\5\1\0\13\5\2\0" - + "\4\5\5\0\5\5\4\0\1\5\21\0\51\5\u0a77\0\57\5\1\0" - + "\57\5\1\0\205\5\6\0\4\5\3\6\2\5\14\0\46\5\1\0" - + "\1\5\5\0\1\5\2\0\70\5\7\0\1\5\17\0\1\6\27\5" - + "\11\0\7\5\1\0\7\5\1\0\7\5\1\0\7\5\1\0\7\5" - + "\1\0\7\5\1\0\7\5\1\0\7\5\1\0\40\6\57\0\1\5" - + "\u01d5\0\3\5\31\0\11\5\6\6\1\0\5\5\2\0\5\5\4\0" - + "\126\5\2\0\2\6\2\0\3\5\1\0\132\5\1\0\4\5\5\0" - + "\53\5\1\0\136\5\21\0\40\5\60\0\20\5\u0200\0\u19c0\5\100\0" - + "\u51fd\5\3\0\u048d\5\103\0\56\5\2\0\u010d\5\3\0\20\5\12\6" - + "\2\5\24\0\57\5\1\6\4\0\12\6\1\0\37\5\2\6\120\5" - + "\2\6\45\0\11\5\2\0\147\5\2\0\65\5\2\0\11\5\52\0" - + "\15\5\1\6\3\5\1\6\4\5\1\6\27\5\5\6\4\0\1\6" - + "\13\0\1\5\7\0\64\5\14\0\2\6\62\5\22\6\12\0\12\6" - + "\6\0\22\6\6\5\3\0\1\5\1\0\2\5\13\6\34\5\10\6" - + "\2\0\27\5\15\6\14\0\35\5\3\0\4\6\57\5\16\6\16\0" - + "\1\5\12\6\6\0\5\5\1\6\12\5\12\6\5\5\1\0\51\5" - + "\16\6\11\0\3\5\1\6\10\5\2\6\2\0\12\6\6\0\27\5" - + "\3\0\1\5\3\6\62\5\1\6\1\5\3\6\2\5\2\6\5\5" - + "\2\6\1\5\1\6\1\5\30\0\3\5\2\0\13\5\5\6\2\0" - + "\3\5\2\6\12\0\6\5\2\0\6\5\2\0\6\5\11\0\7\5" - + "\1\0\7\5\1\0\53\5\1\0\16\5\6\0\163\5\10\6\1\0" - + "\2\6\2\0\12\6\6\0\u2ba4\5\14\0\27\5\4\0\61\5\u2104\0" - + "\u016e\5\2\0\152\5\46\0\7\5\14\0\5\5\5\0\1\5\1\6" - + "\12\5\1\0\15\5\1\0\5\5\1\0\1\5\1\0\2\5\1\0" - + "\2\5\1\0\154\5\41\0\u016b\5\22\0\100\5\2\0\66\5\50\0" - + "\15\5\3\0\20\6\20\0\20\6\3\0\2\5\30\0\3\5\31\0" - + "\1\5\6\0\5\5\1\0\207\5\2\0\1\6\4\0\1\5\13\0" - + "\12\6\7\0\32\5\4\0\1\5\1\0\32\5\13\0\131\5\3\0" - + "\6\5\2\0\6\5\2\0\6\5\2\0\3\5\3\0\2\5\3\0" - + "\2\5\22\0\3\6\4\0\14\5\1\0\32\5\1\0\23\5\1\0" - + "\2\5\1\0\17\5\2\0\16\5\42\0\173\5\105\0\65\5\210\0" - + "\1\6\202\0\35\5\3\0\61\5\17\0\1\6\37\0\40\5\15\0" - + "\36\5\5\0\46\5\5\6\5\0\36\5\2\0\44\5\4\0\10\5" - + "\1\0\5\5\52\0\236\5\2\0\12\6\6\0\44\5\4\0\44\5" - + "\4\0\50\5\10\0\64\5\234\0\u0137\5\11\0\26\5\12\0\10\5" - + "\230\0\6\5\2\0\1\5\1\0\54\5\1\0\2\5\3\0\1\5" - + "\2\0\27\5\12\0\27\5\11\0\37\5\101\0\23\5\1\0\2\5" - + "\12\0\26\5\12\0\32\5\106\0\70\5\6\0\2\5\100\0\1\5" - + "\3\6\1\0\2\6\5\0\4\6\4\5\1\0\3\5\1\0\35\5" - + "\2\0\3\6\4\0\1\6\40\0\35\5\3\0\35\5\43\0\10\5" - + "\1\0\34\5\2\6\31\0\66\5\12\0\26\5\12\0\23\5\15\0" - + "\22\5\156\0\111\5\67\0\63\5\15\0\63\5\15\0\44\5\4\6" - + "\10\0\12\6\u0146\0\52\5\1\0\2\6\3\0\2\5\116\0\35\5" - + "\12\0\1\5\10\0\26\5\13\6\137\0\25\5\33\0\27\5\11\0" - + "\3\6\65\5\17\6\37\0\12\6\17\0\4\6\55\5\13\6\2\0" - + "\1\6\17\0\1\6\2\0\31\5\7\0\12\6\6\0\3\6\44\5" - + "\16\6\1\0\12\6\4\0\1\5\2\6\1\5\10\0\43\5\1\6" - + "\2\0\1\5\11\0\3\6\60\5\16\6\4\5\4\0\4\6\1\0" - + "\14\6\1\5\1\0\1\5\43\0\22\5\1\0\31\5\14\6\6\0" - + "\1\6\101\0\7\5\1\0\1\5\1\0\4\5\1\0\17\5\1\0" - + "\12\5\7\0\57\5\14\6\5\0\12\6\6\0\4\6\1\0\10\5" - + "\2\0\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5" - + "\1\0\2\6\1\5\7\6\2\0\2\6\2\0\3\6\2\0\1\5" - + "\6\0\1\6\5\0\5\5\2\6\2\0\7\6\3\0\5\6\213\0" - + "\65\5\22\6\4\5\5\0\12\6\4\0\1\6\3\5\36\0\60\5" - + "\24\6\2\5\1\0\1\5\10\0\12\6\246\0\57\5\7\6\2\0" - + "\11\6\27\0\4\5\2\6\42\0\60\5\21\6\3\0\1\5\13\0" - + "\12\6\46\0\53\5\15\6\1\5\7\0\12\6\66\0\33\5\2\0" - + "\17\6\4\0\12\6\306\0\54\5\17\6\145\0\100\5\12\6\25\0" - + "\10\5\2\0\1\5\2\0\10\5\1\0\2\5\1\0\30\5\6\6" - + "\1\0\2\6\2\0\4\6\1\5\1\6\1\5\2\6\14\0\12\6" - + "\106\0\10\5\2\0\47\5\7\6\2\0\7\6\1\5\1\0\1\5" - + "\1\6\33\0\1\5\12\6\50\5\7\6\1\5\4\6\10\0\1\6" - + "\10\0\1\5\13\6\56\5\20\6\3\0\1\5\42\0\71\5\u0107\0" - + "\11\5\1\0\45\5\10\6\1\0\10\6\1\5\17\0\12\6\30\0" - + "\36\5\2\0\26\6\1\0\16\6\111\0\7\5\1\0\2\5\1\0" - + "\46\5\6\6\3\0\1\6\1\0\2\6\1\0\7\6\1\5\1\6" - + "\10\0\12\6\6\0\6\5\1\0\2\5\1\0\40\5\5\6\1\0" - + "\2\6\1\0\5\6\1\5\7\0\12\6\u0136\0\23\5\4\6\271\0" - + "\1\5\54\0\4\5\37\0\u039a\5\146\0\157\5\21\0\304\5\u0abc\0" - + "\u042f\5\1\0\11\6\u0fc7\0\u0247\5\u21b9\0\u0239\5\7\0\37\5\1\0" - + "\12\6\146\0\36\5\2\0\5\6\13\0\60\5\7\6\11\0\4\5" - + "\14\0\12\6\11\0\25\5\5\0\23\5\u02b0\0\100\5\200\0\113\5" - + "\4\0\1\6\1\5\67\6\7\0\4\6\15\5\100\0\2\5\1\0" - + "\1\5\1\6\13\0\2\6\16\0\u17f8\5\10\0\u04d6\5\52\0\11\5" - + "\u22f7\0\u011f\5\61\0\3\5\21\0\4\5\10\0\u018c\5\u0904\0\153\5" - + "\5\0\15\5\3\0\11\5\7\0\12\5\3\0\2\6\1\0\4\6" - + "\u14c1\0\5\6\3\0\26\6\2\0\7\6\36\0\4\6\224\0\3\6" - + "\u01bb\0\125\5\1\0\107\5\1\0\2\5\2\0\1\5\2\0\2\5" - + "\2\0\4\5\1\0\14\5\1\0\1\5\1\0\7\5\1\0\101\5" - + "\1\0\4\5\2\0\10\5\1\0\7\5\1\0\34\5\1\0\4\5" - + "\1\0\5\5\1\0\1\5\3\0\7\5\1\0\u0154\5\2\0\31\5" - + "\1\0\31\5\1\0\37\5\1\0\31\5\1\0\37\5\1\0\31\5" - + "\1\0\37\5\1\0\31\5\1\0\37\5\1\0\31\5\1\0\10\5" - + "\2\0\62\6\u0200\0\67\6\4\0\62\6\10\0\1\6\16\0\1\6" - + "\26\0\5\6\1\0\17\6\u0550\0\7\6\1\0\21\6\2\0\7\6" - + "\1\0\2\6\1\0\5\6\325\0\55\5\3\0\7\6\7\5\2\0" - + "\12\6\4\0\1\5\u0171\0\54\5\16\6\5\0\1\5\u0500\0\305\5" - + "\13\0\7\6\51\0\104\5\7\6\1\5\4\0\12\6\u0356\0\1\5" - + "\u014f\0\4\5\1\0\33\5\1\0\2\5\1\0\1\5\2\0\1\5" - + "\1\0\12\5\1\0\4\5\1\0\1\5\1\0\1\5\6\0\1\5" - + "\4\0\1\5\1\0\1\5\1\0\1\5\1\0\3\5\1\0\2\5" - + "\1\0\1\5\2\0\1\5\1\0\1\5\1\0\1\5\1\0\1\5" - + "\1\0\1\5\1\0\2\5\1\0\1\5\2\0\4\5\1\0\7\5" - + "\1\0\4\5\1\0\4\5\1\0\1\5\1\0\12\5\1\0\21\5" - + "\5\0\3\5\1\0\5\5\1\0\21\5\u0d34\0\12\6\u0406\0\ua6de\5" - + "\42\0\u1035\5\13\0\336\5\2\0\u1682\5\16\0\u1d31\5\u0c1f\0\u021e\5" - + "\u05e2\0\u134b\5\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uecc0\0" - + "\1\6\36\0\140\6\200\0\360\6\uffff\0\uffff\0\ufe12\0"; + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\6\1\4\1\2\1\51\1\52\1\1\16\6\4\0\1\4\1\0"+ + "\1\43\1\0\1\5\2\0\1\47\3\0\1\35\1\44\1\25\1\33"+ + "\1\0\1\30\11\31\1\7\1\3\5\0\4\36\1\34\1\36\2\5"+ + "\1\26\4\5\1\32\14\5\1\0\1\37\2\0\1\5\1\0\1\17"+ + "\1\45\1\41\1\23\1\15\1\16\1\40\1\5\1\24\2\5\1\20"+ + "\1\5\1\22\1\42\2\5\1\13\1\21\1\12\1\14\2\5\1\50"+ + "\1\27\1\5\1\10\1\0\1\11\1\0\6\6\1\53\32\6\2\0"+ + "\4\5\1\0\1\46\2\0\1\5\2\0\1\6\7\0\1\5\4\0"+ + "\1\5\5\0\27\5\1\0\37\5\1\0\u01ca\5\4\0\14\5\16\0"+ + "\5\5\7\0\1\5\1\0\1\5\21\0\160\6\5\5\1\0\2\5"+ + "\2\0\4\5\1\0\1\5\6\0\1\5\1\0\3\5\1\0\1\5"+ + "\1\0\24\5\1\0\123\5\1\0\213\5\1\0\5\6\2\0\246\5"+ + "\1\0\46\5\2\0\1\5\6\0\51\5\6\0\1\5\1\0\55\6"+ + "\1\0\1\6\1\0\2\6\1\0\2\6\1\0\1\6\10\0\33\5"+ + "\4\0\4\5\15\0\6\6\5\0\1\5\4\0\13\6\1\0\1\6"+ + "\3\0\53\5\37\6\4\0\2\5\1\6\143\5\1\0\1\5\10\6"+ + "\1\0\6\6\2\5\2\6\1\0\4\6\2\5\12\6\3\5\2\0"+ + "\1\5\17\0\1\6\1\5\1\6\36\5\33\6\2\0\131\5\13\6"+ + "\1\5\16\0\12\6\41\5\11\6\2\5\4\0\1\5\2\0\1\6"+ + "\30\5\4\6\1\5\11\6\1\5\3\6\1\5\5\6\22\0\31\5"+ + "\3\6\4\0\13\5\5\0\30\5\1\0\6\5\1\0\2\6\6\0"+ + "\10\6\52\5\72\6\66\5\3\6\1\5\22\6\1\5\7\6\12\5"+ + "\2\6\2\0\12\6\1\0\20\5\3\6\1\0\10\5\2\0\2\5"+ + "\2\0\26\5\1\0\7\5\1\0\1\5\3\0\4\5\2\0\1\6"+ + "\1\5\7\6\2\0\2\6\2\0\3\6\1\5\10\0\1\6\4\0"+ + "\2\5\1\0\3\5\2\6\2\0\12\6\4\5\7\0\2\5\1\0"+ + "\1\6\2\0\3\6\1\0\6\5\4\0\2\5\2\0\26\5\1\0"+ + "\7\5\1\0\2\5\1\0\2\5\1\0\2\5\2\0\1\6\1\0"+ + "\5\6\4\0\2\6\2\0\3\6\3\0\1\6\7\0\4\5\1\0"+ + "\1\5\7\0\14\6\3\5\1\6\13\0\3\6\1\0\11\5\1\0"+ + "\3\5\1\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5\2\0"+ + "\1\6\1\5\10\6\1\0\3\6\1\0\3\6\2\0\1\5\17\0"+ + "\2\5\2\6\2\0\12\6\1\0\1\5\7\0\1\5\6\6\1\0"+ + "\3\6\1\0\10\5\2\0\2\5\2\0\26\5\1\0\7\5\1\0"+ + "\2\5\1\0\5\5\2\0\1\6\1\5\7\6\2\0\2\6\2\0"+ + "\3\6\7\0\3\6\4\0\2\5\1\0\3\5\2\6\2\0\12\6"+ + "\1\0\1\5\20\0\1\6\1\5\1\0\6\5\3\0\3\5\1\0"+ + "\4\5\3\0\2\5\1\0\1\5\1\0\2\5\3\0\2\5\3\0"+ + "\3\5\3\0\14\5\4\0\5\6\3\0\3\6\1\0\4\6\2\0"+ + "\1\5\6\0\1\6\16\0\12\6\11\0\1\5\6\0\5\6\10\5"+ + "\1\0\3\5\1\0\27\5\1\0\20\5\2\0\1\6\1\5\7\6"+ + "\1\0\3\6\1\0\4\6\7\0\2\6\1\0\3\5\2\0\1\5"+ + "\2\0\2\5\2\6\2\0\12\6\20\0\1\5\3\6\1\0\10\5"+ + "\1\0\3\5\1\0\27\5\1\0\12\5\1\0\5\5\2\0\1\6"+ + "\1\5\7\6\1\0\3\6\1\0\4\6\7\0\2\6\6\0\2\5"+ + "\1\0\2\5\2\6\2\0\12\6\1\0\2\5\15\0\4\6\11\5"+ + "\1\0\3\5\1\0\51\5\2\6\1\5\7\6\1\0\3\6\1\0"+ + "\4\6\1\5\5\0\3\5\1\6\7\0\3\5\2\6\2\0\12\6"+ + "\12\0\6\5\1\0\3\6\1\0\22\5\3\0\30\5\1\0\11\5"+ + "\1\0\1\5\2\0\7\5\3\0\1\6\4\0\6\6\1\0\1\6"+ + "\1\0\10\6\6\0\12\6\2\0\2\6\15\0\60\5\1\6\2\5"+ + "\7\6\4\0\10\5\10\6\1\0\12\6\47\0\2\5\1\0\1\5"+ + "\1\0\5\5\1\0\30\5\1\0\1\5\1\0\12\5\1\6\2\5"+ + "\11\6\1\5\2\0\5\5\1\0\1\5\1\0\6\6\2\0\12\6"+ + "\2\0\4\5\40\0\1\5\27\0\2\6\6\0\12\6\13\0\1\6"+ + "\1\0\1\6\1\0\1\6\4\0\2\6\10\5\1\0\44\5\4\0"+ + "\24\6\1\0\2\6\5\5\13\6\1\0\44\6\11\0\1\6\71\0"+ + "\53\5\24\6\1\5\12\6\6\0\6\5\4\6\4\5\3\6\1\5"+ + "\3\6\2\5\7\6\3\5\4\6\15\5\14\6\1\5\17\6\2\0"+ + "\46\5\1\0\1\5\5\0\1\5\2\0\53\5\1\0\u014d\5\1\0"+ + "\4\5\2\0\7\5\1\0\1\5\1\0\4\5\2\0\51\5\1\0"+ + "\4\5\2\0\41\5\1\0\4\5\2\0\7\5\1\0\1\5\1\0"+ + "\4\5\2\0\17\5\1\0\71\5\1\0\4\5\2\0\103\5\2\0"+ + "\3\6\40\0\20\5\20\0\126\5\2\0\6\5\3\0\u026c\5\2\0"+ + "\21\5\1\0\32\5\5\0\113\5\3\0\13\5\7\0\22\5\4\6"+ + "\11\0\23\5\3\6\13\0\22\5\2\6\14\0\15\5\1\0\3\5"+ + "\1\0\2\6\14\0\64\5\40\6\3\0\1\5\3\0\2\5\1\6"+ + "\2\0\12\6\41\0\17\6\6\0\131\5\7\0\5\5\2\6\42\5"+ + "\1\6\1\5\5\0\106\5\12\0\37\5\1\0\14\6\4\0\14\6"+ + "\12\0\12\6\36\5\2\0\5\5\13\0\54\5\4\0\32\5\6\0"+ + "\12\6\46\0\27\5\5\6\4\0\65\5\12\6\1\0\35\6\2\0"+ + "\13\6\6\0\12\6\15\0\1\5\10\0\16\6\1\0\20\6\61\0"+ + "\5\6\57\5\21\6\10\5\3\0\12\6\21\0\11\6\14\0\3\6"+ + "\36\5\15\6\2\5\12\6\54\5\16\6\14\0\44\5\24\6\10\0"+ + "\12\6\3\0\3\5\12\6\44\5\2\0\11\5\7\0\53\5\2\0"+ + "\3\5\20\0\3\6\1\0\25\6\4\5\1\6\6\5\1\6\2\5"+ + "\3\6\1\5\5\0\300\5\100\6\u0116\5\2\0\6\5\2\0\46\5"+ + "\2\0\6\5\2\0\10\5\1\0\1\5\1\0\1\5\1\0\1\5"+ + "\1\0\37\5\2\0\65\5\1\0\7\5\1\0\1\5\3\0\3\5"+ + "\1\0\7\5\3\0\4\5\2\0\6\5\4\0\15\5\5\0\3\5"+ + "\1\0\7\5\16\0\5\6\30\0\1\51\1\51\5\6\20\0\2\5"+ + "\23\0\1\5\13\0\5\6\1\0\12\6\1\0\1\5\15\0\1\5"+ + "\20\0\15\5\3\0\41\5\17\0\15\6\4\0\1\6\3\0\14\6"+ + "\21\0\1\5\4\0\1\5\2\0\12\5\1\0\1\5\3\0\5\5"+ + "\6\0\1\5\1\0\1\5\1\0\1\5\1\0\4\5\1\0\13\5"+ + "\2\0\4\5\5\0\5\5\4\0\1\5\21\0\51\5\u0a77\0\345\5"+ + "\6\0\4\5\3\6\2\5\14\0\46\5\1\0\1\5\5\0\1\5"+ + "\2\0\70\5\7\0\1\5\17\0\1\6\27\5\11\0\7\5\1\0"+ + "\7\5\1\0\7\5\1\0\7\5\1\0\7\5\1\0\7\5\1\0"+ + "\7\5\1\0\7\5\1\0\40\6\57\0\1\5\u01d5\0\3\5\31\0"+ + "\11\5\6\6\1\0\5\5\2\0\5\5\4\0\126\5\2\0\2\6"+ + "\2\0\3\5\1\0\132\5\1\0\4\5\5\0\53\5\1\0\136\5"+ + "\21\0\40\5\60\0\20\5\u0200\0\u19c0\5\100\0\u568d\5\103\0\56\5"+ + "\2\0\u010d\5\3\0\20\5\12\6\2\5\24\0\57\5\1\6\4\0"+ + "\12\6\1\0\37\5\2\6\120\5\2\6\45\0\11\5\2\0\147\5"+ + "\2\0\100\5\5\0\2\5\1\0\1\5\1\0\5\5\30\0\20\5"+ + "\1\6\3\5\1\6\4\5\1\6\27\5\5\6\4\0\1\6\13\0"+ + "\1\5\7\0\64\5\14\0\2\6\62\5\22\6\12\0\12\6\6\0"+ + "\22\6\6\5\3\0\1\5\1\0\2\5\13\6\34\5\10\6\2\0"+ + "\27\5\15\6\14\0\35\5\3\0\4\6\57\5\16\6\16\0\1\5"+ + "\12\6\6\0\5\5\1\6\12\5\12\6\5\5\1\0\51\5\16\6"+ + "\11\0\3\5\1\6\10\5\2\6\2\0\12\6\6\0\27\5\3\0"+ + "\1\5\3\6\62\5\1\6\1\5\3\6\2\5\2\6\5\5\2\6"+ + "\1\5\1\6\1\5\30\0\3\5\2\0\13\5\5\6\2\0\3\5"+ + "\2\6\12\0\6\5\2\0\6\5\2\0\6\5\11\0\7\5\1\0"+ + "\7\5\1\0\53\5\1\0\16\5\6\0\163\5\10\6\1\0\2\6"+ + "\2\0\12\6\6\0\u2ba4\5\14\0\27\5\4\0\61\5\u2104\0\u016e\5"+ + "\2\0\152\5\46\0\7\5\14\0\5\5\5\0\1\5\1\6\12\5"+ + "\1\0\15\5\1\0\5\5\1\0\1\5\1\0\2\5\1\0\2\5"+ + "\1\0\154\5\41\0\u016b\5\22\0\100\5\2\0\66\5\50\0\15\5"+ + "\3\0\20\6\20\0\20\6\3\0\2\5\30\0\3\5\31\0\1\5"+ + "\6\0\5\5\1\0\207\5\2\0\1\6\4\0\1\5\13\0\12\6"+ + "\7\0\32\5\4\0\1\5\1\0\32\5\13\0\131\5\3\0\6\5"+ + "\2\0\6\5\2\0\6\5\2\0\3\5\3\0\2\5\3\0\2\5"+ + "\22\0\3\6\4\0\14\5\1\0\32\5\1\0\23\5\1\0\2\5"+ + "\1\0\17\5\2\0\16\5\42\0\173\5\105\0\65\5\210\0\1\6"+ + "\202\0\35\5\3\0\61\5\17\0\1\6\37\0\40\5\15\0\36\5"+ + "\5\0\46\5\5\6\5\0\36\5\2\0\44\5\4\0\10\5\1\0"+ + "\5\5\52\0\236\5\2\0\12\6\6\0\44\5\4\0\44\5\4\0"+ + "\50\5\10\0\64\5\14\0\13\5\1\0\17\5\1\0\7\5\1\0"+ + "\2\5\1\0\13\5\1\0\17\5\1\0\7\5\1\0\2\5\103\0"+ + "\u0137\5\11\0\26\5\12\0\10\5\30\0\6\5\1\0\52\5\1\0"+ + "\11\5\105\0\6\5\2\0\1\5\1\0\54\5\1\0\2\5\3\0"+ + "\1\5\2\0\27\5\12\0\27\5\11\0\37\5\101\0\23\5\1\0"+ + "\2\5\12\0\26\5\12\0\32\5\106\0\70\5\6\0\2\5\100\0"+ + "\1\5\3\6\1\0\2\6\5\0\4\6\4\5\1\0\3\5\1\0"+ + "\35\5\2\0\3\6\4\0\1\6\40\0\35\5\3\0\35\5\43\0"+ + "\10\5\1\0\34\5\2\6\31\0\66\5\12\0\26\5\12\0\23\5"+ + "\15\0\22\5\156\0\111\5\67\0\63\5\15\0\63\5\15\0\44\5"+ + "\4\6\10\0\12\6\u0146\0\52\5\1\0\2\6\3\0\2\5\116\0"+ + "\35\5\12\0\1\5\10\0\26\5\13\6\37\0\22\5\4\6\52\0"+ + "\25\5\33\0\27\5\11\0\3\6\65\5\17\6\37\0\13\6\2\5"+ + "\2\6\1\5\11\0\4\6\55\5\13\6\2\0\1\6\4\0\1\6"+ + "\12\0\1\6\2\0\31\5\7\0\12\6\6\0\3\6\44\5\16\6"+ + "\1\0\12\6\4\0\1\5\2\6\1\5\10\0\43\5\1\6\2\0"+ + "\1\5\11\0\3\6\60\5\16\6\4\5\4\0\4\6\1\0\14\6"+ + "\1\5\1\0\1\5\43\0\22\5\1\0\31\5\14\6\6\0\1\6"+ + "\101\0\7\5\1\0\1\5\1\0\4\5\1\0\17\5\1\0\12\5"+ + "\7\0\57\5\14\6\5\0\12\6\6\0\4\6\1\0\10\5\2\0"+ + "\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5\1\0"+ + "\2\6\1\5\7\6\2\0\2\6\2\0\3\6\2\0\1\5\6\0"+ + "\1\6\5\0\5\5\2\6\2\0\7\6\3\0\5\6\213\0\65\5"+ + "\22\6\4\5\5\0\12\6\4\0\1\6\3\5\36\0\60\5\24\6"+ + "\2\5\1\0\1\5\10\0\12\6\246\0\57\5\7\6\2\0\11\6"+ + "\27\0\4\5\2\6\42\0\60\5\21\6\3\0\1\5\13\0\12\6"+ + "\46\0\53\5\15\6\1\5\7\0\12\6\66\0\33\5\2\0\17\6"+ + "\4\0\12\6\6\0\7\5\271\0\54\5\17\6\145\0\100\5\12\6"+ + "\25\0\10\5\2\0\1\5\2\0\10\5\1\0\2\5\1\0\30\5"+ + "\6\6\1\0\2\6\2\0\4\6\1\5\1\6\1\5\2\6\14\0"+ + "\12\6\106\0\10\5\2\0\47\5\7\6\2\0\7\6\1\5\1\0"+ + "\1\5\1\6\33\0\1\5\12\6\50\5\7\6\1\5\4\6\10\0"+ + "\1\6\10\0\1\5\13\6\56\5\20\6\3\0\1\5\22\0\111\5"+ + "\u0107\0\11\5\1\0\45\5\10\6\1\0\10\6\1\5\17\0\12\6"+ + "\30\0\36\5\2\0\26\6\1\0\16\6\111\0\7\5\1\0\2\5"+ + "\1\0\46\5\6\6\3\0\1\6\1\0\2\6\1\0\7\6\1\5"+ + "\1\6\10\0\12\6\6\0\6\5\1\0\2\5\1\0\40\5\5\6"+ + "\1\0\2\6\1\0\5\6\1\5\7\0\12\6\u0136\0\23\5\4\6"+ + "\271\0\1\5\54\0\4\5\37\0\u039a\5\146\0\157\5\21\0\304\5"+ + "\u0a4c\0\141\5\17\0\u042f\5\1\0\11\6\u0fc7\0\u0247\5\u21b9\0\u0239\5"+ + "\7\0\37\5\1\0\12\6\6\0\117\5\1\0\12\6\6\0\36\5"+ + "\2\0\5\6\13\0\60\5\7\6\11\0\4\5\14\0\12\6\11\0"+ + "\25\5\5\0\23\5\u02b0\0\100\5\200\0\113\5\4\0\1\6\1\5"+ + "\67\6\7\0\4\6\15\5\100\0\2\5\1\0\1\5\1\6\13\0"+ + "\2\6\16\0\u17f8\5\10\0\u04d6\5\52\0\11\5\u22e7\0\4\5\1\0"+ + "\7\5\1\0\2\5\1\0\u0123\5\55\0\3\5\21\0\4\5\10\0"+ + "\u018c\5\u0904\0\153\5\5\0\15\5\3\0\11\5\7\0\12\5\3\0"+ + "\2\6\1\0\4\6\u125c\0\56\6\2\0\27\6\u021e\0\5\6\3\0"+ + "\26\6\2\0\7\6\36\0\4\6\224\0\3\6\u01bb\0\125\5\1\0"+ + "\107\5\1\0\2\5\2\0\1\5\2\0\2\5\2\0\4\5\1\0"+ + "\14\5\1\0\1\5\1\0\7\5\1\0\101\5\1\0\4\5\2\0"+ + "\10\5\1\0\7\5\1\0\34\5\1\0\4\5\1\0\5\5\1\0"+ + "\1\5\3\0\7\5\1\0\u0154\5\2\0\31\5\1\0\31\5\1\0"+ + "\37\5\1\0\31\5\1\0\37\5\1\0\31\5\1\0\37\5\1\0"+ + "\31\5\1\0\37\5\1\0\31\5\1\0\10\5\2\0\62\6\u0200\0"+ + "\67\6\4\0\62\6\10\0\1\6\16\0\1\6\26\0\5\6\1\0"+ + "\17\6\u0450\0\37\5\341\0\7\6\1\0\21\6\2\0\7\6\1\0"+ + "\2\6\1\0\5\6\325\0\55\5\3\0\7\6\7\5\2\0\12\6"+ + "\4\0\1\5\u0141\0\36\5\1\6\21\0\54\5\16\6\5\0\1\5"+ + "\u04e0\0\7\5\1\0\4\5\1\0\2\5\1\0\17\5\1\0\305\5"+ + "\13\0\7\6\51\0\104\5\7\6\1\5\4\0\12\6\u0356\0\1\5"+ + "\u014f\0\4\5\1\0\33\5\1\0\2\5\1\0\1\5\2\0\1\5"+ + "\1\0\12\5\1\0\4\5\1\0\1\5\1\0\1\5\6\0\1\5"+ + "\4\0\1\5\1\0\1\5\1\0\1\5\1\0\3\5\1\0\2\5"+ + "\1\0\1\5\2\0\1\5\1\0\1\5\1\0\1\5\1\0\1\5"+ + "\1\0\1\5\1\0\2\5\1\0\1\5\2\0\4\5\1\0\7\5"+ + "\1\0\4\5\1\0\4\5\1\0\1\5\1\0\12\5\1\0\21\5"+ + "\5\0\3\5\1\0\5\5\1\0\21\5\u0d34\0\12\6\u0406\0\ua6e0\5"+ + "\40\0\u1039\5\7\0\336\5\2\0\u1682\5\16\0\u1d31\5\u0c1f\0\u021e\5"+ + "\u05e2\0\u134b\5\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uecc0\0"+ + "\1\6\36\0\140\6\200\0\360\6\uffff\0\uffff\0\ufe12\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 - = "\3\0\2\1\1\2\1\3\1\4\2\5\1\1\1\6" - + "\2\7\1\10\1\11\1\12\5\11\1\1\1\11\2\13" - + "\1\11\1\1\1\11\1\14\1\15\2\16\1\17\1\20" - + "\1\16\1\21\1\22\1\23\1\24\1\25\1\26\1\27" - + "\1\16\5\11\2\0\1\11\1\0\2\30\2\11\4\0" - + "\5\11\1\0\1\11\1\0\2\30\1\11\1\31\1\0" - + "\1\32\1\33\3\11\1\34\1\0\4\11\1\35\1\0" - + "\4\11\1\0\4\11\1\0\4\11\1\0\1\11\2\36" - + "\1\37\1\30\2\40"; + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\2\1\1\2\1\3\1\4\2\5\1\1\1\6"+ + "\2\7\1\10\1\11\1\12\5\11\1\1\1\11\2\13"+ + "\1\11\1\1\1\11\1\14\1\15\1\16\2\17\1\20"+ + "\1\21\1\17\1\22\1\23\1\24\1\25\1\26\1\27"+ + "\1\30\1\17\5\11\2\0\1\11\1\0\2\31\2\11"+ + "\4\0\5\11\1\0\1\11\1\0\2\31\1\11\1\32"+ + "\1\0\1\33\1\34\3\11\1\35\1\0\4\11\1\36"+ + "\1\0\4\11\1\0\4\11\1\0\4\11\1\0\1\11"+ + "\2\37\1\40\1\31\2\41"; - private static int[] zzUnpackAction() { - int[] result = new int[109]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; + private static int [] zzUnpackAction() { + int [] result = new int[110]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackAction(String packed, int offset, int[] result) { - int i = 0; - /* index in packed string */ - int j = offset; - /* index in unpacked array */ - 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; + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\54\0\130\0\204\0\260\0\334\0\204\0\204"+ + "\0\u0108\0\204\0\u0134\0\204\0\u0160\0\204\0\u018c\0\u01b8"+ + "\0\204\0\u01e4\0\u0210\0\u023c\0\u0268\0\u0294\0\u02c0\0\u02ec"+ + "\0\u0318\0\u0344\0\u0370\0\u039c\0\u03c8\0\204\0\204\0\204"+ + "\0\204\0\u03f4\0\204\0\204\0\u0420\0\204\0\204\0\204"+ + "\0\204\0\204\0\204\0\204\0\u044c\0\u0478\0\u04a4\0\u04d0"+ + "\0\u04fc\0\u0528\0\u0554\0\u039c\0\u0580\0\u05ac\0\u0318\0\u05d8"+ + "\0\u0604\0\u0630\0\u065c\0\u0688\0\u06b4\0\u06e0\0\u070c\0\u0738"+ + "\0\u0764\0\u0790\0\u07bc\0\u07e8\0\u0814\0\u0840\0\u0840\0\u01b8"+ + "\0\u086c\0\204\0\u044c\0\204\0\u01b8\0\u0898\0\u08c4\0\u08f0"+ + "\0\u01b8\0\u091c\0\u0948\0\u0974\0\u09a0\0\u09cc\0\u01b8\0\u09f8"+ + "\0\u0a24\0\u0a50\0\u0a7c\0\u0aa8\0\u0ad4\0\u0b00\0\u0b2c\0\u0b58"+ + "\0\u0b84\0\u0bb0\0\u0bdc\0\u0c08\0\u0c34\0\u0c60\0\u0c8c\0\u0cb8"+ + "\0\u01b8\0\u0ce4\0\u01b8\0\204\0\u01b8\0\u0d10"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[110]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); } + return j; + } - /** - * Translates a state to a row index in the transition table - */ - private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); - private static final String ZZ_ROWMAP_PACKED_0 - = "\0\0\0\53\0\126\0\201\0\254\0\327\0\201\0\201" - + "\0\u0102\0\201\0\u012d\0\201\0\u0158\0\201\0\u0183\0\u01ae" - + "\0\201\0\u01d9\0\u0204\0\u022f\0\u025a\0\u0285\0\u02b0\0\u02db" - + "\0\u0306\0\u0331\0\u035c\0\u0387\0\u03b2\0\201\0\201\0\201" - + "\0\u03dd\0\201\0\201\0\u0408\0\201\0\201\0\201\0\201" - + "\0\201\0\201\0\201\0\u0433\0\u045e\0\u0489\0\u04b4\0\u04df" - + "\0\u050a\0\u0535\0\u0387\0\u0560\0\u058b\0\u0306\0\u05b6\0\u05e1" - + "\0\u060c\0\u0637\0\u0662\0\u068d\0\u06b8\0\u06e3\0\u070e\0\u0739" - + "\0\u0764\0\u078f\0\u07ba\0\u07e5\0\u0810\0\u0810\0\u01ae\0\u083b" - + "\0\201\0\u0433\0\201\0\u01ae\0\u0866\0\u0891\0\u08bc\0\u01ae" - + "\0\u08e7\0\u0912\0\u093d\0\u0968\0\u0993\0\u01ae\0\u09be\0\u09e9" - + "\0\u0a14\0\u0a3f\0\u0a6a\0\u0a95\0\u0ac0\0\u0aeb\0\u0b16\0\u0b41" - + "\0\u0b6c\0\u0b97\0\u0bc2\0\u0bed\0\u0c18\0\u0c43\0\u0c6e\0\u01ae" - + "\0\u0c99\0\u01ae\0\201\0\u01ae\0\u0cc4"; + private static final String ZZ_TRANS_PACKED_0 = + "\4\4\1\5\1\6\3\4\1\7\13\6\1\4\2\6"+ + "\2\4\1\6\1\4\1\6\1\4\1\6\1\4\3\6"+ + "\2\4\1\6\2\4\1\6\1\4\1\5\1\4\1\10"+ + "\1\11\1\12\34\10\1\13\3\10\1\14\10\10\1\4"+ + "\1\15\1\16\1\17\1\4\1\20\2\4\1\21\1\4"+ + "\1\22\1\23\1\24\1\20\1\25\3\20\1\26\2\20"+ + "\1\27\1\30\1\20\1\31\1\32\1\33\1\34\1\20"+ + "\1\4\1\20\1\4\1\20\1\35\1\20\1\36\1\37"+ + "\1\20\2\4\1\20\3\4\60\0\1\5\45\0\1\5"+ + "\6\0\2\6\1\40\2\0\13\6\1\0\5\6\1\0"+ + "\1\6\1\0\1\6\1\0\3\6\2\0\1\6\2\0"+ + "\1\6\2\0\1\6\2\0\1\12\51\0\1\41\2\0"+ + "\5\41\1\42\1\41\1\43\1\44\1\45\1\41\1\46"+ + "\3\41\1\47\14\41\1\50\3\41\1\51\1\41\1\52"+ + "\1\53\1\54\1\55\5\0\1\16\51\0\1\17\2\0"+ + "\51\17\5\0\2\20\3\0\13\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\5\0\2\20\3\0\1\20\1\56"+ + "\11\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\3\20\1\57\7\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\5\0\2\20\3\0\10\20\1\60"+ + "\2\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\5\20\1\61\5\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\5\0\2\20\3\0\2\20\1\62"+ + "\10\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\26\0"+ + "\1\63\1\0\1\31\1\32\1\0\1\64\25\0\2\20"+ + "\3\0\10\20\1\65\2\20\1\0\5\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\2\0\1\20\2\0\1\20"+ + "\2\0\1\20\15\0\1\66\12\0\2\67\1\0\1\70"+ + "\1\66\34\0\1\66\12\0\2\32\1\0\1\70\1\66"+ + "\24\0\2\20\3\0\5\20\1\71\5\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\30\0\2\70\27\0\2\20"+ + "\3\0\13\20\1\0\5\20\1\0\1\20\1\0\1\20"+ + "\1\0\2\20\1\72\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\30\0\1\73\1\74\37\0\3\75\3\0\1\75"+ + "\4\0\2\75\2\0\1\75\1\0\1\75\2\0\1\75"+ + "\3\0\1\75\23\0\3\76\3\0\1\76\4\0\2\76"+ + "\2\0\1\76\1\0\1\76\2\0\1\76\3\0\1\76"+ + "\13\0\2\20\3\0\2\20\1\77\10\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\13\20"+ + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\1\100"+ + "\2\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\11\20\1\101\1\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\5\0\2\20\3\0\6\20\1\102"+ + "\4\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\6\20\1\103\4\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\22\0\1\104\36\0\2\20\3\0"+ + "\4\20\1\105\6\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\25\0\1\106\2\0\2\107\3\0\1\106\33\0"+ + "\1\66\12\0\2\70\2\0\1\66\24\0\2\20\3\0"+ + "\13\20\1\0\4\20\1\110\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\2\0\1\20\2\0\1\20\2\0\1\20"+ + "\5\0\2\20\3\0\10\20\1\111\2\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\11\0\1\112\53\0\1\112"+ + "\16\0\2\74\37\0\3\113\3\0\1\113\4\0\2\113"+ + "\2\0\1\113\1\0\1\113\2\0\1\113\3\0\1\113"+ + "\23\0\3\114\3\0\1\114\4\0\2\114\2\0\1\114"+ + "\1\0\1\114\2\0\1\114\3\0\1\114\13\0\2\20"+ + "\3\0\3\20\1\115\7\20\1\0\5\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\2\0\1\20\2\0\1\20"+ + "\2\0\1\20\5\0\2\20\3\0\12\20\1\116\1\0"+ + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\2\0"+ + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0"+ + "\3\20\1\117\7\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\5\0\2\20\3\0\7\20\1\120\3\20\1\0"+ + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\2\0"+ + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0"+ + "\6\20\1\121\4\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\16\0\1\122\42\0\2\20\3\0\12\20\1\123"+ + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\2\0\1\20\2\0\1\20\2\0\1\20\30\0\2\107"+ + "\27\0\2\20\3\0\7\20\1\124\3\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\7\20"+ + "\1\125\3\20\1\0\5\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\2\0\1\20\2\0\1\20\2\0\1\20"+ + "\5\0\2\20\3\0\4\20\1\126\6\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\3\20"+ + "\1\127\7\20\1\0\5\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\2\0\1\20\2\0\1\20\2\0\1\20"+ + "\24\0\1\130\34\0\2\20\3\0\10\20\1\131\2\20"+ + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\2\0\1\20\2\0\1\20\2\0\1\20\5\0\2\20"+ + "\3\0\1\132\12\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\5\0\2\20\3\0\1\133\12\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\12\20"+ + "\1\134\1\0\5\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\22\0"+ + "\1\135\36\0\2\20\3\0\12\20\1\136\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\5\20"+ + "\1\137\5\20\1\0\5\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\2\0\1\20\2\0\1\20\2\0\1\20"+ + "\5\0\2\20\3\0\3\20\1\140\7\20\1\0\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\2\0\1\20"+ + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\10\20"+ + "\1\141\2\20\1\0\5\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\2\0\1\20\2\0\1\20\2\0\1\20"+ + "\24\0\1\142\34\0\2\20\3\0\1\143\12\20\1\0"+ + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\2\0"+ + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0"+ + "\10\20\1\144\2\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\5\0\2\20\3\0\1\20\1\145\11\20\1\0"+ + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\2\0"+ + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0"+ + "\3\20\1\146\7\20\1\0\5\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\2\0\1\20\2\0\1\20\2\0"+ + "\1\20\12\0\1\147\46\0\2\20\3\0\13\20\1\0"+ + "\1\20\1\110\3\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\1\150\12\20\1\0\5\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\2\0\1\20\2\0\1\20"+ + "\2\0\1\20\5\0\2\20\3\0\13\20\1\0\2\20"+ + "\1\151\1\152\1\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\2\0\1\20\2\0\1\20\2\0\1\20\5\0"+ + "\2\20\3\0\11\20\1\153\1\20\1\0\5\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\2\0\1\20\2\0"+ + "\1\20\2\0\1\20\27\0\1\154\31\0\2\20\3\0"+ + "\13\20\1\0\2\20\1\155\1\156\1\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\2\0\1\20\2\0\1\20"+ + "\2\0\1\20\5\0\2\20\3\0\13\20\1\0\2\20"+ + "\2\152\1\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\2\0\1\20\2\0\1\20\2\0\1\20\5\0\2\20"+ + "\3\0\13\20\1\0\2\20\2\156\1\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\2\0\1\20\2\0\1\20"+ + "\2\0\1\20"; - private static int[] zzUnpackRowMap() { - int[] result = new int[109]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; + private static int [] zzUnpackTrans() { + int [] result = new int[3388]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackRowMap(String packed, int offset, int[] result) { - int i = 0; - /* index in packed string */ - int j = offset; - /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; + + /* 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; + + /* 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 = + "\3\0\1\11\2\1\2\11\1\1\1\11\1\1\1\11"+ + "\1\1\1\11\2\1\1\11\14\1\4\11\1\1\2\11"+ + "\1\1\7\11\6\1\2\0\1\1\1\0\4\1\4\0"+ + "\5\1\1\0\1\1\1\0\3\1\1\11\1\0\1\11"+ + "\5\1\1\0\5\1\1\0\4\1\1\0\4\1\1\0"+ + "\4\1\1\0\4\1\1\11\2\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[110]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - /** - * The transition table of the DFA - */ - private static final int[] ZZ_TRANS = zzUnpackTrans(); + /** the input device */ + private java.io.Reader zzReader; - private static final String ZZ_TRANS_PACKED_0 - = "\4\4\1\5\1\6\3\4\1\7\13\6\1\4\2\6" - + "\2\4\1\6\1\4\1\6\1\4\1\6\1\4\3\6" - + "\1\4\1\6\2\4\1\6\1\4\1\5\1\4\1\10" - + "\1\11\1\12\34\10\1\13\3\10\1\14\7\10\1\4" - + "\1\15\1\16\1\17\1\4\1\20\2\4\1\21\1\4" - + "\1\22\1\23\1\24\1\20\1\25\3\20\1\26\2\20" - + "\1\27\1\30\1\20\1\31\1\32\1\33\1\34\1\20" - + "\1\4\1\20\1\4\1\20\1\35\1\20\1\36\1\20" - + "\2\4\1\20\3\4\57\0\1\5\44\0\1\5\6\0" - + "\2\6\1\37\2\0\13\6\1\0\5\6\1\0\1\6" - + "\1\0\1\6\1\0\3\6\1\0\1\6\2\0\1\6" - + "\2\0\1\6\2\0\1\12\50\0\1\40\2\0\5\40" - + "\1\41\1\40\1\42\1\43\1\44\1\40\1\45\3\40" - + "\1\46\14\40\1\47\3\40\1\50\1\51\1\52\1\53" - + "\1\54\5\0\1\16\50\0\1\17\2\0\50\17\5\0" - + "\2\20\3\0\13\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\5\0\2\20\3\0\1\20\1\55\11\20\1\0" - + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\3\20\1\56\7\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\5\0\2\20\3\0\10\20\1\57\2\20\1\0" - + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\5\20\1\60\5\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\5\0\2\20\3\0\2\20\1\61\10\20\1\0" - + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\26\0\1\62\1\0" - + "\1\31\1\32\1\0\1\63\24\0\2\20\3\0\10\20" - + "\1\64\2\20\1\0\5\20\1\0\1\20\1\0\1\20" - + "\1\0\3\20\1\0\1\20\2\0\1\20\2\0\1\20" - + "\15\0\1\65\12\0\2\66\1\0\1\67\1\65\33\0" - + "\1\65\12\0\2\32\1\0\1\67\1\65\23\0\2\20" - + "\3\0\5\20\1\70\5\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\30\0\2\67\26\0\2\20\3\0\13\20" - + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\2\20" - + "\1\71\1\0\1\20\2\0\1\20\2\0\1\20\30\0" - + "\1\72\1\73\36\0\3\74\3\0\1\74\4\0\2\74" - + "\2\0\1\74\1\0\1\74\2\0\1\74\2\0\1\74" - + "\23\0\3\75\3\0\1\75\4\0\2\75\2\0\1\75" - + "\1\0\1\75\2\0\1\75\2\0\1\75\13\0\2\20" - + "\3\0\2\20\1\76\10\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\13\20\1\0\5\20" - + "\1\0\1\20\1\0\1\20\1\0\1\77\2\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\11\20\1\100\1\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\5\0\2\20\3\0\6\20\1\101\4\20\1\0" - + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\6\20\1\102\4\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\22\0\1\103\35\0\2\20\3\0\4\20\1\104" - + "\6\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\25\0" - + "\1\105\2\0\2\106\3\0\1\105\32\0\1\65\12\0" - + "\2\67\2\0\1\65\23\0\2\20\3\0\13\20\1\0" - + "\4\20\1\107\1\0\1\20\1\0\1\20\1\0\3\20" - + "\1\0\1\20\2\0\1\20\2\0\1\20\5\0\2\20" - + "\3\0\10\20\1\110\2\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\11\0\1\111\52\0\1\111\16\0\2\73" - + "\36\0\3\112\3\0\1\112\4\0\2\112\2\0\1\112" - + "\1\0\1\112\2\0\1\112\2\0\1\112\23\0\3\113" - + "\3\0\1\113\4\0\2\113\2\0\1\113\1\0\1\113" - + "\2\0\1\113\2\0\1\113\13\0\2\20\3\0\3\20" - + "\1\114\7\20\1\0\5\20\1\0\1\20\1\0\1\20" - + "\1\0\3\20\1\0\1\20\2\0\1\20\2\0\1\20" - + "\5\0\2\20\3\0\12\20\1\115\1\0\5\20\1\0" - + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\2\0" - + "\1\20\2\0\1\20\5\0\2\20\3\0\3\20\1\116" - + "\7\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\5\0" - + "\2\20\3\0\7\20\1\117\3\20\1\0\5\20\1\0" - + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\2\0" - + "\1\20\2\0\1\20\5\0\2\20\3\0\6\20\1\120" - + "\4\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\16\0" - + "\1\121\41\0\2\20\3\0\12\20\1\122\1\0\5\20" - + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20" - + "\2\0\1\20\2\0\1\20\30\0\2\106\26\0\2\20" - + "\3\0\7\20\1\123\3\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\7\20\1\124\3\20" - + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20" - + "\1\0\1\20\2\0\1\20\2\0\1\20\5\0\2\20" - + "\3\0\4\20\1\125\6\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\3\20\1\126\7\20" - + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20" - + "\1\0\1\20\2\0\1\20\2\0\1\20\24\0\1\127" - + "\33\0\2\20\3\0\10\20\1\130\2\20\1\0\5\20" - + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20" - + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\1\131" - + "\12\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\5\0" - + "\2\20\3\0\1\132\12\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\12\20\1\133\1\0" - + "\5\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\22\0\1\134\35\0" - + "\2\20\3\0\12\20\1\135\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\5\20\1\136\5\20" - + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20" - + "\1\0\1\20\2\0\1\20\2\0\1\20\5\0\2\20" - + "\3\0\3\20\1\137\7\20\1\0\5\20\1\0\1\20" - + "\1\0\1\20\1\0\3\20\1\0\1\20\2\0\1\20" - + "\2\0\1\20\5\0\2\20\3\0\10\20\1\140\2\20" - + "\1\0\5\20\1\0\1\20\1\0\1\20\1\0\3\20" - + "\1\0\1\20\2\0\1\20\2\0\1\20\24\0\1\141" - + "\33\0\2\20\3\0\1\142\12\20\1\0\5\20\1\0" - + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\2\0" - + "\1\20\2\0\1\20\5\0\2\20\3\0\10\20\1\143" - + "\2\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\5\0" - + "\2\20\3\0\1\20\1\144\11\20\1\0\5\20\1\0" - + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\2\0" - + "\1\20\2\0\1\20\5\0\2\20\3\0\3\20\1\145" - + "\7\20\1\0\5\20\1\0\1\20\1\0\1\20\1\0" - + "\3\20\1\0\1\20\2\0\1\20\2\0\1\20\12\0" - + "\1\146\45\0\2\20\3\0\13\20\1\0\1\20\1\107" - + "\3\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\1\147\12\20\1\0\5\20\1\0\1\20\1\0\1\20" - + "\1\0\3\20\1\0\1\20\2\0\1\20\2\0\1\20" - + "\5\0\2\20\3\0\13\20\1\0\2\20\1\150\1\151" - + "\1\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0" - + "\1\20\2\0\1\20\2\0\1\20\5\0\2\20\3\0" - + "\11\20\1\152\1\20\1\0\5\20\1\0\1\20\1\0" - + "\1\20\1\0\3\20\1\0\1\20\2\0\1\20\2\0" - + "\1\20\27\0\1\153\30\0\2\20\3\0\13\20\1\0" - + "\2\20\1\154\1\155\1\20\1\0\1\20\1\0\1\20" - + "\1\0\3\20\1\0\1\20\2\0\1\20\2\0\1\20" - + "\5\0\2\20\3\0\13\20\1\0\2\20\2\151\1\20" - + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20" - + "\2\0\1\20\2\0\1\20\5\0\2\20\3\0\13\20" - + "\1\0\2\20\2\155\1\20\1\0\1\20\1\0\1\20" - + "\1\0\3\20\1\0\1\20\2\0\1\20\2\0\1\20"; + /** the current state of the DFA */ + private int zzState; - private static int[] zzUnpackTrans() { - int[] result = new int[3311]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; - private static int zzUnpackTrans(String packed, int offset, int[] result) { - int i = 0; - /* index in packed string */ - int j = offset; - /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do { - result[j++] = value; - } while (--count > 0); - } - return j; - } + /** 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; - /* 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; + /** the current text position in the buffer */ + private int zzCurrentPos; - /* 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" - }; + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; - private static final String ZZ_ATTRIBUTE_PACKED_0 - = "\3\0\1\11\2\1\2\11\1\1\1\11\1\1\1\11" - + "\1\1\1\11\2\1\1\11\14\1\3\11\1\1\2\11" - + "\1\1\7\11\6\1\2\0\1\1\1\0\4\1\4\0" - + "\5\1\1\0\1\1\1\0\3\1\1\11\1\0\1\11" - + "\5\1\1\0\5\1\1\0\4\1\1\0\4\1\1\0" - + "\4\1\1\0\4\1\1\11\2\1"; + /** number of newlines encountered up to the start of the matched text */ + private int yyline; - private static int[] zzUnpackAttribute() { - int[] result = new int[109]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } + /** the number of characters up to the start of the matched text */ + private int yychar; - private static int zzUnpackAttribute(String packed, int offset, int[] result) { - int i = 0; - /* index in packed string */ - int j = offset; - /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do { - result[j++] = value; - } while (--count > 0); - } - return j; - } + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; - /** - * the input device - */ - private java.io.Reader zzReader; + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; - /** - * the current state of the DFA - */ - private int zzState; + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; - /** - * the current lexical state - */ - private int zzLexicalState = YYINITIAL; + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /** + * The number of occupied positions in zzBuffer beyond zzEndRead. + * When a lead/high surrogate has been read from the input stream + * into the final zzBuffer position, this will have a value of 1; + * otherwise, it will have a value of 0. + */ + private int zzFinalHighSurrogate = 0; - /** - * this buffer contains the current text to be matched and is the source of - * the yytext() string - */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + /* user code: */ - /** - * 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; - - /** - * The number of occupied positions in zzBuffer beyond zzEndRead. When a - * lead/high surrogate has been read from the input stream into the final - * zzBuffer position, this will have a value of 1; otherwise, it will have a - * value of 0. - */ - private int zzFinalHighSurrogate = 0; - - /* user code: */ StringBuilder string = new StringBuilder(); private int repeatNum = 1; @@ -654,586 +625,544 @@ public final class FlasmLexer { return yyline + 1; } - /** - * Creates a new scanner - * - * @param in the java.io.Reader to read input from. - */ - public FlasmLexer(java.io.Reader in) { - this.zzReader = in; + private Stack pushedBack = new Stack<>(); + + public void pushback(ASMParsedSymbol symb) { + pushedBack.push(symb); + last = null; } - /** - * 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[0x110000]; - int i = 0; - /* index in packed string */ - int j = 0; - /* index in unpacked array */ - while (i < 3682) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do { - map[j++] = value; - } while (--count > 0); + ASMParsedSymbol last; + public ASMParsedSymbol lex() throws java.io.IOException, ActionParseException{ + ASMParsedSymbol ret = null; + if (!pushedBack.isEmpty()){ + ret = last = pushedBack.pop(); + } else { + ret = last = yylex(); } - return map; + return ret; } - /** - * 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) { - zzEndRead += zzFinalHighSurrogate; - zzFinalHighSurrogate = 0; - System.arraycopy(zzBuffer, zzStartRead, - zzBuffer, 0, - zzEndRead - zzStartRead); - /* translate stored positions */ - zzEndRead -= zzStartRead; - zzCurrentPos -= zzStartRead; - zzMarkedPos -= zzStartRead; - zzStartRead = 0; + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + public FlasmLexer(java.io.Reader in) { + this.zzReader = 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[0x110000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 3802) { + 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) { + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 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 - zzFinalHighSurrogate) { + /* if not: blow it up */ + char newBuffer[] = new char[zzBuffer.length*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + zzEndRead += zzFinalHighSurrogate; + zzFinalHighSurrogate = 0; + } + + /* fill the buffer with new input */ + int requested = zzBuffer.length - zzEndRead; + int totalRead = 0; + while (totalRead < requested) { + int numRead = zzReader.read(zzBuffer, zzEndRead + totalRead, requested - totalRead); + if (numRead == -1) { + break; + } + totalRead += numRead; + } + + if (totalRead > 0) { + zzEndRead += totalRead; + if (totalRead == requested) { /* possibly more input available */ + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; } + } + return false; + } - /* is the buffer big enough? */ - if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) { - /* if not: blow it up */ - char newBuffer[] = new char[zzBuffer.length * 2]; - System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); - zzBuffer = newBuffer; - zzEndRead += zzFinalHighSurrogate; - zzFinalHighSurrogate = 0; + // totalRead = 0: End of stream + 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. + * + * Internal scan buffer is resized down to its initial length, if it has grown. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + zzFinalHighSurrogate = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + if (zzBuffer.length > ZZ_BUFFERSIZE) + zzBuffer = new char[ZZ_BUFFERSIZE]; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + 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 ASMParsedSymbol yylex() throws java.io.IOException, ActionParseException { + 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; + + boolean zzR = false; + int zzCh; + int zzCharCount; + for (zzCurrentPosL = zzStartRead ; + zzCurrentPosL < zzMarkedPosL ; + zzCurrentPosL += zzCharCount ) { + zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL); + zzCharCount = Character.charCount(zzCh); + switch (zzCh) { + case '\u000B': + case '\u000C': + case '\u0085': + case '\u2028': + case '\u2029': + yyline++; + yycolumn = 0; + zzR = false; + break; + case '\r': + yyline++; + yycolumn = 0; + zzR = true; + break; + case '\n': + if (zzR) + zzR = false; + else { + yyline++; + yycolumn = 0; + } + break; + default: + zzR = false; + yycolumn += zzCharCount; } + } - /* fill the buffer with new input */ - int requested = zzBuffer.length - zzEndRead; - int totalRead = 0; - while (totalRead < requested) { - int numRead = zzReader.read(zzBuffer, zzEndRead + totalRead, requested - totalRead); - if (numRead == -1) { - break; - } - totalRead += numRead; + if (zzR) { + // peek one character ahead if it is \n (if we have counted one line too much) + boolean zzPeek; + if (zzMarkedPosL < zzEndReadL) + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + else if (zzAtEOF) + zzPeek = false; + else { + boolean eof = zzRefill(); + zzEndReadL = zzEndRead; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + if (eof) + zzPeek = false; + else + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; } + if (zzPeek) yyline--; + } + zzAction = -1; - if (totalRead > 0) { - zzEndRead += totalRead; - if (totalRead == requested) { - /* possibly more input available */ - if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { - --zzEndRead; - zzFinalHighSurrogate = 1; - } - } - return false; - } + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; - // totalRead = 0: End of stream - return true; - } + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } - /** - * 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. - * - * Internal scan buffer is resized down to its initial length, if it has - * grown. - * - * @param reader the new input stream - */ - public final void yyreset(java.io.Reader reader) { - zzReader = reader; - zzAtBOL = true; - zzAtEOF = false; - zzEOFDone = false; - zzEndRead = zzStartRead = 0; - zzCurrentPos = zzMarkedPos = 0; - zzFinalHighSurrogate = 0; - yyline = yychar = yycolumn = 0; - zzLexicalState = YYINITIAL; - if (zzBuffer.length > ZZ_BUFFERSIZE) { - zzBuffer = new char[ZZ_BUFFERSIZE]; - } - } - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - /** - * Returns the text matched by the current regular expression. - */ - public final String yytext() { - return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); - } - - /** - * Returns the character at position pos from the matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. A value from 0 to - * yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBuffer[zzStartRead + pos]; - } - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos - zzStartRead; - } - - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of yypushback(int) and - * a match-all fallback rule) this method will only be called with things - * that "Can't Possibly Happen". If this method is called, something is - * seriously wrong (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done in error - * fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - 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 ASMParsedSymbol yylex() throws java.io.IOException, ActionParseException { - 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; + zzForAction: { while (true) { - zzMarkedPosL = zzMarkedPos; - - yychar += zzMarkedPosL - zzStartRead; - - boolean zzR = false; - int zzCh; - int zzCharCount; - for (zzCurrentPosL = zzStartRead; - zzCurrentPosL < zzMarkedPosL; - zzCurrentPosL += zzCharCount) { - zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL); - zzCharCount = Character.charCount(zzCh); - switch (zzCh) { - case '\u000B': - case '\u000C': - case '\u0085': - case '\u2028': - case '\u2029': - yyline++; - yycolumn = 0; - zzR = false; - break; - case '\r': - yyline++; - yycolumn = 0; - zzR = true; - break; - case '\n': - if (zzR) { - zzR = false; - } else { - yyline++; - yycolumn = 0; - } - break; - default: - zzR = false; - yycolumn += zzCharCount; - } + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); + } + 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; } - - if (zzR) { - // peek one character ahead if it is \n (if we have counted one line too much) - boolean zzPeek; - if (zzMarkedPosL < zzEndReadL) { - zzPeek = zzBufferL[zzMarkedPosL] == '\n'; - } else if (zzAtEOF) { - zzPeek = false; - } else { - boolean eof = zzRefill(); - zzEndReadL = zzEndRead; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - if (eof) { - zzPeek = false; - } else { - zzPeek = zzBufferL[zzMarkedPosL] == '\n'; - } - } - if (zzPeek) { - yyline--; - } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); + zzCurrentPosL += Character.charCount(zzInput); } - zzAction = -1; + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } - zzState = ZZ_LEXSTATE[zzLexicalState]; - - // set up zzAction for empty match case: - int zzAttributes = zzAttrL[zzState]; - if ((zzAttributes & 1) == 1) { - zzAction = zzState; - } - - zzForAction: - { - while (true) { - - if (zzCurrentPosL < zzEndReadL) { - zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); - zzCurrentPosL += Character.charCount(zzInput); - } 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 = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL); - zzCurrentPosL += Character.charCount(zzInput); - } - } - int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]]; - if (zzNext == -1) { - break zzForAction; - } - zzState = zzNext; - - zzAttributes = zzAttrL[zzState]; - if ((zzAttributes & 1) == 1) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ((zzAttributes & 8) == 8) { - break zzForAction; - } - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 1: { - } - case 33: - break; - case 2: { - yybegin(PARAMETERS); - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INSTRUCTION_NAME, yytext()); - } - case 34: - break; - case 3: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BLOCK_END); - } - case 35: - break; - case 4: { - for (int r = 0; r < repeatNum; r++) { - string.append(yytext()); - } - repeatNum = 1; - } - case 36: - break; - case 5: { - repeatNum = 1; - throw new ActionParseException("Unterminated string at end of line", yyline + 1); - } - case 37: - break; - case 6: { - yybegin(PARAMETERS); - repeatNum = 1; - // length also includes the trailing quote - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_STRING, string.toString()); - } - case 38: - break; - case 7: { - yybegin(YYINITIAL); - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_EOL); - } - case 39: - break; - case 8: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_COMMENT, yytext().substring(1)); - } - case 40: - break; - case 9: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_IDENTIFIER, yytext()); - } - case 41: - break; - case 10: { - yybegin(YYINITIAL); - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BLOCK_START); - } - case 42: - break; - case 11: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INTEGER, Long.parseLong((yytext()))); - } - case 43: - break; - case 12: { - yybegin(STRING); - string.setLength(0); - } - case 44: - break; - case 13: { - String s = yytext(); - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_LABEL, s.substring(0, s.length() - 1)); - } - case 45: - break; - case 14: { - repeatNum = 1; - throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); - } - case 46: - break; - case 15: { - for (int r = 0; r < repeatNum; r++) { - string.append('\t'); - } - repeatNum = 1; - } - case 47: - break; - case 16: { - for (int r = 0; r < repeatNum; r++) { - string.append('\r'); - } - repeatNum = 1; - } - case 48: - break; - case 17: { - for (int r = 0; r < repeatNum; r++) { - string.append('\f'); - } - repeatNum = 1; - } - case 49: - break; - case 18: { - for (int r = 0; r < repeatNum; r++) { - string.append('\n'); - } - repeatNum = 1; - } - case 50: - break; - case 19: { - for (int r = 0; r < repeatNum; r++) { - string.append('\\'); - } - repeatNum = 1; - } - case 51: - break; - case 20: { - for (int r = 0; r < repeatNum; r++) { - string.append('\"'); - } - repeatNum = 1; - } - case 52: - break; - case 21: { - for (int r = 0; r < repeatNum; r++) { - string.append('\b'); - } - repeatNum = 1; - } - case 53: - break; - case 22: { - for (int r = 0; r < repeatNum; r++) { - string.append('\u00A7'); - } - repeatNum = 1; - } - case 54: - break; - case 23: { - for (int r = 0; r < repeatNum; r++) { - string.append('\''); - } - repeatNum = 1; - } - case 55: - break; - case 24: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_FLOAT, Double.parseDouble((yytext()))); - } - case 56: - break; - case 25: { - repeatNum = Integer.parseInt(yytext().substring(2, yytext().length() - 1)); - } - case 57: - break; - case 26: { - char val = (char) Integer.parseInt(yytext().substring(2), 16); - for (int r = 0; r < repeatNum; r++) { - string.append(val); - } - repeatNum = 1; - } - case 58: - break; - case 27: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BOOLEAN, Boolean.TRUE); - } - case 59: - break; - case 28: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_NULL, Null.INSTANCE); - } - case 60: - break; - case 29: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BOOLEAN, Boolean.FALSE); - } - case 61: - break; - case 30: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_REGISTER, new RegisterNumber(Integer.parseInt(yytext().substring(8)))); - } - case 62: - break; - case 31: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_UNDEFINED, Undefined.INSTANCE); - } - case 63: - break; - case 32: { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_CONSTANT, new ConstantIndex(Integer.parseInt(yytext().substring(8)))); - } - case 64: - break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - { - return new ASMParsedSymbol(ASMParsedSymbol.TYPE_EOF); - } - } else { - zzScanError(ZZ_NO_MATCH); - } - } } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { + } + case 34: break; + case 2: + { yybegin(PARAMETERS); + return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INSTRUCTION_NAME, yytext()); + } + case 35: break; + case 3: + { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BLOCK_END); + } + case 36: break; + case 4: + { for(int r=0;r knownAddreses, ScriptExportMode exportMode) { - String ret = "WaitForFrame " + frame + " " + skipCount; + String ret = "WaitForFrame " + frame + ", " + skipCount; return ret; } @@ -100,7 +100,8 @@ public class ActionWaitForFrame extends Action implements ActionStore { public ActionWaitForFrame(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x8A, -1, charset); frame = (int) lexLong(lexer); - skipCount = (int) lexLong(lexer); + lexOptionalComma(lexer); + skipCount = (int) lexLong(lexer); skipped = new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java index 999fcebed..7417a7441 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java @@ -86,7 +86,7 @@ public class ActionGetURL2 extends Action { @Override public String toString() { - return "GetURL2 " + loadVariablesFlag + " " + loadTargetFlag + " " + sendVarsMethod; + return "GetURL2 " + loadVariablesFlag + ", " + loadTargetFlag + ", " + sendVarsMethod; } @Override @@ -110,7 +110,9 @@ public class ActionGetURL2 extends Action { public ActionGetURL2(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x9A, -1, charset); loadVariablesFlag = lexBoolean(lexer); + lexOptionalComma(lexer); loadTargetFlag = lexBoolean(lexer); + lexOptionalComma(lexer); sendVarsMethod = (int) lexLong(lexer); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java index 8a7dddffd..c12480c8d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java @@ -98,14 +98,16 @@ public class ActionGotoFrame2 extends Action { @Override public String toString() { - return "GotoFrame2 " + sceneBiasFlag + " " + playFlag + " " + (sceneBiasFlag ? " " + sceneBias : ""); + return "GotoFrame2 " + sceneBiasFlag + ", " + playFlag + ", " + (sceneBiasFlag ? ", " + sceneBias : ""); } public ActionGotoFrame2(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x9F, -1, charset); sceneBiasFlag = lexBoolean(lexer); + lexOptionalComma(lexer); playFlag = lexBoolean(lexer); if (sceneBiasFlag) { + lexOptionalComma(lexer); sceneBias = (int) lexLong(lexer); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index dbb49fab8..04db785ee 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -265,10 +265,15 @@ public class ActionPush extends Action { super(0x96, 0, charset); this.constantPool = constantPool; values = new ArrayList<>(); - int count = 0; + int count = 0; loop: while (true) { - ASMParsedSymbol symb = lexer.yylex(); + boolean valueExpected = false; + ASMParsedSymbol symb = lexer.lex(); + if (symb.type == ASMParsedSymbol.TYPE_COMMA) { + symb = lexer.lex(); + valueExpected = true; + } switch (symb.type) { case ASMParsedSymbol.TYPE_STRING: count++; @@ -290,7 +295,9 @@ public class ActionPush extends Action { break; case ASMParsedSymbol.TYPE_EOL: case ASMParsedSymbol.TYPE_EOF: - if (count == 0) { + if (valueExpected) { + throw new ActionParseException("Value expected", lexer.yyline()); + } else if (count == 0) { throw new ActionParseException("Arguments expected", lexer.yyline()); } else { break loop; @@ -342,13 +349,11 @@ public class ActionPush extends Action { } public GraphTextWriter paramsToString(GraphTextWriter writer) { - int pos = 0; for (int i = 0; i < values.size(); i++) { - if (pos > 0) { - writer.appendNoHilight(" "); + if (i > 0) { + writer.appendNoHilight(", "); } - writer.append(toString(i), getAddress() + pos + 1, getFileOffset()); - pos++; + writer.append(toString(i), getAddress() + i + 1, getFileOffset()); } return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java index 31af72e9c..5a6475b7d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java @@ -62,14 +62,24 @@ public class ActionConstantPool extends Action { public ActionConstantPool(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x88, 0, charset); + boolean first = true; while (true) { - ASMParsedSymbol symb = lexer.yylex(); + boolean valueRequired = false; + ASMParsedSymbol symb = lexer.lex(); + if (!first && symb.type == ASMParsedSymbol.TYPE_COMMA) { + symb = lexer.lex(); + valueRequired = true; + } if (symb.type == ASMParsedSymbol.TYPE_STRING) { constantPool.add((String) symb.value); } else { - lexer.yypushback(lexer.yylength()); + if (valueRequired) { + throw new ActionParseException("String expected", lexer.yyline()); + } + lexer.pushback(symb); break; - } + } + first = false; } } @@ -109,6 +119,9 @@ public class ActionConstantPool extends Action { StringBuilder ret = new StringBuilder(); ret.append("ConstantPool"); for (int i = 0; i < constantPool.size(); i++) { + if (i > 0) { + ret.append(","); + } ret.append(" \"").append(Helper.escapeActionScriptString(constantPool.get(i))).append("\""); } return ret.toString(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index 55dfc5a27..a0d344d82 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -97,8 +97,10 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta public ActionDefineFunction(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x9B, -1, charset); functionName = lexString(lexer); + lexOptionalComma(lexer); int numParams = (int) lexLong(lexer); for (int i = 0; i < numParams; i++) { + lexOptionalComma(lexer); paramNames.add(lexString(lexer)); } lexBlockOpen(lexer); @@ -138,10 +140,11 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta public String getASMSource(ActionList container, Set knownAddreses, ScriptExportMode exportMode) { StringBuilder paramStr = new StringBuilder(); for (int i = 0; i < paramNames.size(); i++) { + paramStr.append(", "); paramStr.append("\"").append(Helper.escapeActionScriptString(paramNames.get(i))).append("\" "); } - return "DefineFunction \"" + Helper.escapeActionScriptString(functionName) + "\" " + paramNames.size() + " " + paramStr + " {" + (codeSize == 0 ? "\r\n}" : ""); + return "DefineFunction \"" + Helper.escapeActionScriptString(functionName) + "\", " + paramNames.size() + paramStr + " {" + (codeSize == 0 ? "\r\n}" : ""); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 26790da3e..dc5aedc5b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -145,19 +145,32 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont public ActionDefineFunction2(FlasmLexer lexer, String charset) throws IOException, ActionParseException { super(0x8E, -1, charset); functionName = lexString(lexer); + lexOptionalComma(lexer); int numParams = (int) lexLong(lexer); + lexOptionalComma(lexer); registerCount = (int) lexLong(lexer); + lexOptionalComma(lexer); preloadParentFlag = lexBoolean(lexer); + lexOptionalComma(lexer); preloadRootFlag = lexBoolean(lexer); + lexOptionalComma(lexer); suppressSuperFlag = lexBoolean(lexer); + lexOptionalComma(lexer); preloadSuperFlag = lexBoolean(lexer); + lexOptionalComma(lexer); suppressArgumentsFlag = lexBoolean(lexer); + lexOptionalComma(lexer); preloadArgumentsFlag = lexBoolean(lexer); + lexOptionalComma(lexer); suppressThisFlag = lexBoolean(lexer); + lexOptionalComma(lexer); preloadThisFlag = lexBoolean(lexer); + lexOptionalComma(lexer); preloadGlobalFlag = lexBoolean(lexer); for (int i = 0; i < numParams; i++) { + lexOptionalComma(lexer); paramRegisters.add((int) lexLong(lexer)); + lexOptionalComma(lexer); paramNames.add(lexString(lexer)); } lexBlockOpen(lexer); @@ -227,19 +240,20 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont public String getASMSource(ActionList container, Set knownAddreses, ScriptExportMode exportMode) { StringBuilder paramStr = new StringBuilder(); for (int i = 0; i < paramNames.size(); i++) { - paramStr.append(paramRegisters.get(i)).append(" \"").append(Helper.escapeActionScriptString(paramNames.get(i))).append("\" "); + paramStr.append(", "); + paramStr.append(paramRegisters.get(i)).append(", \"").append(Helper.escapeActionScriptString(paramNames.get(i))).append("\""); } - return ("DefineFunction2 \"" + Helper.escapeActionScriptString(functionName) + "\" " + paramRegisters.size() + " " + registerCount - + " " + preloadParentFlag - + " " + preloadRootFlag - + " " + suppressSuperFlag - + " " + preloadSuperFlag - + " " + suppressArgumentsFlag - + " " + preloadArgumentsFlag - + " " + suppressThisFlag - + " " + preloadThisFlag - + " " + preloadGlobalFlag).trim() + " " + paramStr + " {" + (codeSize == 0 ? "\r\n}" : ""); + return ("DefineFunction2 \"" + Helper.escapeActionScriptString(functionName) + "\", " + paramRegisters.size() + ", " + registerCount + + ", " + preloadParentFlag + + ", " + preloadRootFlag + + ", " + suppressSuperFlag + + ", " + preloadSuperFlag + + ", " + suppressArgumentsFlag + + ", " + preloadArgumentsFlag + + ", " + suppressThisFlag + + ", " + preloadThisFlag + + ", " + preloadGlobalFlag).trim() + paramStr + " {" + (codeSize == 0 ? "\r\n}" : ""); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java index 223a7ea9b..ce66a4118 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java @@ -151,7 +151,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer { super(0x8F, 0, charset); this.version = version; - ASMParsedSymbol symb = lexer.yylex(); + ASMParsedSymbol symb = lexer.lex(); if (symb.type == ASMParsedSymbol.TYPE_STRING) { catchInRegisterFlag = false; catchName = (String) symb.value; @@ -238,7 +238,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer { @Override public boolean parseDivision(long size, FlasmLexer lexer) { try { - ASMParsedSymbol symb = lexer.yylex(); + ASMParsedSymbol symb = lexer.lex(); //catchBlockFlag = false; if (symb.type == ASMParsedSymbol.TYPE_INSTRUCTION_NAME) { if (((String) symb.value).toLowerCase().equals("catch")) { @@ -259,14 +259,14 @@ public class ActionTry extends Action implements GraphSourceItemContainer { return true; } else { //finallyBlockFlag = false; - lexer.yypushback(lexer.yylength()); + lexer.pushback(symb); } } else { //finallyBlockFlag = false; - lexer.yypushback(lexer.yylength()); + lexer.pushback(symb); } } else { - lexer.yypushback(lexer.yylength()); + lexer.pushback(symb); } } catch (IOException | ActionParseException ex) { //ignored @@ -277,7 +277,6 @@ public class ActionTry extends Action implements GraphSourceItemContainer { } else if (catchBlockFlag) { catchSize = size - getHeaderSize() - trySize; } - lexer.yybegin(0); return false; } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java index e940d9337..7dc214681 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java @@ -132,7 +132,7 @@ public class ActionScript2AssemblerTest extends ActionScript2TestBase { String decompiled = writer.toString(); assertEquals(actualResult.trim(), "ok = false;"); - assertTrue(decompiled.contains("Push \"ok\" false") || decompiled.contains("Push constant0 false")); + assertTrue(decompiled.contains("Push \"ok\", false") || decompiled.contains("Push constant0, false")); } catch (IOException | ActionParseException | InterruptedException ex) { fail(); } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2CompilerTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2CompilerTest.java index 8842d4397..eb6049b2c 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2CompilerTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2CompilerTest.java @@ -106,16 +106,16 @@ public class ActionScript2CompilerTest extends ActionScript2TestBase { + " var v5 = a + 3;\n" + " }\n" + " }\n" - + "}", "ConstantPool \"v1\" \"a\"\n" - + "DefineFunction \"outfunc\" 0 {\n" + + "}", "ConstantPool \"v1\", \"a\"\n" + + "DefineFunction \"outfunc\", 0 {\n" + "Push \"v1\"\n" - + "DefineFunction2 \"\" 0 3 false false true false true false true false false {\n" - + "Push \"a\" 1\n" + + "DefineFunction2 \"\", 0, 3, false, false, true, false, true, false, true, false, false {\n" + + "Push \"a\", 1\n" + "DefineLocal\n" //critical + "Push 2\n" + "StoreRegister 1\n" + "Pop\n" - + "DefineFunction2 \"\" 0 2 false false true false true false true false false {\n" + + "DefineFunction2 \"\", 0, 2, false, false, true, false, true, false, true, false, false {\n" + "Push \"a\"\n" + "GetVariable\n" + "Push 3\n" @@ -140,10 +140,10 @@ public class ActionScript2CompilerTest extends ActionScript2TestBase { + " var v2 = a + 2;\n" + " }\n" + " }\n" - + "}", "ConstantPool \"g\" \"a\"\n" - + "DefineFunction \"outfunc\" 0 {\n" + + "}", "ConstantPool \"g\", \"a\"\n" + + "DefineFunction \"outfunc\", 0 {\n" + "Push \"g\"\n" - + "DefineFunction2 \"\" 2 4 false false true false true false true false false 0 \"a\" 1 \"p2\" {\n" + + "DefineFunction2 \"\", 2, 4, false, false, true, false, true, false, true, false, false, 0, \"a\", 1, \"p2\" {\n" + "Push \"a\"\n" + "GetVariable\n" //critical + "Push 1\n" @@ -152,7 +152,7 @@ public class ActionScript2CompilerTest extends ActionScript2TestBase { + "Add2\n" + "StoreRegister 2\n" + "Pop\n" - + "DefineFunction2 \"\" 0 2 false false true false true false true false false {\n" + + "DefineFunction2 \"\", 0, 2, false, false, true, false, true, false, true, false, false {\n" + "Push \"a\"\n" + "GetVariable\n" + "Push 2\n" @@ -171,7 +171,7 @@ public class ActionScript2CompilerTest extends ActionScript2TestBase { public void stopUndefined() { testCompilation("trace(stop());", "ConstantPool\n" + "Stop\n" - + "Push undefined undefined\n" + + "Push undefined, undefined\n" + "Trace"); } } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ModificationTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ModificationTest.java index d8ef0eebe..bc731c55e 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ModificationTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2ModificationTest.java @@ -171,7 +171,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testRemoveJumpAction() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "Return\n" + "}\n" @@ -181,11 +181,11 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { "label_1:Push 3"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "Return\n" + "}\n" - + "Push 2 3"; + + "Push 2, 3"; testRemoveAction(actionsString, expectedResult, new int[]{5}); } @@ -193,7 +193,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testRemoveActionFromContainer() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" // remove this action + "Return\n" + "}\n" @@ -202,7 +202,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 3"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Return\n" + "}\n" + "Push 2\n" @@ -215,7 +215,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testRemoveLastActionFromContainer() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" // remove this action + "}\n" @@ -224,7 +224,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 3"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "}\n" + "Push 2\n" @@ -237,7 +237,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testRemoveIfTargetAction() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -248,7 +248,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "Push 5"; // after removing the previous action the if action should jump here String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -263,7 +263,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testRemoveIfTargetLastAction() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -273,7 +273,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 4"; // remove this action String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -288,7 +288,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testAddAtionFirst() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -299,7 +299,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { String expectedResult = "GetMember\n" + "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -315,7 +315,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testAddAtion1() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -326,7 +326,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { String expectedResult = "ConstantPool\n" + "GetMember\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -342,7 +342,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testAddAtionToContainer() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -352,7 +352,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 4"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "GetMember\n" + "Push 1\n" + "GetVariable\n" @@ -369,7 +369,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testAddActionIf() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -379,7 +379,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 4"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -396,7 +396,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { public void testAddActionAfterContainer() { String actionsString = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n" @@ -406,7 +406,7 @@ public class ActionScript2ModificationTest extends ActionScript2TestBase { + "label_1:Push 4"; String expectedResult = "ConstantPool\n" - + "DefineFunction \"test\" 1 \"p1\" {\n" + + "DefineFunction \"test\", 1, \"p1\" {\n" + "Push 1\n" + "GetVariable\n" + "}\n"