diff --git a/lib/jsyntaxpane-0.9.5.jar b/lib/jsyntaxpane-0.9.5.jar index bc4a42add..1625e6b2e 100644 Binary files a/lib/jsyntaxpane-0.9.5.jar and b/lib/jsyntaxpane-0.9.5.jar differ diff --git a/libsrc/ffdec_lib/lexers/actionscript3_script.flex b/libsrc/ffdec_lib/lexers/actionscript3_script.flex index 8e393ed1f..f0b94ba62 100644 --- a/libsrc/ffdec_lib/lexers/actionscript3_script.flex +++ b/libsrc/ffdec_lib/lexers/actionscript3_script.flex @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Stack; -%% +%% %public %class ActionScriptLexer @@ -37,7 +37,7 @@ import java.util.Stack; public ActionScriptLexer(String sourceCode){ this(new StringReader(sourceCode)); - this.sourceCode = sourceCode; + this.sourceCode = sourceCode; } public void yypushbackstr(String s, int state) @@ -115,7 +115,7 @@ InputCharacter = [^\r\n] WhiteSpace = {LineTerminator} | [ \t\f]+ /* comments */ -Comment = {TraditionalComment} | {EndOfLineComment} +Comment = {TraditionalComment} | {EndOfLineComment} TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? @@ -188,19 +188,20 @@ HexDigit = [0-9a-fA-F] OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} OctDigit = [0-7] - -/* floating point literals */ + +/* floating point literals */ DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? -FLit1 = [0-9]+ \. [0-9]* -FLit2 = \. [0-9]+ -FLit3 = [0-9]+ +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ Exponent = [eE] [+-]? [0-9]+ /* string and character literals */ StringCharacter = [^\r\n\"\\] SingleCharacter = [^\r\n\'\\] OIdentifierCharacter = [^\r\n\u00A7\\] +Preprocessor = \u00A7\u00A7 {Identifier} %state STRING, CHARLITERAL,XMLOPENTAG,XMLOPENTAGATTRIB,XMLINSTROPENTAG,XMLINSTRATTRIB,XMLCDATA,XMLCOMMENT,XML,OIDENTIFIER @@ -252,7 +253,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] "false" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); } "null" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); } "this" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); } - "true" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); } + "true" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); } "undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); } "Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); } "NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); } @@ -261,99 +262,102 @@ OIdentifierCharacter = [^\r\n\u00A7\\] /* operators */ - "(" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); } - ")" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); } - "{" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); } - "}" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); } - "[" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); } - "]" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); } - ";" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); } - "," { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); } - "..." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); } - "." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); } - "=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); } - ">" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); } - "<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); } - "!" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); } - "~" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); } - "?" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); } - ":" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); } - "===" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); } - "==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); } - "<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); } - ">=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); } - "!==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); } - "!=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); } - "&&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); } - "||" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); } - "++" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); } - "--" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); } - "+" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); } - "-" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); } - "*" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); } - "/" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); } - "&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); } - "|" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); } - "^" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); } - "%" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); } - "<<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); } - ">>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); } - ">>>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); } - "+=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); } - "-=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); } - "*=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); } - "/=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); } - "&=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); } - "|=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); } - "^=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); } - "%=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); } - "<<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); } - ">>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); } - ">>>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); } - "as" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); } - "delete" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); } - "instanceof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); } - "is" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); } - "::" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); } - "new" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); } - "typeof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); } - "void" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); } - "@" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); } + "(" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); } + ")" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); } + "{" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); } + "}" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); } + "[" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); } + "]" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); } + ";" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); } + "," { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); } + "..." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); } + "." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); } + "=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); } + ">" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); } + "<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); } + "!" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); } + "~" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); } + "?" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); } + ":" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); } + "===" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); } + "==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); } + "<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); } + ">=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); } + "!==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); } + "!=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); } + "&&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); } + "||" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); } + "++" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); } + "--" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); } + "+" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); } + "-" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); } + "*" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); } + "/" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); } + "&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); } + "|" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); } + "^" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); } + "%" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); } + "<<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); } + ">>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); } + ">>>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); } + "+=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); } + "-=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); } + "*=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); } + "/=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); } + "&=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); } + "|=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); } + "^=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); } + "%=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); } + "<<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); } + ">>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); } + ">>>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); } + "as" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); } + "delete" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); } + "instanceof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); } + "is" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); } + "::" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); } + "new" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); } + "typeof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); } + "void" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); } + "@" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); } ".(" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FILTER, yytext()); } ".." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DESCENDANTS, yytext()); } - + /* string literal */ - \" { + \" { string.setLength(0); - yybegin(STRING); + yybegin(STRING); } - "\u00A7" { + {Preprocessor} { + return new ParsedSymbol(SymbolGroup.PREPROCESSOR, SymbolType.PREPROCESSOR, yytext().substring(2)); + } + "\u00A7" { string.setLength(0); - yybegin(OIDENTIFIER); + yybegin(OIDENTIFIER); } /* character literal */ - \' { + \' { string.setLength(0); - yybegin(CHARLITERAL); + yybegin(CHARLITERAL); } /* numeric literals */ {DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); } - + {HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); } - + {OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); } - + {DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); } - + /* comments */ {Comment} { /*ignore*/ } {LineTerminator} { yyline++;} /* whitespace */ - {WhiteSpace} { /*ignore*/ } + {WhiteSpace} { /*ignore*/ } {TypeNameSpec} { return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, yytext()); } {XmlOpenTagStart} { yybegin(XMLOPENTAG); @@ -361,9 +365,9 @@ OIdentifierCharacter = [^\r\n\u00A7\\] return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext()); } "<{" { return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext()); } - /* identifiers */ - {Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); } - + /* identifiers */ + {Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); } + } { @@ -402,9 +406,9 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.setLength(0); } return lex(); - } + } {LineTerminator} { string.append(yytext()); yyline++;} - {WhiteSpace} { string.append(yytext()); } + {WhiteSpace} { string.append(yytext()); } } @@ -416,8 +420,8 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } "{" { yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext()); - } + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext()); + } } @@ -448,7 +452,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.setLength(0); } return lex(); - } + } {LineTerminator} { string.append(yytext()); yyline++;} {WhiteSpace} { string.append(yytext()); } } @@ -461,11 +465,11 @@ OIdentifierCharacter = [^\r\n\u00A7\\] \"{XmlSQuoteStringChar}*\" { yybegin(XMLINSTROPENTAG); return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext()); - } + } "{" { yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRVALVAR_BEGIN, yytext()); - } + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRVALVAR_BEGIN, yytext()); + } } @@ -529,14 +533,14 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } return lex(); } - {XmlCloseTag} { + {XmlCloseTag} { pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHTAG, yytext())); if (string.length() > 0){ pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); string.setLength(0); } return lex(); - } + } "<{" { yybegin(YYINITIAL); @@ -547,7 +551,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } return lex(); } - " 0){ @@ -555,8 +559,8 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.setLength(0); } return lex(); - } - "{" { + } + "{" { yybegin(YYINITIAL); pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_VAR_BEGIN, yytext())); if (string.length() > 0){ @@ -564,18 +568,18 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.setLength(0); } return lex(); - } + } {LineTerminator} { string.append(yytext()); yyline++;} [^] { string.append(yytext()); } } { - "\u00A7" { - yybegin(YYINITIAL); + "\u00A7" { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); } - + {OIdentifierCharacter}+ { string.append(yytext()); } /* escape sequences */ @@ -590,7 +594,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } - + /* escape sequences */ \\. { throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); } @@ -598,12 +602,12 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \" { - yybegin(YYINITIAL); + \" { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); } - + {StringCharacter}+ { string.append(yytext()); } /* escape sequences */ @@ -619,7 +623,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } - + /* escape sequences */ \\. { /* ignore illegal character escape */ } @@ -627,14 +631,14 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \' { - yybegin(YYINITIAL); + \' { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); } - + {SingleCharacter}+ { string.append(yytext()); } - + /* escape sequences */ "\\b" { string.append('\b'); } "\\t" { string.append('\t'); } @@ -648,7 +652,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } - + /* escape sequences */ \\. { /* ignore illegal character escape */ } diff --git a/libsrc/ffdec_lib/lexers/actionscript_script.flex b/libsrc/ffdec_lib/lexers/actionscript_script.flex index 350dca603..d00294b43 100644 --- a/libsrc/ffdec_lib/lexers/actionscript_script.flex +++ b/libsrc/ffdec_lib/lexers/actionscript_script.flex @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Stack; -%% +%% %public %class ActionScriptLexer @@ -95,7 +95,7 @@ InputCharacter = [^\r\n] WhiteSpace = {LineTerminator} | [ \t\f]+ /* comments */ -Comment = {TraditionalComment} | {EndOfLineComment} +Comment = {TraditionalComment} | {EndOfLineComment} TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? @@ -123,13 +123,13 @@ HexDigit = [0-9a-fA-F] OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} OctDigit = [0-7] - -/* floating point literals */ + +/* floating point literals */ DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? -FLit1 = [0-9]+ \. [0-9]* -FLit2 = \. [0-9]+ -FLit3 = [0-9]+ +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ Exponent = [eE] [+-]? [0-9]+ /* string and character literals */ @@ -137,6 +137,8 @@ StringCharacter = [^\r\n\"\\] SingleCharacter = [^\r\n\'\\] OIdentifierCharacter = [^\r\n\u00A7\\] +Preprocessor = \u00A7\u00A7 {Identifier} + %state STRING, CHARLITERAL, XMLSTARTTAG, XML, OIDENTIFIER %% @@ -236,108 +238,112 @@ OIdentifierCharacter = [^\r\n\u00A7\\] "unloadMovie" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIE, yytext()); } "unloadMovieNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIENUM, yytext()); } "fscommand" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.FSCOMMAND, yytext()); } - + /* operators */ - "(" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); } - ")" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); } - "{" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); } - "}" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); } - "[" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); } - "]" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); } - ";" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); } - "," { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); } - "..." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); } - "." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); } - "=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); } - ">" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); } - "<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); } - "!" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); } - "~" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); } - "?" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); } - ":" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); } - "===" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); } - "==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); } - "<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); } - ">=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); } - "!==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); } - "!=" | "<>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); } - "&&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); } - "||" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); } - "++" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); } - "--" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); } - "+" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); } - "-" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); } - "*" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); } - "/" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); } - "&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); } - "|" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); } - "^" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); } - "%" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); } - "<<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); } - ">>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); } - ">>>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); } - "+=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); } - "-=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); } - "*=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); } - "/=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); } - "&=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); } - "|=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); } - "^=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); } - "%=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); } - "<<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); } - ">>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); } - ">>>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); } - "as" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); } - "delete" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); } - "instanceof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); } - "is" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); } - "::" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); } - "new" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); } - "typeof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); } - "void" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); } - "@" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); } - "and" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLAND, yytext()); } - "or" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLOR, yytext()); } - + "(" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); } + ")" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); } + "{" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); } + "}" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); } + "[" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); } + "]" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); } + ";" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); } + "," { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); } + "..." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); } + "." { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); } + "=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); } + ">" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); } + "<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); } + "!" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); } + "~" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); } + "?" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); } + ":" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); } + "===" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); } + "==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); } + "<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); } + ">=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); } + "!==" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); } + "!=" | "<>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); } + "&&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); } + "||" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); } + "++" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); } + "--" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); } + "+" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); } + "-" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); } + "*" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); } + "/" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); } + "&" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); } + "|" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); } + "^" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); } + "%" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); } + "<<" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); } + ">>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); } + ">>>" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); } + "+=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); } + "-=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); } + "*=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); } + "/=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); } + "&=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); } + "|=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); } + "^=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); } + "%=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); } + "<<=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); } + ">>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); } + ">>>=" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); } + "as" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); } + "delete" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); } + "instanceof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); } + "is" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); } + "::" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); } + "new" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); } + "typeof" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); } + "void" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); } + "@" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); } + "and" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLAND, yytext()); } + "or" { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLOR, yytext()); } + /* string literal */ - \" { + \" { string.setLength(0); - yybegin(STRING); + yybegin(STRING); } - "\u00A7" { + {Preprocessor} { + return new ParsedSymbol(SymbolGroup.PREPROCESSOR, SymbolType.PREPROCESSOR, yytext().substring(2)); + } + + "\u00A7" { string.setLength(0); - yybegin(OIDENTIFIER); - } + yybegin(OIDENTIFIER); + } /* character literal */ - \' { + \' { string.setLength(0); - yybegin(CHARLITERAL); + yybegin(CHARLITERAL); } /* numeric literals */ {DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); } - + {HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); } - + {OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); } - + {DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); } - + /* comments */ {Comment} { /*ignore*/ } {LineTerminator} { yyline++;} /* whitespace */ - {WhiteSpace} { /*ignore*/ } + {WhiteSpace} { /*ignore*/ } {TypeNameSpec} { String t = yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, t.substring(2, t.length() - 1)); } {XMLBeginOneTag} {string.setLength(0); - yybegin(XML); - String s = yytext(); + yybegin(XML); + String s = yytext(); s = s.substring(1, s.length() - 1); if (s.contains(" ")){ s = s.substring(0, s.indexOf(' ')); @@ -345,8 +351,8 @@ OIdentifierCharacter = [^\r\n\u00A7\\] xmlTagName = s; string.append(yytext()); } - /* identifiers */ - {Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); } + /* identifiers */ + {Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); } } { @@ -359,7 +365,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] {XMLBeginOneTag} { string.append(yytext());} {XMLEndTag} { string.append(yytext()); String endtagname = yytext(); - endtagname = endtagname.substring(2, endtagname.length() - 1); + endtagname = endtagname.substring(2, endtagname.length() - 1); if (endtagname.equals(xmlTagName)){ yybegin(YYINITIAL); return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML, string.toString()); @@ -370,12 +376,12 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - "\u00A7" { - yybegin(YYINITIAL); + "\u00A7" { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); } - + {OIdentifierCharacter}+ { string.append(yytext()); } /* escape sequences */ @@ -390,7 +396,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } - + /* escape sequences */ \\. { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); } @@ -398,12 +404,12 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \" { - yybegin(YYINITIAL); + \" { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); } - + {StringCharacter}+ { string.append(yytext()); } /* escape sequences */ @@ -414,14 +420,14 @@ OIdentifierCharacter = [^\r\n\u00A7\\] "\\r" { string.append('\r'); } "\\\"" { string.append('\"'); } "\\'" { string.append('\''); } - "\\\\" { string.append('\\'); } + "\\\\" { string.append('\\'); } \\x{HexDigit}{2} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } \\{OctDigit}{3} { char val = (char) Integer.parseInt(yytext().substring(1), 8); string.append(val); } - + /* escape sequences */ \\. { string.append('\\'); /*illegal escape sequence*/ } @@ -429,14 +435,14 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \' { - yybegin(YYINITIAL); + \' { + yybegin(YYINITIAL); // length also includes the trailing quote return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); } - + {SingleCharacter}+ { string.append(yytext()); } - + /* escape sequences */ /* escape sequences */ "\\b" { string.append('\b'); } @@ -451,7 +457,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] string.append(val); } \\u{HexDigit}{4} { char val = (char) Integer.parseInt(yytext().substring(2), 16); string.append(val); } - + /* escape sequences */ \\. { string.append('\\'); /*illegal escape sequence*/ } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 017984d3f..172d0602c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1736,7 +1736,7 @@ public final class SWF implements SWFContainerItem, Timelined { private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageTypes, ActionGraphSource code, int addr, String path) throws InterruptedException { ActionLocalData localData = new ActionLocalData(); - getVariables(null, localData, new TranslateStack(), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageTypes, path); + getVariables(null, localData, new TranslateStack(path), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageTypes, path); } private List> getVariables(List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes, ASMSource src, String path) throws InterruptedException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java index 212210862..c62dd113d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.graph.ScopeStack; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @@ -56,9 +57,10 @@ public class AVM2LocalData extends BaseLocalData { public ArrayList parsedExceptions; - public ArrayList finallyJumps; + public Map> finallyJumps; - public ArrayList ignoredSwitches; + public Map ignoredSwitches; + public List ignoredSwitches2; public Integer scriptIndex; @@ -88,6 +90,7 @@ public class AVM2LocalData extends BaseLocalData { parsedExceptions = localData.parsedExceptions; finallyJumps = localData.finallyJumps; ignoredSwitches = localData.ignoredSwitches; + ignoredSwitches2 = localData.ignoredSwitches2; scriptIndex = localData.scriptIndex; localRegAssignmentIps = localData.localRegAssignmentIps; ip = localData.ip; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 8653f2fb3..0e3c62f4c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -282,6 +282,7 @@ import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateException; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.decompiler.graph.TypeItem; +import com.jpexs.decompiler.graph.model.ExitItem; import com.jpexs.decompiler.graph.model.ScriptEndItem; import com.jpexs.helpers.Helper; import java.io.ByteArrayInputStream; @@ -1243,8 +1244,8 @@ public class AVM2Code implements Cloneable { if (isKilled(((SetLocalAVM2Item) output.get(i)).regIndex, 0, code.size() - 1)) { SetLocalAVM2Item lsi = (SetLocalAVM2Item) output.get(i); if (i + 1 < output.size()) { - if (output.get(i + 1) instanceof ReturnValueAVM2Item) { - ReturnValueAVM2Item rv = (ReturnValueAVM2Item) output.get(i + 1); + if (output.get(i + 1) instanceof ExitItem) { + GraphTargetItem rv = output.get(i + 1); if (rv.value instanceof LocalRegAVM2Item) { LocalRegAVM2Item lr = (LocalRegAVM2Item) rv.value; if (lr.regIndex == lsi.regIndex) { @@ -1442,7 +1443,7 @@ public class AVM2Code implements Cloneable { } } if (!isKilled(reg, 0, end)) { - GraphTargetItem vx = stack.pop(); + GraphTargetItem vx = stack.pop().getThroughDuplicate(); int dupCnt = 1; for (int i = ip - 1; i >= start; i--) { if (code.get(i).definition instanceof DupIns) { @@ -1899,6 +1900,7 @@ public class AVM2Code implements Cloneable { ret.parsedExceptions = localData.parsedExceptions; ret.finallyJumps = localData.finallyJumps; ret.ignoredSwitches = localData.ignoredSwitches; + ret.ignoredSwitches2 = localData.ignoredSwitches2; ret.scriptIndex = localData.scriptIndex; ret.localRegAssignmentIps = localData.localRegAssignmentIps; ret.ip = localData.ip; @@ -1921,8 +1923,9 @@ public class AVM2Code implements Cloneable { localData.localRegNames = body.getLocalRegNames(abc); localData.fullyQualifiedNames = new ArrayList<>(); localData.parsedExceptions = new ArrayList<>(); - localData.finallyJumps = new ArrayList<>(); - localData.ignoredSwitches = new ArrayList<>(); + localData.finallyJumps = new HashMap<>(); + localData.ignoredSwitches = new HashMap<>(); + localData.ignoredSwitches2 = new ArrayList<>(); localData.scriptIndex = scriptIndex; localData.localRegAssignmentIps = new HashMap<>(); localData.ip = 0; @@ -2958,7 +2961,7 @@ public class AVM2Code implements Cloneable { public static int removeTraps(AVM2ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, AVM2LocalData localData, AVM2GraphSource code, int addr, String path, HashMap> refs) throws InterruptedException { HashMap decisions = new HashMap<>(); - removeTraps(refs, false, false, localData, new TranslateStack(), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path, 0); + removeTraps(refs, false, false, localData, new TranslateStack(path), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path, 0); int cnt = 0; for (AVM2Instruction src : decisions.keySet()) { Decision dec = decisions.get(src); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 75beee2bf..c29e13c1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -36,6 +36,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.HasNextAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NewActivationAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NextNameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NextValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; @@ -69,6 +70,8 @@ import com.jpexs.decompiler.graph.model.ExitItem; import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.LoopItem; import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.PushItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.WhileItem; import java.util.ArrayList; @@ -76,6 +79,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @@ -124,8 +128,9 @@ public class AVM2Graph extends Graph { localData.localRegNames = localRegNames; localData.fullyQualifiedNames = fullyQualifiedNames; localData.parsedExceptions = new ArrayList<>(); - localData.finallyJumps = new ArrayList<>(); - localData.ignoredSwitches = new ArrayList<>(); + localData.finallyJumps = new HashMap<>(); + localData.ignoredSwitches = new HashMap<>(); + localData.ignoredSwitches2 = new ArrayList<>(); localData.scriptIndex = scriptIndex; localData.localRegAssignmentIps = new HashMap<>(); localData.ip = 0; @@ -159,26 +164,6 @@ public class AVM2Graph extends Graph { } } } - - /*for(ABCException ex:body.exceptions){ - for(GraphPart p:allBlocks){ - boolean next_is_ex_start=false; - for(GraphPart n:p.nextParts){ - if(n.start==code.adr2pos(ex.start)){ - next_is_ex_start = true; - break; - } - } - if(next_is_ex_start){ - for(GraphPart q:allBlocks){ //find target part - if(q.start==code.adr2pos(ex.target)){ - p.nextParts.add(q); - break; - } - } - } - } - }*/ } @Override @@ -187,11 +172,13 @@ public class AVM2Graph extends Graph { AVM2LocalData aLocalData = (AVM2LocalData) localData; List parsedExceptions = aLocalData.parsedExceptions; - List finallyJumps = aLocalData.finallyJumps; - List ignoredSwitches = aLocalData.ignoredSwitches; + Map> finallyJumps = aLocalData.finallyJumps; + Map ignoredSwitches = aLocalData.ignoredSwitches; + List ignoredSwitches2 = aLocalData.ignoredSwitches2; int ip = part.start; int addr = this.avm2code.fixAddrAfterDebugLine(this.avm2code.pos2adr(part.start)); int maxend = -1; + List catchedFinallys = new ArrayList<>(); List catchedExceptions = new ArrayList<>(); for (int e = 0; e < body.exceptions.length; e++) { if (addr == this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].start)) { @@ -200,11 +187,13 @@ public class AVM2Graph extends Graph { if (!parsedExceptions.contains(body.exceptions[e])) { if (((body.exceptions[e].end) > maxend)) { catchedExceptions.clear(); + catchedFinallys.clear(); maxend = this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end); catchedExceptions.add(body.exceptions[e]); } else if (this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end) == maxend) { catchedExceptions.add(body.exceptions[e]); } + catchedFinallys.add(e); } } else if (body.exceptions[e].isFinally()) { @@ -233,14 +222,16 @@ public class AVM2Graph extends Graph { List finallyCommands = new ArrayList<>(); boolean hasFinally = false; int returnPos = afterCatchPos; + int finStart = -1; for (int e = 0; e < body.exceptions.length; e++) { if (body.exceptions[e].isFinally()) { if (addr == this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].start)) { if (afterCatchPos + 1 == code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end))) { + catchedFinallys.add(e); AVM2Instruction jmpIns = this.avm2code.code.get(code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end))); if (jmpIns.definition instanceof JumpIns) { - int finStart = code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]); + finStart = code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]); GraphPart fpart = null; for (GraphPart p : allParts) { @@ -249,6 +240,8 @@ public class AVM2Graph extends Graph { break; } } + TranslateStack st = (TranslateStack) stack.clone(); + st.clear(); int swPos = -1; for (int f = finStart; f < this.avm2code.code.size(); f++) { if (this.avm2code.code.get(f).definition instanceof LookupSwitchIns) { @@ -256,7 +249,7 @@ public class AVM2Graph extends Graph { if (swins.operands.length >= 3) { if (swins.operands[0] == swins.getBytes().length) { if (code.adr2pos(code.pos2adr(f) + swins.operands[2]) < finStart) { - stack.push(new ExceptionAVM2Item(body.exceptions[e])); + //st.push(new ExceptionAVM2Item(body.exceptions[e])); GraphPart fepart = null; for (GraphPart p : allParts) { if (p.start == f + 1) { @@ -280,13 +273,17 @@ public class AVM2Graph extends Graph { } //ignoredSwitches.add(-1); //int igs_size=ignoredSwitches.size(); - List oldFinallyJumps = new ArrayList<>(finallyJumps); + Map> oldFinallyJumps = new HashMap<>(finallyJumps); finallyJumps.clear(); - ignoredSwitches.add(swPos); - finallyCommands = printGraph(localData, stack, allParts, parent, fpart, null, loops, staticOperation, path); + ignoredSwitches.put(e, swPos); + st.push(new PopItem(null)); + finallyCommands = printGraph(localData, st, allParts, parent, fpart, null, loops, staticOperation, path); //ignoredSwitches.remove(igs_size-1); - finallyJumps.addAll(oldFinallyJumps); - finallyJumps.add(finStart); + finallyJumps.putAll(oldFinallyJumps); + if (!finallyJumps.containsKey(e)) { + finallyJumps.put(e, new ArrayList<>()); + } + finallyJumps.get(e).add(finStart); hasFinally = true; break; } @@ -328,7 +325,9 @@ public class AVM2Graph extends Graph { break; } } - stack.add(new ExceptionAVM2Item(catchedExceptions.get(e))); + TranslateStack st2 = (TranslateStack) stack.clone(); + st2.clear(); + st2.add(new ExceptionAVM2Item(catchedExceptions.get(e))); AVM2LocalData localData2 = new AVM2LocalData(aLocalData); localData2.scopeStack = new ScopeStack(); List stopPart2 = new ArrayList<>(stopPart); @@ -336,16 +335,18 @@ public class AVM2Graph extends Graph { if (retPart != null) { stopPart2.add(retPart); } - List ncatchedCommands = printGraph(localData2, stack, allParts, parent, npart, stopPart2, loops, staticOperation, path); + + List ncatchedCommands = printGraph(localData2, st2, allParts, parent, npart, stopPart2, loops, staticOperation, path); if (catchedExceptions.get(e).isFinally() && (catchedExceptions.size() > 1 || hasFinally)) { catchedExceptions.remove(e); e--; } else { catchedCommands.add(ncatchedCommands); if (retPart != null && avm2code.code.get(retPart.start).isExit() && !(!ncatchedCommands.isEmpty() && (ncatchedCommands.get(ncatchedCommands.size() - 1) instanceof ExitItem))) { - avm2code.code.get(retPart.start).translate(localData, stack, ncatchedCommands, staticOperation, path); + avm2code.code.get(retPart.start).translate(localData, st2, ncatchedCommands, staticOperation, path); } if (catchedExceptions.get(e).isFinally()) { + //endposStartBlock = -1; if (!ncatchedCommands.isEmpty() && (ncatchedCommands.get(0) instanceof SetLocalAVM2Item)) { SetLocalAVM2Item sl = (SetLocalAVM2Item) ncatchedCommands.get(0); if (sl.value.getNotCoerced() instanceof ExceptionAVM2Item) { @@ -364,19 +365,31 @@ public class AVM2Graph extends Graph { break; } } - List stopPart2 = new ArrayList<>(stopPart); - stopPart2.add(nepart); + List stopPart2 = new ArrayList<>();//stopPart); + if (nepart != null) { + stopPart2.add(nepart); + } stopPart2.addAll(catchParts); if (retPart != null) { stopPart2.add(retPart); } - List tryCommands = printGraph(localData, stack, allParts, parent, part, stopPart2, loops, staticOperation, path); + TranslateStack st = (TranslateStack) stack.clone(); + st.clear(); + List tryCommands = printGraph(localData, st, allParts, parent, part, stopPart2, loops, staticOperation, path); if (retPart != null && avm2code.code.get(retPart.start).isExit() && !(!tryCommands.isEmpty() && (tryCommands.get(tryCommands.size() - 1) instanceof ExitItem))) { - avm2code.code.get(retPart.start).translate(localData, stack, tryCommands, staticOperation, path); + avm2code.code.get(retPart.start).translate(localData, st, tryCommands, staticOperation, path); } output.clear(); + stack.clear(); output.add(new TryAVM2Item(tryCommands, catchedExceptions, catchedCommands, finallyCommands, finCatchName)); + finallyJumps = ((AVM2LocalData) localData).finallyJumps; + for (int fin_e : catchedFinallys) { + if (finallyJumps.containsKey(fin_e)) { + finallyJumps.get(fin_e).clear(); + } + //.remove((Integer) finStart); + } ip = returnPos; } @@ -397,7 +410,10 @@ public class AVM2Graph extends Graph { ret.addAll(output); GraphTargetItem lop = checkLoop(part, stopPart, loops); if (lop == null) { - ret.addAll(printGraph(localData, stack, allParts, null, part, stopPart, loops, staticOperation, path)); + TranslateStack st = (TranslateStack) stack.clone(); + st.clear(); + + ret.addAll(printGraph(localData, st, allParts, null, part, stopPart, loops, staticOperation, path)); } else { ret.add(lop); } @@ -423,7 +439,7 @@ public class AVM2Graph extends Graph { } } } - if ((this.avm2code.code.get(part.end).definition instanceof LookupSwitchIns) && ignoredSwitches.contains(part.end)) { + if ((this.avm2code.code.get(part.end).definition instanceof LookupSwitchIns) && (ignoredSwitches.containsValue(part.end) || ignoredSwitches2.contains(part.end))) { ret = new ArrayList<>(); ret.addAll(output); return ret; @@ -444,9 +460,9 @@ public class AVM2Graph extends Graph { && (this.avm2code.code.get(part.nextParts.get(1).nextParts.get(0).end).definition instanceof LookupSwitchIns))) { if (stack.peek() instanceof StrictEqAVM2Item) { - ignoredSwitches.add(part.nextParts.get(0).nextParts.get(0).end); + ignoredSwitches2.add(part.nextParts.get(0).nextParts.get(0).end); } else { - ignoredSwitches.add(part.nextParts.get(1).nextParts.get(0).end); + ignoredSwitches2.add(part.nextParts.get(1).nextParts.get(0).end); } ret = new ArrayList<>(); ret.addAll(output); @@ -494,7 +510,7 @@ public class AVM2Graph extends Graph { } GraphPart numPart = part.nextParts.get(reversed ? 0 : 1); AVM2Instruction ins = null; - TranslateStack sstack = new TranslateStack(); + TranslateStack sstack = new TranslateStack(path); do { for (int n = 0; n < numPart.getHeight(); n++) { ins = this.avm2code.code.get(numPart.getPosAt(n)); @@ -535,7 +551,7 @@ public class AVM2Graph extends Graph { GraphPart numPart = dp; AVM2Instruction ins = null; - TranslateStack sstack = new TranslateStack(); + TranslateStack sstack = new TranslateStack(path); do { for (int n = 0; n < numPart.getHeight(); n++) { ins = this.avm2code.code.get(numPart.getPosAt(n)); @@ -636,33 +652,34 @@ public class AVM2Graph extends Graph { @Override protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart next, List allParts) { AVM2LocalData aLocalData = (AVM2LocalData) localData; - List finallyJumps = aLocalData.finallyJumps; - List ignoredSwitches = aLocalData.ignoredSwitches; + Map> finallyJumps = aLocalData.finallyJumps; + Map ignoredSwitches = aLocalData.ignoredSwitches; GraphPart ret = next; - for (int f = 0; f < finallyJumps.size(); f++) { - int fip = finallyJumps.get(f); + for (int f : finallyJumps.keySet()) {//int f = 0; f < finallyJumps.size(); f++) { int swip = ignoredSwitches.get(f); - if (next.start == fip) { - if (stack != null && swip != -1) { - AVM2Instruction swIns = avm2code.code.get(swip); - GraphTargetItem t = stack.pop(); - Double dval = EcmaScript.toNumber(t.getResult()); - int val = (int) (double) dval; - if (swIns.definition instanceof LookupSwitchIns) { - List branches = swIns.getBranches(code); - int nip = branches.get(0); - if (val >= 0 && val < branches.size() - 1) { - nip = branches.get(1 + val); - } - for (GraphPart p : allParts) { - if (avm2code.fixIPAfterDebugLine(p.start) == avm2code.fixIPAfterDebugLine(nip)) { - return p; + for (int fip : finallyJumps.get(f)) { + if (next.start == fip) { + if (stack != null && swip != -1) { + AVM2Instruction swIns = avm2code.code.get(swip); + GraphTargetItem t = stack.pop(); + Double dval = EcmaScript.toNumber(t.getResult()); + int val = (int) (double) dval; + if (swIns.definition instanceof LookupSwitchIns) { + List branches = swIns.getBranches(code); + int nip = branches.get(0); + if (val >= 0 && val < branches.size() - 1) { + nip = branches.get(1 + val); } + for (GraphPart p : allParts) { + if (avm2code.fixIPAfterDebugLine(p.start) == avm2code.fixIPAfterDebugLine(nip)) { + return p; + } + } + ret = null; } - ret = null; } + ret = null; } - ret = null; } } if (ret != next) { @@ -678,8 +695,14 @@ public class AVM2Graph extends Graph { AVM2Instruction jmpIns = this.avm2code.code.get(avm2code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end))); if (jmpIns.definition instanceof JumpIns) { int finStart = avm2code.adr2pos(this.avm2code.fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]); - finallyJumps.add(finStart); - ignoredSwitches.add(-1); + if (!finallyJumps.containsKey(e)) { + finallyJumps.put(e, new ArrayList<>()); + } + finallyJumps.get(e).add(finStart); + if (!ignoredSwitches.containsKey(e)) { + ignoredSwitches.put(e, -1); + } + //ignoredSwitches.put(e, -1); break; } } @@ -707,7 +730,11 @@ public class AVM2Graph extends Graph { } GraphTargetItem ft = w.commands.get(pos); if (ft instanceof WithAVM2Item) { - ft = w.commands.get(pos + 1); + pos++; + while (w.commands.get(pos) instanceof SetTypeAVM2Item) { + pos++; + } + ft = w.commands.get(pos); if (ft instanceof IfItem) { IfItem ift = (IfItem) ft; if (ift.onTrue.size() > 0) { @@ -759,7 +786,7 @@ public class AVM2Graph extends Graph { @Override protected void finalProcess(List list, int level, FinalProcessLocalData localData) { - super.finalProcess(list, level, localData); + if (level == 0) { if (!list.isEmpty()) { if (list.get(list.size() - 1) instanceof ReturnVoidAVM2Item) { @@ -864,6 +891,8 @@ public class AVM2Graph extends Graph { } } } + //Handle for loops at the end: + super.finalProcess(list, level, localData); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java index f222a3d22..121344f18 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java @@ -1,49 +1,49 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import com.jpexs.decompiler.graph.model.NotItem; -import java.util.HashMap; -import java.util.List; - -public class NotIns extends InstructionDefinition { - - public NotIns() { - super(0x96, "not", new int[]{}, false); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - GraphTargetItem v = stack.pop(); - stack.push(new NotItem(ins, v)); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return -1 + 1; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.NotItem; +import java.util.HashMap; +import java.util.List; + +public class NotIns extends InstructionDefinition { + + public NotIns() { + super(0x96, "not", new int[]{}, false); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + GraphTargetItem v = stack.pop(); + stack.push(v.invert(ins)); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -1 + 1; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java index 1ac54af7a..e71bdb9e8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java @@ -1,56 +1,57 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import com.jpexs.decompiler.graph.model.NotItem; -import java.util.HashMap; -import java.util.List; - -public class IfFalseIns extends InstructionDefinition implements IfTypeIns { - - public IfFalseIns() { - super(0x12, "iffalse", new int[]{AVM2Code.DAT_OFFSET}, false); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - GraphTargetItem v1 = stack.pop(); - stack.push(new NotItem(ins, v1)); - } - - @Override - public void translateInverted(HashMap localRegs, TranslateStack stack, AVM2Instruction ins) { - //String v1 = stack.pop().toString(); - //stack.push("(" + v1 + ")"); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return -1; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.NotItem; +import java.util.HashMap; +import java.util.List; + +public class IfFalseIns extends InstructionDefinition implements IfTypeIns { + + public IfFalseIns() { + super(0x12, "iffalse", new int[]{AVM2Code.DAT_OFFSET}, false); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + GraphTargetItem v1 = stack.pop(); + //stack.push(new NotItem(ins, v1)); + stack.push(v1.invert(ins)); + } + + @Override + public void translateInverted(HashMap localRegs, TranslateStack stack, AVM2Instruction ins) { + //String v1 = stack.pop().toString(); + //stack.push("(" + v1 + ")"); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -1; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java index 8f61976f0..dd59e4687 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java @@ -1,56 +1,56 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import com.jpexs.decompiler.graph.model.NotItem; -import java.util.HashMap; -import java.util.List; - -public class IfTrueIns extends InstructionDefinition implements IfTypeIns { - - public IfTrueIns() { - super(0x11, "iftrue", new int[]{AVM2Code.DAT_OFFSET}, false); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - //String v1 = stack.pop().toString(); - //stack.push("(" + v1 + ")"); - } - - @Override - public void translateInverted(HashMap localRegs, TranslateStack stack, AVM2Instruction ins) { - GraphTargetItem v1 = stack.pop(); - stack.push(new NotItem(ins, v1)); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return -1; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.NotItem; +import java.util.HashMap; +import java.util.List; + +public class IfTrueIns extends InstructionDefinition implements IfTypeIns { + + public IfTrueIns() { + super(0x11, "iftrue", new int[]{AVM2Code.DAT_OFFSET}, false); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + //String v1 = stack.pop().toString(); + //stack.push("(" + v1 + ")"); + } + + @Override + public void translateInverted(HashMap localRegs, TranslateStack stack, AVM2Instruction ins) { + GraphTargetItem v1 = stack.pop(); + stack.push(v1.invert(null)); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -1; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index 973dcde54..85895b8e5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -1,134 +1,134 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.instructions.SetTypeIns; -import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.DecrementAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.IncrementAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NewActivationAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; - -public abstract class SetLocalTypeIns extends InstructionDefinition implements SetTypeIns { - - public SetLocalTypeIns(int instructionCode, String instructionName, int[] operands, boolean canThrow) { - super(instructionCode, instructionName, operands, canThrow); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { - int regId = getRegisterId(ins); - GraphTargetItem value = stack.pop(); - /*if (localRegs.containsKey(regId)) { - localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value)); - } else { - localRegs.put(regId, value); - }*/ - localRegs.put(regId, value); - if (!regAssignCount.containsKey(regId)) { - regAssignCount.put(regId, 0); - } - regAssignCount.put(regId, regAssignCount.get(regId) + 1); - //localRegsAssignmentIps.put(regId, ip); - if (value instanceof NewActivationAVM2Item) { - return; - } - if (value instanceof FindPropertyAVM2Item) { - return; - } - if (value.getNotCoerced() instanceof IncrementAVM2Item) { - GraphTargetItem inside = ((IncrementAVM2Item) value.getNotCoerced()).value.getNotCoerced().getThroughDuplicate(); - if (inside instanceof LocalRegAVM2Item) { - if (((LocalRegAVM2Item) inside).regIndex == regId) { - if (stack.size() > 0) { - GraphTargetItem top = stack.peek().getNotCoerced().getThroughDuplicate(); - if (top == inside) { - stack.pop(); - stack.push(new PostIncrementAVM2Item(ins, inside)); - } else if ((top instanceof IncrementAVM2Item) && (((IncrementAVM2Item) top).value == inside)) { - stack.pop(); - stack.push(new PreIncrementAVM2Item(ins, inside)); - } else { - output.add(new PostIncrementAVM2Item(ins, inside)); - } - } else { - output.add(new PostIncrementAVM2Item(ins, inside)); - } - return; - } - } - } - - if (value.getNotCoerced() instanceof DecrementAVM2Item) { - GraphTargetItem inside = ((DecrementAVM2Item) value.getNotCoerced()).value.getNotCoerced().getThroughDuplicate(); - if (inside instanceof LocalRegAVM2Item) { - if (((LocalRegAVM2Item) inside).regIndex == regId) { - if (stack.size() > 0) { - GraphTargetItem top = stack.peek().getNotCoerced().getThroughDuplicate(); - if (top == inside) { - stack.pop(); - stack.push(new PostDecrementAVM2Item(ins, inside)); - } else if ((top instanceof DecrementAVM2Item) && (((DecrementAVM2Item) top).value == inside)) { - stack.pop(); - stack.push(new PreDecrementAVM2Item(ins, inside)); - } else { - output.add(new PostDecrementAVM2Item(ins, inside)); - } - } else { - output.add(new PostDecrementAVM2Item(ins, inside)); - } - return; - } - } - } - - //if(val.startsWith("catchscope ")) return; - //if(val.startsWith("newactivation()")) return; - output.add(new SetLocalAVM2Item(ins, regId, value)); - } - - @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { - return AVM2Item.localRegName(localRegNames, getRegisterId(ins)); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return -1; - } - - public abstract int getRegisterId(AVM2Instruction ins); -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.instructions.SetTypeIns; +import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.DecrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.IncrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.NewActivationAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +public abstract class SetLocalTypeIns extends InstructionDefinition implements SetTypeIns { + + public SetLocalTypeIns(int instructionCode, String instructionName, int[] operands, boolean canThrow) { + super(instructionCode, instructionName, operands, canThrow); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + int regId = getRegisterId(ins); + GraphTargetItem value = stack.pop(); + /*if (localRegs.containsKey(regId)) { + localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value)); + } else { + localRegs.put(regId, value); + }*/ + localRegs.put(regId, value); + if (!regAssignCount.containsKey(regId)) { + regAssignCount.put(regId, 0); + } + regAssignCount.put(regId, regAssignCount.get(regId) + 1); + //localRegsAssignmentIps.put(regId, ip); + if (value.getThroughDuplicate() instanceof NewActivationAVM2Item) { + return; + } + if (value instanceof FindPropertyAVM2Item) { + return; + } + if (value.getNotCoerced() instanceof IncrementAVM2Item) { + GraphTargetItem inside = ((IncrementAVM2Item) value.getNotCoerced()).value.getNotCoerced().getThroughDuplicate(); + if (inside instanceof LocalRegAVM2Item) { + if (((LocalRegAVM2Item) inside).regIndex == regId) { + if (stack.size() > 0) { + GraphTargetItem top = stack.peek().getNotCoerced().getThroughDuplicate(); + if (top == inside) { + stack.pop(); + stack.push(new PostIncrementAVM2Item(ins, inside)); + } else if ((top instanceof IncrementAVM2Item) && (((IncrementAVM2Item) top).value == inside)) { + stack.pop(); + stack.push(new PreIncrementAVM2Item(ins, inside)); + } else { + output.add(new PostIncrementAVM2Item(ins, inside)); + } + } else { + output.add(new PostIncrementAVM2Item(ins, inside)); + } + return; + } + } + } + + if (value.getNotCoerced() instanceof DecrementAVM2Item) { + GraphTargetItem inside = ((DecrementAVM2Item) value.getNotCoerced()).value.getNotCoerced().getThroughDuplicate(); + if (inside instanceof LocalRegAVM2Item) { + if (((LocalRegAVM2Item) inside).regIndex == regId) { + if (stack.size() > 0) { + GraphTargetItem top = stack.peek().getNotCoerced().getThroughDuplicate(); + if (top == inside) { + stack.pop(); + stack.push(new PostDecrementAVM2Item(ins, inside)); + } else if ((top instanceof DecrementAVM2Item) && (((DecrementAVM2Item) top).value == inside)) { + stack.pop(); + stack.push(new PreDecrementAVM2Item(ins, inside)); + } else { + output.add(new PostDecrementAVM2Item(ins, inside)); + } + } else { + output.add(new PostDecrementAVM2Item(ins, inside)); + } + return; + } + } + } + + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalAVM2Item(ins, regId, value)); + } + + @Override + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + return AVM2Item.localRegName(localRegNames, getRegisterId(ins)); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -1; + } + + public abstract int getRegisterId(AVM2Instruction ins); +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java index aceb9e46e..7456f9eea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java @@ -156,9 +156,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } } } - if (slotname == null) { - System.err.println("SLOT NOT FOUND"); - } + output.add(new SetSlotAVM2Item(ins, obj, slotname, value)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java index 4865b4ff0..9abebbaaf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java @@ -45,13 +45,9 @@ public class PopIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - if (stack.size() > 0) { - GraphTargetItem top = stack.pop(); - //Note: Commands like "5;" - numbers are unsupported as it collide with try..finally block decompilation. TODO: allow this somehow - - if (/*!(top instanceof IntegerValueAVM2Item) &&*/(!(top instanceof MarkItem))) { - output.add(top); - } + GraphTargetItem top = stack.pop(); + if ((!(top instanceof MarkItem))) { + output.add(top); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java index 8c32f6243..76076797c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java @@ -1,54 +1,55 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.stack; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import java.util.HashMap; -import java.util.List; - -public class PushFalseIns extends InstructionDefinition { - - public PushFalseIns() { - super(0x27, "pushfalse", new int[]{}, false); - } - - @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { - lda.operandStack.push(Boolean.FALSE); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - stack.push(new BooleanAVM2Item(ins, Boolean.FALSE)); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return 1; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.stack; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.FalseItem; +import java.util.HashMap; +import java.util.List; + +public class PushFalseIns extends InstructionDefinition { + + public PushFalseIns() { + super(0x27, "pushfalse", new int[]{}, false); + } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + lda.operandStack.push(Boolean.FALSE); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + stack.push(new FalseItem(ins)); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java index dc86afa3f..f87e6bb8d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java @@ -1,54 +1,55 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.instructions.stack; - -import com.jpexs.decompiler.flash.abc.ABC; -import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; -import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; -import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.ScopeStack; -import com.jpexs.decompiler.graph.TranslateStack; -import java.util.HashMap; -import java.util.List; - -public class PushTrueIns extends InstructionDefinition { - - public PushTrueIns() { - super(0x26, "pushtrue", new int[]{}, false); - } - - @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { - lda.operandStack.push(Boolean.TRUE); - } - - @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { - stack.push(new BooleanAVM2Item(ins, Boolean.TRUE)); - } - - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - return 1; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.stack; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.model.BooleanAVM2Item; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.ScopeStack; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.TrueItem; +import java.util.HashMap; +import java.util.List; + +public class PushTrueIns extends InstructionDefinition { + + public PushTrueIns() { + super(0x26, "pushtrue", new int[]{}, false); + } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + lda.operandStack.push(Boolean.TRUE); + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + stack.push(new TrueItem(ins)); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java index 671975b7f..12e3ca6a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java @@ -40,9 +40,9 @@ public class HasNextAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - collection.toString(writer, localData); + collection.appendTo(writer, localData); writer.append(" hasNext "); - return object.toString(writer, localData); + return object.appendTo(writer, localData); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index dbe0fc1de..ce7c35d1a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -25,6 +26,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -78,4 +80,5 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item { public boolean hasReturnValue() { return true; } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java index b664e18ef..a182b93e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewActivationAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -32,7 +33,7 @@ public class NewActivationAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("newactivation()"); + return writer.append("§§activation"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NumberValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NumberValueAVM2Item.java index 40f114929..3375c588e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NumberValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NumberValueAVM2Item.java @@ -1,25 +1,32 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.graph.SimpleValue; -public abstract class NumberValueAVM2Item extends AVM2Item { +public abstract class NumberValueAVM2Item extends AVM2Item implements SimpleValue { public NumberValueAVM2Item(AVM2Instruction instruction) { super(instruction, PRECEDENCE_PRIMARY); } + + @Override + public boolean isSimpleValue() { + return true; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java index 989735dc2..68256562d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java @@ -46,14 +46,14 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - srcData.localName = slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false); + srcData.localName = slotName == null ? "/*UnknownSlot*/" : slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false); getName(writer, localData); writer.append(" = "); return value.toString(writer, localData); } public String getNameAsStr(LocalData localData) { - return slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false); + return slotName == null ? "/*UnknownSlot*/" : slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false); } public GraphTextWriter getName(GraphTextWriter writer, LocalData localData) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java index c99741759..b2d84022a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/StringAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -31,7 +32,7 @@ import com.jpexs.helpers.Helper; import java.util.List; import java.util.Set; -public class StringAVM2Item extends AVM2Item { +public class StringAVM2Item extends AVM2Item implements SimpleValue { public String value; @@ -71,4 +72,9 @@ public class StringAVM2Item extends AVM2Item { public boolean hasReturnValue() { return true; } + + @Override + public boolean isSimpleValue() { + return true; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java index fae5ce3b2..fe2f677bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -53,7 +54,7 @@ public class EqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new NeqAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java index aaf861327..2fa46b963 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class GeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new LtAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java index 32ec2e1d1..bacf5fffa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class GtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new LeAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java index a65e4250a..017f5e700 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class LeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new GtAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java index bbfc82018..006d7b386 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class LtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new GeAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java index 8e920d6df..69fc52490 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -54,7 +55,7 @@ public class NeqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfCondit } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new EqAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java index e61d1196e..e13bce5a9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -56,7 +57,7 @@ public class StrictEqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfC } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new StrictNeqAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java index cea963789..82cdae968 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -49,7 +50,7 @@ public class StrictNeqAVM2Item extends BinaryOpItem implements LogicalOpItem, If } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new StrictEqAVM2Item(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index cd0302c22..13a7d5188 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -57,9 +57,11 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.DupIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopScopeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushByteIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushFalseIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNullIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushScopeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushStringIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushTrueIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushUndefinedIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushWithIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.SwapIns; @@ -103,7 +105,6 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.abc.types.traits.Traits; -import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; @@ -118,6 +119,7 @@ import com.jpexs.decompiler.graph.model.CommaExpressionItem; import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.DoWhileItem; import com.jpexs.decompiler.graph.model.DuplicateItem; +import com.jpexs.decompiler.graph.model.FalseItem; import com.jpexs.decompiler.graph.model.ForItem; import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -125,6 +127,7 @@ import com.jpexs.decompiler.graph.model.NotItem; import com.jpexs.decompiler.graph.model.OrItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.TrueItem; import com.jpexs.decompiler.graph.model.UnboundedTypeItem; import com.jpexs.decompiler.graph.model.WhileItem; import java.io.ByteArrayOutputStream; @@ -161,6 +164,16 @@ public class AVM2SourceGenerator implements SourceGenerator { return new AVM2Instruction(0, def, operands); } + @Override + public List generate(SourceGeneratorLocalData localData, FalseItem item) throws CompilationException { + return GraphTargetItem.toSourceMerge(localData, this, ins(new PushFalseIns())); + } + + @Override + public List generate(SourceGeneratorLocalData localData, TrueItem item) throws CompilationException { + return GraphTargetItem.toSourceMerge(localData, this, ins(new PushTrueIns())); + } + public List generate(SourceGeneratorLocalData localData, GetDescendantsAVM2Item item) throws CompilationException { int[] nssa = new int[item.openedNamespaces.size()]; for (int i = 0; i < item.openedNamespaces.size(); i++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java index d3d5d869f..1156095b9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScriptLexer.java @@ -1,2344 +1,2128 @@ -/* The following code was generated by JFlex 1.6.0 */ - -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.parser.script; - -import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -/** - * This class is a scanner generated by - * JFlex 1.6.0 - * from the specification file - * C:/Projects/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/actionscript3_script.flex - */ -public final class ActionScriptLexer { - - /** - * 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; - - /** - * lexical states - */ - public static final int YYINITIAL = 0; - - public static final int STRING = 2; - - public static final int CHARLITERAL = 4; - - public static final int XMLOPENTAG = 6; - - public static final int XMLOPENTAGATTRIB = 8; - - public static final int XMLINSTROPENTAG = 10; - - public static final int XMLINSTRATTRIB = 12; - - public static final int XMLCDATA = 14; - - public static final int XMLCOMMENT = 16; - - public static final int XML = 18; - - public static final int OIDENTIFIER = 20; - - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l - * at the beginning of a line - * l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, - 8, 8, 9, 9, 10, 10 - }; - - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED - = "\11\0\1\13\1\2\1\113\1\3\1\1\22\0\1\13\1\14\1\33" - + "\1\0\1\6\1\110\1\105\1\34\1\76\1\77\1\5\1\45\1\103" - + "\1\15\1\11\1\4\1\35\3\41\4\42\2\21\1\17\1\102\1\12" - + "\1\32\1\16\1\23\1\111\1\27\1\20\1\25\1\26\1\43\1\20" - + "\2\10\1\74\4\10\1\75\5\10\1\30\3\10\1\37\2\10\1\24" - + "\1\46\1\31\1\107\1\10\1\0\1\52\1\50\1\54\1\63\1\44" - + "\1\40\1\73\1\66\1\61\1\10\1\53\1\64\1\71\1\57\1\56" - + "\1\67\1\10\1\51\1\55\1\60\1\62\1\72\1\65\1\36\1\70" - + "\1\10\1\100\1\106\1\101\1\104\6\0\1\113\41\0\1\47\2\0" - + "\1\6\12\0\1\6\1\0\1\22\2\0\1\6\5\0\2\6\1\112" - + "\24\6\1\0\37\6\1\0\u01ca\6\4\0\14\6\16\0\5\6\7\0" - + "\1\6\1\0\1\6\21\0\160\7\5\6\1\0\2\6\2\0\4\6" - + "\1\0\1\6\6\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6" - + "\1\0\123\6\1\0\213\6\1\0\5\7\2\0\246\6\1\0\46\6" - + "\2\0\1\6\7\0\47\6\11\0\55\7\1\0\1\7\1\0\2\7" - + "\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\35\0\13\7" - + "\5\0\53\6\37\7\4\0\2\6\1\7\143\6\1\0\1\6\7\7" - + "\2\0\6\7\2\6\2\7\1\0\4\7\2\6\12\7\3\6\2\0" - + "\1\6\20\0\1\6\1\7\36\6\33\7\2\0\131\6\13\7\1\6" - + "\16\0\12\7\41\6\11\7\2\6\4\0\1\6\5\0\26\6\4\7" - + "\1\6\11\7\1\6\3\7\1\6\5\7\22\0\31\6\3\7\104\0" - + "\23\6\61\0\40\7\66\6\3\7\1\6\22\7\1\6\7\7\12\6" - + "\2\7\2\0\12\7\1\0\20\6\3\7\1\0\10\6\2\0\2\6" - + "\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0\1\7" - + "\1\6\7\7\2\0\2\7\2\0\3\7\1\6\10\0\1\7\4\0" - + "\2\6\1\0\3\6\2\7\2\0\12\7\2\6\17\0\3\7\1\0" - + "\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0" - + "\2\6\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0" - + "\3\7\3\0\1\7\7\0\4\6\1\0\1\6\7\0\14\7\3\6" - + "\1\7\13\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6\1\0" - + "\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7\1\0" - + "\3\7\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0\12\7" - + "\21\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6" - + "\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7\2\0\2\7" - + "\2\0\3\7\10\0\2\7\4\0\2\6\1\0\3\6\2\7\2\0" - + "\12\7\1\0\1\6\20\0\1\7\1\6\1\0\6\6\3\0\3\6" - + "\1\0\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0\2\6" - + "\3\0\3\6\3\0\14\6\4\0\5\7\3\0\3\7\1\0\4\7" - + "\2\0\1\6\6\0\1\7\16\0\12\7\20\0\4\7\1\0\10\6" - + "\1\0\3\6\1\0\27\6\1\0\20\6\3\0\1\6\7\7\1\0" - + "\3\7\1\0\4\7\7\0\2\7\1\0\2\6\6\0\2\6\2\7" - + "\2\0\12\7\21\0\3\7\1\0\10\6\1\0\3\6\1\0\27\6" - + "\1\0\12\6\1\0\5\6\2\0\1\7\1\6\7\7\1\0\3\7" - + "\1\0\4\7\7\0\2\7\7\0\1\6\1\0\2\6\2\7\2\0" - + "\12\7\1\0\2\6\16\0\3\7\1\0\10\6\1\0\3\6\1\0" - + "\51\6\2\0\1\6\7\7\1\0\3\7\1\0\4\7\1\6\10\0" - + "\1\7\10\0\2\6\2\7\2\0\12\7\12\0\6\6\2\0\2\7" - + "\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0\7\6" - + "\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7\6\0\12\7" - + "\2\0\2\7\15\0\60\6\1\7\2\6\7\7\5\0\7\6\10\7" - + "\1\0\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6" - + "\2\0\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6" - + "\1\0\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0" - + "\2\7\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7" - + "\2\0\4\6\40\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7" - + "\1\0\1\7\1\0\1\7\4\0\2\7\10\6\1\0\44\6\4\0" - + "\24\7\1\0\2\7\5\6\13\7\1\0\44\7\11\0\1\7\71\0" - + "\53\6\24\7\1\6\12\7\6\0\6\6\4\7\4\6\3\7\1\6" - + "\3\7\2\6\7\7\3\6\4\7\15\6\14\7\1\6\17\7\2\0" - + "\46\6\1\0\1\6\5\0\1\6\2\0\53\6\1\0\u014d\6\1\0" - + "\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6\1\0" - + "\4\6\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0" - + "\4\6\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6\2\0" - + "\3\7\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6\1\0" - + "\32\6\5\0\113\6\3\0\3\7\10\6\7\0\15\6\1\0\4\6" - + "\3\7\13\0\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0" - + "\3\6\1\0\2\7\14\0\64\6\40\7\3\0\1\6\4\0\1\6" - + "\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0" - + "\51\6\1\7\1\6\5\0\106\6\12\0\37\6\1\0\14\7\4\0" - + "\14\7\12\0\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7" - + "\7\6\2\7\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7" - + "\1\0\35\7\2\0\13\7\6\0\12\7\15\0\1\6\10\0\16\7" - + "\102\0\5\7\57\6\21\7\7\6\4\0\12\7\21\0\11\7\14\0" - + "\3\7\36\6\15\7\2\6\12\7\54\6\16\7\14\0\44\6\24\7" - + "\10\0\12\7\3\0\3\6\12\7\44\6\122\0\3\7\1\0\25\7" - + "\4\6\1\7\4\6\3\7\2\6\1\0\2\7\6\0\300\6\66\7" - + "\6\0\4\7\u0116\6\2\0\6\6\2\0\46\6\2\0\6\6\2\0" - + "\10\6\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6\2\0" - + "\65\6\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6\3\0" - + "\4\6\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6\3\0" - + "\14\0\2\0\32\0\1\113\1\113\25\0\2\7\23\0\1\7\33\0" - + "\1\0\1\6\15\0\1\6\20\0\15\6\63\0\15\7\4\0\1\7" - + "\3\0\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6" - + "\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6" - + "\1\0\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\43\7" - + "\2\6\4\7\7\0\u0a70\0\57\6\1\0\57\6\1\0\205\6\6\0" - + "\4\6\3\7\2\6\14\0\46\6\1\0\1\6\5\0\1\6\2\0" - + "\70\6\7\0\1\6\17\0\1\7\27\6\11\0\7\6\1\0\7\6" - + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6" - + "\1\0\7\6\1\0\40\7\57\0\1\6\u01c0\0\21\0\4\0\2\6" - + "\1\7\31\0\17\7\1\0\5\6\2\0\3\7\2\6\4\0\126\6" - + "\2\0\2\7\2\0\3\6\1\0\132\6\1\0\4\6\5\0\51\6" - + "\3\0\136\6\21\0\33\6\65\0\20\6\u0200\0\u19b6\6\112\0\u51cd\6" - + "\63\0\u048d\6\103\0\56\6\2\0\u010d\6\3\0\20\6\12\7\2\6" - + "\24\0\57\6\1\7\4\0\12\7\1\0\37\6\1\0\1\7\106\6" - + "\14\7\45\0\11\6\2\0\147\6\2\0\4\6\1\0\36\6\2\0" - + "\2\6\105\0\13\6\1\7\3\6\1\7\4\6\1\7\27\6\5\7" - + "\30\0\64\6\14\0\2\7\62\6\21\7\13\0\12\7\6\0\22\7" - + "\6\6\3\0\1\6\4\0\12\7\34\6\10\7\2\0\27\6\15\7" - + "\14\0\35\6\3\0\4\7\57\6\16\7\16\0\1\6\12\7\6\0" - + "\5\6\1\7\12\6\12\7\5\6\1\0\51\6\16\7\11\0\3\6" - + "\1\7\10\6\2\7\2\0\12\7\6\0\27\6\3\0\1\6\3\7" - + "\62\6\1\7\1\6\3\7\2\6\2\7\5\6\2\7\1\6\1\7" - + "\1\6\30\0\3\6\2\0\13\6\5\7\2\0\3\6\2\7\12\0" - + "\6\6\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\1\0" - + "\53\6\1\0\4\6\4\0\2\6\132\0\43\6\10\7\1\0\2\7" - + "\2\0\12\7\6\0\u2ba4\6\14\0\27\6\4\0\61\6\4\0\u1800\0" - + "\u0900\0\u016e\6\2\0\152\6\46\0\7\6\14\0\5\6\5\0\1\6" - + "\1\7\12\6\1\0\15\6\1\0\5\6\1\0\1\6\1\0\2\6" - + "\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0\100\6\2\0\66\6" - + "\10\0\40\0\14\6\4\0\20\7\20\0\16\7\5\0\2\7\30\0" - + "\3\7\40\0\5\6\1\0\207\6\23\0\12\7\7\0\32\6\4\0" - + "\1\7\1\0\32\6\13\0\131\6\3\0\6\6\2\0\6\6\2\0" - + "\6\6\2\0\3\6\41\0\2\0\14\6\1\0\32\6\1\0\23\6" - + "\1\0\2\6\1\0\17\6\2\0\16\6\42\0\173\6\105\0\65\7" - + "\210\0\1\7\202\0\35\6\3\0\61\6\17\0\1\7\37\0\40\6" - + "\20\0\21\6\1\7\10\6\1\7\5\0\46\6\5\7\5\0\36\6" - + "\2\0\44\6\4\0\10\6\1\0\5\7\52\0\236\6\2\0\12\7" - + "\126\0\50\6\10\0\64\6\234\0\u0137\6\11\0\26\6\12\0\10\6" - + "\230\0\6\6\2\0\1\6\1\0\54\6\1\0\2\6\3\0\1\6" - + "\2\0\27\6\12\0\27\6\11\0\37\6\141\0\26\6\12\0\32\6" - + "\106\0\70\6\6\0\2\6\100\0\1\6\3\7\1\0\2\7\5\0" - + "\4\7\4\6\1\0\3\6\1\0\33\6\4\0\3\7\4\0\1\7" - + "\40\0\35\6\3\0\35\6\43\0\10\6\1\0\34\6\2\7\31\0" - + "\66\6\12\0\26\6\12\0\23\6\15\0\22\6\156\0\111\6\u03b7\0" - + "\3\7\65\6\17\7\37\0\12\7\17\0\4\7\55\6\13\7\25\0" - + "\31\6\7\0\12\7\6\0\3\7\44\6\16\7\1\0\12\7\20\0" - + "\43\6\1\7\2\0\1\6\11\0\3\7\60\6\16\7\4\6\13\0" - + "\12\7\1\6\45\0\22\6\1\0\31\6\14\7\170\0\57\6\14\7" - + "\5\0\12\7\7\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6" - + "\1\0\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7" - + "\2\0\2\7\2\0\3\7\11\0\1\7\5\0\5\6\2\7\2\0" - + "\7\7\3\0\5\7\u010b\0\60\6\24\7\2\6\1\0\1\6\10\0" - + "\12\7\246\0\57\6\7\7\2\0\11\7\77\0\60\6\21\7\3\0" - + "\1\6\13\0\12\7\46\0\53\6\15\7\10\0\12\7\u01d6\0\100\6" - + "\12\7\25\0\1\6\u01c0\0\71\6\u0507\0\u0399\6\147\0\157\7\u0b91\0" - + "\u042f\6\u33d1\0\u0239\6\7\0\37\6\1\0\12\7\146\0\36\6\2\0" - + "\5\7\13\0\60\6\7\7\11\0\4\6\14\0\12\7\11\0\25\6" - + "\5\0\23\6\u0370\0\105\6\13\0\1\6\56\7\20\0\4\7\15\6" - + "\u4060\0\2\6\u0bfe\0\153\6\5\0\15\6\3\0\11\6\7\0\12\6" - + "\3\0\2\7\u14c6\0\5\7\3\0\6\7\10\0\10\7\2\0\7\7" - + "\36\0\4\7\224\0\3\7\u01bb\0\125\6\1\0\107\6\1\0\2\6" - + "\2\0\1\6\2\0\2\6\2\0\4\6\1\0\14\6\1\0\1\6" - + "\1\0\7\6\1\0\101\6\1\0\4\6\2\0\10\6\1\0\7\6" - + "\1\0\34\6\1\0\4\6\1\0\5\6\1\0\1\6\3\0\7\6" - + "\1\0\u0154\6\2\0\31\6\1\0\31\6\1\0\37\6\1\0\31\6" - + "\1\0\37\6\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6" - + "\1\0\31\6\1\0\10\6\2\0\62\7\u1000\0\305\6\13\0\7\7" - + "\u0529\0\4\6\1\0\33\6\1\0\2\6\1\0\1\6\2\0\1\6" - + "\1\0\12\6\1\0\4\6\1\0\1\6\1\0\1\6\6\0\1\6" - + "\4\0\1\6\1\0\1\6\1\0\1\6\1\0\3\6\1\0\2\6" - + "\1\0\1\6\2\0\1\6\1\0\1\6\1\0\1\6\1\0\1\6" - + "\1\0\1\6\1\0\2\6\1\0\1\6\2\0\4\6\1\0\7\6" - + "\1\0\4\6\1\0\4\6\1\0\1\6\1\0\12\6\1\0\21\6" - + "\5\0\3\6\1\0\5\6\1\0\21\6\u1144\0\ua6d7\6\51\0\u1035\6" - + "\13\0\336\6\u3fe2\0\u021e\6\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u06ed\0" - + "\360\7\uffff\0\uffff\0\ufe12\0"; - - /** - * 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(); - - private static final String ZZ_ACTION_PACKED_0 - = "\13\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7" - + "\1\10\1\11\1\12\1\13\1\14\1\15\1\16\1\17" - + "\1\20\1\21\1\22\1\23\1\15\2\6\1\24\1\25" - + "\21\6\1\26\1\27\1\30\1\31\1\32\1\33\1\34" - + "\1\35\1\36\1\37\1\40\1\41\1\42\2\43\1\44" - + "\1\1\1\42\2\45\2\46\1\42\2\1\1\47\1\50" - + "\1\1\1\51\2\1\1\52\1\1\1\53\2\42\2\54" - + "\2\42\1\55\1\42\1\1\1\56\1\3\1\0\1\57" - + "\1\60\1\61\1\62\1\63\1\64\1\65\1\66\1\67" - + "\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\0" - + "\1\77\1\63\1\100\1\0\2\100\7\6\1\101\1\102" - + "\2\6\1\103\16\6\1\104\1\105\1\106\4\6\1\107" - + "\13\6\1\110\1\111\1\112\1\113\1\114\1\115\1\116" - + "\1\117\1\120\1\116\1\121\1\122\1\123\1\124\1\125" - + "\1\126\1\116\1\127\1\0\1\130\1\0\1\131\1\0" - + "\1\132\1\133\1\0\1\134\4\0\1\135\2\0\1\136" - + "\4\137\2\3\2\0\1\140\1\141\1\142\1\143\1\144" - + "\1\0\1\63\1\145\2\146\1\100\1\6\1\147\13\6" - + "\1\150\4\6\1\151\4\6\1\152\6\6\1\153\12\6" - + "\1\154\1\6\1\155\1\6\1\156\3\0\1\134\1\157" - + "\1\160\1\0\1\161\2\0\1\162\1\163\1\164\1\0" - + "\1\165\1\146\1\100\4\6\1\166\1\167\2\6\1\170" - + "\12\6\1\171\1\172\1\6\1\173\11\6\1\174\5\6" - + "\1\175\1\6\1\176\2\0\1\177\1\200\1\0\1\146" - + "\1\100\1\201\1\202\2\6\1\203\1\6\1\204\1\205" - + "\1\6\1\206\1\6\1\207\4\6\1\210\11\6\1\211" - + "\5\6\1\0\1\146\1\100\3\6\1\212\1\6\1\213" - + "\1\214\1\6\1\215\1\6\1\216\3\6\1\217\3\6" - + "\1\220\4\6\1\221\1\6\1\0\1\146\1\100\1\222" - + "\1\6\1\223\10\6\1\224\1\225\1\6\1\226\1\227" - + "\1\6\1\0\1\146\1\100\1\230\1\231\1\232\3\6" - + "\1\233\3\6\1\234\1\0\1\146\1\100\1\235\1\6" - + "\1\236\1\6\1\237\1\240\1\241\1\146\1\100\1\242" - + "\1\243\6\100"; - - private static int[] zzUnpackAction() { - int[] result = new int[446]; - 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; - } - - /** - * 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\114\0\230\0\344\0\u0130\0\u017c\0\u01c8\0\u0214" - + "\0\u0260\0\u02ac\0\u02f8\0\u0344\0\u0390\0\u0344\0\u03dc\0\u0428" - + "\0\u0474\0\u04c0\0\u050c\0\u0558\0\u05a4\0\u05f0\0\u063c\0\u0688" - + "\0\u06d4\0\u0344\0\u0344\0\u0344\0\u0720\0\u0344\0\u0344\0\u076c" - + "\0\u07b8\0\u0804\0\u0850\0\u0344\0\u089c\0\u08e8\0\u0934\0\u0980" - + "\0\u09cc\0\u0a18\0\u0a64\0\u0ab0\0\u0afc\0\u0b48\0\u0b94\0\u0be0" - + "\0\u0c2c\0\u0c78\0\u0cc4\0\u0d10\0\u0d5c\0\u0344\0\u0344\0\u0344" - + "\0\u0344\0\u0344\0\u0344\0\u0344\0\u0da8\0\u0df4\0\u0e40\0\u0e8c" - + "\0\u0344\0\u0ed8\0\u0f24\0\u0344\0\u0344\0\u0f70\0\u0fbc\0\u1008" - + "\0\u0344\0\u1054\0\u0344\0\u10a0\0\u10ec\0\u1138\0\u0344\0\u0344" - + "\0\u1184\0\u0344\0\u11d0\0\u121c\0\u0344\0\u1268\0\u0344\0\u0344" - + "\0\u12b4\0\u1300\0\u0344\0\u134c\0\u1398\0\u0344\0\u13e4\0\u1430" - + "\0\u0344\0\u147c\0\u14c8\0\u0344\0\u0344\0\u1514\0\u0344\0\u1560" - + "\0\u0344\0\u15ac\0\u15f8\0\u0344\0\u0344\0\u1644\0\u0344\0\u0344" - + "\0\u1690\0\u0344\0\u0344\0\u16dc\0\u1728\0\u1774\0\u17c0\0\u180c" - + "\0\u1858\0\u18a4\0\u18f0\0\u193c\0\u1988\0\u19d4\0\u1a20\0\u1a6c" - + "\0\u1ab8\0\u0344\0\u0344\0\u1b04\0\u1b50\0\u04c0\0\u1b9c\0\u1be8" - + "\0\u1c34\0\u1c80\0\u1ccc\0\u1d18\0\u1d64\0\u1db0\0\u1dfc\0\u1e48" - + "\0\u1e94\0\u1ee0\0\u1f2c\0\u1f78\0\u04c0\0\u04c0\0\u1fc4\0\u2010" - + "\0\u205c\0\u20a8\0\u20f4\0\u04c0\0\u2140\0\u218c\0\u21d8\0\u2224" - + "\0\u2270\0\u22bc\0\u2308\0\u2354\0\u23a0\0\u23ec\0\u2438\0\u0344" - + "\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344" - + "\0\u2484\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u24d0" - + "\0\u0344\0\u1138\0\u0344\0\u1184\0\u0344\0\u11d0\0\u0344\0\u0344" - + "\0\u1268\0\u251c\0\u2568\0\u25b4\0\u2600\0\u264c\0\u2698\0\u26e4" - + "\0\u2730\0\u0344\0\u0344\0\u2484\0\u24d0\0\u277c\0\u27c8\0\u0344" - + "\0\u2814\0\u2860\0\u0344\0\u0344\0\u0344\0\u28ac\0\u0344\0\u28f8" - + "\0\u28f8\0\u0344\0\u2944\0\u180c\0\u2990\0\u29dc\0\u04c0\0\u2a28" - + "\0\u2a74\0\u2ac0\0\u2b0c\0\u2b58\0\u2ba4\0\u2bf0\0\u2c3c\0\u2c88" - + "\0\u2cd4\0\u2d20\0\u04c0\0\u2d6c\0\u2db8\0\u2e04\0\u2e50\0\u04c0" - + "\0\u2e9c\0\u2ee8\0\u2f34\0\u2f80\0\u04c0\0\u2fcc\0\u3018\0\u3064" - + "\0\u30b0\0\u30fc\0\u3148\0\u04c0\0\u3194\0\u31e0\0\u322c\0\u3278" - + "\0\u32c4\0\u3310\0\u335c\0\u33a8\0\u33f4\0\u3440\0\u04c0\0\u348c" - + "\0\u04c0\0\u34d8\0\u04c0\0\u3524\0\u3570\0\u251c\0\u0344\0\u0344" - + "\0\u0344\0\u35bc\0\u0344\0\u3608\0\u3654\0\u36a0\0\u0344\0\u0344" - + "\0\u36ec\0\u0344\0\u3738\0\u3784\0\u37d0\0\u381c\0\u3868\0\u38b4" - + "\0\u04c0\0\u04c0\0\u3900\0\u394c\0\u04c0\0\u3998\0\u39e4\0\u3a30" - + "\0\u3a7c\0\u3ac8\0\u3b14\0\u3b60\0\u3bac\0\u3bf8\0\u3c44\0\u04c0" - + "\0\u04c0\0\u3c90\0\u04c0\0\u3cdc\0\u3d28\0\u3d74\0\u3dc0\0\u3e0c" - + "\0\u3e58\0\u3ea4\0\u3ef0\0\u3f3c\0\u04c0\0\u3f88\0\u3fd4\0\u4020" - + "\0\u406c\0\u40b8\0\u04c0\0\u4104\0\u0344\0\u2484\0\u4150\0\u0344" - + "\0\u0344\0\u419c\0\u41e8\0\u4234\0\u04c0\0\u4280\0\u42cc\0\u4318" - + "\0\u04c0\0\u4364\0\u04c0\0\u04c0\0\u43b0\0\u04c0\0\u43fc\0\u04c0" - + "\0\u4448\0\u4494\0\u44e0\0\u452c\0\u04c0\0\u4578\0\u45c4\0\u4610" - + "\0\u465c\0\u46a8\0\u46f4\0\u4740\0\u478c\0\u47d8\0\u04c0\0\u4824" - + "\0\u4870\0\u48bc\0\u4908\0\u4954\0\u49a0\0\u49ec\0\u4a38\0\u4a84" - + "\0\u4ad0\0\u4b1c\0\u04c0\0\u4b68\0\u04c0\0\u04c0\0\u4bb4\0\u04c0" - + "\0\u4c00\0\u04c0\0\u4c4c\0\u4c98\0\u4ce4\0\u04c0\0\u4d30\0\u4d7c" - + "\0\u4dc8\0\u04c0\0\u4e14\0\u4e60\0\u4eac\0\u4ef8\0\u04c0\0\u4f44" - + "\0\u4f90\0\u4fdc\0\u5028\0\u04c0\0\u5074\0\u04c0\0\u50c0\0\u510c" - + "\0\u5158\0\u51a4\0\u51f0\0\u523c\0\u5288\0\u52d4\0\u04c0\0\u04c0" - + "\0\u5320\0\u04c0\0\u04c0\0\u536c\0\u53b8\0\u5404\0\u5450\0\u04c0" - + "\0\u04c0\0\u04c0\0\u549c\0\u54e8\0\u5534\0\u04c0\0\u5580\0\u55cc" - + "\0\u5618\0\u04c0\0\u5664\0\u56b0\0\u56fc\0\u04c0\0\u5748\0\u04c0" - + "\0\u5794\0\u04c0\0\u04c0\0\u0344\0\u0344\0\u57e0\0\u04c0\0\u04c0" - + "\0\u582c\0\u5878\0\u58c4\0\u5910\0\u595c\0\u1774"; - - private static int[] zzUnpackRowMap() { - int[] result = new int[446]; - 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; - } - - /** - * The transition table of the DFA - */ - private static final int[] ZZ_TRANS = zzUnpackTrans(); - - private static final String ZZ_TRANS_PACKED_0 - = "\1\14\1\15\1\16\1\17\1\20\1\21\1\22\1\14" - + "\1\22\1\23\1\24\1\17\1\25\1\26\1\27\1\30" - + "\1\22\1\31\1\14\1\32\1\33\4\22\1\34\1\35" - + "\1\36\1\37\1\40\2\22\1\41\2\31\1\22\1\42" - + "\1\43\1\14\1\44\1\45\1\46\1\47\1\22\1\50" - + "\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\22" - + "\1\60\1\22\1\61\2\22\1\62\1\63\1\64\1\65" - + "\1\66\1\67\1\70\1\71\1\72\1\73\1\74\1\75" - + "\1\76\1\77\1\100\1\101\1\22\1\14\1\102\1\103" - + "\1\104\30\102\1\105\12\102\1\106\45\102\1\107\1\110" - + "\1\111\31\107\1\105\11\107\1\106\45\107\1\14\1\112" - + "\1\113\1\114\1\115\3\14\1\116\2\14\1\114\2\14" - + "\1\117\2\116\4\14\4\116\5\14\3\116\2\14\2\116" - + "\3\14\26\116\2\14\1\120\46\14\1\121\44\14\1\122" - + "\14\14\1\112\1\113\1\114\4\14\1\123\2\14\1\114" - + "\3\14\2\123\2\14\1\124\1\14\4\123\5\14\3\123" - + "\2\14\2\123\3\14\26\123\2\14\1\125\46\14\1\126" - + "\44\14\1\127\13\14\1\130\1\112\1\113\26\130\1\131" - + "\63\130\1\132\1\133\12\130\1\134\77\130\1\112\1\113" - + "\7\130\1\135\65\130\1\136\13\130\1\137\1\110\1\111" - + "\43\137\1\140\1\141\44\137\116\0\1\16\114\0\1\17" - + "\7\0\1\17\104\0\1\142\1\143\24\0\1\144\113\0" - + "\1\145\67\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\26\22\14\0\1\22\12\0\1\146\1\147" - + "\6\0\1\150\13\0\1\150\3\0\2\150\33\0\1\151" - + "\25\0\1\152\1\0\1\153\4\0\2\152\4\0\4\152" - + "\1\0\1\154\3\0\3\152\2\0\2\152\3\0\26\152" - + "\2\0\1\155\45\0\1\156\76\0\1\157\14\0\1\160" - + "\77\0\1\161\13\0\1\162\100\0\1\163\105\0\1\150" - + "\7\0\1\31\13\0\1\31\3\0\2\31\2\164\101\0" - + "\1\165\72\0\1\150\7\0\1\166\13\0\1\167\2\170" - + "\1\0\1\171\1\172\2\164\55\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\2\22\1\173\3\22" - + "\1\174\2\22\1\175\1\176\13\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\1\22\1\177" - + "\6\22\3\0\2\22\1\200\11\22\1\201\11\22\14\0" - + "\1\22\33\0\1\202\12\0\1\203\54\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\1\22\1\204" - + "\24\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\7\22\1\205\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\5\22\1\206\20\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22" - + "\1\207\3\22\1\210\5\22\1\211\11\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22" - + "\1\212\3\0\10\22\1\213\1\22\1\214\2\22\1\215" - + "\10\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\22\22\1\216\3\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\7\22\1\217\3\0\2\22\1\220\7\22\1\221\13\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\1\22\1\222\14\22\1\223\1\22" - + "\1\224\5\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\3\22\1\225\4\22\3\0\5\22" - + "\1\226\1\22\1\227\11\22\1\230\4\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\5\22\1\231\1\22\1\232\16\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22" - + "\1\233\3\0\6\22\1\234\11\22\1\235\5\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\11\22\1\236\4\22\1\237\7\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\1\22\1\240\1\241\7\22\1\242\13\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\2\22\1\243\3\22\1\244\17\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\7\22\1\245\3\0\26\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\7\22\1\246\16\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\2\22\1\247" - + "\23\22\14\0\1\22\33\0\1\250\52\0\1\251\40\0" - + "\1\252\53\0\1\253\37\0\1\254\113\0\1\255\61\0" - + "\1\102\2\0\30\102\1\0\12\102\1\0\45\102\2\0" - + "\1\104\111\0\1\256\3\0\27\256\1\257\1\260\1\256" - + "\1\261\1\256\1\262\5\256\1\263\1\256\1\264\1\265" - + "\5\256\1\266\1\267\1\256\1\270\30\256\1\0\1\107" - + "\2\0\31\107\1\0\11\107\1\0\45\107\2\0\1\111" - + "\113\0\1\113\114\0\1\114\7\0\1\114\116\0\1\271" - + "\105\0\2\272\3\0\1\272\1\0\4\272\2\0\4\272" - + "\1\0\1\273\2\0\10\272\3\0\26\272\16\0\1\274" - + "\2\0\30\274\1\275\60\274\10\0\2\276\3\0\1\276" - + "\1\0\4\276\2\0\4\276\1\0\1\277\2\0\10\276" - + "\3\0\26\276\34\0\1\300\75\0\1\301\2\0\30\301" - + "\1\302\1\303\57\301\31\0\1\304\64\0\1\133\126\0" - + "\1\305\102\0\1\306\3\0\1\307\3\0\1\310\2\0" - + "\2\307\2\0\1\311\1\0\4\307\5\0\3\307\2\0" - + "\2\307\3\0\26\307\2\0\1\312\13\0\1\137\2\0" - + "\43\137\2\0\44\137\1\313\3\0\32\313\1\314\1\313" - + "\1\262\5\313\1\263\1\313\1\264\1\265\5\313\1\266" - + "\1\267\1\313\1\315\27\313\1\316\1\0\1\142\1\317" - + "\1\320\111\142\5\321\1\322\106\321\11\0\1\323\123\0" - + "\1\150\13\0\1\150\3\0\2\150\2\164\57\0\2\152" - + "\3\0\1\152\1\0\4\152\2\0\4\152\4\0\10\152" - + "\3\0\26\152\50\0\1\324\113\0\1\325\77\0\1\326" - + "\13\0\1\327\76\0\1\330\3\0\1\331\13\0\1\331" - + "\3\0\2\331\2\0\1\330\100\0\1\332\72\0\1\150" - + "\7\0\1\166\13\0\1\166\3\0\2\166\2\164\60\0" - + "\1\150\7\0\1\166\13\0\1\167\3\0\1\171\1\172" - + "\2\164\67\0\2\333\3\0\3\333\5\0\1\334\2\0" - + "\5\333\3\0\1\333\1\0\1\333\1\0\1\333\6\0" - + "\1\333\41\0\1\150\7\0\1\166\13\0\1\172\3\0" - + "\2\172\2\164\60\0\1\150\7\0\1\166\13\0\1\335" - + "\3\0\2\335\2\164\55\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\14\22\1\336\11\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\1\22\1\337\24\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\7\22\1\340\16\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\7\22\1\341" - + "\16\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\10\22\1\342\15\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\4\22\1\343\21\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\5\22\1\344\20\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\7\22\1\345\3\0\26\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\10\22\1\346\15\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\5\22\1\347\2\22\1\350\15\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\7\22\1\351\16\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22" - + "\1\352\23\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\10\22\1\353\15\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\2\22\1\354\23\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\17\22\1\355\6\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\11\22" - + "\1\356\14\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\7\22\1\357\3\0\26\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\15\22\1\360\10\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\10\22\1\361\10\22\1\362\4\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\14\22\1\363\11\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\12\22\1\364" - + "\5\22\1\365\5\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\1\22\1\366" - + "\7\22\1\367\14\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\17\22\1\370" - + "\6\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\5\22\1\371\2\22\1\372" - + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\17\22\1\373\6\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\7\22\1\374\3\0\26\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\13\22" - + "\1\375\12\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\3\22\1\376\4\22\3\0\14\22" - + "\1\377\11\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\7\22\1\u0100\16\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\10\22\1\u0101\15\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\11\22\1\u0102\14\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\6\22" - + "\1\u0103\2\22\1\u0104\14\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\4\22" - + "\1\u0105\21\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\1\u0106\25\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\1\22\1\u0107\24\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\11\22\1\u0108\14\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u0109" - + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\3\22\1\u010a\4\22\3\0\26\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\25\22\1\u010b\14\0\1\22\21\0\2\u010c" - + "\3\0\3\u010c\5\0\1\u010c\2\0\5\u010c\3\0\1\u010c" - + "\1\0\1\u010c\1\0\1\u010c\6\0\1\u010c\50\0\2\u010d" - + "\3\0\3\u010d\5\0\1\u010d\2\0\5\u010d\3\0\1\u010d" - + "\1\0\1\u010d\1\0\1\u010d\6\0\1\u010d\30\0\1\u010e" - + "\2\0\30\u010e\1\302\1\0\57\u010e\1\303\2\0\30\303" - + "\1\u010f\60\303\16\0\1\u0110\113\0\1\u0111\105\0\1\u0112" - + "\6\0\2\u0112\4\0\4\u0112\5\0\3\u0112\2\0\2\u0112" - + "\3\0\26\u0112\2\0\1\u0113\23\0\2\307\3\0\1\307" - + "\1\0\4\307\2\0\4\307\4\0\10\307\3\0\26\307" - + "\33\0\1\u0114\6\0\1\u0115\77\0\1\u0116\6\0\2\u0116" - + "\4\0\4\u0116\5\0\3\u0116\2\0\2\u0116\3\0\26\u0116" - + "\2\0\1\u0117\62\0\1\u0118\46\0\1\320\111\0\5\321" - + "\1\u0119\106\321\4\0\1\320\1\322\140\0\1\u011a\102\0" - + "\1\331\13\0\1\331\3\0\2\331\71\0\2\u011b\3\0" - + "\3\u011b\5\0\1\u011b\2\0\5\u011b\3\0\1\u011b\1\0" - + "\1\u011b\1\0\1\u011b\6\0\1\u011b\41\0\1\150\7\0" - + "\1\166\13\0\1\u011c\3\0\2\u011c\2\164\55\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\5\22" - + "\1\u011d\20\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\2\22\1\u011e\23\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\4\22\1\u011f\21\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22" - + "\1\u0120\3\0\26\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\16\22\1\u0121" - + "\7\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\7\22\1\u0122\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\2\22\1\u0123\23\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\12\22" - + "\1\u0124\13\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\7\22\1\u0125\3\0\26\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\4\22\1\u0126\21\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\5\22\1\u0127\2\22\1\u0128\15\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\5\22\1\u0129\20\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u012a" - + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\7\22\1\u012b\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\10\22\1\u012c\15\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\1\22" - + "\1\u012d\24\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\11\22\1\u012e\14\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\7\22\1\u012f\3\0\26\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\14\22\1\u0130\11\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\7\22\1\u0131\3\0\26\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\6\22\1\u0132\17\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\5\22\1\u0133\20\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u0134\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\10\22\1\u0135\15\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\7\22\1\u0136\3\0\26\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\6\22" - + "\1\u0137\5\22\1\u0138\11\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u0139\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\2\22\1\u013a\23\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\7\22\1\u013b\3\0\26\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22" - + "\1\u013c\23\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\16\22\1\u013d\7\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\14\22\1\u013e\11\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\10\22\1\u013f\15\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\22\22" - + "\1\u0140\3\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\3\22\1\u0141\22\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\14\22\1\u0142\11\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\13\22\1\u0143\12\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\11\22" - + "\1\u0144\14\22\14\0\1\22\21\0\2\u0145\3\0\3\u0145" - + "\5\0\1\u0145\2\0\5\u0145\3\0\1\u0145\1\0\1\u0145" - + "\1\0\1\u0145\6\0\1\u0145\50\0\2\u0146\3\0\3\u0146" - + "\5\0\1\u0146\2\0\5\u0146\3\0\1\u0146\1\0\1\u0146" - + "\1\0\1\u0146\6\0\1\u0146\31\0\2\u0147\5\0\2\u0112" - + "\1\0\1\u0147\1\0\1\u0112\1\u0148\4\u0112\2\0\4\u0112" - + "\4\0\10\u0112\3\0\26\u0112\33\0\1\u0149\123\0\1\u014a" - + "\76\0\2\u0116\3\0\1\u0116\1\0\4\u0116\2\0\4\u0116" - + "\4\0\10\u0116\3\0\26\u0116\16\0\4\321\1\320\1\u0119" - + "\106\321\20\0\2\u014b\3\0\3\u014b\5\0\1\u014b\2\0" - + "\5\u014b\3\0\1\u014b\1\0\1\u014b\1\0\1\u014b\6\0" - + "\1\u014b\41\0\1\150\7\0\1\166\13\0\1\u014c\3\0" - + "\2\u014c\2\164\55\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\7\22\1\u014d\3\0\26\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\14\22\1\u014e\11\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u014f" - + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\7\22\1\u0150\16\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\3\22\1\u0151\22\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\1\22\1\u0152\24\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\16\22\1\u0153" - + "\7\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\10\22\1\u0154\15\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\11\22\1\u0155\14\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\5\22\1\u0156\20\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\11\22\1\u0157" - + "\14\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\1\22\1\u0158\24\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\4\22\1\u0159\21\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\1\22\1\u015a\24\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\22\22\1\u015b" - + "\3\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\5\22\1\u015c\20\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\15\22\1\u015d\10\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\6\22\1\u015e\17\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\2\22\1\u015f" - + "\23\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\1\22\1\u0160\24\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\1\22\1\u0161\24\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\u0162" - + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\3\22\1\u0163\4\22\3\0\26\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\12\22\1\u0164\13\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\10\22\1\u0165\15\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\21\22" - + "\1\u0166\4\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\7\22\1\u0167\3\0\26\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\7\22\1\u0168\3\0\26\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22" - + "\1\u0169\23\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\2\22\1\u016a\23\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\11\22\1\u016b\14\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\7\22\1\u016c\16\22\14\0\1\22\2\0\2\u0147" - + "\10\0\1\u0147\2\0\1\u0148\123\0\1\u016d\105\0\2\u016e" - + "\3\0\3\u016e\5\0\1\u016e\2\0\5\u016e\3\0\1\u016e" - + "\1\0\1\u016e\1\0\1\u016e\6\0\1\u016e\41\0\1\150" - + "\7\0\1\166\13\0\1\u016f\3\0\2\u016f\2\164\55\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\14\22\1\u0170\11\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\11\22\1\u0171" - + "\14\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\13\22\1\u0172\12\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\7\22\1\u0173\16\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\7\22\1\u0174\16\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\4\22\1\u0175" - + "\21\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\16\22\1\u0176\7\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\11\22\1\u0177\14\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\u0178" - + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\17\22\1\u0179\6\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\3\22\1\u017a\4\22\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\7\22\1\u017b\16\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\3\22\1\u017c\4\22" - + "\3\0\7\22\1\u017d\16\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22" - + "\1\u017e\15\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\21\22\1\u017f\4\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\11\22\1\u0180\14\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\14\22\1\u0181\11\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u0182\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\11\22\1\u0183\14\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\4\22\1\u0184\21\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\10\22\1\u0185\15\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\23\22\1\u0186" - + "\2\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\4\22\1\u0187\21\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\11\22\1\u0188\14\22\14\0\1\22\30\0" - + "\1\u0189\104\0\2\u018a\3\0\3\u018a\5\0\1\u018a\2\0" - + "\5\u018a\3\0\1\u018a\1\0\1\u018a\1\0\1\u018a\6\0" - + "\1\u018a\41\0\1\150\7\0\1\166\13\0\1\u018b\3\0" - + "\2\u018b\2\164\55\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\20\22\1\u018c\5\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\6\22\1\u018d\17\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\5\22" - + "\1\u018e\20\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\12\22\1\u018f\13\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\13\22\1\u0190\12\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\2\22\1\u0191\23\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\4\22" - + "\1\u0192\21\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\2\22\1\u0193\23\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\10\22\3\0\2\22\1\u0194\23\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22" - + "\1\u0195\3\0\26\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\7\22\1\u0196" - + "\16\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\10\22\1\u0197\15\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\4\22\1\u0198\21\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\10\22\1\u0199\15\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\7\22\1\u019a\3\0\26\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\7\22\1\u019b\3\0\26\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\10\22\1\u019c\15\22\14\0\1\22\31\0\1\u019d\103\0" - + "\2\u019e\3\0\3\u019e\5\0\1\u019e\2\0\5\u019e\3\0" - + "\1\u019e\1\0\1\u019e\1\0\1\u019e\6\0\1\u019e\41\0" - + "\1\150\7\0\1\166\13\0\1\u019f\3\0\2\u019f\2\164" - + "\55\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\7\22\1\u01a0\16\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u01a1\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\7\22\1\u01a2\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\4\22\1\u01a3\21\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u01a4\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\4\22\1\u01a5\21\22\14\0" - + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0" - + "\10\22\3\0\14\22\1\u01a6\11\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\7\22\1\u01a7\16\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\7\22\1\u01a8\3\0\26\22" - + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22" - + "\4\0\7\22\1\u01a9\3\0\26\22\14\0\1\22\7\0" - + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0" - + "\20\22\1\u01aa\5\22\14\0\1\22\30\0\1\u01ab\104\0" - + "\2\u01ac\3\0\3\u01ac\5\0\1\u01ac\2\0\5\u01ac\3\0" - + "\1\u01ac\1\0\1\u01ac\1\0\1\u01ac\6\0\1\u01ac\41\0" - + "\1\150\7\0\1\166\13\0\1\u01ad\3\0\2\u01ad\2\164" - + "\55\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22" - + "\1\u01ae\3\0\26\22\14\0\1\22\7\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\10\22\3\0\6\22\1\u01af" - + "\17\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\7\22\1\u01b0\3\0\26\22\14\0\1\22" - + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22" - + "\3\0\10\22\1\u01b1\15\22\14\0\1\22\7\0\3\22" - + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\13\22" - + "\1\u01b2\12\22\14\0\1\22\7\0\3\22\7\0\2\22" - + "\3\0\4\22\4\0\10\22\3\0\13\22\1\u01b3\12\22" - + "\14\0\1\22\25\0\1\u01b4\107\0\2\u01b5\3\0\3\u01b5" - + "\5\0\1\u01b5\2\0\5\u01b5\3\0\1\u01b5\1\0\1\u01b5" - + "\1\0\1\u01b5\6\0\1\u01b5\41\0\1\150\7\0\1\166" - + "\13\0\1\u01b6\3\0\2\u01b6\2\164\55\0\3\22\7\0" - + "\2\22\3\0\4\22\4\0\3\22\1\u01b7\4\22\3\0" - + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0" - + "\4\22\4\0\10\22\3\0\5\22\1\u01b8\20\22\14\0" - + "\1\22\12\0\1\150\7\0\1\166\13\0\1\u01b9\3\0" - + "\2\u01b9\2\164\60\0\1\150\7\0\1\166\13\0\1\u01ba" - + "\3\0\2\u01ba\2\164\60\0\1\150\7\0\1\166\13\0" - + "\1\u01bb\3\0\2\u01bb\2\164\60\0\1\150\7\0\1\166" - + "\13\0\1\u01bc\3\0\2\u01bc\2\164\60\0\1\150\7\0" - + "\1\166\13\0\1\u01bd\3\0\2\u01bd\2\164\60\0\1\150" - + "\7\0\1\166\13\0\1\u01be\3\0\2\u01be\2\164\47\0"; - - private static int[] zzUnpackTrans() { - int[] result = new int[22952]; - 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; - } - - - /* 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 - = "\13\0\1\11\1\1\1\11\13\1\3\11\1\1\2\11" - + "\4\1\1\11\21\1\7\11\4\1\1\11\2\1\2\11" - + "\3\1\1\11\1\1\1\11\3\1\2\11\1\1\1\11" - + "\2\1\1\11\1\1\2\11\2\1\1\11\2\1\1\11" - + "\2\1\1\11\1\1\1\0\2\11\1\1\1\11\1\1" - + "\1\11\2\1\2\11\1\1\2\11\1\1\2\11\1\0" - + "\3\1\1\0\11\1\2\11\44\1\11\11\1\1\6\11" - + "\1\1\1\11\1\0\1\11\1\0\1\11\1\0\2\11" - + "\1\0\1\1\4\0\1\1\2\0\2\11\4\1\1\11" - + "\2\0\3\11\1\1\1\11\1\0\1\1\1\11\61\1" - + "\3\0\3\11\1\0\1\11\2\0\1\1\2\11\1\0" - + "\1\11\52\1\1\11\2\0\2\11\1\0\42\1\1\0" - + "\33\1\1\0\23\1\1\0\15\1\1\0\10\1\2\11" - + "\11\1"; - - private static int[] zzUnpackAttribute() { - int[] result = new int[446]; - 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 input device - */ - private java.io.Reader zzReader; - - /** - * the current state of the DFA - */ - private int zzState; - - /** - * the current lexical state - */ - private int zzLexicalState = YYINITIAL; - - /** - * this buffer contains the current text to be matched and is - * the source of the yytext() string - */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - - /** - * the textposition at the last accepting state - */ - private int zzMarkedPos; - - /** - * the current text position in the buffer - */ - private int zzCurrentPos; - - /** - * startRead marks the beginning of the yytext() string in the buffer - */ - private int zzStartRead; - - /** - * endRead marks the last character in the buffer, that has been read - * from input - */ - private int zzEndRead; - - /** - * number of newlines encountered up to the start of the matched text - */ - private int yyline; - - /** - * the number of characters up to the start of the matched text - */ - private int yychar; - - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** - * zzAtEOF == true <=> the scanner is at the EOF - */ - private boolean zzAtEOF; - - /** - * denotes if the user-EOF-code has already been executed - */ - private boolean zzEOFDone; - - /** - * 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: */ - private String sourceCode; - - public ActionScriptLexer(String sourceCode) { - this(new StringReader(sourceCode)); - this.sourceCode = sourceCode; - } - - public void yypushbackstr(String s, int state) { - sourceCode = s + sourceCode.substring(yychar + yylength()); - yyreset(new StringReader(sourceCode)); - yybegin(state); - } - - public void yypushbackstr(String s) { - yypushbackstr(s, YYINITIAL); - } - - StringBuffer string = new StringBuffer(); - - private static String xmlTagName = ""; - - public int yychar() { - return yychar; - } - - private Stack pushedBack = new Stack<>(); - - public int yyline() { - return yyline + 1; - } - - private List listeners = new ArrayList<>(); - - public void addListener(LexListener listener) { - listeners.add(listener); - } - - public void removeListener(LexListener listener) { - listeners.remove(listener); - } - - public void informListenersLex(ParsedSymbol s) { - for (LexListener l : listeners) { - l.onLex(s); - } - } - - public void informListenersPushBack(ParsedSymbol s) { - for (LexListener l : listeners) { - l.onPushBack(s); - } - } - - public void pushback(ParsedSymbol symb) { - pushedBack.push(symb); - last = null; - informListenersPushBack(symb); - } - - ParsedSymbol last; - - public ParsedSymbol lex() throws java.io.IOException, AVM2ParseException { - ParsedSymbol ret = null; - if (!pushedBack.isEmpty()) { - ret = last = pushedBack.pop(); - } else { - ret = last = yylex(); - } - informListenersLex(ret); - return ret; - } - - /** - * Creates a new scanner - * - * @param in the java.io.Reader to read input from. - */ - public ActionScriptLexer(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 < 3140) { - 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; - } - - // 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 ParsedSymbol yylex() throws java.io.IOException, AVM2ParseException { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - char[] zzBufferL = zzBuffer; - char[] zzCMapL = ZZ_CMAP; - - int[] zzTransL = ZZ_TRANS; - int[] zzRowMapL = ZZ_ROWMAP; - int[] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - yychar += zzMarkedPosL - zzStartRead; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - // 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 164: - break; - case 2: { - yyline++; - } - case 165: - break; - case 3: { /*ignore*/ - - } - case 166: - break; - case 4: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); - } - case 167: - break; - case 5: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); - } - case 168: - break; - case 6: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); - } - case 169: - break; - case 7: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); - } - case 170: - break; - case 8: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); - } - case 171: - break; - case 9: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); - } - case 172: - break; - case 10: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); - } - case 173: - break; - case 11: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); - } - case 174: - break; - case 12: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); - } - case 175: - break; - case 13: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); - } - case 176: - break; - case 14: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); - } - case 177: - break; - case 15: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); - } - case 178: - break; - case 16: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); - } - case 179: - break; - case 17: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); - } - case 180: - break; - case 18: { - string.setLength(0); - yybegin(STRING); - } - case 181: - break; - case 19: { - string.setLength(0); - yybegin(CHARLITERAL); - } - case 182: - break; - case 20: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); - } - case 183: - break; - case 21: { - string.setLength(0); - yybegin(OIDENTIFIER); - } - case 184: - break; - case 22: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); - } - case 185: - break; - case 23: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); - } - case 186: - break; - case 24: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); - } - case 187: - break; - case 25: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); - } - case 188: - break; - case 26: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); - } - case 189: - break; - case 27: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); - } - case 190: - break; - case 28: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); - } - case 191: - break; - case 29: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); - } - case 192: - break; - case 30: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); - } - case 193: - break; - case 31: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); - } - case 194: - break; - case 32: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); - } - case 195: - break; - case 33: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); - } - case 196: - break; - case 34: { - string.append(yytext()); - } - case 197: - break; - case 35: { - yybegin(YYINITIAL); - yyline++; - } - case 198: - break; - case 36: { - yybegin(YYINITIAL); - // length also includes the trailing quote - return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); - } - case 199: - break; - case 37: { - yybegin(YYINITIAL); - yyline++; - } - case 200: - break; - case 38: { - string.append(yytext()); - yyline++; - } - case 201: - break; - case 39: { - yybegin(XML); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_END, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 202: - break; - case 40: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRNAMEVAR_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 203: - break; - case 41: { - yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext()); - } - case 204: - break; - case 42: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRNAMEVAR_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 205: - break; - case 43: { - yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRVALVAR_BEGIN, yytext()); - } - case 206: - break; - case 44: { - string.append(yytext()); - yyline++; - } - case 207: - break; - case 45: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_VAR_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 208: - break; - case 46: { - yybegin(YYINITIAL); - // length also includes the trailing quote - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); - } - case 209: - break; - case 47: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); - } - case 210: - break; - case 48: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); - } - case 211: - break; - case 49: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DESCENDANTS, yytext()); - } - case 212: - break; - case 50: { - return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, yytext()); - } - case 213: - break; - case 51: { - return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); - } - case 214: - break; - case 52: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FILTER, yytext()); - } - case 215: - break; - case 53: { - yybegin(XMLOPENTAG); - string.setLength(0); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext()); - } - case 216: - break; - case 54: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); - } - case 217: - break; - case 55: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); - } - case 218: - break; - case 56: { - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext()); - } - case 219: - break; - case 57: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); - } - case 220: - break; - case 58: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); - } - case 221: - break; - case 59: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); - } - case 222: - break; - case 60: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); - } - case 223: - break; - case 61: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); - } - case 224: - break; - case 62: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); - } - case 225: - break; - case 63: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); - } - case 226: - break; - case 64: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); - } - case 227: - break; - case 65: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); - } - case 228: - break; - case 66: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); - } - case 229: - break; - case 67: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); - } - case 230: - break; - case 68: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); - } - case 231: - break; - case 69: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); - } - case 232: - break; - case 70: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); - } - case 233: - break; - case 71: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); - } - case 234: - break; - case 72: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); - } - case 235: - break; - case 73: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); - } - case 236: - break; - case 74: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); - } - case 237: - break; - case 75: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); - } - case 238: - break; - case 76: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); - } - case 239: - break; - case 77: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); - } - case 240: - break; - case 78: { /* ignore illegal character escape */ - - } - case 241: - break; - case 79: { - string.append('\"'); - } - case 242: - break; - case 80: { - string.append('\''); - } - case 243: - break; - case 81: { - string.append('\f'); - } - case 244: - break; - case 82: { - string.append('\\'); - } - case 245: - break; - case 83: { - string.append('\b'); - } - case 246: - break; - case 84: { - string.append('\r'); - } - case 247: - break; - case 85: { - string.append('\n'); - } - case 248: - break; - case 86: { - string.append('\t'); - } - case 249: - break; - case 87: { - yybegin(XML); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTFINISHTAG_END, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 250: - break; - case 88: { - yybegin(XMLOPENTAGATTRIB); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 251: - break; - case 89: { - yybegin(XMLOPENTAG); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext()); - } - case 252: - break; - case 90: { - yybegin(XMLINSTRATTRIB); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 253: - break; - case 91: { - yybegin(XML); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_END, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 254: - break; - case 92: { - yybegin(XMLINSTROPENTAG); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext()); - } - case 255: - break; - case 93: { - yybegin(XMLOPENTAG); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 256: - break; - case 94: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 257: - break; - case 95: { - throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); - } - case 258: - break; - case 96: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); - } - case 259: - break; - case 97: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); - } - case 260: - break; - case 98: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); - } - case 261: - break; - case 99: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); - } - case 262: - break; - case 100: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); - } - case 263: - break; - case 101: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); - } - case 264: - break; - case 102: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); - } - case 265: - break; - case 103: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); - } - case 266: - break; - case 104: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.SET, yytext()); - } - case 267: - break; - case 105: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); - } - case 268: - break; - case 106: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); - } - case 269: - break; - case 107: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); - } - case 270: - break; - case 108: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); - } - case 271: - break; - case 109: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.GET, yytext()); - } - case 272: - break; - case 110: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); - } - case 273: - break; - case 111: { - string.append(yytext()); - yybegin(XML); - String ret = string.toString(); - string.setLength(0); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_CDATA, ret); - } - case 274: - break; - case 112: { - string.append(yytext()); - yybegin(XML); - String ret = string.toString(); - string.setLength(0); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_COMMENT, ret); - } - case 275: - break; - case 113: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHVARTAG_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 276: - break; - case 114: { - yybegin(XMLINSTROPENTAG); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 277: - break; - case 115: { - yybegin(YYINITIAL); - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRVARTAG_BEGIN, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 278: - break; - case 116: { - string.append('\u00A7'); - } - case 279: - break; - case 117: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); - } - case 280: - break; - case 118: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.EACH, yytext()); - } - case 281: - break; - case 119: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); - } - case 282: - break; - case 120: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); - } - case 283: - break; - case 121: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); - } - case 284: - break; - case 122: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); - } - case 285: - break; - case 123: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); - } - case 286: - break; - case 124: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); - } - case 287: - break; - case 125: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); - } - case 288: - break; - case 126: { - char val = (char) Integer.parseInt(yytext().substring(2), 16); - string.append(val); - } - case 289: - break; - case 127: { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHTAG, yytext())); - if (string.length() > 0) { - pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); - string.setLength(0); - } - return lex(); - } - case 290: - break; - case 128: { - String ret = string.toString(); - string.setLength(0); - string.append(yytext()); - yybegin(XMLCOMMENT); - if (!ret.isEmpty()) { - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, ret); - } - } - case 291: - break; - case 129: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); - } - case 292: - break; - case 130: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.FINAL, yytext()); - } - case 293: - break; - case 131: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); - } - case 294: - break; - case 132: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); - } - case 295: - break; - case 133: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); - } - case 296: - break; - case 134: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); - } - case 297: - break; - case 135: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); - } - case 298: - break; - case 136: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); - } - case 299: - break; - case 137: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); - } - case 300: - break; - case 138: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); - } - case 301: - break; - case 139: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.STATIC, yytext()); - } - case 302: - break; - case 140: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); - } - case 303: - break; - case 141: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NATIVE, yytext()); - } - case 304: - break; - case 142: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); - } - case 305: - break; - case 143: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); - } - case 306: - break; - case 144: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); - } - case 307: - break; - case 145: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); - } - case 308: - break; - case 146: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); - } - case 309: - break; - case 147: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); - } - case 310: - break; - case 148: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); - } - case 311: - break; - case 149: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.DYNAMIC, yytext()); - } - case 312: - break; - case 150: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); - } - case 313: - break; - case 151: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); - } - case 314: - break; - case 152: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); - } - case 315: - break; - case 153: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); - } - case 316: - break; - case 154: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.OVERRIDE, yytext()); - } - case 317: - break; - case 155: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); - } - case 318: - break; - case 156: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); - } - case 319: - break; - case 157: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NAMESPACE, yytext()); - } - case 320: - break; - case 158: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); - } - case 321: - break; - case 159: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); - } - case 322: - break; - case 160: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); - } - case 323: - break; - case 161: { - String ret = string.toString(); - string.setLength(0); - string.append(yytext()); - yybegin(XMLCDATA); - if (!ret.isEmpty()) { - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, ret); - } - } - case 324: - break; - case 162: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); - } - case 325: - break; - case 163: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); - } - case 326: - break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - { - return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); - } - } else { - zzScanError(ZZ_NO_MATCH); - } - } - } - } -} +/* The following code was generated by JFlex 1.6.0 */ + +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.List; +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/actionscript3_script.flex + */ +public final class ActionScriptLexer { + + /** 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; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int CHARLITERAL = 4; + public static final int XMLOPENTAG = 6; + public static final int XMLOPENTAGATTRIB = 8; + public static final int XMLINSTROPENTAG = 10; + public static final int XMLINSTRATTRIB = 12; + public static final int XMLCDATA = 14; + public static final int XMLCOMMENT = 16; + public static final int XML = 18; + public static final int OIDENTIFIER = 20; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, + 8, 8, 9, 9, 10, 10 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\13\1\2\1\113\1\3\1\1\22\0\1\13\1\14\1\33"+ + "\1\0\1\6\1\110\1\105\1\34\1\76\1\77\1\5\1\45\1\103"+ + "\1\15\1\11\1\4\1\35\3\41\4\42\2\21\1\17\1\102\1\12"+ + "\1\32\1\16\1\23\1\111\1\27\1\20\1\25\1\26\1\43\1\20"+ + "\2\10\1\74\4\10\1\75\5\10\1\30\3\10\1\37\2\10\1\24"+ + "\1\46\1\31\1\107\1\10\1\0\1\52\1\50\1\54\1\63\1\44"+ + "\1\40\1\73\1\66\1\61\1\10\1\53\1\64\1\71\1\57\1\56"+ + "\1\67\1\10\1\51\1\55\1\60\1\62\1\72\1\65\1\36\1\70"+ + "\1\10\1\100\1\106\1\101\1\104\6\0\1\113\41\0\1\47\2\0"+ + "\1\6\12\0\1\6\1\0\1\22\2\0\1\6\5\0\2\6\1\112"+ + "\24\6\1\0\37\6\1\0\u01ca\6\4\0\14\6\16\0\5\6\7\0"+ + "\1\6\1\0\1\6\21\0\160\7\5\6\1\0\2\6\2\0\4\6"+ + "\1\0\1\6\6\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6"+ + "\1\0\123\6\1\0\213\6\1\0\5\7\2\0\246\6\1\0\46\6"+ + "\2\0\1\6\7\0\47\6\11\0\55\7\1\0\1\7\1\0\2\7"+ + "\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\35\0\13\7"+ + "\5\0\53\6\37\7\4\0\2\6\1\7\143\6\1\0\1\6\7\7"+ + "\2\0\6\7\2\6\2\7\1\0\4\7\2\6\12\7\3\6\2\0"+ + "\1\6\20\0\1\6\1\7\36\6\33\7\2\0\131\6\13\7\1\6"+ + "\16\0\12\7\41\6\11\7\2\6\4\0\1\6\5\0\26\6\4\7"+ + "\1\6\11\7\1\6\3\7\1\6\5\7\22\0\31\6\3\7\104\0"+ + "\23\6\61\0\40\7\66\6\3\7\1\6\22\7\1\6\7\7\12\6"+ + "\2\7\2\0\12\7\1\0\20\6\3\7\1\0\10\6\2\0\2\6"+ + "\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0\1\7"+ + "\1\6\7\7\2\0\2\7\2\0\3\7\1\6\10\0\1\7\4\0"+ + "\2\6\1\0\3\6\2\7\2\0\12\7\2\6\17\0\3\7\1\0"+ + "\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0"+ + "\2\6\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0"+ + "\3\7\3\0\1\7\7\0\4\6\1\0\1\6\7\0\14\7\3\6"+ + "\1\7\13\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6\1\0"+ + "\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7\1\0"+ + "\3\7\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0\12\7"+ + "\21\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6"+ + "\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7\2\0\2\7"+ + "\2\0\3\7\10\0\2\7\4\0\2\6\1\0\3\6\2\7\2\0"+ + "\12\7\1\0\1\6\20\0\1\7\1\6\1\0\6\6\3\0\3\6"+ + "\1\0\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0\2\6"+ + "\3\0\3\6\3\0\14\6\4\0\5\7\3\0\3\7\1\0\4\7"+ + "\2\0\1\6\6\0\1\7\16\0\12\7\20\0\4\7\1\0\10\6"+ + "\1\0\3\6\1\0\27\6\1\0\20\6\3\0\1\6\7\7\1\0"+ + "\3\7\1\0\4\7\7\0\2\7\1\0\2\6\6\0\2\6\2\7"+ + "\2\0\12\7\21\0\3\7\1\0\10\6\1\0\3\6\1\0\27\6"+ + "\1\0\12\6\1\0\5\6\2\0\1\7\1\6\7\7\1\0\3\7"+ + "\1\0\4\7\7\0\2\7\7\0\1\6\1\0\2\6\2\7\2\0"+ + "\12\7\1\0\2\6\16\0\3\7\1\0\10\6\1\0\3\6\1\0"+ + "\51\6\2\0\1\6\7\7\1\0\3\7\1\0\4\7\1\6\10\0"+ + "\1\7\10\0\2\6\2\7\2\0\12\7\12\0\6\6\2\0\2\7"+ + "\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0\7\6"+ + "\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7\6\0\12\7"+ + "\2\0\2\7\15\0\60\6\1\7\2\6\7\7\5\0\7\6\10\7"+ + "\1\0\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6"+ + "\2\0\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6"+ + "\1\0\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0"+ + "\2\7\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7"+ + "\2\0\4\6\40\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7"+ + "\1\0\1\7\1\0\1\7\4\0\2\7\10\6\1\0\44\6\4\0"+ + "\24\7\1\0\2\7\5\6\13\7\1\0\44\7\11\0\1\7\71\0"+ + "\53\6\24\7\1\6\12\7\6\0\6\6\4\7\4\6\3\7\1\6"+ + "\3\7\2\6\7\7\3\6\4\7\15\6\14\7\1\6\17\7\2\0"+ + "\46\6\1\0\1\6\5\0\1\6\2\0\53\6\1\0\u014d\6\1\0"+ + "\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6\1\0"+ + "\4\6\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0"+ + "\4\6\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6\2\0"+ + "\3\7\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6\1\0"+ + "\32\6\5\0\113\6\3\0\3\7\10\6\7\0\15\6\1\0\4\6"+ + "\3\7\13\0\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0"+ + "\3\6\1\0\2\7\14\0\64\6\40\7\3\0\1\6\4\0\1\6"+ + "\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0"+ + "\51\6\1\7\1\6\5\0\106\6\12\0\37\6\1\0\14\7\4\0"+ + "\14\7\12\0\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7"+ + "\7\6\2\7\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7"+ + "\1\0\35\7\2\0\13\7\6\0\12\7\15\0\1\6\10\0\16\7"+ + "\102\0\5\7\57\6\21\7\7\6\4\0\12\7\21\0\11\7\14\0"+ + "\3\7\36\6\15\7\2\6\12\7\54\6\16\7\14\0\44\6\24\7"+ + "\10\0\12\7\3\0\3\6\12\7\44\6\122\0\3\7\1\0\25\7"+ + "\4\6\1\7\4\6\3\7\2\6\1\0\2\7\6\0\300\6\66\7"+ + "\6\0\4\7\u0116\6\2\0\6\6\2\0\46\6\2\0\6\6\2\0"+ + "\10\6\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6\2\0"+ + "\65\6\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6\3\0"+ + "\4\6\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6\3\0"+ + "\14\0\2\0\32\0\1\113\1\113\25\0\2\7\23\0\1\7\33\0"+ + "\1\0\1\6\15\0\1\6\20\0\15\6\63\0\15\7\4\0\1\7"+ + "\3\0\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6"+ + "\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6"+ + "\1\0\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\43\7"+ + "\2\6\4\7\7\0\u0a70\0\57\6\1\0\57\6\1\0\205\6\6\0"+ + "\4\6\3\7\2\6\14\0\46\6\1\0\1\6\5\0\1\6\2\0"+ + "\70\6\7\0\1\6\17\0\1\7\27\6\11\0\7\6\1\0\7\6"+ + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6"+ + "\1\0\7\6\1\0\40\7\57\0\1\6\u01c0\0\21\0\4\0\2\6"+ + "\1\7\31\0\17\7\1\0\5\6\2\0\3\7\2\6\4\0\126\6"+ + "\2\0\2\7\2\0\3\6\1\0\132\6\1\0\4\6\5\0\51\6"+ + "\3\0\136\6\21\0\33\6\65\0\20\6\u0200\0\u19b6\6\112\0\u51cd\6"+ + "\63\0\u048d\6\103\0\56\6\2\0\u010d\6\3\0\20\6\12\7\2\6"+ + "\24\0\57\6\1\7\4\0\12\7\1\0\37\6\1\0\1\7\106\6"+ + "\14\7\45\0\11\6\2\0\147\6\2\0\4\6\1\0\36\6\2\0"+ + "\2\6\105\0\13\6\1\7\3\6\1\7\4\6\1\7\27\6\5\7"+ + "\30\0\64\6\14\0\2\7\62\6\21\7\13\0\12\7\6\0\22\7"+ + "\6\6\3\0\1\6\4\0\12\7\34\6\10\7\2\0\27\6\15\7"+ + "\14\0\35\6\3\0\4\7\57\6\16\7\16\0\1\6\12\7\6\0"+ + "\5\6\1\7\12\6\12\7\5\6\1\0\51\6\16\7\11\0\3\6"+ + "\1\7\10\6\2\7\2\0\12\7\6\0\27\6\3\0\1\6\3\7"+ + "\62\6\1\7\1\6\3\7\2\6\2\7\5\6\2\7\1\6\1\7"+ + "\1\6\30\0\3\6\2\0\13\6\5\7\2\0\3\6\2\7\12\0"+ + "\6\6\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\1\0"+ + "\53\6\1\0\4\6\4\0\2\6\132\0\43\6\10\7\1\0\2\7"+ + "\2\0\12\7\6\0\u2ba4\6\14\0\27\6\4\0\61\6\4\0\u1800\0"+ + "\u0900\0\u016e\6\2\0\152\6\46\0\7\6\14\0\5\6\5\0\1\6"+ + "\1\7\12\6\1\0\15\6\1\0\5\6\1\0\1\6\1\0\2\6"+ + "\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0\100\6\2\0\66\6"+ + "\10\0\40\0\14\6\4\0\20\7\20\0\16\7\5\0\2\7\30\0"+ + "\3\7\40\0\5\6\1\0\207\6\23\0\12\7\7\0\32\6\4\0"+ + "\1\7\1\0\32\6\13\0\131\6\3\0\6\6\2\0\6\6\2\0"+ + "\6\6\2\0\3\6\41\0\2\0\14\6\1\0\32\6\1\0\23\6"+ + "\1\0\2\6\1\0\17\6\2\0\16\6\42\0\173\6\105\0\65\7"+ + "\210\0\1\7\202\0\35\6\3\0\61\6\17\0\1\7\37\0\40\6"+ + "\20\0\21\6\1\7\10\6\1\7\5\0\46\6\5\7\5\0\36\6"+ + "\2\0\44\6\4\0\10\6\1\0\5\7\52\0\236\6\2\0\12\7"+ + "\126\0\50\6\10\0\64\6\234\0\u0137\6\11\0\26\6\12\0\10\6"+ + "\230\0\6\6\2\0\1\6\1\0\54\6\1\0\2\6\3\0\1\6"+ + "\2\0\27\6\12\0\27\6\11\0\37\6\141\0\26\6\12\0\32\6"+ + "\106\0\70\6\6\0\2\6\100\0\1\6\3\7\1\0\2\7\5\0"+ + "\4\7\4\6\1\0\3\6\1\0\33\6\4\0\3\7\4\0\1\7"+ + "\40\0\35\6\3\0\35\6\43\0\10\6\1\0\34\6\2\7\31\0"+ + "\66\6\12\0\26\6\12\0\23\6\15\0\22\6\156\0\111\6\u03b7\0"+ + "\3\7\65\6\17\7\37\0\12\7\17\0\4\7\55\6\13\7\25\0"+ + "\31\6\7\0\12\7\6\0\3\7\44\6\16\7\1\0\12\7\20\0"+ + "\43\6\1\7\2\0\1\6\11\0\3\7\60\6\16\7\4\6\13\0"+ + "\12\7\1\6\45\0\22\6\1\0\31\6\14\7\170\0\57\6\14\7"+ + "\5\0\12\7\7\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6"+ + "\1\0\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\7\7"+ + "\2\0\2\7\2\0\3\7\11\0\1\7\5\0\5\6\2\7\2\0"+ + "\7\7\3\0\5\7\u010b\0\60\6\24\7\2\6\1\0\1\6\10\0"+ + "\12\7\246\0\57\6\7\7\2\0\11\7\77\0\60\6\21\7\3\0"+ + "\1\6\13\0\12\7\46\0\53\6\15\7\10\0\12\7\u01d6\0\100\6"+ + "\12\7\25\0\1\6\u01c0\0\71\6\u0507\0\u0399\6\147\0\157\7\u0b91\0"+ + "\u042f\6\u33d1\0\u0239\6\7\0\37\6\1\0\12\7\146\0\36\6\2\0"+ + "\5\7\13\0\60\6\7\7\11\0\4\6\14\0\12\7\11\0\25\6"+ + "\5\0\23\6\u0370\0\105\6\13\0\1\6\56\7\20\0\4\7\15\6"+ + "\u4060\0\2\6\u0bfe\0\153\6\5\0\15\6\3\0\11\6\7\0\12\6"+ + "\3\0\2\7\u14c6\0\5\7\3\0\6\7\10\0\10\7\2\0\7\7"+ + "\36\0\4\7\224\0\3\7\u01bb\0\125\6\1\0\107\6\1\0\2\6"+ + "\2\0\1\6\2\0\2\6\2\0\4\6\1\0\14\6\1\0\1\6"+ + "\1\0\7\6\1\0\101\6\1\0\4\6\2\0\10\6\1\0\7\6"+ + "\1\0\34\6\1\0\4\6\1\0\5\6\1\0\1\6\3\0\7\6"+ + "\1\0\u0154\6\2\0\31\6\1\0\31\6\1\0\37\6\1\0\31\6"+ + "\1\0\37\6\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6"+ + "\1\0\31\6\1\0\10\6\2\0\62\7\u1000\0\305\6\13\0\7\7"+ + "\u0529\0\4\6\1\0\33\6\1\0\2\6\1\0\1\6\2\0\1\6"+ + "\1\0\12\6\1\0\4\6\1\0\1\6\1\0\1\6\6\0\1\6"+ + "\4\0\1\6\1\0\1\6\1\0\1\6\1\0\3\6\1\0\2\6"+ + "\1\0\1\6\2\0\1\6\1\0\1\6\1\0\1\6\1\0\1\6"+ + "\1\0\1\6\1\0\2\6\1\0\1\6\2\0\4\6\1\0\7\6"+ + "\1\0\4\6\1\0\4\6\1\0\1\6\1\0\12\6\1\0\21\6"+ + "\5\0\3\6\1\0\5\6\1\0\21\6\u1144\0\ua6d7\6\51\0\u1035\6"+ + "\13\0\336\6\u3fe2\0\u021e\6\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u06ed\0"+ + "\360\7\uffff\0\uffff\0\ufe12\0"; + + /** + * 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(); + + private static final String ZZ_ACTION_PACKED_0 = + "\13\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"+ + "\1\10\1\11\1\12\1\13\1\14\1\15\1\16\1\17"+ + "\1\20\1\21\1\22\1\23\1\15\2\6\1\24\1\25"+ + "\21\6\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+ + "\1\35\1\36\1\37\1\40\1\41\1\42\2\43\1\44"+ + "\1\1\1\42\2\45\2\46\1\42\2\1\1\47\1\50"+ + "\1\1\1\51\2\1\1\52\1\1\1\53\2\42\2\54"+ + "\2\42\1\55\1\42\1\1\1\56\1\3\1\0\1\57"+ + "\1\60\1\61\1\62\1\63\1\64\1\65\1\66\1\67"+ + "\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\0"+ + "\1\77\1\63\1\100\1\0\2\100\7\6\1\101\1\102"+ + "\1\0\2\6\1\103\16\6\1\104\1\105\1\106\4\6"+ + "\1\107\13\6\1\110\1\111\1\112\1\113\1\114\1\115"+ + "\1\116\1\117\1\120\1\116\1\121\1\122\1\123\1\124"+ + "\1\125\1\126\1\116\1\127\1\0\1\130\1\0\1\131"+ + "\1\0\1\132\1\133\1\0\1\134\4\0\1\135\2\0"+ + "\1\136\4\137\2\3\2\0\1\140\1\141\1\142\1\143"+ + "\1\144\1\0\1\63\1\145\2\146\1\100\1\6\1\147"+ + "\5\6\1\150\6\6\1\151\4\6\1\152\4\6\1\153"+ + "\6\6\1\154\12\6\1\155\1\6\1\156\1\6\1\157"+ + "\3\0\1\134\1\160\1\161\1\0\1\162\2\0\1\163"+ + "\1\164\1\165\1\0\1\166\1\146\1\100\4\6\1\167"+ + "\1\170\2\6\1\171\12\6\1\172\1\173\1\6\1\174"+ + "\11\6\1\175\5\6\1\176\1\6\1\177\2\0\1\200"+ + "\1\201\1\0\1\146\1\100\1\202\1\203\2\6\1\204"+ + "\1\6\1\205\1\206\1\6\1\207\1\6\1\210\4\6"+ + "\1\211\11\6\1\212\5\6\1\0\1\146\1\100\3\6"+ + "\1\213\1\6\1\214\1\215\1\6\1\216\1\6\1\217"+ + "\3\6\1\220\3\6\1\221\4\6\1\222\1\6\1\0"+ + "\1\146\1\100\1\223\1\6\1\224\10\6\1\225\1\226"+ + "\1\6\1\227\1\230\1\6\1\0\1\146\1\100\1\231"+ + "\1\232\1\233\3\6\1\234\3\6\1\235\1\0\1\146"+ + "\1\100\1\236\1\6\1\237\1\6\1\240\1\241\1\242"+ + "\1\146\1\100\1\243\1\244\6\100"; + + private static int [] zzUnpackAction() { + int [] result = new int[448]; + 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; + } + + + /** + * 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\114\0\230\0\344\0\u0130\0\u017c\0\u01c8\0\u0214"+ + "\0\u0260\0\u02ac\0\u02f8\0\u0344\0\u0390\0\u0344\0\u03dc\0\u0428"+ + "\0\u0474\0\u04c0\0\u050c\0\u0558\0\u05a4\0\u05f0\0\u063c\0\u0688"+ + "\0\u06d4\0\u0344\0\u0344\0\u0344\0\u0720\0\u0344\0\u0344\0\u076c"+ + "\0\u07b8\0\u0804\0\u0850\0\u089c\0\u08e8\0\u0934\0\u0980\0\u09cc"+ + "\0\u0a18\0\u0a64\0\u0ab0\0\u0afc\0\u0b48\0\u0b94\0\u0be0\0\u0c2c"+ + "\0\u0c78\0\u0cc4\0\u0d10\0\u0d5c\0\u0da8\0\u0344\0\u0344\0\u0344"+ + "\0\u0344\0\u0344\0\u0344\0\u0344\0\u0df4\0\u0e40\0\u0e8c\0\u0ed8"+ + "\0\u0344\0\u0f24\0\u0f70\0\u0344\0\u0344\0\u0fbc\0\u1008\0\u1054"+ + "\0\u0344\0\u10a0\0\u0344\0\u10ec\0\u1138\0\u1184\0\u0344\0\u0344"+ + "\0\u11d0\0\u0344\0\u121c\0\u1268\0\u0344\0\u12b4\0\u0344\0\u0344"+ + "\0\u1300\0\u134c\0\u0344\0\u1398\0\u13e4\0\u0344\0\u1430\0\u147c"+ + "\0\u0344\0\u14c8\0\u1514\0\u0344\0\u0344\0\u1560\0\u0344\0\u15ac"+ + "\0\u0344\0\u15f8\0\u1644\0\u0344\0\u0344\0\u1690\0\u0344\0\u0344"+ + "\0\u16dc\0\u0344\0\u0344\0\u1728\0\u1774\0\u17c0\0\u180c\0\u1858"+ + "\0\u18a4\0\u18f0\0\u193c\0\u1988\0\u19d4\0\u1a20\0\u1a6c\0\u1ab8"+ + "\0\u1b04\0\u0344\0\u0344\0\u1b50\0\u1b9c\0\u1be8\0\u04c0\0\u1c34"+ + "\0\u1c80\0\u1ccc\0\u1d18\0\u1d64\0\u1db0\0\u1dfc\0\u1e48\0\u1e94"+ + "\0\u1ee0\0\u1f2c\0\u1f78\0\u1fc4\0\u2010\0\u04c0\0\u04c0\0\u205c"+ + "\0\u20a8\0\u20f4\0\u2140\0\u218c\0\u04c0\0\u21d8\0\u2224\0\u2270"+ + "\0\u22bc\0\u2308\0\u2354\0\u23a0\0\u23ec\0\u2438\0\u2484\0\u24d0"+ + "\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344"+ + "\0\u0344\0\u251c\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344\0\u0344"+ + "\0\u2568\0\u0344\0\u1184\0\u0344\0\u11d0\0\u0344\0\u121c\0\u0344"+ + "\0\u0344\0\u12b4\0\u25b4\0\u2600\0\u264c\0\u2698\0\u26e4\0\u2730"+ + "\0\u277c\0\u27c8\0\u0344\0\u0344\0\u251c\0\u2568\0\u2814\0\u2860"+ + "\0\u0344\0\u28ac\0\u28f8\0\u0344\0\u0344\0\u0344\0\u2944\0\u0344"+ + "\0\u2990\0\u2990\0\u0344\0\u29dc\0\u1858\0\u2a28\0\u2a74\0\u04c0"+ + "\0\u2ac0\0\u2b0c\0\u2b58\0\u2ba4\0\u2bf0\0\u2c3c\0\u2c88\0\u2cd4"+ + "\0\u2d20\0\u2d6c\0\u2db8\0\u2e04\0\u04c0\0\u2e50\0\u2e9c\0\u2ee8"+ + "\0\u2f34\0\u04c0\0\u2f80\0\u2fcc\0\u3018\0\u3064\0\u04c0\0\u30b0"+ + "\0\u30fc\0\u3148\0\u3194\0\u31e0\0\u322c\0\u04c0\0\u3278\0\u32c4"+ + "\0\u3310\0\u335c\0\u33a8\0\u33f4\0\u3440\0\u348c\0\u34d8\0\u3524"+ + "\0\u04c0\0\u3570\0\u04c0\0\u35bc\0\u04c0\0\u3608\0\u3654\0\u25b4"+ + "\0\u0344\0\u0344\0\u0344\0\u36a0\0\u0344\0\u36ec\0\u3738\0\u3784"+ + "\0\u0344\0\u0344\0\u37d0\0\u0344\0\u381c\0\u3868\0\u38b4\0\u3900"+ + "\0\u394c\0\u3998\0\u04c0\0\u04c0\0\u39e4\0\u3a30\0\u04c0\0\u3a7c"+ + "\0\u3ac8\0\u3b14\0\u3b60\0\u3bac\0\u3bf8\0\u3c44\0\u3c90\0\u3cdc"+ + "\0\u3d28\0\u04c0\0\u04c0\0\u3d74\0\u04c0\0\u3dc0\0\u3e0c\0\u3e58"+ + "\0\u3ea4\0\u3ef0\0\u3f3c\0\u3f88\0\u3fd4\0\u4020\0\u04c0\0\u406c"+ + "\0\u40b8\0\u4104\0\u4150\0\u419c\0\u04c0\0\u41e8\0\u0344\0\u251c"+ + "\0\u4234\0\u0344\0\u0344\0\u4280\0\u42cc\0\u4318\0\u04c0\0\u4364"+ + "\0\u43b0\0\u43fc\0\u04c0\0\u4448\0\u04c0\0\u04c0\0\u4494\0\u04c0"+ + "\0\u44e0\0\u04c0\0\u452c\0\u4578\0\u45c4\0\u4610\0\u04c0\0\u465c"+ + "\0\u46a8\0\u46f4\0\u4740\0\u478c\0\u47d8\0\u4824\0\u4870\0\u48bc"+ + "\0\u04c0\0\u4908\0\u4954\0\u49a0\0\u49ec\0\u4a38\0\u4a84\0\u4ad0"+ + "\0\u4b1c\0\u4b68\0\u4bb4\0\u4c00\0\u04c0\0\u4c4c\0\u04c0\0\u04c0"+ + "\0\u4c98\0\u04c0\0\u4ce4\0\u04c0\0\u4d30\0\u4d7c\0\u4dc8\0\u04c0"+ + "\0\u4e14\0\u4e60\0\u4eac\0\u04c0\0\u4ef8\0\u4f44\0\u4f90\0\u4fdc"+ + "\0\u04c0\0\u5028\0\u5074\0\u50c0\0\u510c\0\u04c0\0\u5158\0\u04c0"+ + "\0\u51a4\0\u51f0\0\u523c\0\u5288\0\u52d4\0\u5320\0\u536c\0\u53b8"+ + "\0\u04c0\0\u04c0\0\u5404\0\u04c0\0\u04c0\0\u5450\0\u549c\0\u54e8"+ + "\0\u5534\0\u04c0\0\u04c0\0\u04c0\0\u5580\0\u55cc\0\u5618\0\u04c0"+ + "\0\u5664\0\u56b0\0\u56fc\0\u04c0\0\u5748\0\u5794\0\u57e0\0\u04c0"+ + "\0\u582c\0\u04c0\0\u5878\0\u04c0\0\u04c0\0\u0344\0\u0344\0\u58c4"+ + "\0\u04c0\0\u04c0\0\u5910\0\u595c\0\u59a8\0\u59f4\0\u5a40\0\u17c0"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[448]; + 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; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\14\1\15\1\16\1\17\1\20\1\21\1\22\1\14"+ + "\1\22\1\23\1\24\1\17\1\25\1\26\1\27\1\30"+ + "\1\22\1\31\1\14\1\32\1\33\4\22\1\34\1\35"+ + "\1\36\1\37\1\40\2\22\1\41\2\31\1\22\1\42"+ + "\1\43\1\14\1\44\1\45\1\46\1\47\1\22\1\50"+ + "\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\22"+ + "\1\60\1\22\1\61\2\22\1\62\1\63\1\64\1\65"+ + "\1\66\1\67\1\70\1\71\1\72\1\73\1\74\1\75"+ + "\1\76\1\77\1\100\1\101\1\22\1\14\1\102\1\103"+ + "\1\104\30\102\1\105\12\102\1\106\45\102\1\107\1\110"+ + "\1\111\31\107\1\105\11\107\1\106\45\107\1\14\1\112"+ + "\1\113\1\114\1\115\3\14\1\116\2\14\1\114\2\14"+ + "\1\117\2\116\4\14\4\116\5\14\3\116\2\14\2\116"+ + "\3\14\26\116\2\14\1\120\46\14\1\121\44\14\1\122"+ + "\14\14\1\112\1\113\1\114\4\14\1\123\2\14\1\114"+ + "\3\14\2\123\2\14\1\124\1\14\4\123\5\14\3\123"+ + "\2\14\2\123\3\14\26\123\2\14\1\125\46\14\1\126"+ + "\44\14\1\127\13\14\1\130\1\112\1\113\26\130\1\131"+ + "\63\130\1\132\1\133\12\130\1\134\77\130\1\112\1\113"+ + "\7\130\1\135\65\130\1\136\13\130\1\137\1\110\1\111"+ + "\43\137\1\140\1\141\44\137\116\0\1\16\114\0\1\17"+ + "\7\0\1\17\104\0\1\142\1\143\24\0\1\144\113\0"+ + "\1\145\67\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\26\22\14\0\1\22\12\0\1\146\1\147"+ + "\6\0\1\150\13\0\1\150\3\0\2\150\33\0\1\151"+ + "\25\0\1\152\1\0\1\153\4\0\2\152\4\0\4\152"+ + "\1\0\1\154\3\0\3\152\2\0\2\152\3\0\26\152"+ + "\2\0\1\155\45\0\1\156\76\0\1\157\14\0\1\160"+ + "\77\0\1\161\13\0\1\162\100\0\1\163\105\0\1\150"+ + "\7\0\1\31\13\0\1\31\3\0\2\31\2\164\101\0"+ + "\1\165\72\0\1\150\7\0\1\166\13\0\1\167\2\170"+ + "\1\0\1\171\1\172\2\164\55\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\2\22\1\173\3\22"+ + "\1\174\2\22\1\175\1\176\13\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\1\22\1\177"+ + "\6\22\3\0\2\22\1\200\11\22\1\201\11\22\14\0"+ + "\1\22\33\0\1\202\12\0\1\203\115\0\1\204\52\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\1\22\1\205\24\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\7\22\1\206\3\0\26\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\5\22\1\207\20\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\2\22\1\210\3\22\1\211\5\22\1\212\11\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\7\22\1\213\3\0\10\22\1\214\1\22\1\215"+ + "\2\22\1\216\10\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\22\22\1\217"+ + "\3\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\7\22\1\220\3\0\2\22\1\221\7\22"+ + "\1\222\13\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\1\22\1\223\14\22"+ + "\1\224\1\22\1\225\5\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\3\22\1\226\4\22"+ + "\3\0\5\22\1\227\1\22\1\230\11\22\1\231\4\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\5\22\1\232\1\22\1\233\16\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\7\22\1\234\3\0\6\22\1\235\11\22\1\236"+ + "\5\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\11\22\1\237\4\22\1\240"+ + "\7\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\1\22\1\241\1\242\7\22"+ + "\1\243\13\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\2\22\1\244\3\22"+ + "\1\245\17\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\246\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\7\22\1\247\16\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\2\22\1\250\23\22\14\0\1\22\33\0\1\251\52\0"+ + "\1\252\40\0\1\253\53\0\1\254\37\0\1\255\113\0"+ + "\1\256\61\0\1\102\2\0\30\102\1\0\12\102\1\0"+ + "\45\102\2\0\1\104\111\0\1\257\3\0\27\257\1\260"+ + "\1\261\1\257\1\262\1\257\1\263\5\257\1\264\1\257"+ + "\1\265\1\266\5\257\1\267\1\270\1\257\1\271\30\257"+ + "\1\0\1\107\2\0\31\107\1\0\11\107\1\0\45\107"+ + "\2\0\1\111\113\0\1\113\114\0\1\114\7\0\1\114"+ + "\116\0\1\272\105\0\2\273\3\0\1\273\1\0\4\273"+ + "\2\0\4\273\1\0\1\274\2\0\10\273\3\0\26\273"+ + "\16\0\1\275\2\0\30\275\1\276\60\275\10\0\2\277"+ + "\3\0\1\277\1\0\4\277\2\0\4\277\1\0\1\300"+ + "\2\0\10\277\3\0\26\277\34\0\1\301\75\0\1\302"+ + "\2\0\30\302\1\303\1\304\57\302\31\0\1\305\64\0"+ + "\1\133\126\0\1\306\102\0\1\307\3\0\1\310\3\0"+ + "\1\311\2\0\2\310\2\0\1\312\1\0\4\310\5\0"+ + "\3\310\2\0\2\310\3\0\26\310\2\0\1\313\13\0"+ + "\1\137\2\0\43\137\2\0\44\137\1\314\3\0\32\314"+ + "\1\315\1\314\1\263\5\314\1\264\1\314\1\265\1\266"+ + "\5\314\1\267\1\270\1\314\1\316\27\314\1\317\1\0"+ + "\1\142\1\320\1\321\111\142\5\322\1\323\106\322\11\0"+ + "\1\324\123\0\1\150\13\0\1\150\3\0\2\150\2\164"+ + "\57\0\2\152\3\0\1\152\1\0\4\152\2\0\4\152"+ + "\4\0\10\152\3\0\26\152\50\0\1\325\113\0\1\326"+ + "\77\0\1\327\13\0\1\330\76\0\1\331\3\0\1\332"+ + "\13\0\1\332\3\0\2\332\2\0\1\331\100\0\1\333"+ + "\72\0\1\150\7\0\1\166\13\0\1\166\3\0\2\166"+ + "\2\164\60\0\1\150\7\0\1\166\13\0\1\167\3\0"+ + "\1\171\1\172\2\164\67\0\2\334\3\0\3\334\5\0"+ + "\1\335\2\0\5\334\3\0\1\334\1\0\1\334\1\0"+ + "\1\334\6\0\1\334\41\0\1\150\7\0\1\166\13\0"+ + "\1\172\3\0\2\172\2\164\60\0\1\150\7\0\1\166"+ + "\13\0\1\336\3\0\2\336\2\164\55\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\14\22\1\337"+ + "\11\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\1\22\1\340\24\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\7\22\1\341\16\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\7\22\1\342\16\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\343"+ + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\4\22\1\344\21\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\5\22\1\345\20\22\14\0\1\22\7\0"+ + "\1\346\1\0\1\346\7\0\1\346\4\0\4\346\5\0"+ + "\3\346\2\0\2\346\3\0\26\346\14\0\1\346\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\347"+ + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\10\22\1\350\15\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\5\22\1\351\2\22\1\352\15\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\7\22\1\353\16\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\2\22\1\354\23\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22"+ + "\1\355\15\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\2\22\1\356\23\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\17\22\1\357\6\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\11\22\1\360\14\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\7\22\1\361\3\0"+ + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\15\22\1\362\10\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\10\22\1\363\10\22\1\364\4\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\14\22\1\365\11\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\12\22\1\366\5\22\1\367\5\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\1\22\1\370\7\22\1\371\14\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\17\22\1\372\6\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\5\22\1\373"+ + "\2\22\1\374\15\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\17\22\1\375"+ + "\6\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\7\22\1\376\3\0\26\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\13\22\1\377\12\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\3\22\1\u0100\4\22"+ + "\3\0\14\22\1\u0101\11\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\7\22"+ + "\1\u0102\16\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\10\22\1\u0103\15\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\11\22\1\u0104\14\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\6\22\1\u0105\2\22\1\u0106\14\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\4\22\1\u0107\21\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\1\u0108"+ + "\25\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\1\22\1\u0109\24\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\11\22\1\u010a\14\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\10\22\1\u010b\15\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\3\22\1\u010c\4\22\3\0"+ + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\25\22\1\u010d\14\0\1\22"+ + "\21\0\2\u010e\3\0\3\u010e\5\0\1\u010e\2\0\5\u010e"+ + "\3\0\1\u010e\1\0\1\u010e\1\0\1\u010e\6\0\1\u010e"+ + "\50\0\2\u010f\3\0\3\u010f\5\0\1\u010f\2\0\5\u010f"+ + "\3\0\1\u010f\1\0\1\u010f\1\0\1\u010f\6\0\1\u010f"+ + "\30\0\1\u0110\2\0\30\u0110\1\303\1\0\57\u0110\1\304"+ + "\2\0\30\304\1\u0111\60\304\16\0\1\u0112\113\0\1\u0113"+ + "\105\0\1\u0114\6\0\2\u0114\4\0\4\u0114\5\0\3\u0114"+ + "\2\0\2\u0114\3\0\26\u0114\2\0\1\u0115\23\0\2\310"+ + "\3\0\1\310\1\0\4\310\2\0\4\310\4\0\10\310"+ + "\3\0\26\310\33\0\1\u0116\6\0\1\u0117\77\0\1\u0118"+ + "\6\0\2\u0118\4\0\4\u0118\5\0\3\u0118\2\0\2\u0118"+ + "\3\0\26\u0118\2\0\1\u0119\62\0\1\u011a\46\0\1\321"+ + "\111\0\5\322\1\u011b\106\322\4\0\1\321\1\323\140\0"+ + "\1\u011c\102\0\1\332\13\0\1\332\3\0\2\332\71\0"+ + "\2\u011d\3\0\3\u011d\5\0\1\u011d\2\0\5\u011d\3\0"+ + "\1\u011d\1\0\1\u011d\1\0\1\u011d\6\0\1\u011d\41\0"+ + "\1\150\7\0\1\166\13\0\1\u011e\3\0\2\u011e\2\164"+ + "\55\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\5\22\1\u011f\20\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22"+ + "\1\u0120\23\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\4\22\1\u0121\21\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\7\22\1\u0122\3\0\26\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\16\22\1\u0123\7\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\7\22\1\u0124\3\0\26\22"+ + "\14\0\1\22\7\0\3\346\7\0\2\346\3\0\4\346"+ + "\4\0\10\346\3\0\26\346\14\0\1\346\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22"+ + "\1\u0125\23\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\12\22\1\u0126\13\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\7\22\1\u0127\3\0\26\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\4\22\1\u0128\21\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\5\22\1\u0129"+ + "\2\22\1\u012a\15\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\5\22\1\u012b"+ + "\20\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\10\22\1\u012c\15\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\7\22\1\u012d\3\0\26\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22"+ + "\1\u012e\15\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\1\22\1\u012f\24\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\11\22\1\u0130\14\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22"+ + "\1\u0131\3\0\26\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\14\22\1\u0132"+ + "\11\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\7\22\1\u0133\3\0\26\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\6\22\1\u0134\17\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\5\22"+ + "\1\u0135\20\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\u0136\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\10\22\1\u0137\15\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\u0138"+ + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\6\22\1\u0139\5\22"+ + "\1\u013a\11\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\u013b\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\2\22\1\u013c\23\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\u013d"+ + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\2\22\1\u013e\23\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\16\22\1\u013f\7\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\14\22\1\u0140\11\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22"+ + "\1\u0141\15\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\22\22\1\u0142\3\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\3\22\1\u0143\22\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\14\22\1\u0144\11\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\13\22"+ + "\1\u0145\12\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\11\22\1\u0146\14\22"+ + "\14\0\1\22\21\0\2\u0147\3\0\3\u0147\5\0\1\u0147"+ + "\2\0\5\u0147\3\0\1\u0147\1\0\1\u0147\1\0\1\u0147"+ + "\6\0\1\u0147\50\0\2\u0148\3\0\3\u0148\5\0\1\u0148"+ + "\2\0\5\u0148\3\0\1\u0148\1\0\1\u0148\1\0\1\u0148"+ + "\6\0\1\u0148\31\0\2\u0149\5\0\2\u0114\1\0\1\u0149"+ + "\1\0\1\u0114\1\u014a\4\u0114\2\0\4\u0114\4\0\10\u0114"+ + "\3\0\26\u0114\33\0\1\u014b\123\0\1\u014c\76\0\2\u0118"+ + "\3\0\1\u0118\1\0\4\u0118\2\0\4\u0118\4\0\10\u0118"+ + "\3\0\26\u0118\16\0\4\322\1\321\1\u011b\106\322\20\0"+ + "\2\u014d\3\0\3\u014d\5\0\1\u014d\2\0\5\u014d\3\0"+ + "\1\u014d\1\0\1\u014d\1\0\1\u014d\6\0\1\u014d\41\0"+ + "\1\150\7\0\1\166\13\0\1\u014e\3\0\2\u014e\2\164"+ + "\55\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22"+ + "\1\u014f\3\0\26\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\14\22\1\u0150"+ + "\11\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\10\22\1\u0151\15\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\7\22\1\u0152\16\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\3\22\1\u0153\22\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\1\22\1\u0154"+ + "\24\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\16\22\1\u0155\7\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\10\22\1\u0156\15\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\11\22\1\u0157\14\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\5\22\1\u0158"+ + "\20\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\11\22\1\u0159\14\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\1\22\1\u015a\24\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\4\22\1\u015b\21\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\1\22\1\u015c"+ + "\24\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\22\22\1\u015d\3\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\5\22\1\u015e\20\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\15\22\1\u015f\10\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\6\22\1\u0160"+ + "\17\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\2\22\1\u0161\23\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\1\22\1\u0162\24\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\1\22\1\u0163\24\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\7\22\1\u0164\3\0\26\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\3\22\1\u0165\4\22\3\0\26\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\12\22\1\u0166\13\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22"+ + "\1\u0167\15\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\21\22\1\u0168\4\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\7\22\1\u0169\3\0\26\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\7\22\1\u016a"+ + "\3\0\26\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\2\22\1\u016b\23\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\2\22\1\u016c\23\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\11\22\1\u016d\14\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\7\22"+ + "\1\u016e\16\22\14\0\1\22\2\0\2\u0149\10\0\1\u0149"+ + "\2\0\1\u014a\123\0\1\u016f\105\0\2\u0170\3\0\3\u0170"+ + "\5\0\1\u0170\2\0\5\u0170\3\0\1\u0170\1\0\1\u0170"+ + "\1\0\1\u0170\6\0\1\u0170\41\0\1\150\7\0\1\166"+ + "\13\0\1\u0171\3\0\2\u0171\2\164\55\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\14\22\1\u0172"+ + "\11\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\11\22\1\u0173\14\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\13\22\1\u0174\12\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\7\22\1\u0175\16\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\7\22\1\u0176"+ + "\16\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\4\22\1\u0177\21\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\16\22\1\u0178\7\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\11\22\1\u0179\14\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\7\22\1\u017a\3\0\26\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\17\22\1\u017b\6\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\3\22"+ + "\1\u017c\4\22\3\0\26\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\7\22"+ + "\1\u017d\16\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\3\22\1\u017e\4\22\3\0\7\22"+ + "\1\u017f\16\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\10\22\1\u0180\15\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\21\22\1\u0181\4\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\11\22\1\u0182\14\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\14\22"+ + "\1\u0183\11\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\u0184\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\11\22\1\u0185\14\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\4\22\1\u0186\21\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u0187"+ + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\23\22\1\u0188\2\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\4\22\1\u0189\21\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\11\22\1\u018a\14\22\14\0\1\22\30\0\1\u018b\104\0"+ + "\2\u018c\3\0\3\u018c\5\0\1\u018c\2\0\5\u018c\3\0"+ + "\1\u018c\1\0\1\u018c\1\0\1\u018c\6\0\1\u018c\41\0"+ + "\1\150\7\0\1\166\13\0\1\u018d\3\0\2\u018d\2\164"+ + "\55\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\20\22\1\u018e\5\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\6\22"+ + "\1\u018f\17\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\5\22\1\u0190\20\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\12\22\1\u0191\13\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\13\22\1\u0192\12\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\2\22"+ + "\1\u0193\23\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\4\22\1\u0194\21\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\2\22\1\u0195\23\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\10\22"+ + "\3\0\2\22\1\u0196\23\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u0197\3\0"+ + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\7\22\1\u0198\16\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\10\22\1\u0199\15\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\4\22\1\u019a\21\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u019b"+ + "\15\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\7\22\1\u019c\3\0\26\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22"+ + "\1\u019d\3\0\26\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\10\22\1\u019e"+ + "\15\22\14\0\1\22\31\0\1\u019f\103\0\2\u01a0\3\0"+ + "\3\u01a0\5\0\1\u01a0\2\0\5\u01a0\3\0\1\u01a0\1\0"+ + "\1\u01a0\1\0\1\u01a0\6\0\1\u01a0\41\0\1\150\7\0"+ + "\1\166\13\0\1\u01a1\3\0\2\u01a1\2\164\55\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\7\22"+ + "\1\u01a2\16\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\u01a3\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\7\22\1\u01a4\3\0\26\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\4\22"+ + "\1\u01a5\21\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\7\22\1\u01a6\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\4\22\1\u01a7\21\22\14\0\1\22\7\0"+ + "\3\22\7\0\2\22\3\0\4\22\4\0\10\22\3\0"+ + "\14\22\1\u01a8\11\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\7\22\1\u01a9"+ + "\16\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\7\22\1\u01aa\3\0\26\22\14\0\1\22"+ + "\7\0\3\22\7\0\2\22\3\0\4\22\4\0\7\22"+ + "\1\u01ab\3\0\26\22\14\0\1\22\7\0\3\22\7\0"+ + "\2\22\3\0\4\22\4\0\10\22\3\0\20\22\1\u01ac"+ + "\5\22\14\0\1\22\30\0\1\u01ad\104\0\2\u01ae\3\0"+ + "\3\u01ae\5\0\1\u01ae\2\0\5\u01ae\3\0\1\u01ae\1\0"+ + "\1\u01ae\1\0\1\u01ae\6\0\1\u01ae\41\0\1\150\7\0"+ + "\1\166\13\0\1\u01af\3\0\2\u01af\2\164\55\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\7\22\1\u01b0\3\0"+ + "\26\22\14\0\1\22\7\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\10\22\3\0\6\22\1\u01b1\17\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\7\22\1\u01b2\3\0\26\22\14\0\1\22\7\0\3\22"+ + "\7\0\2\22\3\0\4\22\4\0\10\22\3\0\10\22"+ + "\1\u01b3\15\22\14\0\1\22\7\0\3\22\7\0\2\22"+ + "\3\0\4\22\4\0\10\22\3\0\13\22\1\u01b4\12\22"+ + "\14\0\1\22\7\0\3\22\7\0\2\22\3\0\4\22"+ + "\4\0\10\22\3\0\13\22\1\u01b5\12\22\14\0\1\22"+ + "\25\0\1\u01b6\107\0\2\u01b7\3\0\3\u01b7\5\0\1\u01b7"+ + "\2\0\5\u01b7\3\0\1\u01b7\1\0\1\u01b7\1\0\1\u01b7"+ + "\6\0\1\u01b7\41\0\1\150\7\0\1\166\13\0\1\u01b8"+ + "\3\0\2\u01b8\2\164\55\0\3\22\7\0\2\22\3\0"+ + "\4\22\4\0\3\22\1\u01b9\4\22\3\0\26\22\14\0"+ + "\1\22\7\0\3\22\7\0\2\22\3\0\4\22\4\0"+ + "\10\22\3\0\5\22\1\u01ba\20\22\14\0\1\22\12\0"+ + "\1\150\7\0\1\166\13\0\1\u01bb\3\0\2\u01bb\2\164"+ + "\60\0\1\150\7\0\1\166\13\0\1\u01bc\3\0\2\u01bc"+ + "\2\164\60\0\1\150\7\0\1\166\13\0\1\u01bd\3\0"+ + "\2\u01bd\2\164\60\0\1\150\7\0\1\166\13\0\1\u01be"+ + "\3\0\2\u01be\2\164\60\0\1\150\7\0\1\166\13\0"+ + "\1\u01bf\3\0\2\u01bf\2\164\60\0\1\150\7\0\1\166"+ + "\13\0\1\u01c0\3\0\2\u01c0\2\164\47\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[23180]; + 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; + } + + + /* 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 = + "\13\0\1\11\1\1\1\11\13\1\3\11\1\1\2\11"+ + "\26\1\7\11\4\1\1\11\2\1\2\11\3\1\1\11"+ + "\1\1\1\11\3\1\2\11\1\1\1\11\2\1\1\11"+ + "\1\1\2\11\2\1\1\11\2\1\1\11\2\1\1\11"+ + "\1\1\1\0\2\11\1\1\1\11\1\1\1\11\2\1"+ + "\2\11\1\1\2\11\1\1\2\11\1\0\3\1\1\0"+ + "\11\1\2\11\1\0\44\1\11\11\1\1\6\11\1\1"+ + "\1\11\1\0\1\11\1\0\1\11\1\0\2\11\1\0"+ + "\1\1\4\0\1\1\2\0\2\11\4\1\1\11\2\0"+ + "\3\11\1\1\1\11\1\0\1\1\1\11\62\1\3\0"+ + "\3\11\1\0\1\11\2\0\1\1\2\11\1\0\1\11"+ + "\52\1\1\11\2\0\2\11\1\0\42\1\1\0\33\1"+ + "\1\0\23\1\1\0\15\1\1\0\10\1\2\11\11\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[448]; + 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 input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /** + * 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: */ + + private String sourceCode; + + public ActionScriptLexer(String sourceCode){ + this(new StringReader(sourceCode)); + this.sourceCode = sourceCode; + } + + public void yypushbackstr(String s, int state) + { + sourceCode = s + sourceCode.substring(yychar + yylength()); + yyreset(new StringReader(sourceCode)); + yybegin(state); + } + + public void yypushbackstr(String s) + { + yypushbackstr(s, YYINITIAL); + } + + StringBuffer string = new StringBuffer(); + + private static String xmlTagName = ""; + + public int yychar() { + return yychar; + } + + private Stack pushedBack = new Stack<>(); + + public int yyline() { + return yyline + 1; + } + + private List listeners=new ArrayList<>(); + + public void addListener(LexListener listener){ + listeners.add(listener); + } + + public void removeListener(LexListener listener){ + listeners.remove(listener); + } + + public void informListenersLex(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onLex(s); + } + } + + public void informListenersPushBack(ParsedSymbol s){ + for(LexListener l:listeners){ + l.onPushBack(s); + } + } + + public void pushback(ParsedSymbol symb) { + pushedBack.push(symb); + last = null; + informListenersPushBack(symb); + } + + ParsedSymbol last; + public ParsedSymbol lex() throws java.io.IOException, AVM2ParseException{ + ParsedSymbol ret = null; + if (!pushedBack.isEmpty()){ + ret = last = pushedBack.pop(); + } else { + ret = last = yylex(); + } + informListenersLex(ret); + return ret; + } + + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(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 < 3140) { + 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; + } + + // 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 ParsedSymbol yylex() throws java.io.IOException, AVM2ParseException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // 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 165: break; + case 2: + { yyline++; + } + case 166: break; + case 3: + { /*ignore*/ + } + case 167: break; + case 4: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); + } + case 168: break; + case 5: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); + } + case 169: break; + case 6: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); + } + case 170: break; + case 7: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); + } + case 171: break; + case 8: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); + } + case 172: break; + case 9: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); + } + case 173: break; + case 10: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); + } + case 174: break; + case 11: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); + } + case 175: break; + case 12: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); + } + case 176: break; + case 13: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); + } + case 177: break; + case 14: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); + } + case 178: break; + case 15: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); + } + case 179: break; + case 16: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); + } + case 180: break; + case 17: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); + } + case 181: break; + case 18: + { string.setLength(0); + yybegin(STRING); + } + case 182: break; + case 19: + { string.setLength(0); + yybegin(CHARLITERAL); + } + case 183: break; + case 20: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); + } + case 184: break; + case 21: + { string.setLength(0); + yybegin(OIDENTIFIER); + } + case 185: break; + case 22: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); + } + case 186: break; + case 23: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); + } + case 187: break; + case 24: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); + } + case 188: break; + case 25: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); + } + case 189: break; + case 26: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); + } + case 190: break; + case 27: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); + } + case 191: break; + case 28: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); + } + case 192: break; + case 29: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); + } + case 193: break; + case 30: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); + } + case 194: break; + case 31: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); + } + case 195: break; + case 32: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); + } + case 196: break; + case 33: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); + } + case 197: break; + case 34: + { string.append(yytext()); + } + case 198: break; + case 35: + { yybegin(YYINITIAL); yyline++; + } + case 199: break; + case 36: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); + } + case 200: break; + case 37: + { yybegin(YYINITIAL); yyline++; + } + case 201: break; + case 38: + { string.append(yytext()); yyline++; + } + case 202: break; + case 39: + { yybegin(XML); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_END, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 203: break; + case 40: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRNAMEVAR_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 204: break; + case 41: + { yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext()); + } + case 205: break; + case 42: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRNAMEVAR_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 206: break; + case 43: + { yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRVALVAR_BEGIN, yytext()); + } + case 207: break; + case 44: + { string.append(yytext()); yyline++; + } + case 208: break; + case 45: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_VAR_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 209: break; + case 46: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); + } + case 210: break; + case 47: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); + } + case 211: break; + case 48: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); + } + case 212: break; + case 49: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DESCENDANTS, yytext()); + } + case 213: break; + case 50: + { return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, yytext()); + } + case 214: break; + case 51: + { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); + } + case 215: break; + case 52: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FILTER, yytext()); + } + case 216: break; + case 53: + { yybegin(XMLOPENTAG); + string.setLength(0); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext()); + } + case 217: break; + case 54: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); + } + case 218: break; + case 55: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); + } + case 219: break; + case 56: + { return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext()); + } + case 220: break; + case 57: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); + } + case 221: break; + case 58: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); + } + case 222: break; + case 59: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); + } + case 223: break; + case 60: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); + } + case 224: break; + case 61: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); + } + case 225: break; + case 62: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); + } + case 226: break; + case 63: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); + } + case 227: break; + case 64: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); + } + case 228: break; + case 65: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); + } + case 229: break; + case 66: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); + } + case 230: break; + case 67: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); + } + case 231: break; + case 68: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); + } + case 232: break; + case 69: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); + } + case 233: break; + case 70: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); + } + case 234: break; + case 71: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); + } + case 235: break; + case 72: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); + } + case 236: break; + case 73: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); + } + case 237: break; + case 74: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); + } + case 238: break; + case 75: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); + } + case 239: break; + case 76: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); + } + case 240: break; + case 77: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); + } + case 241: break; + case 78: + { /* ignore illegal character escape */ + } + case 242: break; + case 79: + { string.append('\"'); + } + case 243: break; + case 80: + { string.append('\''); + } + case 244: break; + case 81: + { string.append('\f'); + } + case 245: break; + case 82: + { string.append('\\'); + } + case 246: break; + case 83: + { string.append('\b'); + } + case 247: break; + case 84: + { string.append('\r'); + } + case 248: break; + case 85: + { string.append('\n'); + } + case 249: break; + case 86: + { string.append('\t'); + } + case 250: break; + case 87: + { yybegin(XML); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTFINISHTAG_END, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 251: break; + case 88: + { yybegin(XMLOPENTAGATTRIB); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 252: break; + case 89: + { yybegin(XMLOPENTAG); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext()); + } + case 253: break; + case 90: + { yybegin(XMLINSTRATTRIB); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 254: break; + case 91: + { yybegin(XML); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_END, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 255: break; + case 92: + { yybegin(XMLINSTROPENTAG); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext()); + } + case 256: break; + case 93: + { yybegin(XMLOPENTAG); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 257: break; + case 94: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 258: break; + case 95: + { throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); + } + case 259: break; + case 96: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); + } + case 260: break; + case 97: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); + } + case 261: break; + case 98: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); + } + case 262: break; + case 99: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); + } + case 263: break; + case 100: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); + } + case 264: break; + case 101: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); + } + case 265: break; + case 102: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); + } + case 266: break; + case 103: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); + } + case 267: break; + case 104: + { return new ParsedSymbol(SymbolGroup.PREPROCESSOR, SymbolType.PREPROCESSOR, yytext().substring(2)); + } + case 268: break; + case 105: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.SET, yytext()); + } + case 269: break; + case 106: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); + } + case 270: break; + case 107: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); + } + case 271: break; + case 108: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); + } + case 272: break; + case 109: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); + } + case 273: break; + case 110: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.GET, yytext()); + } + case 274: break; + case 111: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); + } + case 275: break; + case 112: + { string.append(yytext()); + yybegin(XML); + String ret = string.toString(); + string.setLength(0); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_CDATA, ret); + } + case 276: break; + case 113: + { string.append(yytext()); + yybegin(XML); + String ret = string.toString(); + string.setLength(0); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_COMMENT, ret); + } + case 277: break; + case 114: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHVARTAG_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 278: break; + case 115: + { yybegin(XMLINSTROPENTAG); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 279: break; + case 116: + { yybegin(YYINITIAL); + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRVARTAG_BEGIN, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 280: break; + case 117: + { string.append('\u00A7'); + } + case 281: break; + case 118: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); + } + case 282: break; + case 119: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.EACH, yytext()); + } + case 283: break; + case 120: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); + } + case 284: break; + case 121: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); + } + case 285: break; + case 122: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); + } + case 286: break; + case 123: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); + } + case 287: break; + case 124: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); + } + case 288: break; + case 125: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); + } + case 289: break; + case 126: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); + } + case 290: break; + case 127: + { char val = (char) Integer.parseInt(yytext().substring(2), 16); + string.append(val); + } + case 291: break; + case 128: + { pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHTAG, yytext())); + if (string.length() > 0){ + pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString())); + string.setLength(0); + } + return lex(); + } + case 292: break; + case 129: + { String ret = string.toString(); string.setLength(0); string.append(yytext()); yybegin(XMLCOMMENT); + if (!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, ret); + } + case 293: break; + case 130: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); + } + case 294: break; + case 131: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.FINAL, yytext()); + } + case 295: break; + case 132: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); + } + case 296: break; + case 133: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); + } + case 297: break; + case 134: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); + } + case 298: break; + case 135: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); + } + case 299: break; + case 136: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); + } + case 300: break; + case 137: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); + } + case 301: break; + case 138: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); + } + case 302: break; + case 139: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); + } + case 303: break; + case 140: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.STATIC, yytext()); + } + case 304: break; + case 141: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); + } + case 305: break; + case 142: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NATIVE, yytext()); + } + case 306: break; + case 143: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); + } + case 307: break; + case 144: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); + } + case 308: break; + case 145: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); + } + case 309: break; + case 146: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); + } + case 310: break; + case 147: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); + } + case 311: break; + case 148: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); + } + case 312: break; + case 149: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); + } + case 313: break; + case 150: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.DYNAMIC, yytext()); + } + case 314: break; + case 151: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); + } + case 315: break; + case 152: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); + } + case 316: break; + case 153: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); + } + case 317: break; + case 154: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); + } + case 318: break; + case 155: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.OVERRIDE, yytext()); + } + case 319: break; + case 156: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); + } + case 320: break; + case 157: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); + } + case 321: break; + case 158: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NAMESPACE, yytext()); + } + case 322: break; + case 159: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); + } + case 323: break; + case 160: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); + } + case 324: break; + case 161: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); + } + case 325: break; + case 162: + { String ret = string.toString(); string.setLength(0); string.append(yytext() ); yybegin(XMLCDATA); + if (!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, ret); + } + case 326: break; + case 163: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); + } + case 327: break; + case 164: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); + } + case 328: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java index e2342d094..7c5cc7b27 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolGroup.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; /** @@ -32,5 +33,6 @@ public enum SymbolGroup { TYPENAME, EOF, //GLOBALFUNC, - GLOBALCONST + GLOBALCONST, + PREPROCESSOR } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java index 4b06b8220..066fcbf48 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SymbolType.java @@ -1,242 +1,243 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.abc.avm2.parser.script; - -import com.jpexs.decompiler.graph.GraphTargetItem; - -/** - * - * @author JPEXS - */ -public enum SymbolType { - //Keywords - - BREAK, - CASE, - CONTINUE, - DEFAULT, - DO, - WHILE, - ELSE, - FOR, - EACH, - IN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - IF, - RETURN, - SUPER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - SWITCH, - THROW, - TRY, - CATCH, - FINALLY, - WITH, - DYNAMIC, - INTERNAL, - OVERRIDE, - PRIVATE, - PROTECTED, - PUBLIC, - STATIC, - CLASS, - CONST, - EXTENDS, - FUNCTION(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GET, - IMPLEMENTS, - INTERFACE, - NAMESPACE, - PACKAGE, - SET, - VAR, - IMPORT, - USE, - FALSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NULL(GraphTargetItem.PRECEDENCE_PRIMARY, false), - THIS(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TRUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //Operators - PARENT_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PARENT_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CURLY_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CURLY_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - BRACKET_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - BRACKET_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - SEMICOLON, - COMMA(GraphTargetItem.PRECEDENCE_COMMA, false), - REST, - DOT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - ASSIGN(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - GREATER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - LOWER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NOT(GraphTargetItem.PRECEDENCE_UNARY, false), - NEGATE(GraphTargetItem.PRECEDENCE_UNARY, false), - TERNAR(GraphTargetItem.PRECEDENCE_CONDITIONAL, true, true), /*!! ternar !!!*/ - COLON(GraphTargetItem.PRECEDENCE_CONDITIONAL, false),/*!! ternar !!!*/ - EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), - STRICT_EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), - LOWER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - GREATER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), - STRICT_NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), - AND(GraphTargetItem.PRECEDENCE_LOGICALAND, true), - OR(GraphTargetItem.PRECEDENCE_LOGICALOR, true), - INCREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false),//OR Unary - DECREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false), //OR Unary - PLUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), - MINUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), //OR Unary - MULTIPLY(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), - DIVIDE(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), - BITAND(GraphTargetItem.PRECEDENCE_BITWISEAND, true), - BITOR(GraphTargetItem.PRECEDENCE_BITWISEOR, true), - XOR(GraphTargetItem.PRECEDENCE_BITWISEXOR, true), - MODULO(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - SHIFT_LEFT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - ASSIGN_PLUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MINUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MULTIPLY(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_DIVIDE(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_BITAND(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_BITOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_XOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MODULO(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_SHIFT_LEFT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - AS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - DELETE(GraphTargetItem.PRECEDENCE_UNARY, false), - INSTANCEOF(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - IS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NAMESPACE_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NEW(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TYPEOF(GraphTargetItem.PRECEDENCE_UNARY, false), - VOID, - ATTRIBUTE, - //Other - STRING(GraphTargetItem.PRECEDENCE_PRIMARY, false), - COMMENT, - //XML, - IDENTIFIER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - INTEGER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - DOUBLE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TYPENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), - EOF, - //TRACE, - //GETURL, - //GOTOANDSTOP, - //NEXTFRAME, - //PLAY, - //PREVFRAME, - //TELLTARGET, - //STOP, - //STOPALLSOUNDS, - //TOGGLEHIGHQUALITY, - //ORD, - //CHR, - //DUPLICATEMOVIECLIP, - //STOPDRAG, - //GETTIMER, - //LOADVARIABLES, - //LOADMOVIE, - //GOTOANDPLAY, - //MBORD, - //MBCHR, - //MBLENGTH, - //MBSUBSTRING, - //RANDOM, - //REMOVEMOVIECLIP, - //STARTDRAG, - //SUBSTR, - //LENGTH, //string.length - INT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //TARGETPATH, - NUMBER_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STRING_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //IFFRAMELOADED, - INFINITY(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //EVAL, - UNDEFINED(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //NEWLINE, - NAN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //GETVERSION, - //CALL, - //LOADMOVIENUM, - //LOADVARIABLESNUM, - //PRINT, - //PRINTNUM, - //PRINTASBITMAP, - //PRINTASBITMAPNUM, - //UNLOADMOVIE, - //UNLOADMOVIENUM, - FINAL, - XML_STARTTAG_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // - XML_FINISHVARTAG_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // - XML_STARTFINISHTAG_END(GraphTargetItem.PRECEDENCE_PRIMARY, false), // /> - XML_COMMENT(GraphTargetItem.PRECEDENCE_PRIMARY, false), // - XML_CDATA(GraphTargetItem.PRECEDENCE_PRIMARY, false), // - XML_INSTR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // - XML_VAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // { - XML_ATTRIBUTENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa= - XML_ATTRIBUTEVALUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), // "vvv" - XML_TEXT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - XML_ATTRNAMEVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // {...}= - XML_ATTRVALVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa={ - XML_INSTRATTRNAMEVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // {...}= - XML_INSTRATTRVALVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa={ - XML_INSTRVARTAG_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // + XML_FINISHVARTAG_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // + XML_STARTFINISHTAG_END(GraphTargetItem.PRECEDENCE_PRIMARY, false), // /> + XML_COMMENT(GraphTargetItem.PRECEDENCE_PRIMARY, false), // + XML_CDATA(GraphTargetItem.PRECEDENCE_PRIMARY, false), // + XML_INSTR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // + XML_VAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // { + XML_ATTRIBUTENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa= + XML_ATTRIBUTEVALUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), // "vvv" + XML_TEXT(GraphTargetItem.PRECEDENCE_PRIMARY, false), + XML_ATTRNAMEVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // {...}= + XML_ATTRVALVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa={ + XML_INSTRATTRNAMEVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // {...}= + XML_INSTRATTRVALVAR_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa={ + XML_INSTRVARTAG_BEGIN(GraphTargetItem.PRECEDENCE_PRIMARY, false), // propertyNamesList = Arrays.asList(propertyNames); - - private static final Logger logger = Logger.getLogger(Action.class.getName()); - - /** - * Constructor - * - * @param actionCode Action type identifier - * @param actionLength Length of action data - */ - public Action(int actionCode, int actionLength) { - this.actionCode = actionCode; - this.actionLength = actionLength; - } - - public Action() { - } - - /** - * Returns address of this action - * - * @return address of this action - */ - public long getAddress() { - return address; - } - - /** - * Gets all addresses which are referenced from this action and/or - * subactions - * - * @param refs list of addresses - */ - public void getRef(Set refs) { - } - - /** - * Gets all addresses which are referenced from the list of actions - * - * @param list List of actions - * @return List of addresses - */ - public static Set getActionsAllRefs(List list) { - Set ret = new HashSet<>(); - for (Action a : list) { - a.getRef(ret); - } - return ret; - } - - public int getTotalActionLength() { - return actionLength + 1 + ((actionCode >= 0x80) ? 2 : 0); - } - - /** - * Sets address of this instruction - * - * @param address Address - */ - public void setAddress(long address) { - this.address = address; - } - - /** - * Returns a string representation of the object - * - * @return a string representation of the object. - */ - @Override - public String toString() { - return "Action" + actionCode; - } - - /** - * Reads String from FlasmLexer - * - * @param lex FlasmLexer - * @return String value - * @throws IOException - * @throws ActionParseException When read object is not String - */ - protected String lexString(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); - if (symb.type != ASMParsedSymbol.TYPE_STRING) { - throw new ActionParseException("String expected", lex.yyline()); - } - return (String) symb.value; - } - - /** - * Reads Block startServer from FlasmLexer - * - * @param lex FlasmLexer - * @throws IOException - * @throws ActionParseException When read object is not Block startServer - */ - protected void lexBlockOpen(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); - if (symb.type != ASMParsedSymbol.TYPE_BLOCK_START) { - throw new ActionParseException("Block startServer ", lex.yyline()); - } - } - - /** - * Reads Identifier from FlasmLexer - * - * @param lex FlasmLexer - * @return Identifier name - * @throws IOException - * @throws ActionParseException When read object is not Identifier - */ - protected String lexIdentifier(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); - if (symb.type != ASMParsedSymbol.TYPE_IDENTIFIER) { - throw new ActionParseException("Identifier expected", lex.yyline()); - } - return (String) symb.value; - } - - /** - * Reads long value from FlasmLexer - * - * @param lex FlasmLexer - * @return long value - * @throws IOException - * @throws ActionParseException When read object is not long value - */ - protected long lexLong(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); - if (symb.type != ASMParsedSymbol.TYPE_INTEGER) { - throw new ActionParseException("Integer expected", lex.yyline()); - } - return (Long) symb.value; - } - - /** - * Reads boolean value from FlasmLexer - * - * @param lex FlasmLexer - * @return boolean value - * @throws IOException - * @throws ActionParseException When read object is not boolean value - */ - protected boolean lexBoolean(FlasmLexer lex) throws IOException, ActionParseException { - ASMParsedSymbol symb = lex.yylex(); - if (symb.type != ASMParsedSymbol.TYPE_BOOLEAN) { - throw new ActionParseException("Boolean expected", lex.yyline()); - } - return (Boolean) symb.value; - } - - /** - * Gets action converted to bytes - * - * @param version SWF version - * @return Array of bytes - */ - public byte[] getBytes(int version) { - return surroundWithAction(new byte[0], version); - } - - /** - * Gets the length of action converted to bytes - * - * @param version SWF version - * @return Length - */ - public int getBytesLength(int version) { - return getBytes(version).length; - } - - /** - * Uptates the action length to the length calculated from action bytes - * - * @param version SWF version - */ - public void updateLength(int version) { - int length = getBytes(version).length; - actionLength = length - 1 - ((actionCode >= 0x80) ? 2 : 0); - } - - /** - * Surrounds byte array with Action header - * - * @param data Byte array - * @param version SWF version - * @return Byte array - */ - protected byte[] surroundWithAction(byte[] data, int version) { - ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); - SWFOutputStream sos2 = new SWFOutputStream(baos2, version); - try { - sos2.writeUI8(actionCode); - if (actionCode >= 0x80) { - sos2.writeUI16(data.length); - } - sos2.write(data); - sos2.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return baos2.toByteArray(); - } - - /** - * Converts list of Actions to bytes - * - * @param list List of actions - * @param addZero Whether or not to add 0 UI8 value to the end - * @param version SWF version - * @return Array of bytes - */ - public static byte[] actionsToBytes(List list, boolean addZero, int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - Action lastAction = null; - for (Action a : list) { - try { - lastAction = a; - baos.write(a.getBytes(version)); - } catch (IOException e) { - } - } - if (addZero && (lastAction == null || !(lastAction instanceof ActionEnd))) { - baos.write(0); - } - return baos.toByteArray(); - } - - /** - * Set addresses of actions in the list - * - * @param list List of actions - * @param baseAddress Address of first action in the list - */ - public static void setActionsAddresses(List list, long baseAddress) { - long offset = baseAddress; - for (Action a : list) { - a.setAddress(offset); - offset += a.getTotalActionLength(); - } - } - - /** - * Converts list of actions to ASM source - * - * @param listeners - * @param address - * @param list List of actions - * @param version SWF version - * @param exportMode PCode or hex? - * @return source ASM - * - */ - public static String actionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode) { - HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); - actionsToString(listeners, address, list, version, exportMode, writer); - return writer.toString(); - } - - /** - * Converts list of actions to ASM source - * - * @param listeners - * @param address - * @param list List of actions - * @param version SWF version - * @param exportMode PCode or hex? - * @param writer - * @return GraphTextWriter - */ - public static GraphTextWriter actionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode, GraphTextWriter writer) { - if (exportMode == ScriptExportMode.CONSTANTS) { - return constantPoolActionsToString(listeners, address, list, version, exportMode, writer); - } - - long offset; - Set importantOffsets = getActionsAllRefs(list); - /*List cps = SWFInputStream.getConstantPool(new ArrayList(), new ActionGraphSource(list, version, new HashMap(), new HashMap(), new HashMap()), 0, version, path); - if (!cps.isEmpty()) { - setConstantPool(list, cps.get(cps.size() - 1)); - }*/ - HashMap> containers = new HashMap<>(); - HashMap containersPos = new HashMap<>(); - offset = address; - int pos = 0; - boolean lastPush = false; - for (Action a : list) { - if (pos % INFORM_LISTENER_RESOLUTION == 0) { - for (DisassemblyListener listener : listeners) { - listener.progressToString(pos + 1, list.size()); - } - } - - if (exportMode == ScriptExportMode.PCODE_HEX) { - if (lastPush) { - writer.newLine(); - lastPush = false; - } - writer.appendNoHilight("; "); - writer.appendNoHilight(Helper.bytesToHexString(a.getBytes(version))); - writer.newLine(); - } - - offset = a.getAddress(); - - if ((!(a.isIgnored())) && (a instanceof GraphSourceItemContainer)) { - GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; - containersPos.put(cnt, 0); - List sizes = cnt.getContainerSizes(); - long addr = ((Action) cnt).getAddress() + cnt.getHeaderSize(); - for (Long size : sizes) { - addr += size; - if (size == 0) { - continue; - } - if (!containers.containsKey(addr)) { - containers.put(addr, new ArrayList()); - } - containers.get(addr).add(cnt); - } - } - - if (containers.containsKey(offset)) { - for (int i = 0; i < containers.get(offset).size(); i++) { - if (lastPush) { - writer.newLine(); - lastPush = false; - } - writer.appendNoHilight("}").newLine(); - GraphSourceItemContainer cnt = containers.get(offset).get(i); - int cntPos = containersPos.get(cnt); - writer.appendNoHilight(cnt.getASMSourceBetween(cntPos)); - cntPos++; - containersPos.put(cnt, cntPos); - } - } - - if (Configuration.showAllAddresses.get() || importantOffsets.contains(offset)) { - if (lastPush) { - writer.newLine(); - lastPush = false; - } - writer.appendNoHilight("loc"); - writer.appendNoHilight(Helper.formatAddress(offset)); - writer.appendNoHilight(":"); - } - - if (a.isIgnored()) { - if (lastPush) { - writer.newLine(); - lastPush = false; - } - if (!(a instanceof ActionEnd)) { - int len = a.getTotalActionLength(); - for (int i = 0; i < len; i++) { - writer.appendNoHilight("Nop").newLine(); - } - } - } else { - //if (!(a instanceof ActionNop)) { - String add = ""; - // honfika: commented out the following lines, because it makes no sense - /*if (a instanceof ActionIf) { - add = " change: " + ((ActionIf) a).getJumpOffset(); - } - if (a instanceof ActionJump) { - add = " change: " + ((ActionJump) a).getJumpOffset(); - } - add = "; ofs" + Helper.formatAddress(offset) + add; - add = "";*/ - if ((a instanceof ActionPush) && lastPush) { - writer.appendNoHilight(" "); - ((ActionPush) a).paramsToStringReplaced(list, importantOffsets, exportMode, writer); - } else { - if (lastPush) { - writer.newLine(); - lastPush = false; - } - - writer.append("", offset); - - int fixBranch = -1; - if (a instanceof ActionIf) { - ActionIf aif = (ActionIf) a; - if (aif.jumpUsed && !aif.ignoreUsed) { - fixBranch = 0; - } - if (!aif.jumpUsed && aif.ignoreUsed) { - fixBranch = 1; - } - } - - if (fixBranch > -1) { - writer.appendNoHilight("FFDec_DeobfuscatePop"); - if (fixBranch == 0) { //jump - writer.newLine(); - writer.appendNoHilight("Jump loc"); - writer.appendNoHilight(Helper.formatAddress(a.getAddress() + a.getTotalActionLength() + ((ActionIf) a).getJumpOffset())); - } else { - //nojump, ignore - } - } else { - a.getASMSourceReplaced(list, importantOffsets, exportMode, writer); - } - writer.appendNoHilight(a.isIgnored() ? "; ignored" : ""); - writer.appendNoHilight(add); - if (!(a instanceof ActionPush)) { - writer.newLine(); - } - } - if (a instanceof ActionPush) { - lastPush = true; - } else { - lastPush = false; - } - //} - } - - offset += a.getTotalActionLength(); - pos++; - } - if (lastPush) { - writer.newLine(); - } - - if (containers.containsKey(offset)) { - for (int i = 0; i < containers.get(offset).size(); i++) { - writer.appendNoHilight("}"); - writer.newLine(); - GraphSourceItemContainer cnt = containers.get(offset).get(i); - int cntPos = containersPos.get(cnt); - writer.appendNoHilight(cnt.getASMSourceBetween(cntPos)); - cntPos++; - containersPos.put(cnt, cntPos); - } - } - - if (importantOffsets.contains(offset)) { - writer.appendNoHilight("loc"); - writer.appendNoHilight(Helper.formatAddress(offset)); - writer.appendNoHilight(":"); - writer.newLine(); - } - - return writer; - } - - public static GraphTextWriter constantPoolActionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode, GraphTextWriter writer) { - int poolIdx = 0; - writer.appendNoHilight(Helper.constants).newLine(); - for (Action a : list) { - if (a instanceof ActionConstantPool) { - if (poolIdx > 0) { - writer.appendNoHilight("---").newLine(); - } - - ActionConstantPool cPool = (ActionConstantPool) a; - int constIdx = 0; - for (String c : cPool.constantPool) { - writer.appendNoHilight(constIdx); - writer.appendNoHilight("|"); - writer.appendNoHilight(Helper.escapeString(c)); - writer.newLine(); - constIdx++; - } - - poolIdx++; - } - } - - return writer; - } - - /** - * Convert action to ASM source - * - * @param container - * @param knownAddreses List of important offsets to mark as labels - * @param exportMode PCode or hex? - * @return String of P-code source - */ - public String getASMSource(ActionList container, Set knownAddreses, ScriptExportMode exportMode) { - return toString(); - } - - /** - * Translates this function to stack and output. - * - * @param stack Stack - * @param output Output - * @param regNames Register names - * @param variables Variables - * @param functions Functions - * @param staticOperation the value of staticOperation - * @param path the value of path - * @throws java.lang.InterruptedException - */ - public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { - } - - /** - * Pops long value off the stack - * - * @param stack Stack - * @return long value - */ - protected long popLong(TranslateStack stack) { - GraphTargetItem item = stack.pop(); - if (item instanceof DirectValueActionItem) { - if (((DirectValueActionItem) item).value instanceof Long) { - return (long) (Long) ((DirectValueActionItem) item).value; - } - } - return 0; - } - - /** - * Converts action index to address in the specified list of actions - * - * @param actions List of actions - * @param ip Action index - * @return address - */ - public static long ip2adr(List actions, int ip) { - /* List actions=new ArrayList(); - for(GraphSourceItem s:sources){ - if(s instanceof Action){ - actions.add((Action)s); - } - }*/ - if (ip >= actions.size()) { - if (actions.isEmpty()) { - return 0; - } - return actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getTotalActionLength(); - } - if (ip == -1) { - return 0; - } - return actions.get(ip).getAddress(); - } - - /** - * Converts address to action index in the specified list of actions - * - * @param actions List of actions - * @param addr Address - * @return action index - */ - public static int adr2ip(List actions, long addr) { - for (int ip = 0; ip < actions.size(); ip++) { - if (actions.get(ip).getAddress() == addr) { - return ip; - } - } - if (actions.size() > 0) { - long outpos = actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getTotalActionLength(); - if (addr == outpos) { - return actions.size(); - } - } - return -1; - } - - public static List actionsToTree(List actions, int version, int staticOperation, String path) throws InterruptedException { - return actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); - } - - /** - * Converts list of actions to ActionScript source code - * - * @param asm - * @param actions List of actions - * @param path - * @return source - * @throws java.lang.InterruptedException - */ - public static String actionsToSource(final ASMSource asm, final List actions, final String path) throws InterruptedException { - HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); - actionsToSource(asm, actions, path, writer); - return writer.toString(); - } - - /** - * Converts list of actions to ActionScript source code - * - * @param asm - * @param actions List of actions - * @param path - * @param writer - * @throws java.lang.InterruptedException - */ - public static void actionsToSource(final ASMSource asm, final List actions, final String path, GraphTextWriter writer) throws InterruptedException { - writer.suspendMeasure(); - List tree = null; - Throwable convertException = null; - int timeout = Configuration.decompilationTimeoutSingleMethod.get(); - final int version = asm == null ? SWF.DEFAULT_VERSION : asm.getSwf().version; - try { - tree = CancellableWorker.call(new Callable>() { - @Override - public List call() throws Exception { - int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; - List tree = actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); - Graph.graphToString(tree, new NulWriter(), new LocalData()); - return tree; - } - }, timeout, TimeUnit.SECONDS); - } catch (InterruptedException ex) { - throw ex; - } catch (Exception | OutOfMemoryError | StackOverflowError ex) { - if (ex instanceof TimeoutException) { - logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex); - } else { - logger.log(Level.SEVERE, "Decompilation error in: " + path, ex); - } - convertException = ex; - Throwable cause = ex.getCause(); - if (ex instanceof ExecutionException && cause instanceof Exception) { - convertException = cause; - } - } - writer.continueMeasure(); - - if (asm != null) { - asm.getActionSourcePrefix(writer); - } - if (convertException == null) { - Graph.graphToString(tree, writer, new LocalData()); - } else if (convertException instanceof TimeoutException) { - Helper.appendTimeoutComment(writer, timeout); - } else { - Helper.appendErrorComment(writer, convertException); - } - if (asm != null) { - asm.getActionSourceSuffix(writer); - } - } - - /** - * Converts list of actions to List of treeItems - * - * @param regNames Register names - * @param variables - * @param functions - * @param actions List of actions - * @param version SWF version - * @param staticOperation - * @param path - * @return List of treeItems - * @throws java.lang.InterruptedException - */ - public static List actionsToTree(HashMap regNames, HashMap variables, HashMap functions, List actions, int version, int staticOperation, String path) throws InterruptedException { - return ActionGraph.translateViaGraph(regNames, variables, functions, actions, version, staticOperation, path); - } - - @Override - public void translate(BaseLocalData localData, TranslateStack stack, List output, int staticOperation, String path) throws InterruptedException { - ActionLocalData aLocalData = (ActionLocalData) localData; - translate(stack, output, aLocalData.regNames, aLocalData.variables, aLocalData.functions, staticOperation, path); - } - - @Override - public boolean isJump() { - return false; - } - - @Override - public boolean isBranch() { - return false; - } - - @Override - public boolean isExit() { - return false; - } - - @Override - public long getOffset() { - return getAddress(); - } - - @Override - public List getBranches(GraphSource code) { - return new ArrayList<>(); - } - - @Override - public boolean isIgnored() { - return ignored; - } - - @Override - public void setIgnored(boolean ignored, int pos) { - this.ignored = ignored; - } - - private static class Loop { - - public long loopContinue; - - public long loopBreak; - - public int continueCount = 0; - - public int breakCount = 0; - - public Loop(long loopContinue, long loopBreak) { - this.loopContinue = loopContinue; - this.loopBreak = loopBreak; - } - - @Override - public String toString() { - return "[Loop continue:" + loopContinue + ", break:" + loopBreak + "]"; - } - } - - private static void log(String s) { - logger.fine(s); - } - - public static List actionsPartToTree(HashMap registerNames, HashMap variables, HashMap functions, TranslateStack stack, List actions, int start, int end, int version, int staticOperation, String path) throws InterruptedException { - if (start < actions.size() && (end > 0) && (start > 0)) { - log("Entering " + start + "-" + end + (actions.size() > 0 ? (" (" + actions.get(start).toString() + " - " + actions.get(end == actions.size() ? end - 1 : end) + ")") : "")); - } - ActionLocalData localData = new ActionLocalData(registerNames, variables, functions); - List output = new ArrayList<>(); - int ip = start; - boolean isWhile = false; - boolean isForIn = false; - GraphTargetItem inItem = null; - int loopStart = 0; - loopip: - while (ip <= end) { - - long addr = ip2adr(actions, ip); - if (ip > end) { - break; - } - if (ip >= actions.size()) { - output.add(new ScriptEndItem()); - break; - } - Action action = actions.get(ip); - if (action.isIgnored()) { - ip++; - continue; - } - if (action instanceof GraphSourceItemContainer) { - GraphSourceItemContainer cnt = (GraphSourceItemContainer) action; - //List out=actionsPartToTree(new HashMap(), new HashMap(),new HashMap(), new TranslateStack(), src, ip+1,endip-1 , version); - long endAddr = action.getAddress() + cnt.getHeaderSize(); - String cntName = cnt.getName(); - List> outs = new ArrayList<>(); - HashMap variables2 = Helper.deepCopy(variables); - if (cnt instanceof ActionDefineFunction || cnt instanceof ActionDefineFunction2) { - for (int r = 0; r < 256; r++) { - if (variables2.containsKey("__register" + r)) { - variables2.remove("__register" + r); - } - } - } - for (long size : cnt.getContainerSizes()) { - if (size == 0) { - outs.add(new ArrayList()); - continue; - } - List out; - try { - out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); - } catch (OutOfMemoryError | TranslateException | StackOverflowError ex2) { - logger.log(Level.SEVERE, "Decompilation error in: " + path, ex2); - if (ex2 instanceof OutOfMemoryError) { - Helper.freeMem(); - } - out = new ArrayList<>(); - out.add(new CommentItem(new String[]{ - "", - " * " + AppResources.translate("decompilationError"), - " * " + AppResources.translate("decompilationError.obfuscated"), - Helper.decompilationErrorAdd == null ? null : " * " + Helper.decompilationErrorAdd, - " * " + AppResources.translate("decompilationError.errorType") + ": " - + ex2.getClass().getSimpleName(), - ""})); - } - outs.add(out); - endAddr += size; - } - ((GraphSourceItemContainer) action).translateContainer(outs, stack, output, registerNames, variables, functions); - ip = adr2ip(actions, endAddr); - continue; - } - - //return in for..in - if ((action instanceof ActionPush) && (((ActionPush) action).values.size() == 1) && (((ActionPush) action).values.get(0) instanceof Null)) { - if (ip + 3 <= end) { - if ((actions.get(ip + 1) instanceof ActionEquals) || (actions.get(ip + 1) instanceof ActionEquals2)) { - if (actions.get(ip + 2) instanceof ActionNot) { - if (actions.get(ip + 3) instanceof ActionIf) { - ActionIf aif = (ActionIf) actions.get(ip + 3); - if (adr2ip(actions, ip2adr(actions, ip + 4) + aif.getJumpOffset()) == ip) { - ip += 4; - continue; - } - } - } - } - } - } - - /*ActionJump && ActionIf removed*/ - /*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) { - loopStart = ip + 1; - isForIn = true; - ip += 4; - action.translate(localData, stack, output); - EnumerateActionItem en = (EnumerateActionItem) stack.peek(); - inItem = en.object; - continue; - } else*/ /*if (action instanceof ActionTry) { - ActionTry atry = (ActionTry) action; - List tryCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.tryBody, version); - ActionItem catchName; - if (atry.catchInRegisterFlag) { - catchName = new DirectValueActionItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList<>()); - } else { - catchName = new DirectValueActionItem(atry, -1, atry.catchName, new ArrayList<>()); - } - List catchExceptions = new ArrayList(); - catchExceptions.add(catchName); - List> catchCommands = new ArrayList>(); - catchCommands.add(ActionGraph.translateViaGraph(registerNames, variables, functions, atry.catchBody, version)); - List finallyCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.finallyBody, version); - output.add(new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands)); - } else if (action instanceof ActionWith) { - ActionWith awith = (ActionWith) action; - List withCommands = ActionGraph.translateViaGraph(registerNames, variables, functions,new ArrayList() , version); //TODO:parse with actions - output.add(new WithActionItem(action, stack.pop(), withCommands)); - } else */ if (false) { - } /*if (action instanceof ActionStoreRegister) { - if ((ip + 1 <= end) && (actions.get(ip + 1) instanceof ActionPop)) { - action.translate(localData, stack, output); - stack.pop(); - ip++; - } else { - try { - action.translate(localData, stack, output); - } catch (Exception ex) { - // ignore - } - } - } */ /*else if (action instanceof ActionStrictEquals) { - if ((ip + 1 < actions.size()) && (actions.get(ip + 1) instanceof ActionIf)) { - List caseValues = new ArrayList(); - List> caseCommands = new ArrayList>(); - caseValues.add(stack.pop()); - ActionItem switchedObject = stack.pop(); - if (output.size() > 0) { - if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { - output.remove(output.size() - 1); - } - } - int caseStart = ip + 2; - List caseBodyIps = new ArrayList(); - long defaultAddr = 0; - caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip + 1)).getRef(version), version)); - ip++; - do { - ip++; - if ((actions.get(ip - 1) instanceof ActionStrictEquals) && (actions.get(ip) instanceof ActionIf)) { - caseValues.add(actionsToStackTree(registerNames, jumpsOrIfs, actions, constants, caseStart, ip - 2, version).pop()); - caseStart = ip + 1; - caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip)).getRef(version), version)); - if (actions.get(ip + 1) instanceof ActionJump) { - defaultAddr = ((ActionJump) actions.get(ip + 1)).getRef(version); - ip = adr2ip(actions, defaultAddr, version); - break; - } - } - } while (ip < end); - - for (int i = 0; i < caseBodyIps.size(); i++) { - int caseEnd = ip - 1; - if (i < caseBodyIps.size() - 1) { - caseEnd = caseBodyIps.get(i + 1) - 1; - } - caseCommands.add(actionsToTree(registerNames, unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, caseBodyIps.get(i), caseEnd, version)); - } - output.add(new SwitchActionItem(action, defaultAddr, switchedObject, caseValues, caseCommands, null)); - continue; - } else { - action.translate(stack, constants, output, registerNames); - } - } */ else { - - if (action instanceof ActionStore) { - ActionStore store = (ActionStore) action; - store.setStore(actions.subList(ip + 1, ip + 1 + store.getStoreSize())); - ip = ip + 1 + store.getStoreSize() - 1/*ip++ will be next*/; - } - - try { - action.translate(localData, stack, output, staticOperation, path); - } catch (EmptyStackException ese) { - logger.log(Level.SEVERE, "Decompilation error in: " + path, ese); - output.add(new UnsupportedActionItem(action, "Empty stack")); - } - - } - - ip++; - } - //output = checkClass(output); - log("Leaving " + start + "-" + end); - return output; - } - - public static GraphTargetItem getWithoutGlobal(GraphTargetItem ti) { - GraphTargetItem t = ti; - if (!(t instanceof GetMemberActionItem)) { - return ti; - } - GetMemberActionItem lastMember = null; - while (((GetMemberActionItem) t).object instanceof GetMemberActionItem) { - lastMember = (GetMemberActionItem) t; - t = ((GetMemberActionItem) t).object; - } - if (((GetMemberActionItem) t).object instanceof GetVariableActionItem) { - GetVariableActionItem v = (GetVariableActionItem) ((GetMemberActionItem) t).object; - if (v.name instanceof DirectValueActionItem) { - if (((DirectValueActionItem) v.name).value instanceof String) { - if (((DirectValueActionItem) v.name).value.equals("_global")) { - GetVariableActionItem gvt = new GetVariableActionItem(null, ((GetMemberActionItem) t).memberName); - if (lastMember == null) { - return gvt; - } else { - lastMember.object = gvt; - } - } - } - } - } - return ti; - } - - public static List checkClass(List output) { - if (true) { - //return output; - } - List ret = new ArrayList<>(); - List functions = new ArrayList<>(); - List staticFunctions = new ArrayList<>(); - List> vars = new ArrayList<>(); - List> staticVars = new ArrayList<>(); - GraphTargetItem className; - GraphTargetItem extendsOp = null; - List implementsOp = new ArrayList<>(); - boolean ok = true; - int prevCount = 0; - for (GraphTargetItem t : output) { - if (t instanceof IfItem) { - IfItem it = (IfItem) t; - if (it.expression instanceof NotItem) { - NotItem nti = (NotItem) it.expression; - if ((nti.value instanceof GetMemberActionItem) || (nti.value instanceof GetVariableActionItem)) { - if (true) { //it.onFalse.isEmpty()){ //||(it.onFalse.get(0) instanceof UnsupportedActionItem)) { - if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) it.onTrue.get(0)).value instanceof NewObjectActionItem)) { - // ignore - } else { - List parts = it.onTrue; - className = getWithoutGlobal(nti.value); - if (parts.size() >= 1) { - int ipos = 0; - while ((parts.get(ipos) instanceof IfItem) - && ((((IfItem) parts.get(ipos)).onTrue.size() == 1) && (((IfItem) parts.get(ipos)).onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) ((IfItem) parts.get(ipos)).onTrue.get(0)).value instanceof NewObjectActionItem))) { - - ipos++; - } - if (parts.get(ipos) instanceof ExtendsActionItem) { - ExtendsActionItem et = (ExtendsActionItem) parts.get(ipos); - extendsOp = getWithoutGlobal(et.superclass); - ipos++; - } - if (parts.get(ipos) instanceof StoreRegisterActionItem) { - StoreRegisterActionItem sr = (StoreRegisterActionItem) parts.get(ipos); - int instanceReg = sr.register.number; - if (sr.value instanceof GetMemberActionItem) { - GetMemberActionItem gm = (GetMemberActionItem) sr.value; - //gm.memberName should be "prototype" - if (gm.object instanceof TemporaryRegister) { - TemporaryRegister tm = (TemporaryRegister) gm.object; - int classReg = tm.getRegId(); - if (tm.value instanceof SetMemberActionItem) { - SetMemberActionItem sm = (SetMemberActionItem) tm.value; - if (sm.value instanceof StoreRegisterActionItem) { - sr = (StoreRegisterActionItem) sm.value; - if (sr.value instanceof FunctionActionItem) { - ((FunctionActionItem) (sr.value)).calculatedFunctionName = (className instanceof GetMemberActionItem) ? ((GetMemberActionItem) className).memberName : className; - functions.add((FunctionActionItem) sr.value); - - for (; ipos < parts.size(); ipos++) { - if (parts.get(ipos) instanceof ImplementsOpActionItem) { - ImplementsOpActionItem io = (ImplementsOpActionItem) parts.get(ipos); - implementsOp = io.superclasses; - continue; - } - if (parts.get(ipos) instanceof SetMemberActionItem) { - sm = (SetMemberActionItem) parts.get(ipos); - int rnum = -1; - if (sm.object instanceof DirectValueActionItem) { - DirectValueActionItem dv = (DirectValueActionItem) sm.object; - if (dv.value instanceof RegisterNumber) { - RegisterNumber rn = (RegisterNumber) dv.value; - rnum = rn.number; - } - } - if (sm.object instanceof TemporaryRegister) { - rnum = ((TemporaryRegister) sm.object).getRegId(); - } - if (rnum == instanceReg) { - if (sm.value instanceof FunctionActionItem) { - ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; - functions.add((FunctionActionItem) sm.value); - } else { - vars.add(new MyEntry<>(sm.objectName, sm.value)); - } - } else if (rnum == classReg) { - if (sm.value instanceof FunctionActionItem) { - ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; - staticFunctions.add((FunctionActionItem) sm.value); - } else { - staticVars.add(new MyEntry<>(sm.objectName, sm.value)); - } - } - - } - } - - } - - } - } - List output2 = new ArrayList<>(); - for (int i = 0; i < prevCount; i++) { - output2.add(output.get(i)); - } - output2.add(new ClassActionItem(className, extendsOp, implementsOp, null/*FIXME*/, functions, vars, staticFunctions, staticVars)); - return output2; - } - } - } else if (parts.get(ipos) instanceof SetMemberActionItem) { - SetMemberActionItem sm = (SetMemberActionItem) parts.get(0); - if (sm.value instanceof FunctionActionItem) { - FunctionActionItem f = (FunctionActionItem) sm.value; - if (f.actions.isEmpty()) { - if (parts.size() == 2) { - if (parts.get(1) instanceof ImplementsOpActionItem) { - ImplementsOpActionItem iot = (ImplementsOpActionItem) parts.get(1); - implementsOp = iot.superclasses; - } else { - ok = false; - break; - } - } - List output2 = new ArrayList<>(); - for (int i = 0; i < prevCount; i++) { - output2.add(output.get(i)); - } - output2.add(new InterfaceActionItem(sm.objectName, implementsOp)); - return output2; - } - } - } - } - } - } else { - ok = false; - } - } else { - ok = false; - } - } else { - ok = false; - } - } else { - prevCount++; - //ok = false; - } - if (!ok) { - break; - } - } - return output; - } - - @Override - public boolean ignoredLoops() { - return false; - } - - public static void setConstantPool(List actions, ConstantPool cpool) { - for (GraphSourceItem a : actions) { - if (a instanceof ActionPush) { - if (cpool != null) { - ((ActionPush) a).constantPool = cpool.constants; - } - } - if (a instanceof ActionDefineFunction) { - if (cpool != null) { - //((ActionDefineFunction) a).setConstantPool(cpool.constants,actions); - } - } - if (a instanceof ActionDefineFunction2) { - if (cpool != null) { - //((ActionDefineFunction2) a).setConstantPool(cpool.constants,actions); - } - } - } - } - - public GraphTextWriter getASMSourceReplaced(ActionList container, Set knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) { - writer.appendNoHilight(getASMSource(container, knownAddreses, exportMode)); - return writer; - } - - public static double toFloatPoint(Object o) { - if (o instanceof Double) { - return (Double) o; - } - if (o instanceof Integer) { - return (Integer) o; - } - if (o instanceof Long) { - return (Long) o; - } - if (o instanceof String) { - try { - return Double.parseDouble((String) o); - } catch (NumberFormatException nfe) { - return 0; - } - } - return 0; - } - - public static GraphTargetItem gettoset(GraphTargetItem get, GraphTargetItem value, List variables) { - GraphTargetItem ret = get; - boolean boxed = false; - if (get instanceof VariableActionItem) { - boxed = true; - ret = ((VariableActionItem) ret).getBoxedValue(); - } - if (ret instanceof GetVariableActionItem) { - GetVariableActionItem gv = (GetVariableActionItem) ret; - ret = new SetVariableActionItem(null, gv.name, value); - } else if (ret instanceof GetMemberActionItem) { - GetMemberActionItem mem = (GetMemberActionItem) ret; - ret = new SetMemberActionItem(null, mem.object, mem.memberName, value); - } else if ((ret instanceof DirectValueActionItem) && ((DirectValueActionItem) ret).value instanceof RegisterNumber) { - ret = new StoreRegisterActionItem(null, (RegisterNumber) ((DirectValueActionItem) ret).value, value, false); - } else if (ret instanceof GetPropertyActionItem) { - GetPropertyActionItem gp = (GetPropertyActionItem) ret; - ret = new SetPropertyActionItem(null, gp.target, gp.propertyIndex, value); - } - if (boxed) { - GraphTargetItem b = ret; - ret = new VariableActionItem(((VariableActionItem) get).getVariableName(), value, ((VariableActionItem) get).isDefinition()); - ((VariableActionItem) ret).setBoxedValue((ActionItem) b); - variables.remove((VariableActionItem) get); - variables.add((VariableActionItem) ret); - } - return ret; - } - - @Override - public boolean isDeobfuscatePop() { - return false; - } - - @Override - public int getLine() { - return 0; - } - - @Override - public String getFile() { - return null; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action; + +import com.jpexs.decompiler.flash.AppResources; +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.DisassemblyListener; +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.action.model.ActionItem; +import com.jpexs.decompiler.flash.action.model.ConstantPool; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.model.ExtendsActionItem; +import com.jpexs.decompiler.flash.action.model.FunctionActionItem; +import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; +import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem; +import com.jpexs.decompiler.flash.action.model.GetVariableActionItem; +import com.jpexs.decompiler.flash.action.model.ImplementsOpActionItem; +import com.jpexs.decompiler.flash.action.model.NewObjectActionItem; +import com.jpexs.decompiler.flash.action.model.SetMemberActionItem; +import com.jpexs.decompiler.flash.action.model.SetPropertyActionItem; +import com.jpexs.decompiler.flash.action.model.SetVariableActionItem; +import com.jpexs.decompiler.flash.action.model.StoreRegisterActionItem; +import com.jpexs.decompiler.flash.action.model.TemporaryRegister; +import com.jpexs.decompiler.flash.action.model.UnsupportedActionItem; +import com.jpexs.decompiler.flash.action.model.clauses.ClassActionItem; +import com.jpexs.decompiler.flash.action.model.clauses.InterfaceActionItem; +import com.jpexs.decompiler.flash.action.parser.ActionParseException; +import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol; +import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; +import com.jpexs.decompiler.flash.action.parser.script.VariableActionItem; +import com.jpexs.decompiler.flash.action.special.ActionEnd; +import com.jpexs.decompiler.flash.action.special.ActionStore; +import com.jpexs.decompiler.flash.action.swf4.ActionEquals; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ActionNot; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; +import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; +import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; +import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; +import com.jpexs.decompiler.flash.helpers.CodeFormatting; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.flash.helpers.NulWriter; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.flash.tags.base.ASMSource; +import com.jpexs.decompiler.graph.Graph; +import com.jpexs.decompiler.graph.GraphSource; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphSourceItemContainer; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.TranslateException; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.CommentItem; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.LocalData; +import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.ScriptEndItem; +import com.jpexs.helpers.CancellableWorker; +import com.jpexs.helpers.Helper; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EmptyStackException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Represents one ACTIONRECORD, also has some static method to work with Actions + */ +public abstract class Action implements GraphSourceItem { + + private static final int INFORM_LISTENER_RESOLUTION = 100; + + private boolean ignored = false; + + /** + * Action type identifier + */ + public int actionCode; + + /** + * Length of action data + */ + public int actionLength; + + private long address; + + /** + * Names of ActionScript properties + */ + public static final String[] propertyNames = new String[]{ + "_X", + "_Y", + "_xscale", + "_yscale", + "_currentframe", + "_totalframes", + "_alpha", + "_visible", + "_width", + "_height", + "_rotation", + "_target", + "_framesloaded", + "_name", + "_droptarget", + "_url", + "_highquality", + "_focusrect", + "_soundbuftime", + "_quality", + "_xmouse", + "_ymouse" + }; + + public static final List propertyNamesList = Arrays.asList(propertyNames); + + private static final Logger logger = Logger.getLogger(Action.class.getName()); + + /** + * Constructor + * + * @param actionCode Action type identifier + * @param actionLength Length of action data + */ + public Action(int actionCode, int actionLength) { + this.actionCode = actionCode; + this.actionLength = actionLength; + } + + public Action() { + } + + /** + * Returns address of this action + * + * @return address of this action + */ + public long getAddress() { + return address; + } + + /** + * Gets all addresses which are referenced from this action and/or + * subactions + * + * @param refs list of addresses + */ + public void getRef(Set refs) { + } + + /** + * Gets all addresses which are referenced from the list of actions + * + * @param list List of actions + * @return List of addresses + */ + public static Set getActionsAllRefs(List list) { + Set ret = new HashSet<>(); + for (Action a : list) { + a.getRef(ret); + } + return ret; + } + + public int getTotalActionLength() { + return actionLength + 1 + ((actionCode >= 0x80) ? 2 : 0); + } + + /** + * Sets address of this instruction + * + * @param address Address + */ + public void setAddress(long address) { + this.address = address; + } + + /** + * Returns a string representation of the object + * + * @return a string representation of the object. + */ + @Override + public String toString() { + return "Action" + actionCode; + } + + /** + * Reads String from FlasmLexer + * + * @param lex FlasmLexer + * @return String value + * @throws IOException + * @throws ActionParseException When read object is not String + */ + protected String lexString(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.yylex(); + if (symb.type != ASMParsedSymbol.TYPE_STRING) { + throw new ActionParseException("String expected", lex.yyline()); + } + return (String) symb.value; + } + + /** + * Reads Block startServer from FlasmLexer + * + * @param lex FlasmLexer + * @throws IOException + * @throws ActionParseException When read object is not Block startServer + */ + protected void lexBlockOpen(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.yylex(); + if (symb.type != ASMParsedSymbol.TYPE_BLOCK_START) { + throw new ActionParseException("Block startServer ", lex.yyline()); + } + } + + /** + * Reads Identifier from FlasmLexer + * + * @param lex FlasmLexer + * @return Identifier name + * @throws IOException + * @throws ActionParseException When read object is not Identifier + */ + protected String lexIdentifier(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.yylex(); + if (symb.type != ASMParsedSymbol.TYPE_IDENTIFIER) { + throw new ActionParseException("Identifier expected", lex.yyline()); + } + return (String) symb.value; + } + + /** + * Reads long value from FlasmLexer + * + * @param lex FlasmLexer + * @return long value + * @throws IOException + * @throws ActionParseException When read object is not long value + */ + protected long lexLong(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.yylex(); + if (symb.type != ASMParsedSymbol.TYPE_INTEGER) { + throw new ActionParseException("Integer expected", lex.yyline()); + } + return (Long) symb.value; + } + + /** + * Reads boolean value from FlasmLexer + * + * @param lex FlasmLexer + * @return boolean value + * @throws IOException + * @throws ActionParseException When read object is not boolean value + */ + protected boolean lexBoolean(FlasmLexer lex) throws IOException, ActionParseException { + ASMParsedSymbol symb = lex.yylex(); + if (symb.type != ASMParsedSymbol.TYPE_BOOLEAN) { + throw new ActionParseException("Boolean expected", lex.yyline()); + } + return (Boolean) symb.value; + } + + /** + * Gets action converted to bytes + * + * @param version SWF version + * @return Array of bytes + */ + public byte[] getBytes(int version) { + return surroundWithAction(new byte[0], version); + } + + /** + * Gets the length of action converted to bytes + * + * @param version SWF version + * @return Length + */ + public int getBytesLength(int version) { + return getBytes(version).length; + } + + /** + * Uptates the action length to the length calculated from action bytes + * + * @param version SWF version + */ + public void updateLength(int version) { + int length = getBytes(version).length; + actionLength = length - 1 - ((actionCode >= 0x80) ? 2 : 0); + } + + /** + * Surrounds byte array with Action header + * + * @param data Byte array + * @param version SWF version + * @return Byte array + */ + protected byte[] surroundWithAction(byte[] data, int version) { + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); + SWFOutputStream sos2 = new SWFOutputStream(baos2, version); + try { + sos2.writeUI8(actionCode); + if (actionCode >= 0x80) { + sos2.writeUI16(data.length); + } + sos2.write(data); + sos2.close(); + } catch (IOException e) { + throw new Error("This should never happen.", e); + } + return baos2.toByteArray(); + } + + /** + * Converts list of Actions to bytes + * + * @param list List of actions + * @param addZero Whether or not to add 0 UI8 value to the end + * @param version SWF version + * @return Array of bytes + */ + public static byte[] actionsToBytes(List list, boolean addZero, int version) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Action lastAction = null; + for (Action a : list) { + try { + lastAction = a; + baos.write(a.getBytes(version)); + } catch (IOException e) { + } + } + if (addZero && (lastAction == null || !(lastAction instanceof ActionEnd))) { + baos.write(0); + } + return baos.toByteArray(); + } + + /** + * Set addresses of actions in the list + * + * @param list List of actions + * @param baseAddress Address of first action in the list + */ + public static void setActionsAddresses(List list, long baseAddress) { + long offset = baseAddress; + for (Action a : list) { + a.setAddress(offset); + offset += a.getTotalActionLength(); + } + } + + /** + * Converts list of actions to ASM source + * + * @param listeners + * @param address + * @param list List of actions + * @param version SWF version + * @param exportMode PCode or hex? + * @return source ASM + * + */ + public static String actionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode) { + HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); + actionsToString(listeners, address, list, version, exportMode, writer); + return writer.toString(); + } + + /** + * Converts list of actions to ASM source + * + * @param listeners + * @param address + * @param list List of actions + * @param version SWF version + * @param exportMode PCode or hex? + * @param writer + * @return GraphTextWriter + */ + public static GraphTextWriter actionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode, GraphTextWriter writer) { + if (exportMode == ScriptExportMode.CONSTANTS) { + return constantPoolActionsToString(listeners, address, list, version, exportMode, writer); + } + + long offset; + Set importantOffsets = getActionsAllRefs(list); + /*List cps = SWFInputStream.getConstantPool(new ArrayList(), new ActionGraphSource(list, version, new HashMap(), new HashMap(), new HashMap()), 0, version, path); + if (!cps.isEmpty()) { + setConstantPool(list, cps.get(cps.size() - 1)); + }*/ + HashMap> containers = new HashMap<>(); + HashMap containersPos = new HashMap<>(); + offset = address; + int pos = 0; + boolean lastPush = false; + for (Action a : list) { + if (pos % INFORM_LISTENER_RESOLUTION == 0) { + for (DisassemblyListener listener : listeners) { + listener.progressToString(pos + 1, list.size()); + } + } + + if (exportMode == ScriptExportMode.PCODE_HEX) { + if (lastPush) { + writer.newLine(); + lastPush = false; + } + writer.appendNoHilight("; "); + writer.appendNoHilight(Helper.bytesToHexString(a.getBytes(version))); + writer.newLine(); + } + + offset = a.getAddress(); + + if ((!(a.isIgnored())) && (a instanceof GraphSourceItemContainer)) { + GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; + containersPos.put(cnt, 0); + List sizes = cnt.getContainerSizes(); + long addr = ((Action) cnt).getAddress() + cnt.getHeaderSize(); + for (Long size : sizes) { + addr += size; + if (size == 0) { + continue; + } + if (!containers.containsKey(addr)) { + containers.put(addr, new ArrayList()); + } + containers.get(addr).add(cnt); + } + } + + if (containers.containsKey(offset)) { + for (int i = 0; i < containers.get(offset).size(); i++) { + if (lastPush) { + writer.newLine(); + lastPush = false; + } + writer.appendNoHilight("}").newLine(); + GraphSourceItemContainer cnt = containers.get(offset).get(i); + int cntPos = containersPos.get(cnt); + writer.appendNoHilight(cnt.getASMSourceBetween(cntPos)); + cntPos++; + containersPos.put(cnt, cntPos); + } + } + + if (Configuration.showAllAddresses.get() || importantOffsets.contains(offset)) { + if (lastPush) { + writer.newLine(); + lastPush = false; + } + writer.appendNoHilight("loc"); + writer.appendNoHilight(Helper.formatAddress(offset)); + writer.appendNoHilight(":"); + } + + if (a.isIgnored()) { + if (lastPush) { + writer.newLine(); + lastPush = false; + } + if (!(a instanceof ActionEnd)) { + int len = a.getTotalActionLength(); + for (int i = 0; i < len; i++) { + writer.appendNoHilight("Nop").newLine(); + } + } + } else { + //if (!(a instanceof ActionNop)) { + String add = ""; + // honfika: commented out the following lines, because it makes no sense + /*if (a instanceof ActionIf) { + add = " change: " + ((ActionIf) a).getJumpOffset(); + } + if (a instanceof ActionJump) { + add = " change: " + ((ActionJump) a).getJumpOffset(); + } + add = "; ofs" + Helper.formatAddress(offset) + add; + add = "";*/ + if ((a instanceof ActionPush) && lastPush) { + writer.appendNoHilight(" "); + ((ActionPush) a).paramsToStringReplaced(list, importantOffsets, exportMode, writer); + } else { + if (lastPush) { + writer.newLine(); + lastPush = false; + } + + writer.append("", offset); + + int fixBranch = -1; + if (a instanceof ActionIf) { + ActionIf aif = (ActionIf) a; + if (aif.jumpUsed && !aif.ignoreUsed) { + fixBranch = 0; + } + if (!aif.jumpUsed && aif.ignoreUsed) { + fixBranch = 1; + } + } + + if (fixBranch > -1) { + writer.appendNoHilight("FFDec_DeobfuscatePop"); + if (fixBranch == 0) { //jump + writer.newLine(); + writer.appendNoHilight("Jump loc"); + writer.appendNoHilight(Helper.formatAddress(a.getAddress() + a.getTotalActionLength() + ((ActionIf) a).getJumpOffset())); + } else { + //nojump, ignore + } + } else { + a.getASMSourceReplaced(list, importantOffsets, exportMode, writer); + } + writer.appendNoHilight(a.isIgnored() ? "; ignored" : ""); + writer.appendNoHilight(add); + if (!(a instanceof ActionPush)) { + writer.newLine(); + } + } + if (a instanceof ActionPush) { + lastPush = true; + } else { + lastPush = false; + } + //} + } + + offset += a.getTotalActionLength(); + pos++; + } + if (lastPush) { + writer.newLine(); + } + + if (containers.containsKey(offset)) { + for (int i = 0; i < containers.get(offset).size(); i++) { + writer.appendNoHilight("}"); + writer.newLine(); + GraphSourceItemContainer cnt = containers.get(offset).get(i); + int cntPos = containersPos.get(cnt); + writer.appendNoHilight(cnt.getASMSourceBetween(cntPos)); + cntPos++; + containersPos.put(cnt, cntPos); + } + } + + if (importantOffsets.contains(offset)) { + writer.appendNoHilight("loc"); + writer.appendNoHilight(Helper.formatAddress(offset)); + writer.appendNoHilight(":"); + writer.newLine(); + } + + return writer; + } + + public static GraphTextWriter constantPoolActionsToString(List listeners, long address, ActionList list, int version, ScriptExportMode exportMode, GraphTextWriter writer) { + int poolIdx = 0; + writer.appendNoHilight(Helper.constants).newLine(); + for (Action a : list) { + if (a instanceof ActionConstantPool) { + if (poolIdx > 0) { + writer.appendNoHilight("---").newLine(); + } + + ActionConstantPool cPool = (ActionConstantPool) a; + int constIdx = 0; + for (String c : cPool.constantPool) { + writer.appendNoHilight(constIdx); + writer.appendNoHilight("|"); + writer.appendNoHilight(Helper.escapeString(c)); + writer.newLine(); + constIdx++; + } + + poolIdx++; + } + } + + return writer; + } + + /** + * Convert action to ASM source + * + * @param container + * @param knownAddreses List of important offsets to mark as labels + * @param exportMode PCode or hex? + * @return String of P-code source + */ + public String getASMSource(ActionList container, Set knownAddreses, ScriptExportMode exportMode) { + return toString(); + } + + /** + * Translates this function to stack and output. + * + * @param stack Stack + * @param output Output + * @param regNames Register names + * @param variables Variables + * @param functions Functions + * @param staticOperation the value of staticOperation + * @param path the value of path + * @throws java.lang.InterruptedException + */ + public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) throws InterruptedException { + } + + /** + * Pops long value off the stack + * + * @param stack Stack + * @return long value + */ + protected long popLong(TranslateStack stack) { + GraphTargetItem item = stack.pop(); + if (item instanceof DirectValueActionItem) { + if (((DirectValueActionItem) item).value instanceof Long) { + return (long) (Long) ((DirectValueActionItem) item).value; + } + } + return 0; + } + + /** + * Converts action index to address in the specified list of actions + * + * @param actions List of actions + * @param ip Action index + * @return address + */ + public static long ip2adr(List actions, int ip) { + /* List actions=new ArrayList(); + for(GraphSourceItem s:sources){ + if(s instanceof Action){ + actions.add((Action)s); + } + }*/ + if (ip >= actions.size()) { + if (actions.isEmpty()) { + return 0; + } + return actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getTotalActionLength(); + } + if (ip == -1) { + return 0; + } + return actions.get(ip).getAddress(); + } + + /** + * Converts address to action index in the specified list of actions + * + * @param actions List of actions + * @param addr Address + * @return action index + */ + public static int adr2ip(List actions, long addr) { + for (int ip = 0; ip < actions.size(); ip++) { + if (actions.get(ip).getAddress() == addr) { + return ip; + } + } + if (actions.size() > 0) { + long outpos = actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getTotalActionLength(); + if (addr == outpos) { + return actions.size(); + } + } + return -1; + } + + public static List actionsToTree(List actions, int version, int staticOperation, String path) throws InterruptedException { + return actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); + } + + /** + * Converts list of actions to ActionScript source code + * + * @param asm + * @param actions List of actions + * @param path + * @return source + * @throws java.lang.InterruptedException + */ + public static String actionsToSource(final ASMSource asm, final List actions, final String path) throws InterruptedException { + HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); + actionsToSource(asm, actions, path, writer); + return writer.toString(); + } + + /** + * Converts list of actions to ActionScript source code + * + * @param asm + * @param actions List of actions + * @param path + * @param writer + * @throws java.lang.InterruptedException + */ + public static void actionsToSource(final ASMSource asm, final List actions, final String path, GraphTextWriter writer) throws InterruptedException { + writer.suspendMeasure(); + List tree = null; + Throwable convertException = null; + int timeout = Configuration.decompilationTimeoutSingleMethod.get(); + final int version = asm == null ? SWF.DEFAULT_VERSION : asm.getSwf().version; + try { + tree = CancellableWorker.call(new Callable>() { + @Override + public List call() throws Exception { + int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + List tree = actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); + Graph.graphToString(tree, new NulWriter(), new LocalData()); + return tree; + } + }, timeout, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + throw ex; + } catch (Exception | OutOfMemoryError | StackOverflowError ex) { + if (ex instanceof TimeoutException) { + logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex); + } else { + logger.log(Level.SEVERE, "Decompilation error in: " + path, ex); + } + convertException = ex; + Throwable cause = ex.getCause(); + if (ex instanceof ExecutionException && cause instanceof Exception) { + convertException = cause; + } + } + writer.continueMeasure(); + + if (asm != null) { + asm.getActionSourcePrefix(writer); + } + if (convertException == null) { + Graph.graphToString(tree, writer, new LocalData()); + } else if (convertException instanceof TimeoutException) { + Helper.appendTimeoutComment(writer, timeout); + } else { + Helper.appendErrorComment(writer, convertException); + } + if (asm != null) { + asm.getActionSourceSuffix(writer); + } + } + + /** + * Converts list of actions to List of treeItems + * + * @param regNames Register names + * @param variables + * @param functions + * @param actions List of actions + * @param version SWF version + * @param staticOperation + * @param path + * @return List of treeItems + * @throws java.lang.InterruptedException + */ + public static List actionsToTree(HashMap regNames, HashMap variables, HashMap functions, List actions, int version, int staticOperation, String path) throws InterruptedException { + return ActionGraph.translateViaGraph(regNames, variables, functions, actions, version, staticOperation, path); + } + + @Override + public void translate(BaseLocalData localData, TranslateStack stack, List output, int staticOperation, String path) throws InterruptedException { + ActionLocalData aLocalData = (ActionLocalData) localData; + translate(stack, output, aLocalData.regNames, aLocalData.variables, aLocalData.functions, staticOperation, path); + } + + @Override + public boolean isJump() { + return false; + } + + @Override + public boolean isBranch() { + return false; + } + + @Override + public boolean isExit() { + return false; + } + + @Override + public long getOffset() { + return getAddress(); + } + + @Override + public List getBranches(GraphSource code) { + return new ArrayList<>(); + } + + @Override + public boolean isIgnored() { + return ignored; + } + + @Override + public void setIgnored(boolean ignored, int pos) { + this.ignored = ignored; + } + + private static class Loop { + + public long loopContinue; + + public long loopBreak; + + public int continueCount = 0; + + public int breakCount = 0; + + public Loop(long loopContinue, long loopBreak) { + this.loopContinue = loopContinue; + this.loopBreak = loopBreak; + } + + @Override + public String toString() { + return "[Loop continue:" + loopContinue + ", break:" + loopBreak + "]"; + } + } + + private static void log(String s) { + logger.fine(s); + } + + public static List actionsPartToTree(HashMap registerNames, HashMap variables, HashMap functions, TranslateStack stack, List actions, int start, int end, int version, int staticOperation, String path) throws InterruptedException { + if (start < actions.size() && (end > 0) && (start > 0)) { + log("Entering " + start + "-" + end + (actions.size() > 0 ? (" (" + actions.get(start).toString() + " - " + actions.get(end == actions.size() ? end - 1 : end) + ")") : "")); + } + ActionLocalData localData = new ActionLocalData(registerNames, variables, functions); + List output = new ArrayList<>(); + int ip = start; + boolean isWhile = false; + boolean isForIn = false; + GraphTargetItem inItem = null; + int loopStart = 0; + loopip: + while (ip <= end) { + + long addr = ip2adr(actions, ip); + if (ip > end) { + break; + } + if (ip >= actions.size()) { + output.add(new ScriptEndItem()); + break; + } + Action action = actions.get(ip); + if (action.isIgnored()) { + ip++; + continue; + } + if (action instanceof GraphSourceItemContainer) { + GraphSourceItemContainer cnt = (GraphSourceItemContainer) action; + //List out=actionsPartToTree(new HashMap(), new HashMap(),new HashMap(), new TranslateStack(), src, ip+1,endip-1 , version); + long endAddr = action.getAddress() + cnt.getHeaderSize(); + String cntName = cnt.getName(); + List> outs = new ArrayList<>(); + HashMap variables2 = Helper.deepCopy(variables); + if (cnt instanceof ActionDefineFunction || cnt instanceof ActionDefineFunction2) { + for (int r = 0; r < 256; r++) { + if (variables2.containsKey("__register" + r)) { + variables2.remove("__register" + r); + } + } + } + for (long size : cnt.getContainerSizes()) { + if (size == 0) { + outs.add(new ArrayList()); + continue; + } + List out; + try { + out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); + } catch (OutOfMemoryError | TranslateException | StackOverflowError ex2) { + logger.log(Level.SEVERE, "Decompilation error in: " + path, ex2); + if (ex2 instanceof OutOfMemoryError) { + Helper.freeMem(); + } + out = new ArrayList<>(); + out.add(new CommentItem(new String[]{ + "", + " * " + AppResources.translate("decompilationError"), + " * " + AppResources.translate("decompilationError.obfuscated"), + Helper.decompilationErrorAdd == null ? null : " * " + Helper.decompilationErrorAdd, + " * " + AppResources.translate("decompilationError.errorType") + ": " + + ex2.getClass().getSimpleName(), + ""})); + } + outs.add(out); + endAddr += size; + } + ((GraphSourceItemContainer) action).translateContainer(outs, stack, output, registerNames, variables, functions); + ip = adr2ip(actions, endAddr); + continue; + } + + //return in for..in + if ((action instanceof ActionPush) && (((ActionPush) action).values.size() == 1) && (((ActionPush) action).values.get(0) instanceof Null)) { + if (ip + 3 <= end) { + if ((actions.get(ip + 1) instanceof ActionEquals) || (actions.get(ip + 1) instanceof ActionEquals2)) { + if (actions.get(ip + 2) instanceof ActionNot) { + if (actions.get(ip + 3) instanceof ActionIf) { + ActionIf aif = (ActionIf) actions.get(ip + 3); + if (adr2ip(actions, ip2adr(actions, ip + 4) + aif.getJumpOffset()) == ip) { + ip += 4; + continue; + } + } + } + } + } + } + + /*ActionJump && ActionIf removed*/ + /*if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) { + loopStart = ip + 1; + isForIn = true; + ip += 4; + action.translate(localData, stack, output); + EnumerateActionItem en = (EnumerateActionItem) stack.peek(); + inItem = en.object; + continue; + } else*/ /*if (action instanceof ActionTry) { + ActionTry atry = (ActionTry) action; + List tryCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.tryBody, version); + ActionItem catchName; + if (atry.catchInRegisterFlag) { + catchName = new DirectValueActionItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList()); + } else { + catchName = new DirectValueActionItem(atry, -1, atry.catchName, new ArrayList()); + } + List catchExceptions = new ArrayList(); + catchExceptions.add(catchName); + List> catchCommands = new ArrayList>(); + catchCommands.add(ActionGraph.translateViaGraph(registerNames, variables, functions, atry.catchBody, version)); + List finallyCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.finallyBody, version); + output.add(new TryActionItem(tryCommands, catchExceptions, catchCommands, finallyCommands)); + } else if (action instanceof ActionWith) { + ActionWith awith = (ActionWith) action; + List withCommands = ActionGraph.translateViaGraph(registerNames, variables, functions,new ArrayList() , version); //TODO:parse with actions + output.add(new WithActionItem(action, stack.pop(), withCommands)); + } else */ if (false) { + } /*if (action instanceof ActionStoreRegister) { + if ((ip + 1 <= end) && (actions.get(ip + 1) instanceof ActionPop)) { + action.translate(localData, stack, output); + stack.pop(); + ip++; + } else { + try { + action.translate(localData, stack, output); + } catch (Exception ex) { + // ignore + } + } + } */ /*else if (action instanceof ActionStrictEquals) { + if ((ip + 1 < actions.size()) && (actions.get(ip + 1) instanceof ActionIf)) { + List caseValues = new ArrayList(); + List> caseCommands = new ArrayList>(); + caseValues.add(stack.pop()); + ActionItem switchedObject = stack.pop(); + if (output.size() > 0) { + if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { + output.remove(output.size() - 1); + } + } + int caseStart = ip + 2; + List caseBodyIps = new ArrayList(); + long defaultAddr = 0; + caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip + 1)).getRef(version), version)); + ip++; + do { + ip++; + if ((actions.get(ip - 1) instanceof ActionStrictEquals) && (actions.get(ip) instanceof ActionIf)) { + caseValues.add(actionsToStackTree(registerNames, jumpsOrIfs, actions, constants, caseStart, ip - 2, version).pop()); + caseStart = ip + 1; + caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip)).getRef(version), version)); + if (actions.get(ip + 1) instanceof ActionJump) { + defaultAddr = ((ActionJump) actions.get(ip + 1)).getRef(version); + ip = adr2ip(actions, defaultAddr, version); + break; + } + } + } while (ip < end); + + for (int i = 0; i < caseBodyIps.size(); i++) { + int caseEnd = ip - 1; + if (i < caseBodyIps.size() - 1) { + caseEnd = caseBodyIps.get(i + 1) - 1; + } + caseCommands.add(actionsToTree(registerNames, unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, caseBodyIps.get(i), caseEnd, version)); + } + output.add(new SwitchActionItem(action, defaultAddr, switchedObject, caseValues, caseCommands, null)); + continue; + } else { + action.translate(stack, constants, output, registerNames); + } + } */ else { + + if (action instanceof ActionStore) { + ActionStore store = (ActionStore) action; + store.setStore(actions.subList(ip + 1, ip + 1 + store.getStoreSize())); + ip = ip + 1 + store.getStoreSize() - 1/*ip++ will be next*/; + } + + try { + action.translate(localData, stack, output, staticOperation, path); + } catch (EmptyStackException ese) { + logger.log(Level.SEVERE, "Decompilation error in: " + path, ese); + output.add(new UnsupportedActionItem(action, "Empty stack")); + } + + } + + ip++; + } + //output = checkClass(output); + log("Leaving " + start + "-" + end); + return output; + } + + public static GraphTargetItem getWithoutGlobal(GraphTargetItem ti) { + GraphTargetItem t = ti; + if (!(t instanceof GetMemberActionItem)) { + return ti; + } + GetMemberActionItem lastMember = null; + while (((GetMemberActionItem) t).object instanceof GetMemberActionItem) { + lastMember = (GetMemberActionItem) t; + t = ((GetMemberActionItem) t).object; + } + if (((GetMemberActionItem) t).object instanceof GetVariableActionItem) { + GetVariableActionItem v = (GetVariableActionItem) ((GetMemberActionItem) t).object; + if (v.name instanceof DirectValueActionItem) { + if (((DirectValueActionItem) v.name).value instanceof String) { + if (((DirectValueActionItem) v.name).value.equals("_global")) { + GetVariableActionItem gvt = new GetVariableActionItem(null, ((GetMemberActionItem) t).memberName); + if (lastMember == null) { + return gvt; + } else { + lastMember.object = gvt; + } + } + } + } + } + return ti; + } + + public static List checkClass(List output) { + if (true) { + //return output; + } + List ret = new ArrayList<>(); + List functions = new ArrayList<>(); + List staticFunctions = new ArrayList<>(); + List> vars = new ArrayList<>(); + List> staticVars = new ArrayList<>(); + GraphTargetItem className; + GraphTargetItem extendsOp = null; + List implementsOp = new ArrayList<>(); + boolean ok = true; + int prevCount = 0; + for (GraphTargetItem t : output) { + if (t instanceof IfItem) { + IfItem it = (IfItem) t; + if (it.expression instanceof NotItem) { + NotItem nti = (NotItem) it.expression; + if ((nti.value instanceof GetMemberActionItem) || (nti.value instanceof GetVariableActionItem)) { + if (true) { //it.onFalse.isEmpty()){ //||(it.onFalse.get(0) instanceof UnsupportedActionItem)) { + if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) it.onTrue.get(0)).value instanceof NewObjectActionItem)) { + // ignore + } else { + List parts = it.onTrue; + className = getWithoutGlobal(nti.value); + if (parts.size() >= 1) { + int ipos = 0; + while ((parts.get(ipos) instanceof PopItem) || ((parts.get(ipos) instanceof IfItem) + && ((((IfItem) parts.get(ipos)).onTrue.size() == 1) && (((IfItem) parts.get(ipos)).onTrue.get(0) instanceof SetMemberActionItem) && (((SetMemberActionItem) ((IfItem) parts.get(ipos)).onTrue.get(0)).value instanceof NewObjectActionItem)))) { + + ipos++; + } + if (parts.get(ipos) instanceof ExtendsActionItem) { + ExtendsActionItem et = (ExtendsActionItem) parts.get(ipos); + extendsOp = getWithoutGlobal(et.superclass); + ipos++; + } + if (parts.get(ipos) instanceof StoreRegisterActionItem) { + StoreRegisterActionItem sr = (StoreRegisterActionItem) parts.get(ipos); + int instanceReg = sr.register.number; + if (sr.value instanceof GetMemberActionItem) { + GetMemberActionItem gm = (GetMemberActionItem) sr.value; + //gm.memberName should be "prototype" + if (gm.object instanceof TemporaryRegister) { + TemporaryRegister tm = (TemporaryRegister) gm.object; + int classReg = tm.getRegId(); + if (tm.value instanceof SetMemberActionItem) { + SetMemberActionItem sm = (SetMemberActionItem) tm.value; + if (sm.value instanceof StoreRegisterActionItem) { + sr = (StoreRegisterActionItem) sm.value; + if (sr.value instanceof FunctionActionItem) { + ((FunctionActionItem) (sr.value)).calculatedFunctionName = (className instanceof GetMemberActionItem) ? ((GetMemberActionItem) className).memberName : className; + functions.add((FunctionActionItem) sr.value); + + for (; ipos < parts.size(); ipos++) { + if (parts.get(ipos) instanceof ImplementsOpActionItem) { + ImplementsOpActionItem io = (ImplementsOpActionItem) parts.get(ipos); + implementsOp = io.superclasses; + continue; + } + if (parts.get(ipos) instanceof SetMemberActionItem) { + sm = (SetMemberActionItem) parts.get(ipos); + int rnum = -1; + if (sm.object instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) sm.object; + if (dv.value instanceof RegisterNumber) { + RegisterNumber rn = (RegisterNumber) dv.value; + rnum = rn.number; + } + } + if (sm.object instanceof TemporaryRegister) { + rnum = ((TemporaryRegister) sm.object).getRegId(); + } + if (rnum == instanceReg) { + if (sm.value instanceof FunctionActionItem) { + ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; + functions.add((FunctionActionItem) sm.value); + } else { + vars.add(new MyEntry<>(sm.objectName, sm.value)); + } + } else if (rnum == classReg) { + if (sm.value instanceof FunctionActionItem) { + ((FunctionActionItem) sm.value).calculatedFunctionName = sm.objectName; + staticFunctions.add((FunctionActionItem) sm.value); + } else { + staticVars.add(new MyEntry<>(sm.objectName, sm.value)); + } + } + + } + } + + } + + } + } + List output2 = new ArrayList<>(); + for (int i = 0; i < prevCount; i++) { + output2.add(output.get(i)); + } + output2.add(new ClassActionItem(className, extendsOp, implementsOp, null/*FIXME*/, functions, vars, staticFunctions, staticVars)); + return output2; + } + } + } else if (parts.get(ipos) instanceof SetMemberActionItem) { + SetMemberActionItem sm = (SetMemberActionItem) parts.get(0); + if (sm.value instanceof FunctionActionItem) { + FunctionActionItem f = (FunctionActionItem) sm.value; + if (f.actions.isEmpty()) { + if (parts.size() == 2) { + if (parts.get(1) instanceof ImplementsOpActionItem) { + ImplementsOpActionItem iot = (ImplementsOpActionItem) parts.get(1); + implementsOp = iot.superclasses; + } else { + ok = false; + break; + } + } + List output2 = new ArrayList<>(); + for (int i = 0; i < prevCount; i++) { + output2.add(output.get(i)); + } + output2.add(new InterfaceActionItem(sm.objectName, implementsOp)); + return output2; + } + } + } + } + } + } else { + ok = false; + } + } else { + ok = false; + } + } else { + ok = false; + } + } else if (!(t instanceof PopItem)) { + prevCount++; + //ok = false; + } + if (!ok) { + break; + } + } + return output; + } + + @Override + public boolean ignoredLoops() { + return false; + } + + public static void setConstantPool(List actions, ConstantPool cpool) { + for (GraphSourceItem a : actions) { + if (a instanceof ActionPush) { + if (cpool != null) { + ((ActionPush) a).constantPool = cpool.constants; + } + } + if (a instanceof ActionDefineFunction) { + if (cpool != null) { + //((ActionDefineFunction) a).setConstantPool(cpool.constants,actions); + } + } + if (a instanceof ActionDefineFunction2) { + if (cpool != null) { + //((ActionDefineFunction2) a).setConstantPool(cpool.constants,actions); + } + } + } + } + + public GraphTextWriter getASMSourceReplaced(ActionList container, Set knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) { + writer.appendNoHilight(getASMSource(container, knownAddreses, exportMode)); + return writer; + } + + public static double toFloatPoint(Object o) { + if (o instanceof Double) { + return (Double) o; + } + if (o instanceof Integer) { + return (Integer) o; + } + if (o instanceof Long) { + return (Long) o; + } + if (o instanceof String) { + try { + return Double.parseDouble((String) o); + } catch (NumberFormatException nfe) { + return 0; + } + } + return 0; + } + + public static GraphTargetItem gettoset(GraphTargetItem get, GraphTargetItem value, List variables) { + GraphTargetItem ret = get; + boolean boxed = false; + if (get instanceof VariableActionItem) { + boxed = true; + ret = ((VariableActionItem) ret).getBoxedValue(); + } + if (ret instanceof GetVariableActionItem) { + GetVariableActionItem gv = (GetVariableActionItem) ret; + ret = new SetVariableActionItem(null, gv.name, value); + } else if (ret instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) ret; + ret = new SetMemberActionItem(null, mem.object, mem.memberName, value); + } else if ((ret instanceof DirectValueActionItem) && ((DirectValueActionItem) ret).value instanceof RegisterNumber) { + ret = new StoreRegisterActionItem(null, (RegisterNumber) ((DirectValueActionItem) ret).value, value, false); + } else if (ret instanceof GetPropertyActionItem) { + GetPropertyActionItem gp = (GetPropertyActionItem) ret; + ret = new SetPropertyActionItem(null, gp.target, gp.propertyIndex, value); + } + if (boxed) { + GraphTargetItem b = ret; + ret = new VariableActionItem(((VariableActionItem) get).getVariableName(), value, ((VariableActionItem) get).isDefinition()); + ((VariableActionItem) ret).setBoxedValue((ActionItem) b); + variables.remove((VariableActionItem) get); + variables.add((VariableActionItem) ret); + } + return ret; + } + + @Override + public boolean isDeobfuscatePop() { + return false; + } + + @Override + public int getLine() { + return 0; + } + + @Override + public String getFile() { + return null; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index c8ad89d07..599018dc0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -1,487 +1,487 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.action; - -import com.jpexs.decompiler.flash.BaseLocalData; -import com.jpexs.decompiler.flash.FinalProcessLocalData; -import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; -import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; -import com.jpexs.decompiler.flash.action.model.FunctionActionItem; -import com.jpexs.decompiler.flash.action.model.SetTarget2ActionItem; -import com.jpexs.decompiler.flash.action.model.SetTargetActionItem; -import com.jpexs.decompiler.flash.action.model.SetTypeActionItem; -import com.jpexs.decompiler.flash.action.model.StoreRegisterActionItem; -import com.jpexs.decompiler.flash.action.model.clauses.ForInActionItem; -import com.jpexs.decompiler.flash.action.model.clauses.TellTargetActionItem; -import com.jpexs.decompiler.flash.action.model.operations.NeqActionItem; -import com.jpexs.decompiler.flash.action.model.operations.StrictEqActionItem; -import com.jpexs.decompiler.flash.action.swf4.ActionEquals; -import com.jpexs.decompiler.flash.action.swf4.ActionIf; -import com.jpexs.decompiler.flash.action.swf4.ActionNot; -import com.jpexs.decompiler.flash.action.swf4.ActionPush; -import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; -import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; -import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; -import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; -import com.jpexs.decompiler.flash.ecma.Null; -import com.jpexs.decompiler.graph.Graph; -import com.jpexs.decompiler.graph.GraphPart; -import com.jpexs.decompiler.graph.GraphSource; -import com.jpexs.decompiler.graph.GraphSourceItem; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.Loop; -import com.jpexs.decompiler.graph.TranslateStack; -import com.jpexs.decompiler.graph.model.BreakItem; -import com.jpexs.decompiler.graph.model.ContinueItem; -import com.jpexs.decompiler.graph.model.SwitchItem; -import com.jpexs.decompiler.graph.model.WhileItem; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -/** - * - * @author JPEXS - */ -public class ActionGraph extends Graph { - - public ActionGraph(List code, HashMap registerNames, HashMap variables, HashMap functions, int version) { - super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList()); - //this.version = version; - /*heads = makeGraph(code, new ArrayList()); - for (GraphPart head : heads) { - fixGraph(head); - makeMulti(head, new ArrayList()); - }*/ - } - - public static List translateViaGraph(HashMap registerNames, HashMap variables, HashMap functions, List code, int version, int staticOperation, String path) throws InterruptedException { - - ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version); - ActionLocalData localData = new ActionLocalData(registerNames); - g.init(localData); - return g.translate(localData, staticOperation, path); - } - - @Override - public void finalProcessStack(TranslateStack stack, List output) { - if (stack.size() > 0) { - for (int i = stack.size() - 1; i >= 0; i--) { - //System.err.println(stack.get(i)); - if (stack.get(i) instanceof FunctionActionItem) { - FunctionActionItem f = (FunctionActionItem) stack.remove(i); - if (!output.contains(f)) { - output.add(0, f); - } - } - } - } - } - - @Override - protected void finalProcess(List list, int level, FinalProcessLocalData localData) { - super.finalProcess(list, level, localData); - List ret = Action.checkClass(list); - if (ret != list) { - list.clear(); - list.addAll(ret); - } - int targetStart; - int targetEnd; - - boolean again; - do { - again = false; - targetStart = -1; - targetEnd = -1; - GraphTargetItem targetStartItem = null; - GraphTargetItem target = null; - for (int t = 0; t < list.size(); t++) { - GraphTargetItem it = list.get(t); - if (it instanceof SetTargetActionItem) { - SetTargetActionItem st = (SetTargetActionItem) it; - if (st.target.isEmpty()) { - if (targetStart > -1) { - targetEnd = t; - break; - } - } else { - target = new DirectValueActionItem(null, 0, st.target, new ArrayList<>()); - targetStart = t; - targetStartItem = it; - } - } - if (it instanceof SetTarget2ActionItem) { - SetTarget2ActionItem st = (SetTarget2ActionItem) it; - if ((st.target instanceof DirectValueActionItem) && st.target.getResult().equals("")) { - if (targetStart > -1) { - targetEnd = t; - break; - } - } else { - targetStart = t; - target = st.target; - targetStartItem = it; - } - } - } - if ((targetStart > -1) && (targetEnd > -1)) { - List newlist = new ArrayList<>(); - for (int i = 0; i < targetStart; i++) { - newlist.add(list.get(i)); - } - List tellist = new ArrayList<>(); - for (int i = targetStart + 1; i < targetEnd; i++) { - tellist.add(list.get(i)); - } - newlist.add(new TellTargetActionItem(targetStartItem.src, target, tellist)); - for (int i = targetEnd + 1; i < list.size(); i++) { - newlist.add(list.get(i)); - } - list.clear(); - list.addAll(newlist); - again = true; - } - } while (again); - for (int t = 0; t < list.size(); t++) { - GraphTargetItem it = list.get(t); - - if (it instanceof WhileItem) { - WhileItem wi = (WhileItem) it; - if ((!wi.commands.isEmpty()) && (wi.commands.get(0) instanceof SetTypeActionItem)) { - SetTypeActionItem sti = (SetTypeActionItem) wi.commands.get(0); - if (wi.expression.get(wi.expression.size() - 1) instanceof NeqActionItem) { - NeqActionItem ne = (NeqActionItem) wi.expression.get(wi.expression.size() - 1); - if (ne.rightSide instanceof DirectValueActionItem) { - DirectValueActionItem dv = (DirectValueActionItem) ne.rightSide; - if (dv.value instanceof Null) { - GraphTargetItem en = ne.leftSide; - if (en instanceof StoreRegisterActionItem) { - en = ((StoreRegisterActionItem) en).value; - } - if (en instanceof EnumerateActionItem) { - EnumerateActionItem eti = (EnumerateActionItem) en; - list.remove(t); - wi.commands.remove(0); - list.add(t, new ForInActionItem(null, wi.loop, sti.getObject(), eti.object, wi.commands)); - } - } - } - } - } - - } - } - //detectChained(list, temporaryRegisters); - } - - @Override - protected List checkPrecoNextParts(GraphPart part) { - List items = getPartItems(part); - part = makeMultiPart(part); - if (items.size() > 1) { - if (items.get(items.size() - 1) instanceof ActionIf) { - if (items.get(items.size() - 2) instanceof ActionStrictEquals) { - List storeRegisters = new ArrayList<>(); - for (GraphSourceItem s : items) { - if (s instanceof ActionStoreRegister) { - ActionStoreRegister sr = (ActionStoreRegister) s; - storeRegisters.add(sr.registerNumber); - } - } - if (!storeRegisters.isEmpty()) { - List caseBodies = new ArrayList<>(); - boolean proceed = false; - do { - proceed = false; - caseBodies.add(part.nextParts.get(0)); //jump - part = part.nextParts.get(1); //nojump - items = getPartItems(part); - part = makeMultiPart(part); - if (!items.isEmpty()) { - if (items.get(0) instanceof ActionPush) { - ActionPush pu = (ActionPush) items.get(0); - if (!pu.values.isEmpty()) { - if (pu.values.get(0) instanceof RegisterNumber) { - RegisterNumber rn = (RegisterNumber) pu.values.get(0); - if (storeRegisters.contains(rn.number)) { - storeRegisters.clear(); - storeRegisters.add(rn.number); - if (items.get(items.size() - 1) instanceof ActionIf) { - if (items.size() > 1) { - if (items.get(items.size() - 2) instanceof ActionStrictEquals) { - proceed = true; - } - } - } - } - } - } - } - } - } while (proceed); - - if (caseBodies.size() > 1) { - caseBodies.add(part); //TODO: properly detect default clause (?) - return caseBodies; - } - } - } - } - } - return null; - } - - @Override - protected List check(GraphSource code, BaseLocalData localData, List allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { - if (!output.isEmpty()) { - if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { - StoreRegisterActionItem str = (StoreRegisterActionItem) output.get(output.size() - 1); - if (str.value instanceof EnumerateActionItem) { - output.remove(output.size() - 1); - } - } - } - List ret = null; - if ((part.nextParts.size() == 2) && (!stack.isEmpty()) && (stack.peek() instanceof StrictEqActionItem)) { - - GraphTargetItem switchedObject = null; - if (!output.isEmpty()) { - if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { - switchedObject = ((StoreRegisterActionItem) output.get(output.size() - 1)).value; - } - } - if (switchedObject == null) { - switchedObject = new DirectValueActionItem(null, -1, new Null(), null); - } - HashMap caseValuesMap = new HashMap<>(); - - int pos = 0; - StrictEqActionItem set = (StrictEqActionItem) stack.pop(); - caseValuesMap.put(pos, set.rightSide); - if (set.leftSide instanceof StoreRegisterActionItem) { - switchedObject = ((StoreRegisterActionItem) set.leftSide).value; - } - //GraphPart switchLoc = part.nextParts.get(1).nextParts.get(0); - List caseBodyParts = new ArrayList<>(); - caseBodyParts.add(part.nextParts.get(0)); - GraphTargetItem top = null; - int cnt = 1; - while (part.nextParts.size() > 1 - && part.nextParts.get(1).getHeight() > 1 - && code.get(part.nextParts.get(1).end >= code.size() ? code.size() - 1 : part.nextParts.get(1).end) instanceof ActionIf - && ((top = translatePartGetStack(localData, part.nextParts.get(1), stack, staticOperation)) instanceof StrictEqActionItem)) { - cnt++; - part = part.nextParts.get(1); - pos++; - caseBodyParts.add(part.nextParts.get(0)); - - set = (StrictEqActionItem) top; - caseValuesMap.put(pos, set.rightSide); - } - if (cnt == 1) { - stack.push(set); - } else { - part = part.nextParts.get(1); - - GraphPart defaultPart = part; //21-21 - //caseBodyParts.add(defaultPart); - - List defaultAndLastPart = new ArrayList<>(); - defaultAndLastPart.add(defaultPart); - defaultAndLastPart.add(caseBodyParts.get(caseBodyParts.size() - 1)); - - GraphPart defaultPart2 = getCommonPart(localData, defaultAndLastPart, loops);//34-37 - - List defaultCommands = new ArrayList<>(); - List stopPart2 = new ArrayList<>(stopPart); - stopPart2.add(defaultPart2); - defaultCommands = printGraph(localData, stack, allParts, null, defaultPart, stopPart2, loops, staticOperation, path); - - List loopContinues = new ArrayList<>(); - for (Loop l : loops) { - if (l.loopContinue != null) { - loopContinues.add(l.loopContinue); - } - } - - List breakParts = new ArrayList<>(); - /*for (int g = 0; g < caseBodyParts.size(); g++) { - if (g < caseBodyParts.size() - 1) { - if (caseBodyParts.get(g).leadsTo(code, caseBodyParts.get(g + 1), loops)) { - continue; - } - } - GraphPart nsp = caseBodyParts.get(g).getNextSuperPartPath(loopContinues); - if (nsp != null) { - breakParts.add(nsp); - } - } - Collections.sort(breakParts, new Comparator() { - @Override - public int compare(GraphPart o1, GraphPart o2) { - return o2.path.length() - o1.path.length(); - } - });*/ - - //GraphPart breakPart = breakParts.isEmpty() ? null : breakParts.get(0); - List mcp = new ArrayList<>(); - mcp.addAll(caseBodyParts); - if (defaultPart2 != null) { - mcp.add(defaultPart2); - } - GraphPart breakPart = getMostCommonPart(localData, mcp, loops); - if ((defaultPart2 != breakPart) && (defaultCommands.isEmpty())) { - defaultPart = defaultPart2; - } - - List caseValues = new ArrayList<>(); - for (int i = 0; i < caseBodyParts.size(); i++) { - if (caseValuesMap.containsKey(i)) { - caseValues.add(caseValuesMap.get(i)); - } else { - continue; - } - } - - List> caseCommands = new ArrayList<>(); - GraphPart next = null; - - next = breakPart; - - GraphTargetItem ti = checkLoop(next, stopPart, loops); - currentLoop = new Loop(loops.size(), null, next); - currentLoop.phase = 1; - loops.add(currentLoop); - //switchLoc.getNextPartPath(new ArrayList()); - List valuesMapping = new ArrayList<>(); - List caseBodies = new ArrayList<>(); - for (int i = 0; i < caseValues.size(); i++) { - GraphPart cur = caseBodyParts.get(i); - if (!caseBodies.contains(cur)) { - caseBodies.add(cur); - } - valuesMapping.add(caseBodies.indexOf(cur)); - } - - if (defaultPart == breakPart) { - defaultPart = null; - } - if ((defaultPart != null) && (defaultCommands.isEmpty())) { - List stopPart2x = new ArrayList<>(stopPart); - stopPart2x.add(next); - defaultCommands = printGraph(localData, stack, allParts, null, defaultPart, stopPart2x, loops, staticOperation, path); - } - - if (!defaultCommands.isEmpty()) { - if (defaultCommands.get(defaultCommands.size() - 1) instanceof BreakItem) { - BreakItem bi = (BreakItem) defaultCommands.get(defaultCommands.size() - 1); - if (bi.loopId == currentLoop.id) { - defaultCommands.remove(defaultCommands.size() - 1); - } - } - } - - List ignored = new ArrayList<>(); - for (Loop l : loops) { - ignored.add(l.loopContinue); - } - - for (int i = 0; i < caseBodies.size(); i++) { - List cc = new ArrayList<>(); - GraphPart nextCase = null; - nextCase = next; - if (next != null) { - if (i < caseBodies.size() - 1) { - if (!caseBodies.get(i).leadsTo(localData, this, code, caseBodies.get(i + 1), loops)) { - cc.add(new BreakItem(null, currentLoop.id)); - } else { - nextCase = caseBodies.get(i + 1); - } - } else if (!defaultCommands.isEmpty()) { - if (!caseBodies.get(i).leadsTo(localData, this, code, defaultPart, loops)) { - cc.add(new BreakItem(null, currentLoop.id)); - } else { - nextCase = defaultPart; - } - } - } - List stopPart2x = new ArrayList<>(stopPart); - //stopPart2.add(nextCase); - for (GraphPart b : caseBodies) { - if (b != caseBodies.get(i)) { - stopPart2x.add(b); - } - } - if (defaultPart != null) { - stopPart2x.add(defaultPart); - } - if (breakPart != null) { - stopPart2x.add(breakPart); - } - cc.addAll(0, printGraph(localData, stack, allParts, null, caseBodies.get(i), stopPart2x, loops, staticOperation, path)); - if (cc.size() >= 2) { - if (cc.get(cc.size() - 1) instanceof BreakItem) { - if ((cc.get(cc.size() - 2) instanceof ContinueItem) || (cc.get(cc.size() - 2) instanceof BreakItem)) { - cc.remove(cc.size() - 1); - } - } - } - caseCommands.add(cc); - } - ret = new ArrayList<>(); - ret.addAll(output); - SwitchItem sti = new SwitchItem(null, currentLoop, switchedObject, caseValues, caseCommands, defaultCommands, valuesMapping); - ret.add(sti); - currentLoop.phase = 2; - if (next != null) { - if (ti != null) { - ret.add(ti); - } else { - ret.addAll(printGraph(localData, stack, allParts, null, next, stopPart, loops, staticOperation, path)); - } - } - } - } - return ret; - } - - @Override - protected int checkIp(int ip) { - int oldIp = ip; - //return in for..in - GraphSourceItem action = code.get(ip); - if ((action instanceof ActionPush) && (((ActionPush) action).values.size() == 1) && (((ActionPush) action).values.get(0) instanceof Null)) { - if (ip + 3 < code.size()) { - if ((code.get(ip + 1) instanceof ActionEquals) || (code.get(ip + 1) instanceof ActionEquals2)) { - if (code.get(ip + 2) instanceof ActionNot) { - if (code.get(ip + 3) instanceof ActionIf) { - ActionIf aif = (ActionIf) code.get(ip + 3); - if (code.adr2pos(code.pos2adr(ip + 4) + aif.getJumpOffset()) == ip) { - ip += 4; - } - } - } - } - } - } - if (oldIp != ip) { - return checkIp(ip); - } - return ip; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action; + +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.FinalProcessLocalData; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; +import com.jpexs.decompiler.flash.action.model.FunctionActionItem; +import com.jpexs.decompiler.flash.action.model.SetTarget2ActionItem; +import com.jpexs.decompiler.flash.action.model.SetTargetActionItem; +import com.jpexs.decompiler.flash.action.model.SetTypeActionItem; +import com.jpexs.decompiler.flash.action.model.StoreRegisterActionItem; +import com.jpexs.decompiler.flash.action.model.clauses.ForInActionItem; +import com.jpexs.decompiler.flash.action.model.clauses.TellTargetActionItem; +import com.jpexs.decompiler.flash.action.model.operations.NeqActionItem; +import com.jpexs.decompiler.flash.action.model.operations.StrictEqActionItem; +import com.jpexs.decompiler.flash.action.swf4.ActionEquals; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ActionNot; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; +import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; +import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.graph.Graph; +import com.jpexs.decompiler.graph.GraphPart; +import com.jpexs.decompiler.graph.GraphSource; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.Loop; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.BreakItem; +import com.jpexs.decompiler.graph.model.ContinueItem; +import com.jpexs.decompiler.graph.model.PopItem; +import com.jpexs.decompiler.graph.model.SwitchItem; +import com.jpexs.decompiler.graph.model.WhileItem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class ActionGraph extends Graph { + + public ActionGraph(List code, HashMap registerNames, HashMap variables, HashMap functions, int version) { + super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList()); + //this.version = version; + /*heads = makeGraph(code, new ArrayList()); + for (GraphPart head : heads) { + fixGraph(head); + makeMulti(head, new ArrayList()); + }*/ + } + + public static List translateViaGraph(HashMap registerNames, HashMap variables, HashMap functions, List code, int version, int staticOperation, String path) throws InterruptedException { + + ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version); + ActionLocalData localData = new ActionLocalData(registerNames); + g.init(localData); + return g.translate(localData, staticOperation, path); + } + + @Override + public void finalProcessStack(TranslateStack stack, List output) { + if (stack.size() > 0) { + for (int i = stack.size() - 1; i >= 0; i--) { + //System.err.println(stack.get(i)); + if (stack.get(i) instanceof FunctionActionItem) { + FunctionActionItem f = (FunctionActionItem) stack.remove(i); + if (!output.contains(f)) { + output.add(0, f); + } + } + } + } + } + + @Override + protected void finalProcess(List list, int level, FinalProcessLocalData localData) { + List ret = Action.checkClass(list); + if (ret != list) { + list.clear(); + list.addAll(ret); + } + int targetStart; + int targetEnd; + + boolean again; + do { + again = false; + targetStart = -1; + targetEnd = -1; + GraphTargetItem targetStartItem = null; + GraphTargetItem target = null; + for (int t = 0; t < list.size(); t++) { + GraphTargetItem it = list.get(t); + if (it instanceof SetTargetActionItem) { + SetTargetActionItem st = (SetTargetActionItem) it; + if (st.target.isEmpty()) { + if (targetStart > -1) { + targetEnd = t; + break; + } + } else { + target = new DirectValueActionItem(null, 0, st.target, new ArrayList()); + targetStart = t; + targetStartItem = it; + } + } + if (it instanceof SetTarget2ActionItem) { + SetTarget2ActionItem st = (SetTarget2ActionItem) it; + if ((st.target instanceof DirectValueActionItem) && st.target.getResult().equals("")) { + if (targetStart > -1) { + targetEnd = t; + break; + } + } else { + targetStart = t; + target = st.target; + targetStartItem = it; + } + } + } + if ((targetStart > -1) && (targetEnd > -1)) { + List newlist = new ArrayList<>(); + for (int i = 0; i < targetStart; i++) { + newlist.add(list.get(i)); + } + List tellist = new ArrayList<>(); + for (int i = targetStart + 1; i < targetEnd; i++) { + tellist.add(list.get(i)); + } + newlist.add(new TellTargetActionItem(targetStartItem.src, target, tellist)); + for (int i = targetEnd + 1; i < list.size(); i++) { + newlist.add(list.get(i)); + } + list.clear(); + list.addAll(newlist); + again = true; + } + } while (again); + for (int t = 1/*not first*/; t < list.size(); t++) { + GraphTargetItem it = list.get(t); + if (it instanceof WhileItem) { + WhileItem wi = (WhileItem) it; + if ((!wi.commands.isEmpty()) && (wi.commands.get(0) instanceof SetTypeActionItem)) { + SetTypeActionItem sti = (SetTypeActionItem) wi.commands.get(0); + if (wi.expression.get(wi.expression.size() - 1) instanceof NeqActionItem) { + NeqActionItem ne = (NeqActionItem) wi.expression.get(wi.expression.size() - 1); + if (ne.rightSide instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) ne.rightSide; + if (dv.value instanceof Null) { + GraphTargetItem en = list.get(t - 1); + if (en instanceof EnumerateActionItem) { + EnumerateActionItem eti = (EnumerateActionItem) en; + list.remove(t); + wi.commands.remove(0); + list.add(t, new ForInActionItem(null, wi.loop, sti.getObject(), eti.object, wi.commands)); + list.remove(t - 1); + t--; + } + } + + } + } + } + + } + } + //Handle for loops at the end: + super.finalProcess(list, level, localData); + } + + @Override + protected List checkPrecoNextParts(GraphPart part) { + List items = getPartItems(part); + part = makeMultiPart(part); + if (items.size() > 1) { + if (items.get(items.size() - 1) instanceof ActionIf) { + if (items.get(items.size() - 2) instanceof ActionStrictEquals) { + List storeRegisters = new ArrayList<>(); + for (GraphSourceItem s : items) { + if (s instanceof ActionStoreRegister) { + ActionStoreRegister sr = (ActionStoreRegister) s; + storeRegisters.add(sr.registerNumber); + } + } + if (!storeRegisters.isEmpty()) { + List caseBodies = new ArrayList<>(); + boolean proceed = false; + do { + proceed = false; + caseBodies.add(part.nextParts.get(0)); //jump + part = part.nextParts.get(1); //nojump + items = getPartItems(part); + part = makeMultiPart(part); + if (!items.isEmpty()) { + if (items.get(0) instanceof ActionPush) { + ActionPush pu = (ActionPush) items.get(0); + if (!pu.values.isEmpty()) { + if (pu.values.get(0) instanceof RegisterNumber) { + RegisterNumber rn = (RegisterNumber) pu.values.get(0); + if (storeRegisters.contains(rn.number)) { + storeRegisters.clear(); + storeRegisters.add(rn.number); + if (items.get(items.size() - 1) instanceof ActionIf) { + if (items.size() > 1) { + if (items.get(items.size() - 2) instanceof ActionStrictEquals) { + proceed = true; + } + } + } + } + } + } + } + } + } while (proceed); + + if (caseBodies.size() > 1) { + caseBodies.add(part); //TODO: properly detect default clause (?) + return caseBodies; + } + } + } + } + } + return null; + } + + @Override + protected List check(GraphSource code, BaseLocalData localData, List allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + if (!output.isEmpty()) { + if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { + StoreRegisterActionItem str = (StoreRegisterActionItem) output.get(output.size() - 1); + if (str.value instanceof EnumerateActionItem) { + output.remove(output.size() - 1); + } + } + } + List ret = null; + if ((part.nextParts.size() == 2) && (!stack.isEmpty()) && (stack.peek() instanceof StrictEqActionItem)) { + + GraphTargetItem switchedObject = null; + if (!output.isEmpty()) { + if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { + switchedObject = ((StoreRegisterActionItem) output.get(output.size() - 1)).value; + } + } + if (switchedObject == null) { + switchedObject = new DirectValueActionItem(null, -1, new Null(), null); + } + HashMap caseValuesMap = new HashMap<>(); + + int pos = 0; + StrictEqActionItem set = (StrictEqActionItem) stack.pop(); + caseValuesMap.put(pos, set.rightSide); + if (set.leftSide instanceof StoreRegisterActionItem) { + switchedObject = ((StoreRegisterActionItem) set.leftSide).value; + } + //GraphPart switchLoc = part.nextParts.get(1).nextParts.get(0); + List caseBodyParts = new ArrayList<>(); + caseBodyParts.add(part.nextParts.get(0)); + GraphTargetItem top = null; + int cnt = 1; + while (part.nextParts.size() > 1 + && part.nextParts.get(1).getHeight() > 1 + && code.get(part.nextParts.get(1).end >= code.size() ? code.size() - 1 : part.nextParts.get(1).end) instanceof ActionIf + && ((top = translatePartGetStack(localData, part.nextParts.get(1), stack, staticOperation)) instanceof StrictEqActionItem)) { + cnt++; + part = part.nextParts.get(1); + pos++; + caseBodyParts.add(part.nextParts.get(0)); + + set = (StrictEqActionItem) top; + caseValuesMap.put(pos, set.rightSide); + } + if (cnt == 1) { + stack.push(set); + } else { + part = part.nextParts.get(1); + + GraphPart defaultPart = part; //21-21 + //caseBodyParts.add(defaultPart); + + List defaultAndLastPart = new ArrayList<>(); + defaultAndLastPart.add(defaultPart); + defaultAndLastPart.add(caseBodyParts.get(caseBodyParts.size() - 1)); + + GraphPart defaultPart2 = getCommonPart(localData, defaultAndLastPart, loops);//34-37 + + List defaultCommands = new ArrayList<>(); + List stopPart2 = new ArrayList<>(stopPart); + stopPart2.add(defaultPart2); + defaultCommands = printGraph(localData, stack, allParts, null, defaultPart, stopPart2, loops, staticOperation, path); + + List loopContinues = new ArrayList<>(); + for (Loop l : loops) { + if (l.loopContinue != null) { + loopContinues.add(l.loopContinue); + } + } + + List breakParts = new ArrayList<>(); + /*for (int g = 0; g < caseBodyParts.size(); g++) { + if (g < caseBodyParts.size() - 1) { + if (caseBodyParts.get(g).leadsTo(code, caseBodyParts.get(g + 1), loops)) { + continue; + } + } + GraphPart nsp = caseBodyParts.get(g).getNextSuperPartPath(loopContinues); + if (nsp != null) { + breakParts.add(nsp); + } + } + Collections.sort(breakParts, new Comparator() { + @Override + public int compare(GraphPart o1, GraphPart o2) { + return o2.path.length() - o1.path.length(); + } + });*/ + + //GraphPart breakPart = breakParts.isEmpty() ? null : breakParts.get(0); + List mcp = new ArrayList<>(); + mcp.addAll(caseBodyParts); + if (defaultPart2 != null) { + mcp.add(defaultPart2); + } + GraphPart breakPart = getMostCommonPart(localData, mcp, loops); + if ((defaultPart2 != breakPart) && (defaultCommands.isEmpty())) { + defaultPart = defaultPart2; + } + + List caseValues = new ArrayList<>(); + for (int i = 0; i < caseBodyParts.size(); i++) { + if (caseValuesMap.containsKey(i)) { + caseValues.add(caseValuesMap.get(i)); + } else { + continue; + } + } + + List> caseCommands = new ArrayList<>(); + GraphPart next = null; + + next = breakPart; + + GraphTargetItem ti = checkLoop(next, stopPart, loops); + currentLoop = new Loop(loops.size(), null, next); + currentLoop.phase = 1; + loops.add(currentLoop); + //switchLoc.getNextPartPath(new ArrayList()); + List valuesMapping = new ArrayList<>(); + List caseBodies = new ArrayList<>(); + for (int i = 0; i < caseValues.size(); i++) { + GraphPart cur = caseBodyParts.get(i); + if (!caseBodies.contains(cur)) { + caseBodies.add(cur); + } + valuesMapping.add(caseBodies.indexOf(cur)); + } + + if (defaultPart == breakPart) { + defaultPart = null; + } + if ((defaultPart != null) && (defaultCommands.isEmpty())) { + List stopPart2x = new ArrayList<>(stopPart); + stopPart2x.add(next); + defaultCommands = printGraph(localData, stack, allParts, null, defaultPart, stopPart2x, loops, staticOperation, path); + } + + if (!defaultCommands.isEmpty()) { + if (defaultCommands.get(defaultCommands.size() - 1) instanceof BreakItem) { + BreakItem bi = (BreakItem) defaultCommands.get(defaultCommands.size() - 1); + if (bi.loopId == currentLoop.id) { + defaultCommands.remove(defaultCommands.size() - 1); + } + } + } + + List ignored = new ArrayList<>(); + for (Loop l : loops) { + ignored.add(l.loopContinue); + } + + for (int i = 0; i < caseBodies.size(); i++) { + List cc = new ArrayList<>(); + GraphPart nextCase = null; + nextCase = next; + if (next != null) { + if (i < caseBodies.size() - 1) { + if (!caseBodies.get(i).leadsTo(localData, this, code, caseBodies.get(i + 1), loops)) { + cc.add(new BreakItem(null, currentLoop.id)); + } else { + nextCase = caseBodies.get(i + 1); + } + } else if (!defaultCommands.isEmpty()) { + if (!caseBodies.get(i).leadsTo(localData, this, code, defaultPart, loops)) { + cc.add(new BreakItem(null, currentLoop.id)); + } else { + nextCase = defaultPart; + } + } + } + List stopPart2x = new ArrayList<>(stopPart); + //stopPart2.add(nextCase); + for (GraphPart b : caseBodies) { + if (b != caseBodies.get(i)) { + stopPart2x.add(b); + } + } + if (defaultPart != null) { + stopPart2x.add(defaultPart); + } + if (breakPart != null) { + stopPart2x.add(breakPart); + } + cc.addAll(0, printGraph(localData, stack, allParts, null, caseBodies.get(i), stopPart2x, loops, staticOperation, path)); + if (cc.size() >= 2) { + if (cc.get(cc.size() - 1) instanceof BreakItem) { + if ((cc.get(cc.size() - 2) instanceof ContinueItem) || (cc.get(cc.size() - 2) instanceof BreakItem)) { + cc.remove(cc.size() - 1); + } + } + } + caseCommands.add(cc); + } + ret = new ArrayList<>(); + ret.addAll(output); + SwitchItem sti = new SwitchItem(null, currentLoop, switchedObject, caseValues, caseCommands, defaultCommands, valuesMapping); + ret.add(sti); + currentLoop.phase = 2; + if (next != null) { + if (ti != null) { + ret.add(ti); + } else { + ret.addAll(printGraph(localData, stack, allParts, null, next, stopPart, loops, staticOperation, path)); + } + } + } + } + return ret; + } + + @Override + protected int checkIp(int ip) { + int oldIp = ip; + //return in for..in + GraphSourceItem action = code.get(ip); + if ((action instanceof ActionPush) && (((ActionPush) action).values.size() == 1) && (((ActionPush) action).values.get(0) instanceof Null)) { + if (ip + 3 < code.size()) { + if ((code.get(ip + 1) instanceof ActionEquals) || (code.get(ip + 1) instanceof ActionEquals2)) { + if (code.get(ip + 2) instanceof ActionNot) { + if (code.get(ip + 3) instanceof ActionIf) { + ActionIf aif = (ActionIf) code.get(ip + 3); + if (code.adr2pos(code.pos2adr(ip + 4) + aif.getJumpOffset()) == ip) { + ip += 4; + } + } + } + } + } + } + if (oldIp != ip) { + return checkIp(ip); + } + return ip; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java index 2c7bc5a5a..7f2a6a07a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java @@ -1,1011 +1,1011 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.action; - -import com.jpexs.decompiler.flash.DisassemblyListener; -import com.jpexs.decompiler.flash.SWFInputStream; -import com.jpexs.decompiler.flash.action.deobfuscation.ActionDeobfuscator; -import com.jpexs.decompiler.flash.action.deobfuscation.ActionDeobfuscatorSimple; -import com.jpexs.decompiler.flash.action.model.ConstantPool; -import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; -import com.jpexs.decompiler.flash.action.special.ActionDeobfuscateJump; -import com.jpexs.decompiler.flash.action.special.ActionEnd; -import com.jpexs.decompiler.flash.action.special.ActionNop; -import com.jpexs.decompiler.flash.action.special.ActionStore; -import com.jpexs.decompiler.flash.action.swf4.ActionEquals; -import com.jpexs.decompiler.flash.action.swf4.ActionIf; -import com.jpexs.decompiler.flash.action.swf4.ActionJump; -import com.jpexs.decompiler.flash.action.swf4.ActionPush; -import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; -import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; -import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; -import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; -import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; -import com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.ecma.EcmaScript; -import com.jpexs.decompiler.flash.ecma.Null; -import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; -import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin; -import com.jpexs.decompiler.graph.Graph; -import com.jpexs.decompiler.graph.GraphSourceItemContainer; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.NotCompileTimeItem; -import com.jpexs.decompiler.graph.TranslateException; -import com.jpexs.decompiler.graph.TranslateStack; -import com.jpexs.decompiler.graph.model.LocalData; -import com.jpexs.helpers.CancellableWorker; -import com.jpexs.helpers.Helper; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Queue; -import java.util.Scanner; -import java.util.TreeMap; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Class for reading data from SWF file - * - * @author JPEXS - */ -public class ActionListReader { - - private static final Logger logger = Logger.getLogger(ActionListReader.class.getName()); - - /** - * Reads list of actions from the stream. Reading ends with - * ActionEndFlag(=0) or end of the stream. - * - * @param listeners - * @param sis - * @param version - * @param ip - * @param endIp - * @param path - * @return List of actions - * @throws IOException - * @throws java.lang.InterruptedException - * @throws java.util.concurrent.TimeoutException - */ - public static ActionList readActionListTimeout(final List listeners, final SWFInputStream sis, final int version, final int ip, final int endIp, final String path) throws IOException, InterruptedException, TimeoutException { - try { - final int deobfuscationMode = Configuration.autoDeobfuscate.get() ? Configuration.deobfuscationMode.get() : -1; - ActionList actions = CancellableWorker.call(new Callable() { - - @Override - public ActionList call() throws IOException, InterruptedException { - return readActionList(listeners, sis, version, ip, endIp, path, deobfuscationMode); - } - }, Configuration.decompilationTimeoutSingleMethod.get(), TimeUnit.SECONDS); - - return actions; - } catch (ExecutionException ex) { - Throwable cause = ex.getCause(); - if (cause instanceof InterruptedException) { - throw (InterruptedException) cause; - } else if (cause instanceof InterruptedException) { - throw (IOException) cause; - } else { - logger.log(Level.SEVERE, null, ex); - } - } - return new ActionList(); - } - - /** - * Reads list of actions from the stream. Reading ends with - * ActionEndFlag(=0) or end of the stream. - * - * @param listeners - * @param sis - * @param version - * @param ip - * @param endIp - * @param path - * @param deobfuscationMode - * @return List of actions - * @throws IOException - * @throws java.lang.InterruptedException - */ - public static ActionList readActionList(List listeners, SWFInputStream sis, int version, int ip, int endIp, String path, int deobfuscationMode) throws IOException, InterruptedException { - // Map of the actions. Use TreeMap to sort the keys in ascending order - // actionMap and nextOffsets should contain exaclty the same keys - Map actionMap = new TreeMap<>(); - Map nextOffsets = new HashMap<>(); - Action entryAction = readActionListAtPos(listeners, null, - sis, actionMap, nextOffsets, - ip, 0, endIp, path, false, new ArrayList()); - - if (actionMap.isEmpty()) { - return new ActionList(); - } - - List addresses = new ArrayList<>(actionMap.keySet()); - - // add end action - Action lastAction = actionMap.get(addresses.get(addresses.size() - 1)); - long endAddress; - if (!(lastAction instanceof ActionEnd)) { - Action aEnd = new ActionEnd(); - aEnd.setAddress(nextOffsets.get(lastAction.getAddress())); - endAddress = aEnd.getAddress(); - actionMap.put(aEnd.getAddress(), aEnd); - nextOffsets.put(endAddress, endAddress + 1); - } - - ActionList actions = fixActionList(new ActionList(actionMap.values()), nextOffsets, version); - - // jump to the entry action when it is diffrent from the first action in the map - if (entryAction != actions.get(0)) { - ActionJump jump = new ActionDeobfuscateJump(0); - actions.addAction(0, jump); - jump.setJumpOffset((int) (entryAction.getAddress() - jump.getTotalActionLength())); - } - - if (SWFDecompilerPlugin.fireActionListParsed(actions, sis.getSwf())) { - actions = fixActionList(actions, null, version); - } - - if (deobfuscationMode == 0) { - try { - actions = deobfuscateActionList(listeners, actions, version, 0, path); - updateActionLengths(actions, version); - } catch (OutOfMemoryError | StackOverflowError | TranslateException ex) { - // keep orignal (not deobfuscated) actions - logger.log(Level.SEVERE, null, ex); - } - } else if (deobfuscationMode == 1) { - try { - new ActionDeobfuscatorSimple().actionListParsed(actions, sis.getSwf()); - new ActionDeobfuscator().actionListParsed(actions, sis.getSwf()); - } catch (OutOfMemoryError | StackOverflowError | TranslateException ex) { - // keep orignal (not deobfuscated) actions - logger.log(Level.SEVERE, null, ex); - } - } - - return actions; - } - - public static ActionList fixActionList(ActionList actions, Map nextOffsets, int version) { - Map> containerLastActions = new HashMap<>(); - getContainerLastActions(actions, containerLastActions); - - ActionList ret = new ActionList(); - - if (nextOffsets != null) { - int index = 0; - while (index != -1 && index < actions.size()) { - Action action = actions.get(index); - ret.add(action); - index++; - if (index < actions.size()) { - long nextAddress = nextOffsets.get(action.getAddress()); - if (actions.get(index).getAddress() != nextAddress) { - if (!action.isExit() && !(action instanceof ActionJump)) { - ActionJump jump = new ActionDeobfuscateJump(0); - jump.setAddress(action.getAddress()); - int size = jump.getTotalActionLength(); - jump.setJumpOffset((int) (nextAddress - action.getAddress() - size)); - ret.add(jump); - } - } - } - } - } else { - ret.addAll(actions); - } - - // Map for storing the targers of the "jump" actions - // "jump" action can be ActionIf, ActionJump and any ActionStore - Map jumps = new HashMap<>(); - getJumps(ret, jumps); - - updateActionLengths(ret, version); - updateAddresses(ret, 0); - long endAddress = ret.get(ret.size() - 1).getAddress(); - - updateJumps(ret, jumps, containerLastActions, endAddress); - updateActionStores(ret, jumps); - updateContainerSizes(ret, containerLastActions); - - return ret; - } - - public static List getOriginalActions(SWFInputStream sis, int startIp, int endIp) throws IOException, InterruptedException { - // Map of the actions. Use TreeMap to sort the keys in ascending order - Map actionMap = new TreeMap<>(); - Map nextOffsets = new HashMap<>(); - readActionListAtPos(new ArrayList(), null, - sis, actionMap, nextOffsets, - startIp, startIp, endIp + 1, "", false, new ArrayList()); - - return new ArrayList<>(actionMap.values()); - } - - /** - * Reads list of actions from the stream. Reading ends with - * ActionEndFlag(=0) or end of the stream. - * - * @param listeners - * @param actions - * @param version - * @param ip - * @param path - * @return List of actions - * @throws IOException - * @throws java.lang.InterruptedException - */ - private static ActionList deobfuscateActionList(List listeners, ActionList actions, int version, int ip, String path) throws IOException, InterruptedException { - if (actions.isEmpty()) { - return actions; - } - - Action lastAction = actions.get(actions.size() - 1); - int endIp = (int) lastAction.getAddress(); - - List retMap = new ArrayList<>(endIp); - for (int i = 0; i < endIp; i++) { - retMap.add(null); - } - List actionMap = new ArrayList<>(endIp); - for (int i = 0; i <= endIp; i++) { - actionMap.add(null); - } - for (Action a : actions) { - actionMap.set((int) a.getAddress(), a); - } - - int maxRecursionLevel = 0; - for (int i = 0; i < actions.size(); i++) { - Action a = actions.get(i); - if (a instanceof ActionIf || a instanceof GraphSourceItemContainer) { - maxRecursionLevel++; - } - if (a instanceof ActionIf) { - ActionIf aif = (ActionIf) a; - aif.ignoreUsed = false; - aif.jumpUsed = false; - } - } - - deobfustaceActionListAtPosRecursive(listeners, - new ArrayList(), - new HashMap>(), - new ActionLocalData(), - new TranslateStack(), - new ConstantPool(), - actionMap, ip, retMap, ip, endIp, path, - new HashMap(), false, - new HashMap>(), - version, 0, maxRecursionLevel); - - ActionList ret = new ActionList(); - Action last = null; - for (Action a : retMap) { - if (a != last && a != null) { - ret.add(a); - } - last = a; - } - ret.removeNops(); - ActionList reta = new ActionList(); - for (Object o : ret) { - if (o instanceof Action) { - reta.add((Action) o); - } - } - return reta; - } - - private static long getNearAddress(ActionList actions, long address, boolean next) { - int min = 0; - int max = actions.size() - 1; - - while (max >= min) { - int mid = (min + max) / 2; - long midValue = actions.get(mid).getAddress(); - if (midValue == address) { - return address; - } else if (midValue < address) { - min = mid + 1; - } else { - max = mid - 1; - } - } - - return next - ? (min < actions.size() ? actions.get(min).getAddress() : -1) - : (max >= 0 ? actions.get(max).getAddress() : -1); - } - - private static Map actionListToMap(List actions) { - Map map = new HashMap<>(actions.size()); - for (Action a : actions) { - long address = a.getAddress(); - // There are multiple actions in the same address (2nd action is a jump for obfuscated code) - // So this check is required - if (!map.containsKey(address)) { - map.put(a.getAddress(), a); - } - } - return map; - } - - private static void getJumps(List actions, Map jumps) { - Map actionMap = actionListToMap(actions); - for (Action a : actions) { - long target = -1; - if (a instanceof ActionIf) { - ActionIf aIf = (ActionIf) a; - target = aIf.getAddress() + a.getTotalActionLength() + aIf.getJumpOffset(); - } else if (a instanceof ActionJump) { - ActionJump aJump = (ActionJump) a; - target = aJump.getAddress() + a.getTotalActionLength() + aJump.getJumpOffset(); - } else if (a instanceof ActionStore) { - ActionStore aStore = (ActionStore) a; - int storeSize = aStore.getStoreSize(); - // skip storeSize + 1 actions (+1 is the current action) - Action targetAction = a; - for (int i = 0; i <= storeSize; i++) { - long address = targetAction.getAddress() + targetAction.getTotalActionLength(); - targetAction = actionMap.get(address); - if (targetAction == null) { - break; - } - } - jumps.put(a, targetAction); - } - if (target >= 0) { - Action targetAction = actionMap.get(target); - jumps.put(a, targetAction); - } - } - } - - public static List getContainerLastActions(ActionList actions, Action action) { - GraphSourceItemContainer container = (GraphSourceItemContainer) action; - List sizes = container.getContainerSizes(); - long endAddress = action.getAddress() + container.getHeaderSize(); - List lasts = new ArrayList<>(sizes.size()); - for (long size : sizes) { - endAddress += size; - long lastActionAddress = getNearAddress(actions, endAddress - 1, false); - Action lastAction = null; - if (lastActionAddress != -1) { - lastAction = actions.getByAddress(lastActionAddress); - } - lasts.add(lastAction); - } - return lasts; - } - - private static void getContainerLastActions(ActionList actions, Map> lastActions) { - for (Action a : actions) { - if (a instanceof GraphSourceItemContainer) { - lastActions.put(a, getContainerLastActions(actions, a)); - } - } - } - - private static long updateAddresses(List actions, long address) { - for (int i = 0; i < actions.size(); i++) { - Action a = actions.get(i); - a.setAddress(address); - int length = a.getTotalActionLength(); - if ((i != actions.size() - 1) && (a instanceof ActionEnd)) { - // placeholder for jump action - length = new ActionDeobfuscateJump(0).getTotalActionLength(); - } - address += length; - } - return address; - } - - private static void updateActionLengths(List actions, int version) { - for (int i = 0; i < actions.size(); i++) { - actions.get(i).updateLength(version); - } - } - - private static void updateActionStores(List actions, Map jumps) { - Map actionMap = actionListToMap(actions); - for (int i = 0; i < actions.size(); i++) { - Action a = actions.get(i); - if (a instanceof ActionStore) { - ActionStore aStore = (ActionStore) a; - Action nextActionAfterStore = jumps.get(a); - Action a1 = a; - List store = new ArrayList<>(); - while (true) { - long address = a1.getAddress() + a1.getTotalActionLength(); - a1 = actionMap.get(address); - if (a1 == null || a1 == nextActionAfterStore) { - break; - } - store.add(a1); - } - aStore.setStore(store); - } - } - } - - private static void updateContainerSizes(List actions, Map> containerLastActions) { - for (int i = 0; i < actions.size(); i++) { - Action a = actions.get(i); - if (a instanceof GraphSourceItemContainer) { - GraphSourceItemContainer container = (GraphSourceItemContainer) a; - List lastActions = containerLastActions.get(a); - long startAddress = a.getAddress() + container.getHeaderSize(); - for (int j = 0; j < lastActions.size(); j++) { - Action lastAction = lastActions.get(j); - int length = (int) (lastAction.getAddress() + lastAction.getTotalActionLength() - startAddress); - container.setContainerSize(j, length); - startAddress += length; - } - } - } - } - - private static void replaceJumpTargets(Map jumps, Action oldTarget, Action newTarget) { - for (Action a : jumps.keySet()) { - if (jumps.get(a) == oldTarget) { - jumps.put(a, newTarget); - } - } - } - - private static void replaceContainerLastActions(Map> containerLastActions, Action oldTarget, Action newTarget) { - for (Action a : containerLastActions.keySet()) { - List targets = containerLastActions.get(a); - for (int i = 0; i < targets.size(); i++) { - if (targets.get(i) == oldTarget) { - targets.set(i, newTarget); - } - } - } - } - - private static void updateJumps(List actions, Map jumps, Map> containerLastActions, long endAddress) { - if (actions.isEmpty()) { - return; - } - - for (int i = 0; i < actions.size(); i++) { - Action a = actions.get(i); - if ((i != actions.size() - 1) && (a instanceof ActionEnd)) { - ActionJump aJump = new ActionDeobfuscateJump(0); - aJump.setJumpOffset((int) (endAddress - a.getAddress() - aJump.getTotalActionLength())); - aJump.setAddress(a.getAddress()); - replaceJumpTargets(jumps, a, aJump); - replaceContainerLastActions(containerLastActions, a, aJump); - a = aJump; - actions.set(i, a); - } else if (a instanceof ActionIf) { - ActionIf aIf = (ActionIf) a; - Action target = jumps.get(a); - long offset; - if (target != null) { - offset = target.getAddress() - a.getAddress() - a.getTotalActionLength(); - } else { - offset = endAddress - a.getAddress() - a.getTotalActionLength(); - } - aIf.setJumpOffset((int) offset); - } else if (a instanceof ActionJump) { - ActionJump aJump = (ActionJump) a; - Action target = jumps.get(a); - long offset; - if (target != null) { - offset = target.getAddress() - a.getAddress() - a.getTotalActionLength(); - } else { - offset = endAddress - a.getAddress() - a.getTotalActionLength(); - } - aJump.setJumpOffset((int) offset); - } - } - } - - /** - * Removes an action from the action list, and updates all references This - * method will keep the inner actions of the container when you remove the - * container - * - * @param actions - * @param index - * @param version - * @param removeWhenLast - * @return - */ - public static boolean removeAction(ActionList actions, int index, int version, boolean removeWhenLast) { - - if (index < 0 || actions.size() <= index) { - return false; - } - - long startIp = actions.get(0).getAddress(); - Action lastAction = actions.get(actions.size() - 1); - long endAddress = lastAction.getAddress() + lastAction.getTotalActionLength(); - - Map> containerLastActions = new HashMap<>(); - getContainerLastActions(actions, containerLastActions); - - Map jumps = new HashMap<>(); - getJumps(actions, jumps); - - Action prevAction = index > 0 ? actions.get(index - 1) : null; - Action nextAction = index + 1 < actions.size() ? actions.get(index + 1) : null; - Action actionToRemove = actions.get(index); - for (Action a : containerLastActions.keySet()) { - List lastActions = containerLastActions.get(a); - for (int i = 0; i < lastActions.size(); i++) { - if (lastActions.get(i) == actionToRemove) { - if (!removeWhenLast) { - return false; - } - lastActions.set(i, prevAction); - } - } - } - for (Action a : jumps.keySet()) { - Action targetAction = jumps.get(a); - if (targetAction == actionToRemove) { - jumps.put(a, nextAction); - } - } - if (containerLastActions.containsKey(actionToRemove)) { - containerLastActions.remove(actionToRemove); - } - if (jumps.containsKey(actionToRemove)) { - jumps.remove(actionToRemove); - } - - actions.remove(index); - - updateActionLengths(actions, version); - updateAddresses(actions, startIp); - updateJumps(actions, jumps, containerLastActions, endAddress); - updateActionStores(actions, jumps); - updateContainerSizes(actions, containerLastActions); - - return true; - } - - /** - * Adds an action to the action list to the specified location, and updates - * all references - * - * @param actions - * @param index - * @param action - * @param version - * @param addToContainer - * @param replaceJump - * @return - */ - public static boolean addAction(ActionList actions, int index, Action action, - int version, boolean addToContainer, boolean replaceJump) { - - if (index < 0 || actions.size() < index) { - return false; - } - - long startIp = actions.get(0).getAddress(); - Action lastAction = actions.get(actions.size() - 1); - if (!(lastAction instanceof ActionEnd)) { - Action aEnd = new ActionEnd(); - aEnd.setAddress(lastAction.getAddress() + lastAction.getTotalActionLength()); - actions.add(aEnd); - lastAction = aEnd; - } - - long endAddress = lastAction.getAddress(); - - Map> containerLastActions = new HashMap<>(); - getContainerLastActions(actions, containerLastActions); - - Map jumps = new HashMap<>(); - List tempActions = new ArrayList<>(actions); - tempActions.add(action); - getJumps(tempActions, jumps); - - Action prevAction = actions.get(index); - if (addToContainer) { - for (Action a : containerLastActions.keySet()) { - List lastActions = containerLastActions.get(a); - for (int i = 0; i < lastActions.size(); i++) { - if (lastActions.get(i) == prevAction) { - lastActions.set(i, action); - } - } - } - } - - if (replaceJump) { - for (Action a : jumps.keySet()) { - Action targetAction = jumps.get(a); - if (targetAction == prevAction) { - jumps.put(a, action); - } - } - } - - actions.add(index, action); - - updateActionLengths(actions, version); - updateAddresses(actions, startIp); - updateJumps(actions, jumps, containerLastActions, endAddress); - updateActionStores(actions, jumps); - updateContainerSizes(actions, containerLastActions); - - return true; - } - - private static Action readActionListAtPos(List listeners, ConstantPool cpool, - SWFInputStream sis, Map actions, Map nextOffsets, - long ip, long startIp, long endIp, String path, boolean indeterminate, List visitedContainers) throws IOException { - - Action entryAction = null; - - if (visitedContainers.contains(ip)) { - return null; - } - visitedContainers.add(ip); - - Queue jumpQueue = new LinkedList<>(); - jumpQueue.add(ip); - while (!jumpQueue.isEmpty()) { - ip = jumpQueue.remove(); - if (ip < startIp) { - continue; - } - - while (endIp == -1 || endIp > ip) { - sis.seek((int) ip); - - Action a; - if ((a = sis.readAction()) == null) { - break; - } - - int actionLengthWithHeader = a.getTotalActionLength(); - - // unknown action, replace with jump - if (a instanceof ActionNop) { - ActionJump aJump = new ActionDeobfuscateJump(0); - int jumpLength = aJump.getTotalActionLength(); - aJump.setAddress(a.getAddress()); - aJump.setJumpOffset(actionLengthWithHeader - jumpLength); - a = aJump; - actionLengthWithHeader = a.getTotalActionLength(); - } - - if (entryAction == null) { - entryAction = a; - } - - Action existingAction = actions.get(ip); - if (existingAction != null) { - break; - } - - actions.put(ip, a); - nextOffsets.put(ip, ip + actionLengthWithHeader); - - long pos = sis.getPos(); - long length = pos + sis.available(); - for (int i = 0; i < listeners.size(); i++) { - listeners.get(i).progressReading(pos, length); - } - - a.setAddress(ip); - - if (a instanceof ActionPush && cpool != null) { - ((ActionPush) a).constantPool = cpool.constants; - } else if (a instanceof ActionConstantPool) { - cpool = new ConstantPool(((ActionConstantPool) a).constantPool); - } else if (a instanceof ActionIf) { - ActionIf aIf = (ActionIf) a; - long nIp = ip + actionLengthWithHeader + aIf.getJumpOffset(); - if (nIp >= 0) { - jumpQueue.add(nIp); - } - } else if (a instanceof ActionJump) { - ActionJump aJump = (ActionJump) a; - long nIp = ip + actionLengthWithHeader + aJump.getJumpOffset(); - if (nIp >= 0) { - jumpQueue.add(nIp); - } - break; - } else if (a instanceof GraphSourceItemContainer) { - GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; - String cntName = cnt.getName(); - String newPath = path + (cntName == null ? "" : "/" + cntName); - for (long size : cnt.getContainerSizes()) { - if (size != 0) { - long ip2 = ip + actionLengthWithHeader; - long endIp2 = ip + actionLengthWithHeader + size; - readActionListAtPos(listeners, cpool, - sis, actions, nextOffsets, - ip2, startIp, endIp2, newPath, indeterminate, visitedContainers); - actionLengthWithHeader += size; - } - } - } - - ip += actionLengthWithHeader; - - if (a.isExit()) { - break; - } - } - } - return entryAction; - } - - private static void deobfustaceActionListAtPosRecursive(List listeners, List output, HashMap> containers, ActionLocalData localData, TranslateStack stack, ConstantPool cpool, List actions, int ip, List ret, int startIp, int endip, String path, Map visited, boolean indeterminate, Map> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException { - boolean debugMode = false; - boolean decideBranch = false; - - if (recursionLevel > maxRecursionLevel + 1) { - throw new TranslateException("deobfustaceActionListAtPosRecursive max recursion level reached."); - } - - Action a; - Scanner sc = null; - loopip: - while (((endip == -1) || (endip > ip)) && (a = actions.get(ip)) != null) { - if (Thread.currentThread().isInterrupted()) { - throw new InterruptedException(); - } - - int actionLen = a.getTotalActionLength(); - if (!visited.containsKey(ip)) { - visited.put(ip, 0); - } - int curVisited = visited.get(ip); - curVisited++; - visited.put(ip, curVisited); - for (int i = 0; i < listeners.size(); i++) { - listeners.get(i).progressDeobfuscating(ip, actions.size()); - } - int info = a.getTotalActionLength(); - - if (a instanceof ActionPush) { - if (cpool != null) { - ((ActionPush) a).constantPool = cpool.constants; - } - } - - if (debugMode) { - String atos = a.getASMSource(new ActionList(), new HashSet(), ScriptExportMode.PCODE); - if (a instanceof GraphSourceItemContainer) { - atos = a.toString(); - } - System.err.println("readActionListAtPos ip: " + (ip - startIp) + " (0x" + Helper.formatAddress(ip - startIp) + ") " + " action(len " + a.actionLength + "): " + atos + (a.isIgnored() ? " (ignored)" : "") + " stack:" + Helper.stackToString(stack, LocalData.create(cpool)) + " " + Helper.byteArrToString(a.getBytes(version))); - System.err.print("variables: "); - for (Map.Entry v : localData.variables.entrySet()) { - System.err.print("'" + v + "' = " + v.getValue().toString(LocalData.create(cpool)) + ", "); - } - System.err.println(); - String add = ""; - if (a instanceof ActionIf) { - add = " change: " + ((ActionIf) a).getJumpOffset(); - } - if (a instanceof ActionJump) { - add = " change: " + ((ActionJump) a).getJumpOffset(); - } - System.err.println(add); - } - - int newip = -1; - - if (a instanceof ActionConstantPool) { - if (cpool == null) { - cpool = new ConstantPool(); - } - cpool.setNew(((ActionConstantPool) a).constantPool); - } - ActionIf aif = null; - boolean goaif = false; - if (!a.isIgnored()) { - String varname = null; - if (a instanceof StoreTypeAction) { - StoreTypeAction sta = (StoreTypeAction) a; - varname = sta.getVariableName(stack, cpool); - } - - try { - if (a instanceof ActionIf) { - aif = (ActionIf) a; - - GraphTargetItem top = stack.pop(); - int nip = ip + actionLen + aif.getJumpOffset(); - - if (decideBranch) { - System.out.print("newip " + nip + ", "); - System.out.print("Action: jump(j),ignore(i),compute(c)?"); - if (sc == null) { - sc = new Scanner(System.in); - } - String next = sc.next(); - switch (next) { - case "j": - newip = nip; - break; - case "i": - break; - case "c": - goaif = true; - break; - } - } else if (top.isCompileTime() && (!top.hasSideEffect())) { - if (debugMode) { - System.err.print("is compiletime -> "); - } - if (EcmaScript.toBoolean(top.getResult())) { - newip = nip; - aif.jumpUsed = true; - if (debugMode) { - System.err.println("jump"); - } - } else { - aif.ignoreUsed = true; - if (debugMode) { - System.err.println("ignore"); - } - } - } else { - if (debugMode) { - System.err.println("goaif"); - } - goaif = true; - } - } else if (a instanceof ActionJump) { - newip = ip + actionLen + ((ActionJump) a).getJumpOffset(); - } else if (!(a instanceof GraphSourceItemContainer)) { - //return in for..in, TODO:Handle this better way - if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) { - stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>())); - } - if ((a instanceof ActionStoreRegister) && stack.isEmpty()) { - stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>())); - } - a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path); - } - } catch (RuntimeException ex) { - logger.log(Level.SEVERE, "Disassembly exception", ex); - break; - } - - HashMap vars = localData.variables; - if (varname != null) { - GraphTargetItem varval = vars.get(varname); - if (varval != null && varval.isCompileTime() && indeterminate) { - vars.put(varname, new NotCompileTimeItem(null, varval)); - } - } - } - for (int i = 0; i < actionLen; i++) { - ret.set(ip + i, a); - } - - if (a instanceof GraphSourceItemContainer) { - GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; - if (a instanceof Action) { - long endAddr = a.getAddress() + cnt.getHeaderSize(); - String cntName = cnt.getName(); - List> output2s = new ArrayList<>(); - for (long size : cnt.getContainerSizes()) { - if (size == 0) { - output2s.add(new ArrayList()); - continue; - } - ActionLocalData localData2; - List output2 = new ArrayList<>(); - if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) { - localData2 = new ActionLocalData(); - } else { - localData2 = localData; - } - deobfustaceActionListAtPosRecursive(listeners, output2, containers, localData2, new TranslateStack(), cpool, actions, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); - output2s.add(output2); - endAddr += size; - } - cnt.translateContainer(output2s, stack, output, localData.regNames, localData.variables, localData.functions); - ip = (int) endAddr; - continue; - } - } - - if (a instanceof ActionEnd) { - break; - } - if (goaif) { - aif.ignoreUsed = true; - aif.jumpUsed = true; - indeterminate = true; - - HashMap vars = localData.variables; - boolean stateChanged = false; - if (decisionStates.containsKey(ip)) { - HashMap oldstate = decisionStates.get(ip); - if (oldstate.size() != vars.size()) { - stateChanged = true; - } else { - for (String k : vars.keySet()) { - if (!oldstate.containsKey(k)) { - stateChanged = true; - break; - } - if (!vars.get(k).isCompileTime() && oldstate.get(k).isCompileTime()) { - stateChanged = true; - break; - } - } - } - } - HashMap curstate = new HashMap<>(); - curstate.putAll(vars); - decisionStates.put(ip, curstate); - - if ((!stateChanged) && curVisited > 1) { - List branches = new ArrayList<>(); - branches.add(ip + actionLen + aif.getJumpOffset()); - branches.add(ip + actionLen); - for (int br : branches) { - int visc = 0; - if (visited.containsKey(br)) { - visc = visited.get(br); - } - if (visc == 0) {//(localData.regNames), - new HashMap<>(localData.variables), new HashMap<>(localData.functions)); - deobfustaceActionListAtPosRecursive(listeners, output, containers, subLocalData, subStack, cpool, actions, ip + actionLen + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); - } - - if (newip > -1) { - ip = newip; - } else { - ip += info; - } - - if (a.isExit()) { - break; - } - } - for (DisassemblyListener listener : listeners) { - listener.progressDeobfuscating(ip, actions.size()); - } - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action; + +import com.jpexs.decompiler.flash.DisassemblyListener; +import com.jpexs.decompiler.flash.SWFInputStream; +import com.jpexs.decompiler.flash.action.deobfuscation.ActionDeobfuscator; +import com.jpexs.decompiler.flash.action.deobfuscation.ActionDeobfuscatorSimple; +import com.jpexs.decompiler.flash.action.model.ConstantPool; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.special.ActionDeobfuscateJump; +import com.jpexs.decompiler.flash.action.special.ActionEnd; +import com.jpexs.decompiler.flash.action.special.ActionNop; +import com.jpexs.decompiler.flash.action.special.ActionStore; +import com.jpexs.decompiler.flash.action.swf4.ActionEquals; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ActionJump; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf5.ActionConstantPool; +import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; +import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; +import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; +import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.ecma.EcmaScript; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; +import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin; +import com.jpexs.decompiler.graph.Graph; +import com.jpexs.decompiler.graph.GraphSourceItemContainer; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.NotCompileTimeItem; +import com.jpexs.decompiler.graph.TranslateException; +import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.LocalData; +import com.jpexs.helpers.CancellableWorker; +import com.jpexs.helpers.Helper; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Scanner; +import java.util.TreeMap; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Class for reading data from SWF file + * + * @author JPEXS + */ +public class ActionListReader { + + private static final Logger logger = Logger.getLogger(ActionListReader.class.getName()); + + /** + * Reads list of actions from the stream. Reading ends with + * ActionEndFlag(=0) or end of the stream. + * + * @param listeners + * @param sis + * @param version + * @param ip + * @param endIp + * @param path + * @return List of actions + * @throws IOException + * @throws java.lang.InterruptedException + * @throws java.util.concurrent.TimeoutException + */ + public static ActionList readActionListTimeout(final List listeners, final SWFInputStream sis, final int version, final int ip, final int endIp, final String path) throws IOException, InterruptedException, TimeoutException { + try { + final int deobfuscationMode = Configuration.autoDeobfuscate.get() ? Configuration.deobfuscationMode.get() : -1; + ActionList actions = CancellableWorker.call(new Callable() { + + @Override + public ActionList call() throws IOException, InterruptedException { + return readActionList(listeners, sis, version, ip, endIp, path, deobfuscationMode); + } + }, Configuration.decompilationTimeoutSingleMethod.get(), TimeUnit.SECONDS); + + return actions; + } catch (ExecutionException ex) { + Throwable cause = ex.getCause(); + if (cause instanceof InterruptedException) { + throw (InterruptedException) cause; + } else if (cause instanceof InterruptedException) { + throw (IOException) cause; + } else { + logger.log(Level.SEVERE, null, ex); + } + } + return new ActionList(); + } + + /** + * Reads list of actions from the stream. Reading ends with + * ActionEndFlag(=0) or end of the stream. + * + * @param listeners + * @param sis + * @param version + * @param ip + * @param endIp + * @param path + * @param deobfuscationMode + * @return List of actions + * @throws IOException + * @throws java.lang.InterruptedException + */ + public static ActionList readActionList(List listeners, SWFInputStream sis, int version, int ip, int endIp, String path, int deobfuscationMode) throws IOException, InterruptedException { + // Map of the actions. Use TreeMap to sort the keys in ascending order + // actionMap and nextOffsets should contain exaclty the same keys + Map actionMap = new TreeMap<>(); + Map nextOffsets = new HashMap<>(); + Action entryAction = readActionListAtPos(listeners, null, + sis, actionMap, nextOffsets, + ip, 0, endIp, path, false, new ArrayList()); + + if (actionMap.isEmpty()) { + return new ActionList(); + } + + List addresses = new ArrayList<>(actionMap.keySet()); + + // add end action + Action lastAction = actionMap.get(addresses.get(addresses.size() - 1)); + long endAddress; + if (!(lastAction instanceof ActionEnd)) { + Action aEnd = new ActionEnd(); + aEnd.setAddress(nextOffsets.get(lastAction.getAddress())); + endAddress = aEnd.getAddress(); + actionMap.put(aEnd.getAddress(), aEnd); + nextOffsets.put(endAddress, endAddress + 1); + } + + ActionList actions = fixActionList(new ActionList(actionMap.values()), nextOffsets, version); + + // jump to the entry action when it is diffrent from the first action in the map + if (entryAction != actions.get(0)) { + ActionJump jump = new ActionDeobfuscateJump(0); + actions.addAction(0, jump); + jump.setJumpOffset((int) (entryAction.getAddress() - jump.getTotalActionLength())); + } + + if (SWFDecompilerPlugin.fireActionListParsed(actions, sis.getSwf())) { + actions = fixActionList(actions, null, version); + } + + if (deobfuscationMode == 0) { + try { + actions = deobfuscateActionList(listeners, actions, version, 0, path); + updateActionLengths(actions, version); + } catch (OutOfMemoryError | StackOverflowError | TranslateException ex) { + // keep orignal (not deobfuscated) actions + logger.log(Level.SEVERE, null, ex); + } + } else if (deobfuscationMode == 1) { + try { + new ActionDeobfuscatorSimple().actionListParsed(actions, sis.getSwf()); + new ActionDeobfuscator().actionListParsed(actions, sis.getSwf()); + } catch (OutOfMemoryError | StackOverflowError | TranslateException ex) { + // keep orignal (not deobfuscated) actions + logger.log(Level.SEVERE, null, ex); + } + } + + return actions; + } + + public static ActionList fixActionList(ActionList actions, Map nextOffsets, int version) { + Map> containerLastActions = new HashMap<>(); + getContainerLastActions(actions, containerLastActions); + + ActionList ret = new ActionList(); + + if (nextOffsets != null) { + int index = 0; + while (index != -1 && index < actions.size()) { + Action action = actions.get(index); + ret.add(action); + index++; + if (index < actions.size()) { + long nextAddress = nextOffsets.get(action.getAddress()); + if (actions.get(index).getAddress() != nextAddress) { + if (!action.isExit() && !(action instanceof ActionJump)) { + ActionJump jump = new ActionDeobfuscateJump(0); + jump.setAddress(action.getAddress()); + int size = jump.getTotalActionLength(); + jump.setJumpOffset((int) (nextAddress - action.getAddress() - size)); + ret.add(jump); + } + } + } + } + } else { + ret.addAll(actions); + } + + // Map for storing the targers of the "jump" actions + // "jump" action can be ActionIf, ActionJump and any ActionStore + Map jumps = new HashMap<>(); + getJumps(ret, jumps); + + updateActionLengths(ret, version); + updateAddresses(ret, 0); + long endAddress = ret.get(ret.size() - 1).getAddress(); + + updateJumps(ret, jumps, containerLastActions, endAddress); + updateActionStores(ret, jumps); + updateContainerSizes(ret, containerLastActions); + + return ret; + } + + public static List getOriginalActions(SWFInputStream sis, int startIp, int endIp) throws IOException, InterruptedException { + // Map of the actions. Use TreeMap to sort the keys in ascending order + Map actionMap = new TreeMap<>(); + Map nextOffsets = new HashMap<>(); + readActionListAtPos(new ArrayList(), null, + sis, actionMap, nextOffsets, + startIp, startIp, endIp + 1, "", false, new ArrayList()); + + return new ArrayList<>(actionMap.values()); + } + + /** + * Reads list of actions from the stream. Reading ends with + * ActionEndFlag(=0) or end of the stream. + * + * @param listeners + * @param actions + * @param version + * @param ip + * @param path + * @return List of actions + * @throws IOException + * @throws java.lang.InterruptedException + */ + private static ActionList deobfuscateActionList(List listeners, ActionList actions, int version, int ip, String path) throws IOException, InterruptedException { + if (actions.isEmpty()) { + return actions; + } + + Action lastAction = actions.get(actions.size() - 1); + int endIp = (int) lastAction.getAddress(); + + List retMap = new ArrayList<>(endIp); + for (int i = 0; i < endIp; i++) { + retMap.add(null); + } + List actionMap = new ArrayList<>(endIp); + for (int i = 0; i <= endIp; i++) { + actionMap.add(null); + } + for (Action a : actions) { + actionMap.set((int) a.getAddress(), a); + } + + int maxRecursionLevel = 0; + for (int i = 0; i < actions.size(); i++) { + Action a = actions.get(i); + if (a instanceof ActionIf || a instanceof GraphSourceItemContainer) { + maxRecursionLevel++; + } + if (a instanceof ActionIf) { + ActionIf aif = (ActionIf) a; + aif.ignoreUsed = false; + aif.jumpUsed = false; + } + } + + deobfustaceActionListAtPosRecursive(listeners, + new ArrayList(), + new HashMap>(), + new ActionLocalData(), + new TranslateStack(path), + new ConstantPool(), + actionMap, ip, retMap, ip, endIp, path, + new HashMap(), false, + new HashMap>(), + version, 0, maxRecursionLevel); + + ActionList ret = new ActionList(); + Action last = null; + for (Action a : retMap) { + if (a != last && a != null) { + ret.add(a); + } + last = a; + } + ret.removeNops(); + ActionList reta = new ActionList(); + for (Object o : ret) { + if (o instanceof Action) { + reta.add((Action) o); + } + } + return reta; + } + + private static long getNearAddress(ActionList actions, long address, boolean next) { + int min = 0; + int max = actions.size() - 1; + + while (max >= min) { + int mid = (min + max) / 2; + long midValue = actions.get(mid).getAddress(); + if (midValue == address) { + return address; + } else if (midValue < address) { + min = mid + 1; + } else { + max = mid - 1; + } + } + + return next + ? (min < actions.size() ? actions.get(min).getAddress() : -1) + : (max >= 0 ? actions.get(max).getAddress() : -1); + } + + private static Map actionListToMap(List actions) { + Map map = new HashMap<>(actions.size()); + for (Action a : actions) { + long address = a.getAddress(); + // There are multiple actions in the same address (2nd action is a jump for obfuscated code) + // So this check is required + if (!map.containsKey(address)) { + map.put(a.getAddress(), a); + } + } + return map; + } + + private static void getJumps(List actions, Map jumps) { + Map actionMap = actionListToMap(actions); + for (Action a : actions) { + long target = -1; + if (a instanceof ActionIf) { + ActionIf aIf = (ActionIf) a; + target = aIf.getAddress() + a.getTotalActionLength() + aIf.getJumpOffset(); + } else if (a instanceof ActionJump) { + ActionJump aJump = (ActionJump) a; + target = aJump.getAddress() + a.getTotalActionLength() + aJump.getJumpOffset(); + } else if (a instanceof ActionStore) { + ActionStore aStore = (ActionStore) a; + int storeSize = aStore.getStoreSize(); + // skip storeSize + 1 actions (+1 is the current action) + Action targetAction = a; + for (int i = 0; i <= storeSize; i++) { + long address = targetAction.getAddress() + targetAction.getTotalActionLength(); + targetAction = actionMap.get(address); + if (targetAction == null) { + break; + } + } + jumps.put(a, targetAction); + } + if (target >= 0) { + Action targetAction = actionMap.get(target); + jumps.put(a, targetAction); + } + } + } + + public static List getContainerLastActions(ActionList actions, Action action) { + GraphSourceItemContainer container = (GraphSourceItemContainer) action; + List sizes = container.getContainerSizes(); + long endAddress = action.getAddress() + container.getHeaderSize(); + List lasts = new ArrayList<>(sizes.size()); + for (long size : sizes) { + endAddress += size; + long lastActionAddress = getNearAddress(actions, endAddress - 1, false); + Action lastAction = null; + if (lastActionAddress != -1) { + lastAction = actions.getByAddress(lastActionAddress); + } + lasts.add(lastAction); + } + return lasts; + } + + private static void getContainerLastActions(ActionList actions, Map> lastActions) { + for (Action a : actions) { + if (a instanceof GraphSourceItemContainer) { + lastActions.put(a, getContainerLastActions(actions, a)); + } + } + } + + private static long updateAddresses(List actions, long address) { + for (int i = 0; i < actions.size(); i++) { + Action a = actions.get(i); + a.setAddress(address); + int length = a.getTotalActionLength(); + if ((i != actions.size() - 1) && (a instanceof ActionEnd)) { + // placeholder for jump action + length = new ActionDeobfuscateJump(0).getTotalActionLength(); + } + address += length; + } + return address; + } + + private static void updateActionLengths(List actions, int version) { + for (int i = 0; i < actions.size(); i++) { + actions.get(i).updateLength(version); + } + } + + private static void updateActionStores(List actions, Map jumps) { + Map actionMap = actionListToMap(actions); + for (int i = 0; i < actions.size(); i++) { + Action a = actions.get(i); + if (a instanceof ActionStore) { + ActionStore aStore = (ActionStore) a; + Action nextActionAfterStore = jumps.get(a); + Action a1 = a; + List store = new ArrayList<>(); + while (true) { + long address = a1.getAddress() + a1.getTotalActionLength(); + a1 = actionMap.get(address); + if (a1 == null || a1 == nextActionAfterStore) { + break; + } + store.add(a1); + } + aStore.setStore(store); + } + } + } + + private static void updateContainerSizes(List actions, Map> containerLastActions) { + for (int i = 0; i < actions.size(); i++) { + Action a = actions.get(i); + if (a instanceof GraphSourceItemContainer) { + GraphSourceItemContainer container = (GraphSourceItemContainer) a; + List lastActions = containerLastActions.get(a); + long startAddress = a.getAddress() + container.getHeaderSize(); + for (int j = 0; j < lastActions.size(); j++) { + Action lastAction = lastActions.get(j); + int length = (int) (lastAction.getAddress() + lastAction.getTotalActionLength() - startAddress); + container.setContainerSize(j, length); + startAddress += length; + } + } + } + } + + private static void replaceJumpTargets(Map jumps, Action oldTarget, Action newTarget) { + for (Action a : jumps.keySet()) { + if (jumps.get(a) == oldTarget) { + jumps.put(a, newTarget); + } + } + } + + private static void replaceContainerLastActions(Map> containerLastActions, Action oldTarget, Action newTarget) { + for (Action a : containerLastActions.keySet()) { + List targets = containerLastActions.get(a); + for (int i = 0; i < targets.size(); i++) { + if (targets.get(i) == oldTarget) { + targets.set(i, newTarget); + } + } + } + } + + private static void updateJumps(List actions, Map jumps, Map> containerLastActions, long endAddress) { + if (actions.isEmpty()) { + return; + } + + for (int i = 0; i < actions.size(); i++) { + Action a = actions.get(i); + if ((i != actions.size() - 1) && (a instanceof ActionEnd)) { + ActionJump aJump = new ActionDeobfuscateJump(0); + aJump.setJumpOffset((int) (endAddress - a.getAddress() - aJump.getTotalActionLength())); + aJump.setAddress(a.getAddress()); + replaceJumpTargets(jumps, a, aJump); + replaceContainerLastActions(containerLastActions, a, aJump); + a = aJump; + actions.set(i, a); + } else if (a instanceof ActionIf) { + ActionIf aIf = (ActionIf) a; + Action target = jumps.get(a); + long offset; + if (target != null) { + offset = target.getAddress() - a.getAddress() - a.getTotalActionLength(); + } else { + offset = endAddress - a.getAddress() - a.getTotalActionLength(); + } + aIf.setJumpOffset((int) offset); + } else if (a instanceof ActionJump) { + ActionJump aJump = (ActionJump) a; + Action target = jumps.get(a); + long offset; + if (target != null) { + offset = target.getAddress() - a.getAddress() - a.getTotalActionLength(); + } else { + offset = endAddress - a.getAddress() - a.getTotalActionLength(); + } + aJump.setJumpOffset((int) offset); + } + } + } + + /** + * Removes an action from the action list, and updates all references This + * method will keep the inner actions of the container when you remove the + * container + * + * @param actions + * @param index + * @param version + * @param removeWhenLast + * @return + */ + public static boolean removeAction(ActionList actions, int index, int version, boolean removeWhenLast) { + + if (index < 0 || actions.size() <= index) { + return false; + } + + long startIp = actions.get(0).getAddress(); + Action lastAction = actions.get(actions.size() - 1); + long endAddress = lastAction.getAddress() + lastAction.getTotalActionLength(); + + Map> containerLastActions = new HashMap<>(); + getContainerLastActions(actions, containerLastActions); + + Map jumps = new HashMap<>(); + getJumps(actions, jumps); + + Action prevAction = index > 0 ? actions.get(index - 1) : null; + Action nextAction = index + 1 < actions.size() ? actions.get(index + 1) : null; + Action actionToRemove = actions.get(index); + for (Action a : containerLastActions.keySet()) { + List lastActions = containerLastActions.get(a); + for (int i = 0; i < lastActions.size(); i++) { + if (lastActions.get(i) == actionToRemove) { + if (!removeWhenLast) { + return false; + } + lastActions.set(i, prevAction); + } + } + } + for (Action a : jumps.keySet()) { + Action targetAction = jumps.get(a); + if (targetAction == actionToRemove) { + jumps.put(a, nextAction); + } + } + if (containerLastActions.containsKey(actionToRemove)) { + containerLastActions.remove(actionToRemove); + } + if (jumps.containsKey(actionToRemove)) { + jumps.remove(actionToRemove); + } + + actions.remove(index); + + updateActionLengths(actions, version); + updateAddresses(actions, startIp); + updateJumps(actions, jumps, containerLastActions, endAddress); + updateActionStores(actions, jumps); + updateContainerSizes(actions, containerLastActions); + + return true; + } + + /** + * Adds an action to the action list to the specified location, and updates + * all references + * + * @param actions + * @param index + * @param action + * @param version + * @param addToContainer + * @param replaceJump + * @return + */ + public static boolean addAction(ActionList actions, int index, Action action, + int version, boolean addToContainer, boolean replaceJump) { + + if (index < 0 || actions.size() < index) { + return false; + } + + long startIp = actions.get(0).getAddress(); + Action lastAction = actions.get(actions.size() - 1); + if (!(lastAction instanceof ActionEnd)) { + Action aEnd = new ActionEnd(); + aEnd.setAddress(lastAction.getAddress() + lastAction.getTotalActionLength()); + actions.add(aEnd); + lastAction = aEnd; + } + + long endAddress = lastAction.getAddress(); + + Map> containerLastActions = new HashMap<>(); + getContainerLastActions(actions, containerLastActions); + + Map jumps = new HashMap<>(); + List tempActions = new ArrayList<>(actions); + tempActions.add(action); + getJumps(tempActions, jumps); + + Action prevAction = actions.get(index); + if (addToContainer) { + for (Action a : containerLastActions.keySet()) { + List lastActions = containerLastActions.get(a); + for (int i = 0; i < lastActions.size(); i++) { + if (lastActions.get(i) == prevAction) { + lastActions.set(i, action); + } + } + } + } + + if (replaceJump) { + for (Action a : jumps.keySet()) { + Action targetAction = jumps.get(a); + if (targetAction == prevAction) { + jumps.put(a, action); + } + } + } + + actions.add(index, action); + + updateActionLengths(actions, version); + updateAddresses(actions, startIp); + updateJumps(actions, jumps, containerLastActions, endAddress); + updateActionStores(actions, jumps); + updateContainerSizes(actions, containerLastActions); + + return true; + } + + private static Action readActionListAtPos(List listeners, ConstantPool cpool, + SWFInputStream sis, Map actions, Map nextOffsets, + long ip, long startIp, long endIp, String path, boolean indeterminate, List visitedContainers) throws IOException { + + Action entryAction = null; + + if (visitedContainers.contains(ip)) { + return null; + } + visitedContainers.add(ip); + + Queue jumpQueue = new LinkedList<>(); + jumpQueue.add(ip); + while (!jumpQueue.isEmpty()) { + ip = jumpQueue.remove(); + if (ip < startIp) { + continue; + } + + while (endIp == -1 || endIp > ip) { + sis.seek((int) ip); + + Action a; + if ((a = sis.readAction()) == null) { + break; + } + + int actionLengthWithHeader = a.getTotalActionLength(); + + // unknown action, replace with jump + if (a instanceof ActionNop) { + ActionJump aJump = new ActionDeobfuscateJump(0); + int jumpLength = aJump.getTotalActionLength(); + aJump.setAddress(a.getAddress()); + aJump.setJumpOffset(actionLengthWithHeader - jumpLength); + a = aJump; + actionLengthWithHeader = a.getTotalActionLength(); + } + + if (entryAction == null) { + entryAction = a; + } + + Action existingAction = actions.get(ip); + if (existingAction != null) { + break; + } + + actions.put(ip, a); + nextOffsets.put(ip, ip + actionLengthWithHeader); + + long pos = sis.getPos(); + long length = pos + sis.available(); + for (int i = 0; i < listeners.size(); i++) { + listeners.get(i).progressReading(pos, length); + } + + a.setAddress(ip); + + if (a instanceof ActionPush && cpool != null) { + ((ActionPush) a).constantPool = cpool.constants; + } else if (a instanceof ActionConstantPool) { + cpool = new ConstantPool(((ActionConstantPool) a).constantPool); + } else if (a instanceof ActionIf) { + ActionIf aIf = (ActionIf) a; + long nIp = ip + actionLengthWithHeader + aIf.getJumpOffset(); + if (nIp >= 0) { + jumpQueue.add(nIp); + } + } else if (a instanceof ActionJump) { + ActionJump aJump = (ActionJump) a; + long nIp = ip + actionLengthWithHeader + aJump.getJumpOffset(); + if (nIp >= 0) { + jumpQueue.add(nIp); + } + break; + } else if (a instanceof GraphSourceItemContainer) { + GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; + String cntName = cnt.getName(); + String newPath = path + (cntName == null ? "" : "/" + cntName); + for (long size : cnt.getContainerSizes()) { + if (size != 0) { + long ip2 = ip + actionLengthWithHeader; + long endIp2 = ip + actionLengthWithHeader + size; + readActionListAtPos(listeners, cpool, + sis, actions, nextOffsets, + ip2, startIp, endIp2, newPath, indeterminate, visitedContainers); + actionLengthWithHeader += size; + } + } + } + + ip += actionLengthWithHeader; + + if (a.isExit()) { + break; + } + } + } + return entryAction; + } + + private static void deobfustaceActionListAtPosRecursive(List listeners, List output, HashMap> containers, ActionLocalData localData, TranslateStack stack, ConstantPool cpool, List actions, int ip, List ret, int startIp, int endip, String path, Map visited, boolean indeterminate, Map> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException { + boolean debugMode = false; + boolean decideBranch = false; + + if (recursionLevel > maxRecursionLevel + 1) { + throw new TranslateException("deobfustaceActionListAtPosRecursive max recursion level reached."); + } + + Action a; + Scanner sc = null; + loopip: + while (((endip == -1) || (endip > ip)) && (a = actions.get(ip)) != null) { + if (Thread.currentThread().isInterrupted()) { + throw new InterruptedException(); + } + + int actionLen = a.getTotalActionLength(); + if (!visited.containsKey(ip)) { + visited.put(ip, 0); + } + int curVisited = visited.get(ip); + curVisited++; + visited.put(ip, curVisited); + for (int i = 0; i < listeners.size(); i++) { + listeners.get(i).progressDeobfuscating(ip, actions.size()); + } + int info = a.getTotalActionLength(); + + if (a instanceof ActionPush) { + if (cpool != null) { + ((ActionPush) a).constantPool = cpool.constants; + } + } + + if (debugMode) { + String atos = a.getASMSource(new ActionList(), new HashSet(), ScriptExportMode.PCODE); + if (a instanceof GraphSourceItemContainer) { + atos = a.toString(); + } + System.err.println("readActionListAtPos ip: " + (ip - startIp) + " (0x" + Helper.formatAddress(ip - startIp) + ") " + " action(len " + a.actionLength + "): " + atos + (a.isIgnored() ? " (ignored)" : "") + " stack:" + Helper.stackToString(stack, LocalData.create(cpool)) + " " + Helper.byteArrToString(a.getBytes(version))); + System.err.print("variables: "); + for (Map.Entry v : localData.variables.entrySet()) { + System.err.print("'" + v + "' = " + v.getValue().toString(LocalData.create(cpool)) + ", "); + } + System.err.println(); + String add = ""; + if (a instanceof ActionIf) { + add = " change: " + ((ActionIf) a).getJumpOffset(); + } + if (a instanceof ActionJump) { + add = " change: " + ((ActionJump) a).getJumpOffset(); + } + System.err.println(add); + } + + int newip = -1; + + if (a instanceof ActionConstantPool) { + if (cpool == null) { + cpool = new ConstantPool(); + } + cpool.setNew(((ActionConstantPool) a).constantPool); + } + ActionIf aif = null; + boolean goaif = false; + if (!a.isIgnored()) { + String varname = null; + if (a instanceof StoreTypeAction) { + StoreTypeAction sta = (StoreTypeAction) a; + varname = sta.getVariableName(stack, cpool); + } + + try { + if (a instanceof ActionIf) { + aif = (ActionIf) a; + + GraphTargetItem top = stack.pop(); + int nip = ip + actionLen + aif.getJumpOffset(); + + if (decideBranch) { + System.out.print("newip " + nip + ", "); + System.out.print("Action: jump(j),ignore(i),compute(c)?"); + if (sc == null) { + sc = new Scanner(System.in); + } + String next = sc.next(); + switch (next) { + case "j": + newip = nip; + break; + case "i": + break; + case "c": + goaif = true; + break; + } + } else if (top.isCompileTime() && (!top.hasSideEffect())) { + if (debugMode) { + System.err.print("is compiletime -> "); + } + if (EcmaScript.toBoolean(top.getResult())) { + newip = nip; + aif.jumpUsed = true; + if (debugMode) { + System.err.println("jump"); + } + } else { + aif.ignoreUsed = true; + if (debugMode) { + System.err.println("ignore"); + } + } + } else { + if (debugMode) { + System.err.println("goaif"); + } + goaif = true; + } + } else if (a instanceof ActionJump) { + newip = ip + actionLen + ((ActionJump) a).getJumpOffset(); + } else if (!(a instanceof GraphSourceItemContainer)) { + //return in for..in, TODO:Handle this better way + if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) { + stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); + } + if ((a instanceof ActionStoreRegister) && stack.isEmpty()) { + stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); + } + a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path); + } + } catch (RuntimeException ex) { + logger.log(Level.SEVERE, "Disassembly exception", ex); + break; + } + + HashMap vars = localData.variables; + if (varname != null) { + GraphTargetItem varval = vars.get(varname); + if (varval != null && varval.isCompileTime() && indeterminate) { + vars.put(varname, new NotCompileTimeItem(null, varval)); + } + } + } + for (int i = 0; i < actionLen; i++) { + ret.set(ip + i, a); + } + + if (a instanceof GraphSourceItemContainer) { + GraphSourceItemContainer cnt = (GraphSourceItemContainer) a; + if (a instanceof Action) { + long endAddr = a.getAddress() + cnt.getHeaderSize(); + String cntName = cnt.getName(); + List> output2s = new ArrayList<>(); + for (long size : cnt.getContainerSizes()) { + if (size == 0) { + output2s.add(new ArrayList()); + continue; + } + ActionLocalData localData2; + List output2 = new ArrayList<>(); + if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) { + localData2 = new ActionLocalData(); + } else { + localData2 = localData; + } + deobfustaceActionListAtPosRecursive(listeners, output2, containers, localData2, new TranslateStack(path), cpool, actions, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); + output2s.add(output2); + endAddr += size; + } + cnt.translateContainer(output2s, stack, output, localData.regNames, localData.variables, localData.functions); + ip = (int) endAddr; + continue; + } + } + + if (a instanceof ActionEnd) { + break; + } + if (goaif) { + aif.ignoreUsed = true; + aif.jumpUsed = true; + indeterminate = true; + + HashMap vars = localData.variables; + boolean stateChanged = false; + if (decisionStates.containsKey(ip)) { + HashMap oldstate = decisionStates.get(ip); + if (oldstate.size() != vars.size()) { + stateChanged = true; + } else { + for (String k : vars.keySet()) { + if (!oldstate.containsKey(k)) { + stateChanged = true; + break; + } + if (!vars.get(k).isCompileTime() && oldstate.get(k).isCompileTime()) { + stateChanged = true; + break; + } + } + } + } + HashMap curstate = new HashMap<>(); + curstate.putAll(vars); + decisionStates.put(ip, curstate); + + if ((!stateChanged) && curVisited > 1) { + List branches = new ArrayList<>(); + branches.add(ip + actionLen + aif.getJumpOffset()); + branches.add(ip + actionLen); + for (int br : branches) { + int visc = 0; + if (visited.containsKey(br)) { + visc = visited.get(br); + } + if (visc == 0) {//(localData.regNames), + new HashMap<>(localData.variables), new HashMap<>(localData.functions)); + deobfustaceActionListAtPosRecursive(listeners, output, containers, subLocalData, subStack, cpool, actions, ip + actionLen + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); + } + + if (newip > -1) { + ip = newip; + } else { + ip += info; + } + + if (a.isExit()) { + break; + } + } + for (DisassemblyListener listener : listeners) { + listener.progressDeobfuscating(ip, actions.size()); + } + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index 802b3342c..b51764d96 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -223,7 +223,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple { private void executeActions(ActionList actions, int idx, int endIdx, ActionConstantPool constantPool, ExecutionResult result, Map fakeFunctions) { List output = new ArrayList<>(); ActionLocalData localData = new ActionLocalData(); - FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack(); + FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack(""); int instructionsProcessed = 0; ActionConstantPool lastConstantPool = null; @@ -442,7 +442,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple { public Set defines = new HashSet<>(); - public TranslateStack stack = new TranslateStack(); + public TranslateStack stack = new TranslateStack("?"); public Object resultValue; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscatorSimple.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscatorSimple.java index 2bea33d89..6b90466f7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscatorSimple.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscatorSimple.java @@ -273,7 +273,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener { private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) { List output = new ArrayList<>(); ActionLocalData localData = new ActionLocalData(); - FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack(); + FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack(""); int instructionsProcessed = 0; try { @@ -388,7 +388,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener { public int instructionsProcessed = -1; - public TranslateStack stack = new TranslateStack(); + public TranslateStack stack = new TranslateStack("?"); public Object resultValue; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/FixItemCounterTranslateStack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/FixItemCounterTranslateStack.java index 133476812..677710042 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/FixItemCounterTranslateStack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/FixItemCounterTranslateStack.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.deobfuscation; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -26,6 +27,10 @@ public class FixItemCounterTranslateStack extends TranslateStack { private int fixItemCount = Integer.MAX_VALUE; + public FixItemCounterTranslateStack(String path) { + super(null); //null path => do not add PushItems + } + @Override public GraphTargetItem pop() { GraphTargetItem result = super.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index 8536e4da7..4dc97afc0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; @@ -34,7 +35,7 @@ import java.util.List; import java.util.Objects; import java.util.Set; -public class DirectValueActionItem extends ActionItem { +public class DirectValueActionItem extends ActionItem implements SimpleValue { public Object value; @@ -91,6 +92,11 @@ public class DirectValueActionItem extends ActionItem { return value; } + @Override + public boolean isSimpleValue() { + return !(value instanceof RegisterNumber); + } + @Override public String toStringNoQuotes(LocalData localData) { if (value instanceof Double) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java index 99809b9aa..e286e5053 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -41,8 +42,9 @@ public class EnumerateActionItem extends ActionItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.append("enumerate "); - return object.toString(writer, localData); + writer.append("§§enumerate("); + object.toString(writer, localData); + return writer.append(")"); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java index 1508f005f..4408950b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -48,7 +49,7 @@ public class EqActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new NeqActionItem(src, leftSide, rightSide, version2); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java index 30bb365a3..c33f6375f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -58,7 +59,7 @@ public class GeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new LtActionItem(src, leftSide, rightSide, version2); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java index 7cb210db6..29b3a6528 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -42,7 +43,7 @@ public class GtActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new LeActionItem(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/Inverted.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/Inverted.java index 834c918ec..df7e5ac6e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/Inverted.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/Inverted.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; /** @@ -23,5 +25,5 @@ import com.jpexs.decompiler.graph.GraphTargetItem; */ public interface Inverted { - public GraphTargetItem invert(); + public GraphTargetItem invert(GraphSourceItem src); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java index 9cbeb028a..76ef25950 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java @@ -50,7 +50,7 @@ public class LeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new GtActionItem(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java index 87f51504d..9d4b8c702 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -50,7 +51,7 @@ public class LtActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem neqSrc) { return new GeActionItem(src, leftSide, rightSide, version2); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java index 463efa58a..2b2a31bfd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java @@ -49,7 +49,7 @@ public class NeqActionItem extends BinaryOpItem implements LogicalOpItem, Invert } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new EqActionItem(src, leftSide, rightSide, version2); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java index 91ab8b2cc..c25133620 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java @@ -42,7 +42,7 @@ public class StrictEqActionItem extends BinaryOpItem implements LogicalOpItem, I } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StrictNeqActionItem(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java index f7331a689..47f6986da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java @@ -43,7 +43,7 @@ public class StrictNeqActionItem extends BinaryOpItem implements LogicalOpItem, } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StrictEqActionItem(src, leftSide, rightSide); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java index 0b0d9a432..f122b47de 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java @@ -48,7 +48,7 @@ public class StringEqActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringNeActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGeActionItem.java index 84c262ffd..dabc07d66 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGeActionItem.java @@ -49,7 +49,7 @@ public class StringGeActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringLtActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGtActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGtActionItem.java index 941d8d00e..1df7f826a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGtActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringGtActionItem.java @@ -54,7 +54,7 @@ public class StringGtActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringLeActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLeActionItem.java index 4815f27cd..4f42a55b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLeActionItem.java @@ -57,7 +57,7 @@ public class StringLeActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringGtActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java index f90ac8046..c85bfa334 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java @@ -48,7 +48,7 @@ public class StringLtActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringGeActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringNeActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringNeActionItem.java index f24f2d5da..9027886d3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringNeActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/operations/StringNeActionItem.java @@ -49,7 +49,7 @@ public class StringNeActionItem extends BinaryOpItem implements Inverted { } @Override - public GraphTargetItem invert() { + public GraphTargetItem invert(GraphSourceItem negSrc) { return new StringEqActionItem(src, leftSide, rightSide); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptLexer.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptLexer.java index 04477c044..12a1d8506 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptLexer.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptLexer.java @@ -17,1253 +17,1207 @@ * License along with this library. */ package com.jpexs.decompiler.flash.action.parser.script; - import com.jpexs.decompiler.flash.action.parser.ActionParseException; import java.util.ArrayList; import java.util.List; import java.util.Stack; + /** - * This class is a scanner generated by - * JFlex 1.6.0 from the specification file - * D:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript_script.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_script.flex */ public final class ActionScriptLexer { - /** - * This character denotes the end of file - */ - public static final int YYEOF = -1; + /** This character denotes the end of file */ + public static final int YYEOF = -1; - /** - * initial size of the lookahead buffer - */ - private static final int ZZ_BUFFERSIZE = 16384; + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; - /** - * lexical states - */ - public static final int YYINITIAL = 0; + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int STRING = 2; + public static final int CHARLITERAL = 4; + public static final int XMLSTARTTAG = 6; + public static final int XML = 8; + public static final int OIDENTIFIER = 10; - public static final int STRING = 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, 3, 3, 4, 4, 5, 5 + }; - public static final int CHARLITERAL = 4; + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\121\1\122\1\1\16\7\4\0\1\14\1\110"+ + "\1\16\1\0\1\6\1\117\1\113\1\30\1\100\1\101\1\5\1\115"+ + "\1\107\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\106"+ + "\1\12\1\15\1\13\1\112\1\120\1\62\1\22\1\72\1\73\1\25"+ + "\1\64\1\6\1\66\1\77\2\6\1\70\1\71\1\76\1\6\1\75"+ + "\1\67\1\6\1\63\1\65\1\61\1\74\1\6\1\21\2\6\1\104"+ + "\1\27\1\105\1\116\1\6\1\0\1\35\1\32\1\37\1\46\1\34"+ + "\1\47\1\60\1\52\1\44\1\6\1\36\1\50\1\55\1\42\1\41"+ + "\1\53\1\6\1\33\1\40\1\43\1\45\1\56\1\51\1\57\1\54"+ + "\1\6\1\102\1\114\1\103\1\111\6\7\1\123\32\7\2\0\4\6"+ + "\1\0\1\31\2\0\1\6\2\0\1\7\7\0\1\6\4\0\1\6"+ + "\5\0\27\6\1\0\37\6\1\0\u01ca\6\4\0\14\6\16\0\5\6"+ + "\7\0\1\6\1\0\1\6\21\0\160\7\5\6\1\0\2\6\2\0"+ + "\4\6\10\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6\1\0"+ + "\123\6\1\0\213\6\1\0\5\7\2\0\236\6\11\0\46\6\2\0"+ + "\1\6\7\0\47\6\7\0\1\6\1\0\55\7\1\0\1\7\1\0"+ + "\2\7\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\15\0"+ + "\5\7\6\0\1\6\4\0\13\7\5\0\53\6\37\7\4\0\2\6"+ + "\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6\2\7\1\0"+ + "\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7\1\6\1\7"+ + "\36\6\33\7\2\0\131\6\13\7\1\6\16\0\12\7\41\6\11\7"+ + "\2\6\4\0\1\6\5\0\26\6\4\7\1\6\11\7\1\6\3\7"+ + "\1\6\5\7\22\0\31\6\3\7\104\0\1\6\1\0\13\6\67\0"+ + "\33\7\1\0\4\7\66\6\3\7\1\6\22\7\1\6\7\7\12\6"+ + "\2\7\2\0\12\7\1\0\7\6\1\0\7\6\1\0\3\7\1\0"+ + "\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\1\6\3\0"+ + "\4\6\2\0\1\7\1\6\7\7\2\0\2\7\2\0\3\7\1\6"+ + "\10\0\1\7\4\0\2\6\1\0\3\6\2\7\2\0\12\7\4\6"+ + "\7\0\1\6\5\0\3\7\1\0\6\6\4\0\2\6\2\0\26\6"+ + "\1\0\7\6\1\0\2\6\1\0\2\6\1\0\2\6\2\0\1\7"+ + "\1\0\5\7\4\0\2\7\2\0\3\7\3\0\1\7\7\0\4\6"+ + "\1\0\1\6\7\0\14\7\3\6\1\7\13\0\3\7\1\0\11\6"+ + "\1\0\3\6\1\0\26\6\1\0\7\6\1\0\2\6\1\0\5\6"+ + "\2\0\1\7\1\6\10\7\1\0\3\7\1\0\3\7\2\0\1\6"+ + "\17\0\2\6\2\7\2\0\12\7\1\0\1\6\17\0\3\7\1\0"+ + "\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0"+ + "\5\6\2\0\1\7\1\6\7\7\2\0\2\7\2\0\3\7\10\0"+ + "\2\7\4\0\2\6\1\0\3\6\2\7\2\0\12\7\1\0\1\6"+ + "\20\0\1\7\1\6\1\0\6\6\3\0\3\6\1\0\4\6\3\0"+ + "\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0\3\6\3\0"+ + "\14\6\4\0\5\7\3\0\3\7\1\0\4\7\2\0\1\6\6\0"+ + "\1\7\16\0\12\7\11\0\1\6\7\0\3\7\1\0\10\6\1\0"+ + "\3\6\1\0\27\6\1\0\12\6\1\0\5\6\3\0\1\6\7\7"+ + "\1\0\3\7\1\0\4\7\7\0\2\7\1\0\2\6\6\0\2\6"+ + "\2\7\2\0\12\7\22\0\2\7\1\0\10\6\1\0\3\6\1\0"+ + "\27\6\1\0\12\6\1\0\5\6\2\0\1\7\1\6\7\7\1\0"+ + "\3\7\1\0\4\7\7\0\2\7\7\0\1\6\1\0\2\6\2\7"+ + "\2\0\12\7\1\0\2\6\17\0\2\7\1\0\10\6\1\0\3\6"+ + "\1\0\51\6\2\0\1\6\7\7\1\0\3\7\1\0\4\7\1\6"+ + "\10\0\1\7\10\0\2\6\2\7\2\0\12\7\12\0\6\6\2\0"+ + "\2\7\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0"+ + "\7\6\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7\22\0"+ + "\2\7\15\0\60\6\1\7\2\6\7\7\4\0\10\6\10\7\1\0"+ + "\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6\2\0"+ + "\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6\1\0"+ + "\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0\2\7"+ + "\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7\2\0"+ + "\4\6\40\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7\1\0"+ + "\1\7\1\0\1\7\4\0\2\7\10\6\1\0\44\6\4\0\24\7"+ + "\1\0\2\7\5\6\13\7\1\0\44\7\11\0\1\7\71\0\53\6"+ + "\24\7\1\6\12\7\6\0\6\6\4\7\4\6\3\7\1\6\3\7"+ + "\2\6\7\7\3\6\4\7\15\6\14\7\1\6\17\7\2\0\46\6"+ + "\1\0\1\6\5\0\1\6\2\0\53\6\1\0\u014d\6\1\0\4\6"+ + "\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6\1\0\4\6"+ + "\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6"+ + "\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6\2\0\3\7"+ + "\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6\1\0\32\6"+ + "\5\0\113\6\3\0\3\6\17\0\15\6\1\0\4\6\3\7\13\0"+ + "\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0\3\6\1\0"+ + "\2\7\14\0\64\6\40\7\3\0\1\6\3\0\2\6\1\7\2\0"+ + "\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0\51\6\1\7"+ + "\1\6\5\0\106\6\12\0\35\6\3\0\14\7\4\0\14\7\12\0"+ + "\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7\7\6\2\7"+ + "\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7\1\0\35\7"+ + "\2\0\13\7\6\0\12\7\15\0\1\6\130\0\5\7\57\6\21\7"+ + "\7\6\4\0\12\7\21\0\11\7\14\0\3\7\36\6\15\7\2\6"+ + "\12\7\54\6\16\7\14\0\44\6\24\7\10\0\12\7\3\0\3\6"+ + "\12\7\44\6\122\0\3\7\1\0\25\7\4\6\1\7\4\6\3\7"+ + "\2\6\11\0\300\6\47\7\25\0\4\7\u0116\6\2\0\6\6\2\0"+ + "\46\6\2\0\6\6\2\0\10\6\1\0\1\6\1\0\1\6\1\0"+ + "\1\6\1\0\37\6\2\0\65\6\1\0\7\6\1\0\1\6\3\0"+ + "\3\6\1\0\7\6\3\0\4\6\2\0\6\6\4\0\15\6\5\0"+ + "\3\6\1\0\7\6\16\0\5\7\30\0\1\121\1\121\5\7\20\0"+ + "\2\6\23\0\1\6\13\0\5\7\5\0\6\7\1\0\1\6\15\0"+ + "\1\6\20\0\15\6\3\0\33\6\25\0\15\7\4\0\1\7\3\0"+ + "\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6\3\0"+ + "\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6\1\0"+ + "\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\51\6\u0a77\0"+ + "\57\6\1\0\57\6\1\0\205\6\6\0\4\6\3\7\2\6\14\0"+ + "\46\6\1\0\1\6\5\0\1\6\2\0\70\6\7\0\1\6\17\0"+ + "\1\7\27\6\11\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6"+ + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\40\7"+ + "\57\0\1\6\u01d5\0\3\6\31\0\11\6\6\7\1\0\5\6\2\0"+ + "\5\6\4\0\126\6\2\0\2\7\2\0\3\6\1\0\132\6\1\0"+ + "\4\6\5\0\51\6\3\0\136\6\21\0\33\6\65\0\20\6\u0200\0"+ + "\u19b6\6\112\0\u51cd\6\63\0\u048d\6\103\0\56\6\2\0\u010d\6\3\0"+ + "\20\6\12\7\2\6\24\0\57\6\1\7\4\0\12\7\1\0\31\6"+ + "\7\0\1\7\120\6\2\7\45\0\11\6\2\0\147\6\2\0\4\6"+ + "\1\0\4\6\14\0\13\6\115\0\12\6\1\7\3\6\1\7\4\6"+ + "\1\7\27\6\5\7\20\0\1\6\7\0\64\6\14\0\2\7\62\6"+ + "\21\7\13\0\12\7\6\0\22\7\6\6\3\0\1\6\4\0\12\7"+ + "\34\6\10\7\2\0\27\6\15\7\14\0\35\6\3\0\4\7\57\6"+ + "\16\7\16\0\1\6\12\7\46\0\51\6\16\7\11\0\3\6\1\7"+ + "\10\6\2\7\2\0\12\7\6\0\27\6\3\0\1\6\1\7\4\0"+ + "\60\6\1\7\1\6\3\7\2\6\2\7\5\6\2\7\1\6\1\7"+ + "\1\6\30\0\3\6\2\0\13\6\5\7\2\0\3\6\2\7\12\0"+ + "\6\6\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\221\0"+ + "\43\6\10\7\1\0\2\7\2\0\12\7\6\0\u2ba4\6\14\0\27\6"+ + "\4\0\61\6\u2104\0\u016e\6\2\0\152\6\46\0\7\6\14\0\5\6"+ + "\5\0\1\6\1\7\12\6\1\0\15\6\1\0\5\6\1\0\1\6"+ + "\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0\100\6"+ + "\2\0\66\6\50\0\15\6\3\0\20\7\20\0\7\7\14\0\2\6"+ + "\30\0\3\6\31\0\1\6\6\0\5\6\1\0\207\6\2\0\1\7"+ + "\4\0\1\6\13\0\12\7\7\0\32\6\4\0\1\6\1\0\32\6"+ + "\13\0\131\6\3\0\6\6\2\0\6\6\2\0\6\6\2\0\3\6"+ + "\3\0\2\6\3\0\2\6\22\0\3\7\4\0\14\6\1\0\32\6"+ + "\1\0\23\6\1\0\2\6\1\0\17\6\2\0\16\6\42\0\173\6"+ + "\105\0\65\6\210\0\1\7\202\0\35\6\3\0\61\6\57\0\37\6"+ + "\21\0\33\6\65\0\36\6\2\0\44\6\4\0\10\6\1\0\5\6"+ + "\52\0\236\6\2\0\12\7\u0356\0\6\6\2\0\1\6\1\0\54\6"+ + "\1\0\2\6\3\0\1\6\2\0\27\6\252\0\26\6\12\0\32\6"+ + "\106\0\70\6\6\0\2\6\100\0\1\6\3\7\1\0\2\7\5\0"+ + "\4\7\4\6\1\0\3\6\1\0\33\6\4\0\3\7\4\0\1\7"+ + "\40\0\35\6\203\0\66\6\12\0\26\6\12\0\23\6\215\0\111\6"+ + "\u03b7\0\3\7\65\6\17\7\37\0\12\7\20\0\3\7\55\6\13\7"+ + "\2\0\1\7\22\0\31\6\7\0\12\7\6\0\3\7\44\6\16\7"+ + "\1\0\12\7\100\0\3\7\60\6\16\7\4\6\13\0\12\7\u04a6\0"+ + "\53\6\15\7\10\0\12\7\u0936\0\u036f\6\221\0\143\6\u0b9d\0\u042f\6"+ + "\u33d1\0\u0239\6\u04c7\0\105\6\13\0\1\6\56\7\20\0\4\7\15\6"+ + "\u4060\0\2\6\u2163\0\5\7\3\0\26\7\2\0\7\7\36\0\4\7"+ + "\224\0\3\7\u01bb\0\125\6\1\0\107\6\1\0\2\6\2\0\1\6"+ + "\2\0\2\6\2\0\4\6\1\0\14\6\1\0\1\6\1\0\7\6"+ + "\1\0\101\6\1\0\4\6\2\0\10\6\1\0\7\6\1\0\34\6"+ + "\1\0\4\6\1\0\5\6\1\0\1\6\3\0\7\6\1\0\u0154\6"+ + "\2\0\31\6\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6"+ + "\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6\1\0\31\6"+ + "\1\0\10\6\2\0\62\7\u1600\0\4\6\1\0\33\6\1\0\2\6"+ + "\1\0\1\6\2\0\1\6\1\0\12\6\1\0\4\6\1\0\1\6"+ + "\1\0\1\6\6\0\1\6\4\0\1\6\1\0\1\6\1\0\1\6"+ + "\1\0\3\6\1\0\2\6\1\0\1\6\2\0\1\6\1\0\1\6"+ + "\1\0\1\6\1\0\1\6\1\0\1\6\1\0\2\6\1\0\1\6"+ + "\2\0\4\6\1\0\7\6\1\0\4\6\1\0\4\6\1\0\1\6"+ + "\1\0\12\6\1\0\21\6\5\0\3\6\1\0\5\6\1\0\21\6"+ + "\u1144\0\ua6d7\6\51\0\u1035\6\13\0\336\6\u3fe2\0\u021e\6\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u05ee\0"+ + "\1\7\36\0\140\7\200\0\360\7\uffff\0\uffff\0\ufe12\0"; - public static final int XMLSTARTTAG = 6; + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - public static final int XML = 8; + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); - public static final int OIDENTIFIER = 10; + private static final String ZZ_ACTION_PACKED_0 = + "\6\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7"+ + "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17"+ + "\1\20\26\6\1\21\1\22\1\23\1\24\1\25\1\26"+ + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"+ + "\1\37\1\40\1\41\1\42\2\43\1\44\1\1\1\42"+ + "\1\1\2\45\1\42\1\1\1\46\2\42\2\47\2\42"+ + "\1\1\1\50\1\3\1\0\1\51\1\52\1\53\2\0"+ + "\1\54\1\0\1\55\1\56\1\57\1\60\1\61\1\62"+ + "\1\63\1\54\1\0\2\63\1\0\1\64\1\65\1\0"+ + "\7\6\1\66\11\6\1\67\12\6\1\70\1\71\1\72"+ + "\4\6\1\73\30\6\1\56\1\74\1\75\1\76\1\77"+ + "\1\100\1\101\1\102\1\103\1\104\1\105\1\104\1\106"+ + "\1\107\1\110\1\111\1\112\1\113\1\104\1\114\1\104"+ + "\6\0\1\115\1\116\2\115\2\3\2\0\1\117\3\0"+ + "\1\120\1\0\1\121\1\122\1\123\1\124\2\125\1\63"+ + "\1\54\1\0\1\126\10\6\1\127\5\6\1\130\1\131"+ + "\5\6\1\132\1\6\1\133\5\6\1\134\7\6\1\135"+ + "\2\6\1\136\10\6\1\137\20\6\1\140\1\6\1\141"+ + "\2\6\1\142\2\6\1\143\12\0\1\144\5\0\1\145"+ + "\1\125\1\63\4\6\1\146\1\147\1\150\1\6\1\151"+ + "\1\6\1\152\5\6\1\153\7\6\1\154\1\6\1\155"+ + "\4\6\1\156\22\6\1\157\7\6\1\160\4\6\1\161"+ + "\7\6\1\162\1\0\1\163\1\42\1\0\1\164\12\0"+ + "\1\125\1\63\1\165\4\6\1\166\1\167\1\6\1\170"+ + "\5\6\1\171\5\6\1\172\3\6\1\173\14\6\1\174"+ + "\6\6\1\175\2\6\1\176\3\6\1\177\1\6\1\200"+ + "\10\6\10\0\1\125\1\63\1\201\1\6\1\202\3\6"+ + "\1\203\2\6\1\204\1\205\7\6\1\206\4\6\1\207"+ + "\4\6\1\210\5\6\1\211\10\6\1\212\2\6\1\213"+ + "\3\6\1\214\1\215\1\6\2\0\1\120\1\125\1\63"+ + "\1\6\1\216\5\6\1\217\14\6\1\220\1\6\1\221"+ + "\1\6\1\222\7\6\1\223\1\224\6\6\1\42\1\125"+ + "\1\63\1\6\1\225\2\6\1\226\1\227\6\6\1\230"+ + "\7\6\1\231\5\6\1\232\1\6\1\233\1\234\3\6"+ + "\1\235\1\125\1\63\1\6\1\236\1\6\1\237\1\240"+ + "\4\6\1\241\2\6\1\242\2\6\1\243\1\244\1\6"+ + "\1\245\1\246\5\6\1\125\1\63\2\6\1\247\1\250"+ + "\1\6\1\251\1\6\1\252\6\6\1\253\2\6\1\63"+ + "\4\6\1\254\4\6\1\255\1\256\1\257\1\63\6\6"+ + "\1\260\2\6\1\63\1\6\1\261\1\6\1\262\2\6"+ + "\1\263\1\264\1\63\2\6\1\265\3\6\1\63\1\266"+ + "\4\6\1\63\2\6\1\267\1\270\1\271\1\6\1\272"; - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the - * beginning of a line l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 - }; + private static int [] zzUnpackAction() { + int [] result = new int[707]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED - = "\11\7\1\3\1\2\1\121\1\122\1\1\16\7\4\0\1\14\1\110" - + "\1\16\1\0\1\6\1\117\1\113\1\30\1\100\1\101\1\5\1\115" - + "\1\107\1\26\1\11\1\4\1\17\3\23\4\24\2\20\1\10\1\106" - + "\1\12\1\15\1\13\1\112\1\120\1\62\1\22\1\72\1\73\1\25" - + "\1\64\1\6\1\66\1\77\2\6\1\70\1\71\1\76\1\6\1\75" - + "\1\67\1\6\1\63\1\65\1\61\1\74\1\6\1\21\2\6\1\104" - + "\1\27\1\105\1\116\1\6\1\0\1\35\1\32\1\37\1\46\1\34" - + "\1\47\1\60\1\52\1\44\1\6\1\36\1\50\1\55\1\42\1\41" - + "\1\53\1\6\1\33\1\40\1\43\1\45\1\56\1\51\1\57\1\54" - + "\1\6\1\102\1\114\1\103\1\111\6\7\1\123\32\7\2\0\4\6" - + "\1\0\1\31\2\0\1\6\2\0\1\7\7\0\1\6\4\0\1\6" - + "\5\0\27\6\1\0\37\6\1\0\u01ca\6\4\0\14\6\16\0\5\6" - + "\7\0\1\6\1\0\1\6\21\0\160\7\5\6\1\0\2\6\2\0" - + "\4\6\10\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6\1\0" - + "\123\6\1\0\213\6\1\0\5\7\2\0\236\6\11\0\46\6\2\0" - + "\1\6\7\0\47\6\7\0\1\6\1\0\55\7\1\0\1\7\1\0" - + "\2\7\1\0\2\7\1\0\1\7\10\0\33\6\5\0\3\6\15\0" - + "\5\7\6\0\1\6\4\0\13\7\5\0\53\6\37\7\4\0\2\6" - + "\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6\2\7\1\0" - + "\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7\1\6\1\7" - + "\36\6\33\7\2\0\131\6\13\7\1\6\16\0\12\7\41\6\11\7" - + "\2\6\4\0\1\6\5\0\26\6\4\7\1\6\11\7\1\6\3\7" - + "\1\6\5\7\22\0\31\6\3\7\104\0\1\6\1\0\13\6\67\0" - + "\33\7\1\0\4\7\66\6\3\7\1\6\22\7\1\6\7\7\12\6" - + "\2\7\2\0\12\7\1\0\7\6\1\0\7\6\1\0\3\7\1\0" - + "\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\1\6\3\0" - + "\4\6\2\0\1\7\1\6\7\7\2\0\2\7\2\0\3\7\1\6" - + "\10\0\1\7\4\0\2\6\1\0\3\6\2\7\2\0\12\7\4\6" - + "\7\0\1\6\5\0\3\7\1\0\6\6\4\0\2\6\2\0\26\6" - + "\1\0\7\6\1\0\2\6\1\0\2\6\1\0\2\6\2\0\1\7" - + "\1\0\5\7\4\0\2\7\2\0\3\7\3\0\1\7\7\0\4\6" - + "\1\0\1\6\7\0\14\7\3\6\1\7\13\0\3\7\1\0\11\6" - + "\1\0\3\6\1\0\26\6\1\0\7\6\1\0\2\6\1\0\5\6" - + "\2\0\1\7\1\6\10\7\1\0\3\7\1\0\3\7\2\0\1\6" - + "\17\0\2\6\2\7\2\0\12\7\1\0\1\6\17\0\3\7\1\0" - + "\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0" - + "\5\6\2\0\1\7\1\6\7\7\2\0\2\7\2\0\3\7\10\0" - + "\2\7\4\0\2\6\1\0\3\6\2\7\2\0\12\7\1\0\1\6" - + "\20\0\1\7\1\6\1\0\6\6\3\0\3\6\1\0\4\6\3\0" - + "\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0\3\6\3\0" - + "\14\6\4\0\5\7\3\0\3\7\1\0\4\7\2\0\1\6\6\0" - + "\1\7\16\0\12\7\11\0\1\6\7\0\3\7\1\0\10\6\1\0" - + "\3\6\1\0\27\6\1\0\12\6\1\0\5\6\3\0\1\6\7\7" - + "\1\0\3\7\1\0\4\7\7\0\2\7\1\0\2\6\6\0\2\6" - + "\2\7\2\0\12\7\22\0\2\7\1\0\10\6\1\0\3\6\1\0" - + "\27\6\1\0\12\6\1\0\5\6\2\0\1\7\1\6\7\7\1\0" - + "\3\7\1\0\4\7\7\0\2\7\7\0\1\6\1\0\2\6\2\7" - + "\2\0\12\7\1\0\2\6\17\0\2\7\1\0\10\6\1\0\3\6" - + "\1\0\51\6\2\0\1\6\7\7\1\0\3\7\1\0\4\7\1\6" - + "\10\0\1\7\10\0\2\6\2\7\2\0\12\7\12\0\6\6\2\0" - + "\2\7\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0" - + "\7\6\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7\22\0" - + "\2\7\15\0\60\6\1\7\2\6\7\7\4\0\10\6\10\7\1\0" - + "\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6\2\0" - + "\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6\1\0" - + "\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0\2\7" - + "\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7\2\0" - + "\4\6\40\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7\1\0" - + "\1\7\1\0\1\7\4\0\2\7\10\6\1\0\44\6\4\0\24\7" - + "\1\0\2\7\5\6\13\7\1\0\44\7\11\0\1\7\71\0\53\6" - + "\24\7\1\6\12\7\6\0\6\6\4\7\4\6\3\7\1\6\3\7" - + "\2\6\7\7\3\6\4\7\15\6\14\7\1\6\17\7\2\0\46\6" - + "\1\0\1\6\5\0\1\6\2\0\53\6\1\0\u014d\6\1\0\4\6" - + "\2\0\7\6\1\0\1\6\1\0\4\6\2\0\51\6\1\0\4\6" - + "\2\0\41\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6" - + "\2\0\17\6\1\0\71\6\1\0\4\6\2\0\103\6\2\0\3\7" - + "\40\0\20\6\20\0\125\6\14\0\u026c\6\2\0\21\6\1\0\32\6" - + "\5\0\113\6\3\0\3\6\17\0\15\6\1\0\4\6\3\7\13\0" - + "\22\6\3\7\13\0\22\6\2\7\14\0\15\6\1\0\3\6\1\0" - + "\2\7\14\0\64\6\40\7\3\0\1\6\3\0\2\6\1\7\2\0" - + "\12\7\41\0\3\7\2\0\12\7\6\0\130\6\10\0\51\6\1\7" - + "\1\6\5\0\106\6\12\0\35\6\3\0\14\7\4\0\14\7\12\0" - + "\12\7\36\6\2\0\5\6\13\0\54\6\4\0\21\7\7\6\2\7" - + "\6\0\12\7\46\0\27\6\5\7\4\0\65\6\12\7\1\0\35\7" - + "\2\0\13\7\6\0\12\7\15\0\1\6\130\0\5\7\57\6\21\7" - + "\7\6\4\0\12\7\21\0\11\7\14\0\3\7\36\6\15\7\2\6" - + "\12\7\54\6\16\7\14\0\44\6\24\7\10\0\12\7\3\0\3\6" - + "\12\7\44\6\122\0\3\7\1\0\25\7\4\6\1\7\4\6\3\7" - + "\2\6\11\0\300\6\47\7\25\0\4\7\u0116\6\2\0\6\6\2\0" - + "\46\6\2\0\6\6\2\0\10\6\1\0\1\6\1\0\1\6\1\0" - + "\1\6\1\0\37\6\2\0\65\6\1\0\7\6\1\0\1\6\3\0" - + "\3\6\1\0\7\6\3\0\4\6\2\0\6\6\4\0\15\6\5\0" - + "\3\6\1\0\7\6\16\0\5\7\30\0\1\121\1\121\5\7\20\0" - + "\2\6\23\0\1\6\13\0\5\7\5\0\6\7\1\0\1\6\15\0" - + "\1\6\20\0\15\6\3\0\33\6\25\0\15\7\4\0\1\7\3\0" - + "\14\7\21\0\1\6\4\0\1\6\2\0\12\6\1\0\1\6\3\0" - + "\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0\4\6\1\0" - + "\13\6\2\0\4\6\5\0\5\6\4\0\1\6\21\0\51\6\u0a77\0" - + "\57\6\1\0\57\6\1\0\205\6\6\0\4\6\3\7\2\6\14\0" - + "\46\6\1\0\1\6\5\0\1\6\2\0\70\6\7\0\1\6\17\0" - + "\1\7\27\6\11\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6" - + "\1\0\7\6\1\0\7\6\1\0\7\6\1\0\7\6\1\0\40\7" - + "\57\0\1\6\u01d5\0\3\6\31\0\11\6\6\7\1\0\5\6\2\0" - + "\5\6\4\0\126\6\2\0\2\7\2\0\3\6\1\0\132\6\1\0" - + "\4\6\5\0\51\6\3\0\136\6\21\0\33\6\65\0\20\6\u0200\0" - + "\u19b6\6\112\0\u51cd\6\63\0\u048d\6\103\0\56\6\2\0\u010d\6\3\0" - + "\20\6\12\7\2\6\24\0\57\6\1\7\4\0\12\7\1\0\31\6" - + "\7\0\1\7\120\6\2\7\45\0\11\6\2\0\147\6\2\0\4\6" - + "\1\0\4\6\14\0\13\6\115\0\12\6\1\7\3\6\1\7\4\6" - + "\1\7\27\6\5\7\20\0\1\6\7\0\64\6\14\0\2\7\62\6" - + "\21\7\13\0\12\7\6\0\22\7\6\6\3\0\1\6\4\0\12\7" - + "\34\6\10\7\2\0\27\6\15\7\14\0\35\6\3\0\4\7\57\6" - + "\16\7\16\0\1\6\12\7\46\0\51\6\16\7\11\0\3\6\1\7" - + "\10\6\2\7\2\0\12\7\6\0\27\6\3\0\1\6\1\7\4\0" - + "\60\6\1\7\1\6\3\7\2\6\2\7\5\6\2\7\1\6\1\7" - + "\1\6\30\0\3\6\2\0\13\6\5\7\2\0\3\6\2\7\12\0" - + "\6\6\2\0\6\6\2\0\6\6\11\0\7\6\1\0\7\6\221\0" - + "\43\6\10\7\1\0\2\7\2\0\12\7\6\0\u2ba4\6\14\0\27\6" - + "\4\0\61\6\u2104\0\u016e\6\2\0\152\6\46\0\7\6\14\0\5\6" - + "\5\0\1\6\1\7\12\6\1\0\15\6\1\0\5\6\1\0\1\6" - + "\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6\22\0\100\6" - + "\2\0\66\6\50\0\15\6\3\0\20\7\20\0\7\7\14\0\2\6" - + "\30\0\3\6\31\0\1\6\6\0\5\6\1\0\207\6\2\0\1\7" - + "\4\0\1\6\13\0\12\7\7\0\32\6\4\0\1\6\1\0\32\6" - + "\13\0\131\6\3\0\6\6\2\0\6\6\2\0\6\6\2\0\3\6" - + "\3\0\2\6\3\0\2\6\22\0\3\7\4\0\14\6\1\0\32\6" - + "\1\0\23\6\1\0\2\6\1\0\17\6\2\0\16\6\42\0\173\6" - + "\105\0\65\6\210\0\1\7\202\0\35\6\3\0\61\6\57\0\37\6" - + "\21\0\33\6\65\0\36\6\2\0\44\6\4\0\10\6\1\0\5\6" - + "\52\0\236\6\2\0\12\7\u0356\0\6\6\2\0\1\6\1\0\54\6" - + "\1\0\2\6\3\0\1\6\2\0\27\6\252\0\26\6\12\0\32\6" - + "\106\0\70\6\6\0\2\6\100\0\1\6\3\7\1\0\2\7\5\0" - + "\4\7\4\6\1\0\3\6\1\0\33\6\4\0\3\7\4\0\1\7" - + "\40\0\35\6\203\0\66\6\12\0\26\6\12\0\23\6\215\0\111\6" - + "\u03b7\0\3\7\65\6\17\7\37\0\12\7\20\0\3\7\55\6\13\7" - + "\2\0\1\7\22\0\31\6\7\0\12\7\6\0\3\7\44\6\16\7" - + "\1\0\12\7\100\0\3\7\60\6\16\7\4\6\13\0\12\7\u04a6\0" - + "\53\6\15\7\10\0\12\7\u0936\0\u036f\6\221\0\143\6\u0b9d\0\u042f\6" - + "\u33d1\0\u0239\6\u04c7\0\105\6\13\0\1\6\56\7\20\0\4\7\15\6" - + "\u4060\0\2\6\u2163\0\5\7\3\0\26\7\2\0\7\7\36\0\4\7" - + "\224\0\3\7\u01bb\0\125\6\1\0\107\6\1\0\2\6\2\0\1\6" - + "\2\0\2\6\2\0\4\6\1\0\14\6\1\0\1\6\1\0\7\6" - + "\1\0\101\6\1\0\4\6\2\0\10\6\1\0\7\6\1\0\34\6" - + "\1\0\4\6\1\0\5\6\1\0\1\6\3\0\7\6\1\0\u0154\6" - + "\2\0\31\6\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6" - + "\1\0\31\6\1\0\37\6\1\0\31\6\1\0\37\6\1\0\31\6" - + "\1\0\10\6\2\0\62\7\u1600\0\4\6\1\0\33\6\1\0\2\6" - + "\1\0\1\6\2\0\1\6\1\0\12\6\1\0\4\6\1\0\1\6" - + "\1\0\1\6\6\0\1\6\4\0\1\6\1\0\1\6\1\0\1\6" - + "\1\0\3\6\1\0\2\6\1\0\1\6\2\0\1\6\1\0\1\6" - + "\1\0\1\6\1\0\1\6\1\0\1\6\1\0\2\6\1\0\1\6" - + "\2\0\4\6\1\0\7\6\1\0\4\6\1\0\4\6\1\0\1\6" - + "\1\0\12\6\1\0\21\6\5\0\3\6\1\0\5\6\1\0\21\6" - + "\u1144\0\ua6d7\6\51\0\u1035\6\13\0\336\6\u3fe2\0\u021e\6\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\u05ee\0" - + "\1\7\36\0\140\7\200\0\360\7\uffff\0\uffff\0\ufe12\0"; - - /** - * 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(); - - private static final String ZZ_ACTION_PACKED_0 - = "\6\0\1\1\2\2\1\3\1\4\1\5\1\6\1\7" - + "\1\10\1\11\1\12\1\13\1\14\2\15\1\16\1\17" - + "\1\20\26\6\1\21\1\22\1\23\1\24\1\25\1\26" - + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36" - + "\1\37\1\40\1\41\1\42\2\43\1\44\1\1\1\42" - + "\1\1\2\45\1\42\1\1\1\46\2\42\2\47\2\42" - + "\1\1\1\50\1\3\1\0\1\51\1\52\1\53\2\0" - + "\1\54\1\0\1\55\1\56\1\57\1\60\1\61\1\62" - + "\1\63\1\54\1\0\2\63\1\0\1\64\1\65\7\6" - + "\1\66\11\6\1\67\12\6\1\70\1\71\1\72\4\6" - + "\1\73\30\6\1\56\1\74\1\75\1\76\1\77\1\100" - + "\1\101\1\102\1\103\1\104\1\105\1\104\1\106\1\107" - + "\1\110\1\111\1\112\1\113\1\104\1\114\1\104\6\0" - + "\1\115\1\116\2\115\2\3\2\0\1\117\3\0\1\120" - + "\1\0\1\121\1\122\1\123\1\124\2\125\1\63\1\54" - + "\1\0\10\6\1\126\5\6\1\127\1\130\5\6\1\131" - + "\1\6\1\132\5\6\1\133\7\6\1\134\2\6\1\135" - + "\10\6\1\136\20\6\1\137\1\6\1\140\2\6\1\141" - + "\2\6\1\142\12\0\1\143\5\0\1\144\1\125\1\63" - + "\4\6\1\145\1\146\1\147\1\6\1\150\1\6\1\151" - + "\5\6\1\152\7\6\1\153\1\6\1\154\4\6\1\155" - + "\22\6\1\156\7\6\1\157\4\6\1\160\7\6\1\161" - + "\1\0\1\162\1\42\1\0\1\163\12\0\1\125\1\63" - + "\1\164\4\6\1\165\1\166\1\6\1\167\5\6\1\170" - + "\5\6\1\171\3\6\1\172\14\6\1\173\6\6\1\174" - + "\2\6\1\175\3\6\1\176\1\6\1\177\10\6\10\0" - + "\1\125\1\63\1\200\1\6\1\201\3\6\1\202\2\6" - + "\1\203\1\204\7\6\1\205\4\6\1\206\4\6\1\207" - + "\5\6\1\210\10\6\1\211\2\6\1\212\3\6\1\213" - + "\1\214\1\6\2\0\1\120\1\125\1\63\1\6\1\215" - + "\5\6\1\216\14\6\1\217\1\6\1\220\1\6\1\221" - + "\7\6\1\222\1\223\6\6\1\42\1\125\1\63\1\6" - + "\1\224\2\6\1\225\1\226\6\6\1\227\7\6\1\230" - + "\5\6\1\231\1\6\1\232\1\233\3\6\1\234\1\125" - + "\1\63\1\6\1\235\1\6\1\236\1\237\4\6\1\240" - + "\2\6\1\241\2\6\1\242\1\243\1\6\1\244\1\245" - + "\5\6\1\125\1\63\2\6\1\246\1\247\1\6\1\250" - + "\1\6\1\251\6\6\1\252\2\6\1\63\4\6\1\253" - + "\4\6\1\254\1\255\1\256\1\63\6\6\1\257\2\6" - + "\1\63\1\6\1\260\1\6\1\261\2\6\1\262\1\263" - + "\1\63\2\6\1\264\3\6\1\63\1\265\4\6\1\63" - + "\2\6\1\266\1\267\1\270\1\6\1\271"; - - private static int[] zzUnpackAction() { - int[] result = new int[705]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackAction(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do { - result[j++] = value; - } while (--count > 0); - } - return j; + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\124\0\250\0\374\0\u0150\0\u01a4\0\u01f8\0\u024c"+ + "\0\u01f8\0\u02a0\0\u02f4\0\u0348\0\u039c\0\u03f0\0\u0444\0\u0498"+ + "\0\u04ec\0\u0540\0\u01f8\0\u0594\0\u05e8\0\u063c\0\u01f8\0\u0690"+ + "\0\u06e4\0\u0738\0\u078c\0\u07e0\0\u0834\0\u0888\0\u08dc\0\u0930"+ + "\0\u0984\0\u09d8\0\u0a2c\0\u0a80\0\u0ad4\0\u0b28\0\u0b7c\0\u0bd0"+ + "\0\u0c24\0\u0c78\0\u0ccc\0\u0d20\0\u0d74\0\u0dc8\0\u01f8\0\u01f8"+ + "\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u0e1c\0\u01f8"+ + "\0\u01f8\0\u0e70\0\u0ec4\0\u0f18\0\u0f6c\0\u0fc0\0\u01f8\0\u1014"+ + "\0\u1068\0\u01f8\0\u01f8\0\u10bc\0\u1110\0\u1164\0\u11b8\0\u01f8"+ + "\0\u120c\0\u1260\0\u01f8\0\u12b4\0\u01f8\0\u1308\0\u01f8\0\u135c"+ + "\0\u13b0\0\u1404\0\u01f8\0\u1458\0\u14ac\0\u01f8\0\u01f8\0\u01f8"+ + "\0\u1500\0\u1554\0\u15a8\0\u15fc\0\u1650\0\u01f8\0\u01f8\0\u16a4"+ + "\0\u01f8\0\u16f8\0\u174c\0\u17a0\0\u17f4\0\u1848\0\u189c\0\u18f0"+ + "\0\u01f8\0\u01f8\0\u1944\0\u1998\0\u19ec\0\u1a40\0\u1a94\0\u1ae8"+ + "\0\u1b3c\0\u1b90\0\u039c\0\u1be4\0\u1c38\0\u1c8c\0\u1ce0\0\u1d34"+ + "\0\u1d88\0\u1ddc\0\u1e30\0\u1e84\0\u1ed8\0\u1f2c\0\u1f80\0\u1fd4"+ + "\0\u2028\0\u207c\0\u20d0\0\u2124\0\u2178\0\u21cc\0\u2220\0\u039c"+ + "\0\u2274\0\u22c8\0\u231c\0\u2370\0\u23c4\0\u2418\0\u039c\0\u246c"+ + "\0\u24c0\0\u2514\0\u2568\0\u25bc\0\u2610\0\u2664\0\u26b8\0\u270c"+ + "\0\u2760\0\u27b4\0\u2808\0\u285c\0\u28b0\0\u2904\0\u2958\0\u29ac"+ + "\0\u2a00\0\u2a54\0\u2aa8\0\u2afc\0\u2b50\0\u2ba4\0\u2bf8\0\u2c4c"+ + "\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8"+ + "\0\u01f8\0\u01f8\0\u2ca0\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8"+ + "\0\u01f8\0\u2cf4\0\u01f8\0\u2d48\0\u1260\0\u2d9c\0\u2df0\0\u2e44"+ + "\0\u2e98\0\u2eec\0\u01f8\0\u01f8\0\u2cf4\0\u2d48\0\u2f40\0\u01f8"+ + "\0\u2f94\0\u2fe8\0\u01f8\0\u303c\0\u3090\0\u30e4\0\u01f8\0\u3138"+ + "\0\u01f8\0\u318c\0\u01f8\0\u01f8\0\u17f4\0\u31e0\0\u3234\0\u3288"+ + "\0\u3288\0\u32dc\0\u3330\0\u3384\0\u33d8\0\u342c\0\u3480\0\u34d4"+ + "\0\u3528\0\u357c\0\u039c\0\u35d0\0\u3624\0\u3678\0\u36cc\0\u3720"+ + "\0\u039c\0\u039c\0\u3774\0\u37c8\0\u381c\0\u3870\0\u38c4\0\u039c"+ + "\0\u3918\0\u396c\0\u39c0\0\u3a14\0\u3a68\0\u3abc\0\u3b10\0\u039c"+ + "\0\u3b64\0\u3bb8\0\u3c0c\0\u3c60\0\u3cb4\0\u3d08\0\u3d5c\0\u3db0"+ + "\0\u3e04\0\u3e58\0\u039c\0\u3eac\0\u3f00\0\u3f54\0\u3fa8\0\u3ffc"+ + "\0\u4050\0\u40a4\0\u40f8\0\u039c\0\u414c\0\u41a0\0\u41f4\0\u4248"+ + "\0\u429c\0\u42f0\0\u4344\0\u4398\0\u43ec\0\u4440\0\u4494\0\u44e8"+ + "\0\u453c\0\u4590\0\u45e4\0\u4638\0\u039c\0\u468c\0\u46e0\0\u4734"+ + "\0\u4788\0\u039c\0\u47dc\0\u4830\0\u01f8\0\u4884\0\u48d8\0\u492c"+ + "\0\u4980\0\u49d4\0\u4a28\0\u4a7c\0\u4ad0\0\u4b24\0\u4b78\0\u01f8"+ + "\0\u4bcc\0\u4c20\0\u4c74\0\u4cc8\0\u4d1c\0\u01f8\0\u4d70\0\u4dc4"+ + "\0\u4e18\0\u4e6c\0\u4ec0\0\u4f14\0\u039c\0\u039c\0\u039c\0\u4f68"+ + "\0\u039c\0\u4fbc\0\u039c\0\u5010\0\u5064\0\u50b8\0\u510c\0\u5160"+ + "\0\u51b4\0\u5208\0\u525c\0\u52b0\0\u5304\0\u5358\0\u53ac\0\u5400"+ + "\0\u039c\0\u5454\0\u039c\0\u54a8\0\u54fc\0\u5550\0\u55a4\0\u039c"+ + "\0\u55f8\0\u564c\0\u56a0\0\u56f4\0\u5748\0\u579c\0\u57f0\0\u5844"+ + "\0\u5898\0\u58ec\0\u5940\0\u5994\0\u59e8\0\u5a3c\0\u5a90\0\u5ae4"+ + "\0\u5b38\0\u5b8c\0\u039c\0\u5be0\0\u5c34\0\u5c88\0\u5cdc\0\u5d30"+ + "\0\u5d84\0\u5dd8\0\u039c\0\u5e2c\0\u5e80\0\u5ed4\0\u5f28\0\u039c"+ + "\0\u5f7c\0\u5fd0\0\u6024\0\u6078\0\u60cc\0\u6120\0\u6174\0\u01f8"+ + "\0\u2d48\0\u01f8\0\u61c8\0\u621c\0\u01f8\0\u6270\0\u62c4\0\u6318"+ + "\0\u636c\0\u63c0\0\u6414\0\u6468\0\u64bc\0\u6510\0\u6564\0\u65b8"+ + "\0\u660c\0\u039c\0\u6660\0\u66b4\0\u6708\0\u675c\0\u039c\0\u039c"+ + "\0\u67b0\0\u039c\0\u6804\0\u6858\0\u68ac\0\u6900\0\u6954\0\u039c"+ + "\0\u69a8\0\u69fc\0\u6a50\0\u6aa4\0\u6af8\0\u039c\0\u6b4c\0\u6ba0"+ + "\0\u6bf4\0\u039c\0\u6c48\0\u6c9c\0\u6cf0\0\u6d44\0\u6d98\0\u6dec"+ + "\0\u6e40\0\u6e94\0\u6ee8\0\u6f3c\0\u6f90\0\u6fe4\0\u039c\0\u7038"+ + "\0\u708c\0\u70e0\0\u7134\0\u7188\0\u71dc\0\u039c\0\u7230\0\u7284"+ + "\0\u72d8\0\u732c\0\u7380\0\u73d4\0\u039c\0\u7428\0\u039c\0\u747c"+ + "\0\u74d0\0\u7524\0\u7578\0\u75cc\0\u7620\0\u7674\0\u76c8\0\u771c"+ + "\0\u7770\0\u77c4\0\u7818\0\u786c\0\u78c0\0\u7914\0\u7968\0\u79bc"+ + "\0\u7a10\0\u039c\0\u7a64\0\u039c\0\u7ab8\0\u7b0c\0\u7b60\0\u039c"+ + "\0\u7bb4\0\u7c08\0\u039c\0\u039c\0\u7c5c\0\u7cb0\0\u7d04\0\u7d58"+ + "\0\u7dac\0\u7e00\0\u7e54\0\u039c\0\u7ea8\0\u7efc\0\u7f50\0\u7fa4"+ + "\0\u039c\0\u7ff8\0\u804c\0\u80a0\0\u80f4\0\u039c\0\u8148\0\u819c"+ + "\0\u81f0\0\u8244\0\u8298\0\u039c\0\u82ec\0\u8340\0\u8394\0\u83e8"+ + "\0\u843c\0\u8490\0\u84e4\0\u8538\0\u039c\0\u858c\0\u85e0\0\u039c"+ + "\0\u8634\0\u8688\0\u86dc\0\u039c\0\u039c\0\u8730\0\u8784\0\u87d8"+ + "\0\u6468\0\u882c\0\u8880\0\u88d4\0\u039c\0\u8928\0\u897c\0\u89d0"+ + "\0\u8a24\0\u8a78\0\u039c\0\u8acc\0\u8b20\0\u8b74\0\u8bc8\0\u8c1c"+ + "\0\u8c70\0\u8cc4\0\u8d18\0\u8d6c\0\u8dc0\0\u8e14\0\u8e68\0\u039c"+ + "\0\u8ebc\0\u039c\0\u8f10\0\u039c\0\u8f64\0\u8fb8\0\u900c\0\u9060"+ + "\0\u90b4\0\u9108\0\u915c\0\u039c\0\u039c\0\u91b0\0\u9204\0\u9258"+ + "\0\u92ac\0\u9300\0\u9354\0\u77c4\0\u93a8\0\u93fc\0\u9450\0\u039c"+ + "\0\u94a4\0\u94f8\0\u039c\0\u039c\0\u954c\0\u95a0\0\u95f4\0\u9648"+ + "\0\u969c\0\u96f0\0\u039c\0\u9744\0\u9798\0\u97ec\0\u9840\0\u9894"+ + "\0\u98e8\0\u993c\0\u039c\0\u9990\0\u99e4\0\u9a38\0\u9a8c\0\u9ae0"+ + "\0\u039c\0\u9b34\0\u039c\0\u039c\0\u9b88\0\u9bdc\0\u9c30\0\u039c"+ + "\0\u9c84\0\u9cd8\0\u9d2c\0\u039c\0\u9d80\0\u039c\0\u039c\0\u9dd4"+ + "\0\u9e28\0\u9e7c\0\u9ed0\0\u039c\0\u9f24\0\u9f78\0\u039c\0\u9fcc"+ + "\0\ua020\0\u039c\0\ua074\0\ua0c8\0\u039c\0\u039c\0\ua11c\0\ua170"+ + "\0\ua1c4\0\ua218\0\ua26c\0\u01f8\0\ua2c0\0\ua314\0\ua368\0\u039c"+ + "\0\u039c\0\ua3bc\0\u039c\0\ua410\0\u039c\0\ua464\0\ua4b8\0\ua50c"+ + "\0\ua560\0\ua5b4\0\ua608\0\u039c\0\ua65c\0\ua6b0\0\ua704\0\ua758"+ + "\0\ua7ac\0\ua800\0\ua854\0\ua8a8\0\ua8fc\0\ua950\0\ua9a4\0\ua9f8"+ + "\0\u039c\0\u039c\0\u039c\0\uaa4c\0\uaaa0\0\uaaf4\0\uab48\0\uab9c"+ + "\0\uabf0\0\uac44\0\u039c\0\uac98\0\uacec\0\uad40\0\uad94\0\u039c"+ + "\0\uade8\0\u039c\0\uae3c\0\uae90\0\uaee4\0\uaf38\0\uaf8c\0\uafe0"+ + "\0\ub034\0\u039c\0\ub088\0\ub0dc\0\ub130\0\ub184\0\u039c\0\ub1d8"+ + "\0\ub22c\0\ub280\0\ub2d4\0\u17a0\0\ub328\0\ub37c\0\u039c\0\u039c"+ + "\0\u039c\0\ub3d0\0\u039c"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[707]; + 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\124\0\250\0\374\0\u0150\0\u01a4\0\u01f8\0\u024c" - + "\0\u01f8\0\u02a0\0\u02f4\0\u0348\0\u039c\0\u03f0\0\u0444\0\u0498" - + "\0\u04ec\0\u0540\0\u01f8\0\u0594\0\u05e8\0\u063c\0\u01f8\0\u01f8" - + "\0\u0690\0\u06e4\0\u0738\0\u078c\0\u07e0\0\u0834\0\u0888\0\u08dc" - + "\0\u0930\0\u0984\0\u09d8\0\u0a2c\0\u0a80\0\u0ad4\0\u0b28\0\u0b7c" - + "\0\u0bd0\0\u0c24\0\u0c78\0\u0ccc\0\u0d20\0\u0d74\0\u01f8\0\u01f8" - + "\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u0dc8\0\u01f8" - + "\0\u01f8\0\u0e1c\0\u0e70\0\u0ec4\0\u0f18\0\u0f6c\0\u01f8\0\u0fc0" - + "\0\u1014\0\u01f8\0\u01f8\0\u1068\0\u10bc\0\u1110\0\u1164\0\u01f8" - + "\0\u11b8\0\u120c\0\u01f8\0\u1260\0\u01f8\0\u12b4\0\u01f8\0\u1308" - + "\0\u135c\0\u13b0\0\u01f8\0\u1404\0\u1458\0\u01f8\0\u01f8\0\u01f8" - + "\0\u14ac\0\u1500\0\u1554\0\u15a8\0\u15fc\0\u01f8\0\u01f8\0\u1650" - + "\0\u01f8\0\u16a4\0\u16f8\0\u174c\0\u17a0\0\u17f4\0\u1848\0\u189c" - + "\0\u01f8\0\u01f8\0\u18f0\0\u1944\0\u1998\0\u19ec\0\u1a40\0\u1a94" - + "\0\u1ae8\0\u039c\0\u1b3c\0\u1b90\0\u1be4\0\u1c38\0\u1c8c\0\u1ce0" - + "\0\u1d34\0\u1d88\0\u1ddc\0\u1e30\0\u1e84\0\u1ed8\0\u1f2c\0\u1f80" - + "\0\u1fd4\0\u2028\0\u207c\0\u20d0\0\u2124\0\u2178\0\u039c\0\u21cc" - + "\0\u2220\0\u2274\0\u22c8\0\u231c\0\u2370\0\u039c\0\u23c4\0\u2418" - + "\0\u246c\0\u24c0\0\u2514\0\u2568\0\u25bc\0\u2610\0\u2664\0\u26b8" - + "\0\u270c\0\u2760\0\u27b4\0\u2808\0\u285c\0\u28b0\0\u2904\0\u2958" - + "\0\u29ac\0\u2a00\0\u2a54\0\u2aa8\0\u2afc\0\u2b50\0\u2ba4\0\u01f8" - + "\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8" - + "\0\u01f8\0\u2bf8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8\0\u01f8" - + "\0\u2c4c\0\u01f8\0\u2ca0\0\u120c\0\u2cf4\0\u2d48\0\u2d9c\0\u2df0" - + "\0\u2e44\0\u01f8\0\u01f8\0\u2c4c\0\u2ca0\0\u2e98\0\u01f8\0\u2eec" - + "\0\u2f40\0\u01f8\0\u2f94\0\u2fe8\0\u303c\0\u01f8\0\u3090\0\u01f8" - + "\0\u30e4\0\u01f8\0\u01f8\0\u17a0\0\u3138\0\u318c\0\u31e0\0\u31e0" - + "\0\u3234\0\u3288\0\u32dc\0\u3330\0\u3384\0\u33d8\0\u342c\0\u3480" - + "\0\u039c\0\u34d4\0\u3528\0\u357c\0\u35d0\0\u3624\0\u039c\0\u039c" - + "\0\u3678\0\u36cc\0\u3720\0\u3774\0\u37c8\0\u039c\0\u381c\0\u3870" - + "\0\u38c4\0\u3918\0\u396c\0\u39c0\0\u3a14\0\u039c\0\u3a68\0\u3abc" - + "\0\u3b10\0\u3b64\0\u3bb8\0\u3c0c\0\u3c60\0\u3cb4\0\u3d08\0\u3d5c" - + "\0\u039c\0\u3db0\0\u3e04\0\u3e58\0\u3eac\0\u3f00\0\u3f54\0\u3fa8" - + "\0\u3ffc\0\u039c\0\u4050\0\u40a4\0\u40f8\0\u414c\0\u41a0\0\u41f4" - + "\0\u4248\0\u429c\0\u42f0\0\u4344\0\u4398\0\u43ec\0\u4440\0\u4494" - + "\0\u44e8\0\u453c\0\u039c\0\u4590\0\u45e4\0\u4638\0\u468c\0\u039c" - + "\0\u46e0\0\u4734\0\u01f8\0\u4788\0\u47dc\0\u4830\0\u4884\0\u48d8" - + "\0\u492c\0\u4980\0\u49d4\0\u4a28\0\u4a7c\0\u01f8\0\u4ad0\0\u4b24" - + "\0\u4b78\0\u4bcc\0\u4c20\0\u01f8\0\u4c74\0\u4cc8\0\u4d1c\0\u4d70" - + "\0\u4dc4\0\u4e18\0\u039c\0\u039c\0\u039c\0\u4e6c\0\u039c\0\u4ec0" - + "\0\u039c\0\u4f14\0\u4f68\0\u4fbc\0\u5010\0\u5064\0\u50b8\0\u510c" - + "\0\u5160\0\u51b4\0\u5208\0\u525c\0\u52b0\0\u5304\0\u039c\0\u5358" - + "\0\u039c\0\u53ac\0\u5400\0\u5454\0\u54a8\0\u039c\0\u54fc\0\u5550" - + "\0\u55a4\0\u55f8\0\u564c\0\u56a0\0\u56f4\0\u5748\0\u579c\0\u57f0" - + "\0\u5844\0\u5898\0\u58ec\0\u5940\0\u5994\0\u59e8\0\u5a3c\0\u5a90" - + "\0\u039c\0\u5ae4\0\u5b38\0\u5b8c\0\u5be0\0\u5c34\0\u5c88\0\u5cdc" - + "\0\u039c\0\u5d30\0\u5d84\0\u5dd8\0\u5e2c\0\u039c\0\u5e80\0\u5ed4" - + "\0\u5f28\0\u5f7c\0\u5fd0\0\u6024\0\u6078\0\u01f8\0\u2ca0\0\u01f8" - + "\0\u60cc\0\u6120\0\u01f8\0\u6174\0\u61c8\0\u621c\0\u6270\0\u62c4" - + "\0\u6318\0\u636c\0\u63c0\0\u6414\0\u6468\0\u64bc\0\u6510\0\u039c" - + "\0\u6564\0\u65b8\0\u660c\0\u6660\0\u039c\0\u039c\0\u66b4\0\u039c" - + "\0\u6708\0\u675c\0\u67b0\0\u6804\0\u6858\0\u039c\0\u68ac\0\u6900" - + "\0\u6954\0\u69a8\0\u69fc\0\u039c\0\u6a50\0\u6aa4\0\u6af8\0\u039c" - + "\0\u6b4c\0\u6ba0\0\u6bf4\0\u6c48\0\u6c9c\0\u6cf0\0\u6d44\0\u6d98" - + "\0\u6dec\0\u6e40\0\u6e94\0\u6ee8\0\u039c\0\u6f3c\0\u6f90\0\u6fe4" - + "\0\u7038\0\u708c\0\u70e0\0\u039c\0\u7134\0\u7188\0\u71dc\0\u7230" - + "\0\u7284\0\u72d8\0\u039c\0\u732c\0\u039c\0\u7380\0\u73d4\0\u7428" - + "\0\u747c\0\u74d0\0\u7524\0\u7578\0\u75cc\0\u7620\0\u7674\0\u76c8" - + "\0\u771c\0\u7770\0\u77c4\0\u7818\0\u786c\0\u78c0\0\u7914\0\u039c" - + "\0\u7968\0\u039c\0\u79bc\0\u7a10\0\u7a64\0\u039c\0\u7ab8\0\u7b0c" - + "\0\u039c\0\u039c\0\u7b60\0\u7bb4\0\u7c08\0\u7c5c\0\u7cb0\0\u7d04" - + "\0\u7d58\0\u039c\0\u7dac\0\u7e00\0\u7e54\0\u7ea8\0\u039c\0\u7efc" - + "\0\u7f50\0\u7fa4\0\u7ff8\0\u039c\0\u804c\0\u80a0\0\u80f4\0\u8148" - + "\0\u819c\0\u039c\0\u81f0\0\u8244\0\u8298\0\u82ec\0\u8340\0\u8394" - + "\0\u83e8\0\u843c\0\u039c\0\u8490\0\u84e4\0\u039c\0\u8538\0\u858c" - + "\0\u85e0\0\u039c\0\u039c\0\u8634\0\u8688\0\u86dc\0\u636c\0\u8730" - + "\0\u8784\0\u87d8\0\u039c\0\u882c\0\u8880\0\u88d4\0\u8928\0\u897c" - + "\0\u039c\0\u89d0\0\u8a24\0\u8a78\0\u8acc\0\u8b20\0\u8b74\0\u8bc8" - + "\0\u8c1c\0\u8c70\0\u8cc4\0\u8d18\0\u8d6c\0\u039c\0\u8dc0\0\u039c" - + "\0\u8e14\0\u039c\0\u8e68\0\u8ebc\0\u8f10\0\u8f64\0\u8fb8\0\u900c" - + "\0\u9060\0\u039c\0\u039c\0\u90b4\0\u9108\0\u915c\0\u91b0\0\u9204" - + "\0\u9258\0\u76c8\0\u92ac\0\u9300\0\u9354\0\u039c\0\u93a8\0\u93fc" - + "\0\u039c\0\u039c\0\u9450\0\u94a4\0\u94f8\0\u954c\0\u95a0\0\u95f4" - + "\0\u039c\0\u9648\0\u969c\0\u96f0\0\u9744\0\u9798\0\u97ec\0\u9840" - + "\0\u039c\0\u9894\0\u98e8\0\u993c\0\u9990\0\u99e4\0\u039c\0\u9a38" - + "\0\u039c\0\u039c\0\u9a8c\0\u9ae0\0\u9b34\0\u039c\0\u9b88\0\u9bdc" - + "\0\u9c30\0\u039c\0\u9c84\0\u039c\0\u039c\0\u9cd8\0\u9d2c\0\u9d80" - + "\0\u9dd4\0\u039c\0\u9e28\0\u9e7c\0\u039c\0\u9ed0\0\u9f24\0\u039c" - + "\0\u9f78\0\u9fcc\0\u039c\0\u039c\0\ua020\0\ua074\0\ua0c8\0\ua11c" - + "\0\ua170\0\u01f8\0\ua1c4\0\ua218\0\ua26c\0\u039c\0\u039c\0\ua2c0" - + "\0\u039c\0\ua314\0\u039c\0\ua368\0\ua3bc\0\ua410\0\ua464\0\ua4b8" - + "\0\ua50c\0\u039c\0\ua560\0\ua5b4\0\ua608\0\ua65c\0\ua6b0\0\ua704" - + "\0\ua758\0\ua7ac\0\ua800\0\ua854\0\ua8a8\0\ua8fc\0\u039c\0\u039c" - + "\0\u039c\0\ua950\0\ua9a4\0\ua9f8\0\uaa4c\0\uaaa0\0\uaaf4\0\uab48" - + "\0\u039c\0\uab9c\0\uabf0\0\uac44\0\uac98\0\u039c\0\uacec\0\u039c" - + "\0\uad40\0\uad94\0\uade8\0\uae3c\0\uae90\0\uaee4\0\uaf38\0\u039c" - + "\0\uaf8c\0\uafe0\0\ub034\0\ub088\0\u039c\0\ub0dc\0\ub130\0\ub184" - + "\0\ub1d8\0\u174c\0\ub22c\0\ub280\0\u039c\0\u039c\0\u039c\0\ub2d4" - + "\0\u039c"; + private static final String ZZ_TRANS_PACKED_0 = + "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\7"+ + "\1\16\1\17\1\20\1\21\1\12\1\22\1\23\1\24"+ + "\1\25\2\15\2\25\1\15\1\26\1\7\1\27\1\30"+ + "\1\31\1\32\1\33\1\34\1\15\1\35\1\36\1\37"+ + "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\47"+ + "\1\15\1\50\1\15\1\51\1\52\1\15\1\53\2\15"+ + "\1\54\12\15\1\55\1\56\1\57\1\60\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72"+ + "\1\73\1\74\1\75\1\76\1\77\1\7\1\12\1\7"+ + "\1\100\1\101\1\102\13\100\1\103\10\100\1\104\74\100"+ + "\1\105\1\101\1\102\24\105\1\106\1\103\73\105\1\7"+ + "\1\107\1\110\1\111\2\7\1\112\4\7\1\113\1\114"+ + "\4\7\2\112\2\7\1\112\4\7\46\112\22\7\1\111"+ + "\1\7\1\115\1\116\1\117\7\115\1\120\111\115\1\121"+ + "\1\101\1\102\24\121\1\122\1\121\1\123\72\121\126\0"+ + "\1\11\124\0\1\12\10\0\1\12\105\0\1\12\5\0"+ + "\1\124\1\125\7\0\1\126\123\0\1\127\114\0\2\15"+ + "\7\0\7\15\4\0\46\15\23\0\1\15\10\0\1\130"+ + "\124\0\1\131\1\132\4\0\2\133\2\0\2\133\105\0"+ + "\1\134\3\0\1\135\1\136\1\0\1\137\3\0\2\134"+ + "\2\0\1\134\4\0\46\134\37\0\1\140\1\0\1\141"+ + "\123\0\1\142\117\0\1\133\5\0\1\143\1\144\1\145"+ + "\1\0\1\146\1\147\1\150\6\0\1\150\22\0\1\145"+ + "\55\0\1\133\5\0\2\25\2\0\2\25\1\150\6\0"+ + "\1\150\104\0\1\151\10\0\1\152\126\0\1\153\100\0"+ + "\2\15\7\0\7\15\4\0\1\15\1\154\44\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\155"+ + "\1\156\42\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\3\15\1\157\12\15\1\160\5\15\1\161\1\162"+ + "\20\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\6\15\1\163\1\15\1\164\35\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\165\3\15\1\166"+ + "\6\15\1\167\1\15\1\170\25\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\171\6\15\1\172"+ + "\1\15\1\173\3\15\1\174\26\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\15\1\175\22\15\1\176"+ + "\21\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\177\1\200\7\15\1\201\32\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\1\15\1\202\1\203"+ + "\1\204\3\15\1\205\10\15\1\206\1\15\1\207\23\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\6\15"+ + "\1\210\1\15\1\211\4\15\1\212\5\15\1\213\22\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\6\15"+ + "\1\214\1\15\1\215\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\216\4\15\1\217\3\15"+ + "\1\220\6\15\1\221\23\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\3\15\1\222\2\15\1\223\1\224"+ + "\2\15\1\225\1\226\32\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\227\4\15\1\230\36\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15"+ + "\1\231\5\15\1\232\25\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\233\1\15\1\234\7\15"+ + "\1\235\2\15\1\236\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\237\45\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\240\3\15\1\241"+ + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\242\4\15\1\243\36\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\244\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\245"+ + "\7\15\1\246\32\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\10\15\1\247\35\15\23\0\1\15\15\0"+ + "\1\250\123\0\1\251\75\0\1\252\25\0\1\253\76\0"+ + "\1\254\24\0\1\255\77\0\1\256\23\0\1\257\123\0"+ + "\1\260\106\0\1\100\2\0\13\100\1\0\10\100\1\0"+ + "\74\100\2\0\1\102\121\0\1\261\2\0\13\261\1\262"+ + "\1\263\3\261\2\263\2\261\1\264\1\265\1\261\1\266"+ + "\1\267\6\261\1\270\1\271\1\261\1\272\1\261\1\273"+ + "\7\261\1\274\41\261\3\0\1\105\2\0\24\105\2\0"+ + "\73\105\1\261\2\0\13\261\1\262\10\261\1\264\1\265"+ + "\1\261\1\266\1\267\6\261\1\270\1\271\1\261\1\272"+ + "\1\261\1\273\7\261\1\274\41\261\5\0\1\110\124\0"+ + "\1\111\10\0\1\111\105\0\1\111\7\0\2\275\1\276"+ + "\3\0\1\277\1\300\1\0\7\275\4\0\46\275\23\0"+ + "\1\275\3\0\1\111\2\0\1\275\5\0\1\114\4\0"+ + "\2\275\2\0\1\275\4\0\46\275\22\0\1\111\3\0"+ + "\1\117\125\0\1\301\1\0\1\302\12\0\2\302\2\0"+ + "\1\302\4\0\46\302\24\0\1\121\2\0\24\121\1\0"+ + "\1\121\1\0\72\121\1\303\2\0\24\303\1\264\1\303"+ + "\1\304\1\266\1\267\6\303\1\270\1\271\1\303\1\305"+ + "\1\303\1\273\7\303\1\306\41\303\3\0\1\124\1\307"+ + "\1\310\121\124\5\311\1\312\116\311\11\0\1\313\120\0"+ + "\1\314\12\0\2\314\2\0\1\314\4\0\46\314\43\0"+ + "\2\133\2\0\2\133\1\150\6\0\1\150\75\0\1\315"+ + "\1\134\1\316\2\0\1\317\1\320\2\0\2\134\2\315"+ + "\2\134\1\315\4\0\46\315\23\0\1\134\15\0\1\321"+ + "\121\0\1\322\1\0\1\323\123\0\1\324\117\0\1\133"+ + "\5\0\1\143\1\144\2\0\1\146\1\147\1\150\6\0"+ + "\1\150\100\0\1\133\5\0\2\144\2\0\2\144\1\150"+ + "\6\0\1\150\106\0\1\325\1\326\1\0\4\326\4\0"+ + "\1\326\1\0\2\326\1\0\1\326\6\0\2\326\12\0"+ + "\1\326\1\0\1\326\5\0\2\326\41\0\1\133\5\0"+ + "\1\147\1\144\2\0\2\147\1\150\6\0\1\150\100\0"+ + "\1\133\5\0\1\327\1\144\2\0\2\327\1\150\6\0"+ + "\1\150\106\0\2\330\2\0\2\330\1\0\1\331\66\0"+ + "\1\331\14\0\1\332\12\0\2\332\2\0\1\332\4\0"+ + "\46\332\32\0\2\15\7\0\7\15\4\0\2\15\1\333"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\334\11\15\1\335\22\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\10\15\1\336\35\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\5\15\1\337"+ + "\40\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\6\15\1\340\37\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\3\15\1\341\42\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\342\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\343"+ + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\6\15\1\344\2\15\1\345\4\15\1\346\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\347"+ + "\35\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\3\15\1\350\42\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\1\15\1\351\44\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\352\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\353"+ + "\3\15\1\354\36\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\1\355\20\15\1\356\24\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\357\33\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15"+ + "\1\360\31\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\361\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\17\15\1\362\5\15\1\363\20\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15"+ + "\1\364\22\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\16\15\1\365\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\3\15\1\366\7\15\1\367\6\15"+ + "\1\370\23\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\16\15\1\371\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\372\44\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\26\15\1\373\17\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15"+ + "\1\374\10\15\1\375\33\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\21\15\1\376\24\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\6\15\1\377\2\15"+ + "\1\u0100\34\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\32\15\1\u0101\13\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\21\15\1\u0102\24\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u0103\43\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15"+ + "\1\u0104\1\15\1\u0105\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\15\15\1\u0106\1\u0107\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\21\15\1\u0108"+ + "\24\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\10\15\1\u0109\35\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\16\15\1\u010a\27\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\5\15\1\u010b\40\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u010c"+ + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\10\15\1\u010d\35\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\10\15\1\u010e\35\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\10\15\1\u010f\35\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0110"+ + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u0111\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u0112\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u0113\4\15\1\u0114"+ + "\2\15\1\u0115\33\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\5\15\1\u0116\40\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\u0117\45\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\3\15\1\u0118\42\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\5\15"+ + "\1\u0119\1\u011a\1\u011b\6\15\1\u011c\27\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\1\15\1\u011d\44\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15"+ + "\1\u011e\33\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\11\15\1\u011f\34\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\11\15\1\u0120\34\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\1\15\1\u0121\44\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\44\15"+ + "\1\u0122\1\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\23\15\1\u0123\22\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\15\15\1\u0124\30\15\23\0\1\15"+ + "\15\0\1\u0125\125\0\1\u0126\3\0\2\u0126\116\0\2\u0127"+ + "\1\0\4\u0127\4\0\1\u0127\1\0\2\u0127\1\0\1\u0127"+ + "\6\0\2\u0127\12\0\1\u0127\1\0\1\u0127\5\0\2\u0127"+ + "\47\0\2\u0128\1\0\4\u0128\4\0\1\u0128\1\0\2\u0128"+ + "\1\0\1\u0128\6\0\2\u0128\12\0\1\u0128\1\0\1\u0128"+ + "\5\0\2\u0128\36\0\1\u0129\12\0\2\u0129\2\0\1\u0129"+ + "\4\0\46\u0129\40\0\1\277\1\300\122\0\1\300\1\0"+ + "\1\u012a\113\0\1\u012b\12\0\2\u012b\2\0\1\u012b\4\0"+ + "\46\u012b\32\0\1\u012c\1\302\1\u012d\2\0\1\115\1\u012e"+ + "\2\0\2\302\2\u012c\2\302\1\u012c\4\0\46\u012c\23\0"+ + "\1\302\2\0\1\310\121\0\5\311\1\u012f\116\311\4\0"+ + "\1\310\1\312\124\0\2\314\3\0\1\u0130\3\0\7\314"+ + "\4\0\46\314\23\0\1\314\6\0\2\315\1\u0131\2\0"+ + "\1\317\1\u0132\1\u0133\1\0\7\315\4\0\46\315\23\0"+ + "\1\315\6\0\1\u0134\12\0\2\u0134\2\0\1\u0134\4\0"+ + "\46\u0134\32\0\1\u0135\5\0\1\320\4\0\2\u0135\2\0"+ + "\1\u0135\4\0\46\u0135\41\0\1\u0136\125\0\2\u0137\1\0"+ + "\4\u0137\4\0\1\u0137\1\0\2\u0137\1\0\1\u0137\6\0"+ + "\2\u0137\12\0\1\u0137\1\0\1\u0137\5\0\2\u0137\41\0"+ + "\1\133\5\0\1\u0138\1\144\2\0\2\u0138\1\150\6\0"+ + "\1\150\106\0\2\330\2\0\2\330\105\0\2\332\7\0"+ + "\7\332\4\0\46\332\23\0\1\332\6\0\2\15\7\0"+ + "\7\15\4\0\3\15\1\u0139\42\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\13\15\1\u013a\32\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\7\15\1\u013b"+ + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\14\15\1\u013c\31\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\20\15\1\u013d\25\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u013e\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u013f"+ + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u0140\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0141\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\5\15\1\u0142\40\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u0143"+ + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\6\15\1\u0144\2\15\1\u0145\34\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u0146\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u0147"+ + "\7\15\1\u0148\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\21\15\1\u0149\24\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u014a\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u014b"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u014c\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\1\15\1\u014d\44\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\16\15\1\u014e\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u014f"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u0150\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\16\15\1\u0151\27\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\5\15\1\u0152\40\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u0153"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\16\15\1\u0154\27\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\26\15\1\u0155\17\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\26\15\1\u0156\17\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\7\15\1\u0157"+ + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\6\15\1\u0158\37\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0159\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\u015a\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u015b"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\1\15\1\u015c\44\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\7\15\1\u015d\6\15\1\u015e\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u015f"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\7\15\1\u0160\36\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\3\15\1\u0161\42\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u0162\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u0163"+ + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\3\15\1\u0164\42\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\6\15\1\u0165\37\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\7\15\1\u0166\36\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0167"+ + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\5\15\1\u0168\40\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\26\15\1\u0169\17\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\14\15\1\u016a\31\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\20\15\1\u016b"+ + "\25\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\16\15\1\u016c\27\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\24\15\1\u016d\21\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\u016e\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\u016f"+ + "\13\15\1\u0170\21\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\4\15\1\u0171\41\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\16\15\1\u0172\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\22\15\1\u0173"+ + "\23\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\20\15\1\u0174\25\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\13\15\1\u0175\32\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\15\1\u0176\44\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u0177"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\14\15\1\u0178\31\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\27\15\1\u0179\3\15\1\u017a\6\15\1\u017b"+ + "\3\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\7\15\1\u017c\36\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u017d\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\u017e\45\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u017f\33\15"+ + "\23\0\1\15\17\0\1\u0180\3\0\2\u0180\116\0\2\u0181"+ + "\1\0\4\u0181\4\0\1\u0181\1\0\2\u0181\1\0\1\u0181"+ + "\6\0\2\u0181\12\0\1\u0181\1\0\1\u0181\5\0\2\u0181"+ + "\47\0\2\u0182\1\0\4\u0182\4\0\1\u0182\1\0\2\u0182"+ + "\1\0\1\u0182\6\0\2\u0182\12\0\1\u0182\1\0\1\u0182"+ + "\5\0\2\u0182\36\0\2\u0129\4\0\1\277\1\300\1\0"+ + "\7\u0129\4\0\46\u0129\23\0\1\u0129\1\u012a\2\0\13\u012a"+ + "\1\u0183\105\u012a\6\0\2\u012b\1\u0184\2\0\1\u0185\3\0"+ + "\7\u012b\4\0\46\u012b\23\0\1\u012b\6\0\2\u012c\1\u0186"+ + "\2\0\1\115\1\u0187\1\u0188\1\0\7\u012c\4\0\46\u012c"+ + "\23\0\1\u012c\6\0\1\u0189\12\0\2\u0189\2\0\1\u0189"+ + "\4\0\46\u0189\32\0\1\u018a\5\0\1\u012e\4\0\2\u018a"+ + "\2\0\1\u018a\4\0\46\u018a\24\0\4\311\1\310\1\u012f"+ + "\116\311\6\0\1\u018b\12\0\2\u018b\2\0\1\u018b\4\0"+ + "\46\u018b\32\0\1\u0135\5\0\1\u0132\1\u0133\3\0\2\u0135"+ + "\2\0\1\u0135\4\0\46\u0135\40\0\1\u0133\1\0\1\u018c"+ + "\113\0\1\u018d\1\u0134\3\0\1\317\1\320\2\0\2\u0134"+ + "\2\u018d\2\u0134\1\u018d\4\0\46\u018d\23\0\1\u0134\6\0"+ + "\2\u0135\1\u018e\3\0\1\u018f\1\u0133\1\0\7\u0135\4\0"+ + "\46\u0135\23\0\1\u0135\17\0\2\u0190\1\0\4\u0190\4\0"+ + "\1\u0190\1\0\2\u0190\1\0\1\u0190\6\0\2\u0190\12\0"+ + "\1\u0190\1\0\1\u0190\5\0\2\u0190\41\0\1\133\5\0"+ + "\1\u0191\1\144\2\0\2\u0191\1\150\6\0\1\150\75\0"+ + "\2\15\7\0\7\15\4\0\4\15\1\u0192\41\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u0193"+ + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\24\15\1\u0194\21\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\7\15\1\u0195\36\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\10\15\1\u0196\35\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\20\15\1\u0197"+ + "\25\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u0198\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u0199\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u019a\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u019b"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\12\15\1\u019c\33\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\30\15\1\u019d\10\15\1\u019e\4\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u019f"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\1\15\1\u01a0\44\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\5\15\1\u01a1\40\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\15\1\u01a2\44\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\12\15\1\u01a3"+ + "\33\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\32\15\1\u01a4\13\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\6\15\1\u01a5\37\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u01a6\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\33\15\1\u01a7"+ + "\12\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u01a8\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\16\15\1\u01a9\27\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\17\15\1\u01aa\26\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\7\15\1\u01ab"+ + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\3\15\1\u01ac\42\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\1\15\1\u01ad\44\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u01ae\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u01af"+ + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u01b0\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\15\15\1\u01b1\30\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u01b2\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u01b3"+ + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u01b4\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u01b5\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\23\15\1\u01b6\22\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u01b7"+ + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\23\15\1\u01b8\22\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\16\15\1\u01b9\27\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\u01ba\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u01bb"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\37\15\1\u01bc\2\15\1\u01bd\3\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u01be\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\32\15\1\u01bf"+ + "\13\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u01c0\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\11\15\1\u01c1\34\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u01c2\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u01c3"+ + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\12\15\1\u01c4\33\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\1\15\1\u01c5\44\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\1\u01c6\45\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u01c7\31\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15"+ + "\1\u01c8\35\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\1\15\1\u01c9\44\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\12\15\1\u01ca\33\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u01cb\43\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\30\15"+ + "\1\u01cc\15\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u01cd\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u01ce\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\10\15\1\u01cf\35\15"+ + "\23\0\1\15\1\u012a\2\0\11\u012a\1\u0183\1\u012a\1\u0183"+ + "\105\u012a\6\0\1\u01d0\12\0\2\u01d0\2\0\1\u01d0\4\0"+ + "\46\u01d0\32\0\1\u01d1\12\0\2\u01d1\2\0\1\u01d1\4\0"+ + "\46\u01d1\32\0\1\u018a\5\0\1\u0187\1\u0188\3\0\2\u018a"+ + "\2\0\1\u018a\4\0\46\u018a\40\0\1\u0188\1\0\1\u01d2"+ + "\113\0\1\u01d3\1\u0189\3\0\1\115\1\u012e\2\0\2\u0189"+ + "\2\u01d3\2\u0189\1\u01d3\4\0\46\u01d3\23\0\1\u0189\6\0"+ + "\2\u018a\1\u01d4\3\0\1\u01d5\1\u0188\1\0\7\u018a\4\0"+ + "\46\u018a\23\0\1\u018a\6\0\1\u018d\1\u018b\3\0\1\317"+ + "\1\u0132\1\u0133\1\0\2\u018b\2\u018d\2\u018b\1\u018d\4\0"+ + "\46\u018d\23\0\1\u018b\1\u018c\2\0\13\u018c\1\u01d6\105\u018c"+ + "\6\0\2\u018d\1\u018e\2\0\1\317\1\u0132\1\u0133\1\0"+ + "\7\u018d\4\0\46\u018d\23\0\1\u018d\6\0\1\u01d7\12\0"+ + "\2\u01d7\2\0\1\u01d7\4\0\46\u01d7\40\0\1\u018f\1\u0133"+ + "\125\0\2\u01d8\1\0\4\u01d8\4\0\1\u01d8\1\0\2\u01d8"+ + "\1\0\1\u01d8\6\0\2\u01d8\12\0\1\u01d8\1\0\1\u01d8"+ + "\5\0\2\u01d8\41\0\1\133\5\0\1\u01d9\1\144\2\0"+ + "\2\u01d9\1\150\6\0\1\150\75\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u01da\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u01db\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u01dc\22\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15"+ + "\1\u01dd\31\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u01de\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\41\15\1\u01df\4\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\5\15\1\u01e0\40\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15"+ + "\1\u01e1\27\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\1\15\1\u01e2\44\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\u01e3\44\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\20\15\1\u01e4\25\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15"+ + "\1\u01e5\33\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u01e6\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\u01e7\44\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\21\15\1\u01e8\24\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\3\15"+ + "\1\u01e9\42\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\11\15\1\u01ea\34\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u01eb\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\15\15\1\u01ec\30\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15"+ + "\1\u01ed\35\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u01ee\4\15\1\u01ef\30\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u01f0\22\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\11\15"+ + "\1\u01f1\34\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\23\15\1\u01f2\22\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\12\15\1\u01f3\33\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u01f4\31\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15"+ + "\1\u01f5\27\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\u01f6\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\5\15\1\u01f7\40\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u01f8\33\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15"+ + "\1\u01f9\22\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\16\15\1\u01fa\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\12\15\1\u01fb\33\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\20\15\1\u01fc\25\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\7\15"+ + "\1\u01fd\36\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\3\15\1\u01fe\42\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\u01ff\44\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\5\15\1\u0200\40\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\30\15"+ + "\1\u0201\13\15\1\u0202\1\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\11\15\1\u0203\34\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\26\15\1\u0204\17\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\5\15"+ + "\1\u0205\40\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\6\15\1\u0206\37\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\26\15\1\u0207\17\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\16\15\1\u0208\27\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15"+ + "\1\u0209\22\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\1\15\1\u020a\44\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\10\15\1\u020b\35\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\26\15\1\u020c\17\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15"+ + "\1\u020d\44\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\12\15\1\u020e\33\15\23\0\1\15\6\0\2\u01d0"+ + "\3\0\1\u0185\3\0\7\u01d0\4\0\46\u01d0\23\0\1\u01d0"+ + "\6\0\1\u01d3\1\u01d1\3\0\1\115\1\u0187\1\u0188\1\0"+ + "\2\u01d1\2\u01d3\2\u01d1\1\u01d3\4\0\46\u01d3\23\0\1\u01d1"+ + "\1\u01d2\2\0\13\u01d2\1\u020f\105\u01d2\6\0\2\u01d3\1\u01d4"+ + "\2\0\1\115\1\u0187\1\u0188\1\0\7\u01d3\4\0\46\u01d3"+ + "\23\0\1\u01d3\6\0\1\u0210\12\0\2\u0210\2\0\1\u0210"+ + "\4\0\46\u0210\40\0\1\u01d5\1\u0188\106\0\1\u018c\2\0"+ + "\10\u018c\1\u0211\1\u01d6\1\u018c\1\u01d6\105\u018c\6\0\2\u01d7"+ + "\4\0\1\u018f\1\u0133\1\0\7\u01d7\4\0\46\u01d7\23\0"+ + "\1\u01d7\17\0\2\u0212\1\0\4\u0212\4\0\1\u0212\1\0"+ + "\2\u0212\1\0\1\u0212\6\0\2\u0212\12\0\1\u0212\1\0"+ + "\1\u0212\5\0\2\u0212\41\0\1\133\5\0\1\u0213\1\144"+ + "\2\0\2\u0213\1\150\6\0\1\150\75\0\2\15\7\0"+ + "\7\15\4\0\37\15\1\u0214\6\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u0215\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u0216"+ + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\1\15\1\u0217\44\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\16\15\1\u0218\27\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u0219\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u021a"+ + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u021b\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\3\15\1\u021c\42\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u021d\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u021e"+ + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\43\15\1\u021f\2\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\34\15\1\u0220\11\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\5\15\1\u0221\40\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0222"+ + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\3\15\1\u0223\42\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0224\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u0225\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\u0226"+ + "\35\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\37\15\1\u0227\6\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\11\15\1\u0228\34\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u0229\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\5\15\1\u022a"+ + "\40\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\3\15\1\u022b\42\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\22\15\1\u022c\23\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\7\15\1\u022d\36\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\24\15\1\u022e"+ + "\21\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\1\15\1\u022f\44\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\3\15\1\u0230\42\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\u0231\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\u0232"+ + "\37\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\13\15\1\u0233\32\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0234\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\2\15\1\u0235\43\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u0236"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u0237\34\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0238\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u0239\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u023a"+ + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\11\15\1\u023b\34\15\23\0\1\15\1\u01d2\2\0\10\u01d2"+ + "\1\u023c\1\u020f\1\u01d2\1\u020f\105\u01d2\6\0\2\u0210\4\0"+ + "\1\u01d5\1\u0188\1\0\7\u0210\4\0\46\u0210\23\0\1\u0210"+ + "\17\0\2\u023d\1\0\4\u023d\4\0\1\u023d\1\0\2\u023d"+ + "\1\0\1\u023d\6\0\2\u023d\12\0\1\u023d\1\0\1\u023d"+ + "\5\0\2\u023d\41\0\1\133\5\0\1\u023e\1\144\2\0"+ + "\2\u023e\1\150\6\0\1\150\75\0\2\15\7\0\7\15"+ + "\4\0\7\15\1\u023f\36\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u0240\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\3\15\1\u0241\42\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\31\15"+ + "\1\u0242\14\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\26\15\1\u0243\17\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u0244\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u0245\22\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\5\15"+ + "\1\u0246\40\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\26\15\1\u0247\17\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\3\15\1\u0248\42\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u0249\33\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15"+ + "\1\u024a\43\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\16\15\1\u024b\27\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\5\15\1\u024c\40\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\36\15\1\u024d\7\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15"+ + "\1\u024e\35\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\u024f\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\7\15\1\u0250\36\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\11\15\1\u0251\34\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15"+ + "\1\u0252\35\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\10\15\1\u0253\35\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\12\15\1\u0254\33\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u0255\33\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15"+ + "\1\u0256\22\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\u0257\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\3\15\1\u0258\3\15\4\0\46\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u0259\22\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15"+ + "\1\u025a\44\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\20\15\1\u025b\25\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\1\15\1\u025c\44\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u025d\33\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\31\15"+ + "\1\u025e\11\15\1\u025f\2\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\22\15\1\u0260\23\15\23\0\1\15"+ + "\17\0\2\u0261\1\0\4\u0261\4\0\1\u0261\1\0\2\u0261"+ + "\1\0\1\u0261\6\0\2\u0261\12\0\1\u0261\1\0\1\u0261"+ + "\5\0\2\u0261\41\0\1\133\5\0\1\u0262\1\144\2\0"+ + "\2\u0262\1\150\6\0\1\150\75\0\2\15\7\0\7\15"+ + "\4\0\24\15\1\u0263\21\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\26\15\1\u0264\17\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\7\15\1\u0265\36\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15"+ + "\1\u0266\43\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\u0267\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u0268\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\11\15\1\u0269\34\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\26\15"+ + "\1\u026a\17\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\7\15\1\u026b\36\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\2\15\1\u026c\43\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\7\15\1\u026d\36\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\11\15"+ + "\1\u026e\34\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\14\15\1\u026f\31\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\24\15\1\u0270\21\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u0271\43\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15"+ + "\1\u0272\31\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\2\15\1\u0273\43\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\3\15\1\u0274\42\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u0275\43\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15"+ + "\1\u0276\31\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\12\15\1\u0277\33\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\12\15\1\u0278\33\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\7\15\1\u0279\36\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\11\15"+ + "\1\u027a\34\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\16\15\1\u027b\27\15\23\0\1\15\17\0\2\u027c"+ + "\1\0\4\u027c\4\0\1\u027c\1\0\2\u027c\1\0\1\u027c"+ + "\6\0\2\u027c\12\0\1\u027c\1\0\1\u027c\5\0\2\u027c"+ + "\41\0\1\133\5\0\1\u027d\1\144\2\0\2\u027d\1\150"+ + "\6\0\1\150\75\0\2\15\7\0\7\15\4\0\12\15"+ + "\1\u027e\33\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\13\15\1\u027f\32\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\11\15\1\u0280\34\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\20\15\1\u0281\25\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\20\15"+ + "\1\u0282\25\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\15\15\1\u0283\30\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\3\15\1\u0284\42\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\6\15\1\u0285\37\15"+ + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15"+ + "\1\u0286\33\15\23\0\1\15\6\0\2\15\7\0\7\15"+ + "\4\0\37\15\1\u0287\6\15\23\0\1\15\6\0\2\15"+ + "\7\0\7\15\4\0\44\15\1\u0288\1\15\23\0\1\15"+ + "\6\0\2\15\7\0\7\15\4\0\1\u0289\45\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u028a"+ + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\10\15\1\u028b\35\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\10\15\1\u028c\35\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\7\15\1\u028d\36\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u028e"+ + "\42\15\23\0\1\15\11\0\1\133\5\0\1\u028f\1\144"+ + "\2\0\2\u028f\1\150\6\0\1\150\75\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0290\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\10\15\1\u0291\35\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\35\15\1\u0292"+ + "\10\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\14\15\1\u0293\31\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u0294\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\7\15\1\u0295\36\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u0296"+ + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\16\15\1\u0297\27\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\23\15\1\u0298\22\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\26\15\1\u0299\17\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\21\15\1\u029a"+ + "\24\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\22\15\1\u029b\23\15\23\0\1\15\11\0\1\133\5\0"+ + "\1\u029c\1\144\2\0\2\u029c\1\150\6\0\1\150\75\0"+ + "\2\15\7\0\7\15\4\0\40\15\1\u029d\5\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u029e"+ + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\13\15\1\u029f\32\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u02a0\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\44\15\1\u02a1\1\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\24\15\1\u02a2"+ + "\21\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\23\15\1\u02a3\22\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\2\15\1\u02a4\43\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u02a5\42\15\23\0"+ + "\1\15\11\0\1\133\5\0\1\u02a6\1\144\2\0\2\u02a6"+ + "\1\150\6\0\1\150\75\0\2\15\7\0\7\15\4\0"+ + "\16\15\1\u02a7\27\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\6\15\1\u02a8\37\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\3\15\1\u02a9\42\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u02aa"+ + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\13\15\1\u02ab\32\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u02ac\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\6\15\1\u02ad\37\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\21\15\1\u02ae"+ + "\24\15\23\0\1\15\11\0\1\133\5\0\1\u02af\1\144"+ + "\2\0\2\u02af\1\150\6\0\1\150\75\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u02b0\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\16\15\1\u02b1\27\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\23\15\1\u02b2"+ + "\22\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\2\15\1\u02b3\43\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\44\15\1\u02b4\1\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\44\15\1\u02b5\1\15\23\0"+ + "\1\15\11\0\1\133\5\0\1\u02b6\1\144\2\0\2\u02b6"+ + "\1\150\6\0\1\150\75\0\2\15\7\0\7\15\4\0"+ + "\21\15\1\u02b7\24\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\12\15\1\u02b8\33\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\40\15\1\u02b9\5\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u02ba"+ + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\13\15\1\u02bb\32\15\23\0\1\15\11\0\1\133\5\0"+ + "\1\u02bc\1\144\2\0\2\u02bc\1\150\6\0\1\150\75\0"+ + "\2\15\7\0\7\15\4\0\11\15\1\u02bd\34\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u02be"+ + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\23\15\1\u02bf\22\15\23\0\1\15\6\0\2\15\7\0"+ + "\7\15\4\0\23\15\1\u02c0\22\15\23\0\1\15\6\0"+ + "\2\15\7\0\7\15\4\0\22\15\1\u02c1\23\15\23\0"+ + "\1\15\6\0\2\15\7\0\7\15\4\0\12\15\1\u02c2"+ + "\33\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0"+ + "\21\15\1\u02c3\24\15\23\0\1\15"; - private static int[] zzUnpackRowMap() { - int[] result = new int[705]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; + private static int [] zzUnpackTrans() { + int [] result = new int[46116]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); } + return j; + } - private static int zzUnpackRowMap(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\6\0\1\11\1\1\1\11\11\1\1\11\3\1\1\11"+ + "\27\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11"+ + "\4\1\1\11\2\1\1\11\1\1\1\11\1\1\1\11"+ + "\3\1\1\11\1\1\1\0\3\11\2\0\1\1\1\0"+ + "\1\1\2\11\1\1\1\11\3\1\1\0\2\1\1\0"+ + "\2\11\1\0\75\1\12\11\1\1\6\11\1\1\1\11"+ + "\1\1\6\0\2\11\3\1\1\11\2\0\1\11\3\0"+ + "\1\11\1\0\1\11\1\1\2\11\4\1\1\0\113\1"+ + "\1\11\12\0\1\11\5\0\1\11\111\1\1\11\1\0"+ + "\1\11\1\1\1\0\1\11\12\0\100\1\10\0\67\1"+ + "\2\0\153\1\1\11\107\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[707]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); } + return j; + } - /** - * The transition table of the DFA - */ - private static final int[] ZZ_TRANS = zzUnpackTrans(); + /** the input device */ + private java.io.Reader zzReader; - private static final String ZZ_TRANS_PACKED_0 - = "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\7" - + "\1\16\1\17\1\20\1\21\1\12\1\22\1\23\1\24" - + "\1\25\2\15\2\25\1\15\1\26\1\7\1\27\1\30" - + "\1\31\1\32\1\33\1\34\1\15\1\35\1\36\1\37" - + "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\47" - + "\1\15\1\50\1\15\1\51\1\52\1\15\1\53\2\15" - + "\1\54\12\15\1\55\1\56\1\57\1\60\1\61\1\62" - + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72" - + "\1\73\1\74\1\75\1\76\1\77\1\7\1\12\1\7" - + "\1\100\1\101\1\102\13\100\1\103\10\100\1\104\74\100" - + "\1\105\1\101\1\102\24\105\1\106\1\103\73\105\1\7" - + "\1\107\1\110\1\111\2\7\1\112\4\7\1\113\1\114" - + "\4\7\2\112\2\7\1\112\4\7\46\112\22\7\1\111" - + "\1\7\1\115\1\116\1\117\7\115\1\120\111\115\1\121" - + "\1\101\1\102\24\121\1\122\1\121\1\123\72\121\126\0" - + "\1\11\124\0\1\12\10\0\1\12\105\0\1\12\5\0" - + "\1\124\1\125\7\0\1\126\123\0\1\127\114\0\2\15" - + "\7\0\7\15\4\0\46\15\23\0\1\15\10\0\1\130" - + "\124\0\1\131\1\132\4\0\2\133\2\0\2\133\105\0" - + "\1\134\3\0\1\135\1\136\1\0\1\137\3\0\2\134" - + "\2\0\1\134\4\0\46\134\37\0\1\140\1\0\1\141" - + "\123\0\1\142\117\0\1\133\5\0\1\143\1\144\1\145" - + "\1\0\1\146\1\147\1\150\6\0\1\150\22\0\1\145" - + "\55\0\1\133\5\0\2\25\2\0\2\25\1\150\6\0" - + "\1\150\104\0\1\151\10\0\1\152\103\0\2\15\7\0" - + "\7\15\4\0\1\15\1\153\44\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\154\1\155\42\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\3\15" - + "\1\156\12\15\1\157\5\15\1\160\1\161\20\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\162" - + "\1\15\1\163\35\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\164\3\15\1\165\6\15\1\166" - + "\1\15\1\167\25\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\170\6\15\1\171\1\15\1\172" - + "\3\15\1\173\26\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\15\1\174\22\15\1\175\21\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\176" - + "\1\177\7\15\1\200\32\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\1\15\1\201\1\202\1\203\3\15" - + "\1\204\10\15\1\205\1\15\1\206\23\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\6\15\1\207\1\15" - + "\1\210\4\15\1\211\5\15\1\212\22\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\6\15\1\213\1\15" - + "\1\214\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\215\4\15\1\216\3\15\1\217\6\15" - + "\1\220\23\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\3\15\1\221\2\15\1\222\1\223\2\15\1\224" - + "\1\225\32\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\226\4\15\1\227\36\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\12\15\1\230\5\15" - + "\1\231\25\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\232\1\15\1\233\7\15\1\234\2\15" - + "\1\235\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\236\45\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\237\3\15\1\240\36\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\241" - + "\4\15\1\242\36\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\243\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\244\7\15\1\245" - + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\10\15\1\246\35\15\23\0\1\15\15\0\1\247\123\0" - + "\1\250\75\0\1\251\25\0\1\252\76\0\1\253\24\0" - + "\1\254\77\0\1\255\23\0\1\256\123\0\1\257\106\0" - + "\1\100\2\0\13\100\1\0\10\100\1\0\74\100\2\0" - + "\1\102\121\0\1\260\2\0\13\260\1\261\1\262\3\260" - + "\2\262\2\260\1\263\1\264\1\260\1\265\1\266\6\260" - + "\1\267\1\270\1\260\1\271\1\260\1\272\7\260\1\273" - + "\41\260\3\0\1\105\2\0\24\105\2\0\73\105\1\260" - + "\2\0\13\260\1\261\10\260\1\263\1\264\1\260\1\265" - + "\1\266\6\260\1\267\1\270\1\260\1\271\1\260\1\272" - + "\7\260\1\273\41\260\5\0\1\110\124\0\1\111\10\0" - + "\1\111\105\0\1\111\7\0\2\274\1\275\3\0\1\276" - + "\1\277\1\0\7\274\4\0\46\274\23\0\1\274\3\0" - + "\1\111\2\0\1\274\5\0\1\114\4\0\2\274\2\0" - + "\1\274\4\0\46\274\22\0\1\111\3\0\1\117\125\0" - + "\1\300\1\0\1\301\12\0\2\301\2\0\1\301\4\0" - + "\46\301\24\0\1\121\2\0\24\121\1\0\1\121\1\0" - + "\72\121\1\302\2\0\24\302\1\263\1\302\1\303\1\265" - + "\1\266\6\302\1\267\1\270\1\302\1\304\1\302\1\272" - + "\7\302\1\305\41\302\3\0\1\124\1\306\1\307\121\124" - + "\5\310\1\311\116\310\11\0\1\312\120\0\1\313\12\0" - + "\2\313\2\0\1\313\4\0\46\313\43\0\2\133\2\0" - + "\2\133\1\150\6\0\1\150\75\0\1\314\1\134\1\315" - + "\2\0\1\316\1\317\2\0\2\134\2\314\2\134\1\314" - + "\4\0\46\314\23\0\1\134\15\0\1\320\121\0\1\321" - + "\1\0\1\322\123\0\1\323\117\0\1\133\5\0\1\143" - + "\1\144\2\0\1\146\1\147\1\150\6\0\1\150\100\0" - + "\1\133\5\0\2\144\2\0\2\144\1\150\6\0\1\150" - + "\106\0\1\324\1\325\1\0\4\325\4\0\1\325\1\0" - + "\2\325\1\0\1\325\6\0\2\325\12\0\1\325\1\0" - + "\1\325\5\0\2\325\41\0\1\133\5\0\1\147\1\144" - + "\2\0\2\147\1\150\6\0\1\150\100\0\1\133\5\0" - + "\1\326\1\144\2\0\2\326\1\150\6\0\1\150\106\0" - + "\2\327\2\0\2\327\1\0\1\330\66\0\1\330\14\0" - + "\2\15\7\0\7\15\4\0\2\15\1\331\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\332" - + "\11\15\1\333\22\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\10\15\1\334\35\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\5\15\1\335\40\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\336" - + "\37\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\3\15\1\337\42\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\340\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\14\15\1\341\31\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\342" - + "\2\15\1\343\4\15\1\344\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\10\15\1\345\35\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\346" - + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\1\15\1\347\44\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\350\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\351\3\15\1\352" - + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\1\353\20\15\1\354\24\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\355\33\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\14\15\1\356\31\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\357\43\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\17\15\1\360\5\15\1\361\20\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\23\15\1\362\22\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15" - + "\1\363\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\3\15\1\364\7\15\1\365\6\15\1\366\23\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15" - + "\1\367\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\370\44\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\26\15\1\371\17\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\1\15\1\372\10\15" - + "\1\373\33\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\21\15\1\374\24\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\6\15\1\375\2\15\1\376\34\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\32\15" - + "\1\377\13\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\21\15\1\u0100\24\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\2\15\1\u0101\43\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u0102\1\15" - + "\1\u0103\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\15\15\1\u0104\1\u0105\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\21\15\1\u0106\24\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\u0107" - + "\35\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\16\15\1\u0108\27\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\5\15\1\u0109\40\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\1\15\1\u010a\44\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\u010b" - + "\35\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\10\15\1\u010c\35\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\10\15\1\u010d\35\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\u010e\42\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u010f" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u0110\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u0111\4\15\1\u0112\2\15\1\u0113" - + "\33\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\5\15\1\u0114\40\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\u0115\45\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\3\15\1\u0116\42\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\5\15\1\u0117\1\u0118" - + "\1\u0119\6\15\1\u011a\27\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\1\15\1\u011b\44\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u011c\33\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\11\15" - + "\1\u011d\34\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\11\15\1\u011e\34\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\1\15\1\u011f\44\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\44\15\1\u0120\1\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15" - + "\1\u0121\22\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\15\15\1\u0122\30\15\23\0\1\15\15\0\1\u0123" - + "\125\0\1\u0124\3\0\2\u0124\116\0\2\u0125\1\0\4\u0125" - + "\4\0\1\u0125\1\0\2\u0125\1\0\1\u0125\6\0\2\u0125" - + "\12\0\1\u0125\1\0\1\u0125\5\0\2\u0125\47\0\2\u0126" - + "\1\0\4\u0126\4\0\1\u0126\1\0\2\u0126\1\0\1\u0126" - + "\6\0\2\u0126\12\0\1\u0126\1\0\1\u0126\5\0\2\u0126" - + "\36\0\1\u0127\12\0\2\u0127\2\0\1\u0127\4\0\46\u0127" - + "\40\0\1\276\1\277\122\0\1\277\1\0\1\u0128\113\0" - + "\1\u0129\12\0\2\u0129\2\0\1\u0129\4\0\46\u0129\32\0" - + "\1\u012a\1\301\1\u012b\2\0\1\115\1\u012c\2\0\2\301" - + "\2\u012a\2\301\1\u012a\4\0\46\u012a\23\0\1\301\2\0" - + "\1\307\121\0\5\310\1\u012d\116\310\4\0\1\307\1\311" - + "\124\0\2\313\3\0\1\u012e\3\0\7\313\4\0\46\313" - + "\23\0\1\313\6\0\2\314\1\u012f\2\0\1\316\1\u0130" - + "\1\u0131\1\0\7\314\4\0\46\314\23\0\1\314\6\0" - + "\1\u0132\12\0\2\u0132\2\0\1\u0132\4\0\46\u0132\32\0" - + "\1\u0133\5\0\1\317\4\0\2\u0133\2\0\1\u0133\4\0" - + "\46\u0133\41\0\1\u0134\125\0\2\u0135\1\0\4\u0135\4\0" - + "\1\u0135\1\0\2\u0135\1\0\1\u0135\6\0\2\u0135\12\0" - + "\1\u0135\1\0\1\u0135\5\0\2\u0135\41\0\1\133\5\0" - + "\1\u0136\1\144\2\0\2\u0136\1\150\6\0\1\150\106\0" - + "\2\327\2\0\2\327\105\0\2\15\7\0\7\15\4\0" - + "\3\15\1\u0137\42\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\13\15\1\u0138\32\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\7\15\1\u0139\36\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u013a" - + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\20\15\1\u013b\25\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u013c\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\16\15\1\u013d\27\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u013e" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u013f\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\5\15\1\u0140\40\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\16\15\1\u0141\27\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\u0142" - + "\2\15\1\u0143\34\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u0144\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\1\15\1\u0145\7\15\1\u0146" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\21\15\1\u0147\24\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u0148\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u0149\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u014a" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\1\15\1\u014b\44\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\16\15\1\u014c\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u014d\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u014e" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\16\15\1\u014f\27\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\5\15\1\u0150\40\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u0151\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u0152" - + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\26\15\1\u0153\17\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\26\15\1\u0154\17\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\7\15\1\u0155\36\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\6\15\1\u0156" - + "\37\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u0157\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\u0158\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u0159\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u015a" - + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\7\15\1\u015b\6\15\1\u015c\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u015d\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\7\15\1\u015e" - + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\3\15\1\u015f\42\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u0160\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\16\15\1\u0161\27\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0162" - + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\6\15\1\u0163\37\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\7\15\1\u0164\36\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\u0165\42\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\5\15\1\u0166" - + "\40\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\26\15\1\u0167\17\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\14\15\1\u0168\31\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\20\15\1\u0169\25\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u016a" - + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\24\15\1\u016b\21\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\u016c\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\10\15\1\u016d\13\15\1\u016e" - + "\21\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\4\15\1\u016f\41\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\16\15\1\u0170\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\22\15\1\u0171\23\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\20\15\1\u0172" - + "\25\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\13\15\1\u0173\32\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\15\1\u0174\44\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u0175\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u0176" - + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\27\15\1\u0177\3\15\1\u0178\6\15\1\u0179\3\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\7\15\1\u017a" - + "\36\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u017b\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\u017c\45\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\u017d\33\15\23\0\1\15" - + "\17\0\1\u017e\3\0\2\u017e\116\0\2\u017f\1\0\4\u017f" - + "\4\0\1\u017f\1\0\2\u017f\1\0\1\u017f\6\0\2\u017f" - + "\12\0\1\u017f\1\0\1\u017f\5\0\2\u017f\47\0\2\u0180" - + "\1\0\4\u0180\4\0\1\u0180\1\0\2\u0180\1\0\1\u0180" - + "\6\0\2\u0180\12\0\1\u0180\1\0\1\u0180\5\0\2\u0180" - + "\36\0\2\u0127\4\0\1\276\1\277\1\0\7\u0127\4\0" - + "\46\u0127\23\0\1\u0127\1\u0128\2\0\13\u0128\1\u0181\105\u0128" - + "\6\0\2\u0129\1\u0182\2\0\1\u0183\3\0\7\u0129\4\0" - + "\46\u0129\23\0\1\u0129\6\0\2\u012a\1\u0184\2\0\1\115" - + "\1\u0185\1\u0186\1\0\7\u012a\4\0\46\u012a\23\0\1\u012a" - + "\6\0\1\u0187\12\0\2\u0187\2\0\1\u0187\4\0\46\u0187" - + "\32\0\1\u0188\5\0\1\u012c\4\0\2\u0188\2\0\1\u0188" - + "\4\0\46\u0188\24\0\4\310\1\307\1\u012d\116\310\6\0" - + "\1\u0189\12\0\2\u0189\2\0\1\u0189\4\0\46\u0189\32\0" - + "\1\u0133\5\0\1\u0130\1\u0131\3\0\2\u0133\2\0\1\u0133" - + "\4\0\46\u0133\40\0\1\u0131\1\0\1\u018a\113\0\1\u018b" - + "\1\u0132\3\0\1\316\1\317\2\0\2\u0132\2\u018b\2\u0132" - + "\1\u018b\4\0\46\u018b\23\0\1\u0132\6\0\2\u0133\1\u018c" - + "\3\0\1\u018d\1\u0131\1\0\7\u0133\4\0\46\u0133\23\0" - + "\1\u0133\17\0\2\u018e\1\0\4\u018e\4\0\1\u018e\1\0" - + "\2\u018e\1\0\1\u018e\6\0\2\u018e\12\0\1\u018e\1\0" - + "\1\u018e\5\0\2\u018e\41\0\1\133\5\0\1\u018f\1\144" - + "\2\0\2\u018f\1\150\6\0\1\150\75\0\2\15\7\0" - + "\7\15\4\0\4\15\1\u0190\41\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\1\15\1\u0191\44\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\24\15\1\u0192" - + "\21\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\7\15\1\u0193\36\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\10\15\1\u0194\35\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\20\15\1\u0195\25\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u0196" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u0197\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u0198\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u0199\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\12\15\1\u019a" - + "\33\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\30\15\1\u019b\10\15\1\u019c\4\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u019d\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u019e" - + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\5\15\1\u019f\40\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\15\1\u01a0\44\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\12\15\1\u01a1\33\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\32\15\1\u01a2" - + "\13\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\6\15\1\u01a3\37\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u01a4\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\33\15\1\u01a5\12\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u01a6" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\16\15\1\u01a7\27\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\17\15\1\u01a8\26\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\7\15\1\u01a9\36\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u01aa" - + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\1\15\1\u01ab\44\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u01ac\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\1\15\1\u01ad\44\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u01ae" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\15\15\1\u01af\30\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u01b0\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\13\15\1\u01b1\32\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u01b2" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u01b3\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\23\15\1\u01b4\22\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\2\15\1\u01b5\43\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\23\15\1\u01b6" - + "\22\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\16\15\1\u01b7\27\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\u01b8\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u01b9\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\37\15\1\u01ba" - + "\2\15\1\u01bb\3\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u01bc\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\32\15\1\u01bd\13\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u01be" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\11\15\1\u01bf\34\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u01c0\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\u01c1\42\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\12\15\1\u01c2" - + "\33\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\1\15\1\u01c3\44\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\1\u01c4\45\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\14\15\1\u01c5\31\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\10\15\1\u01c6\35\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15" - + "\1\u01c7\44\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\12\15\1\u01c8\33\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\2\15\1\u01c9\43\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\30\15\1\u01ca\15\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u01cb\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u01cc\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\10\15\1\u01cd\35\15\23\0\1\15" - + "\1\u0128\2\0\11\u0128\1\u0181\1\u0128\1\u0181\105\u0128\6\0" - + "\1\u01ce\12\0\2\u01ce\2\0\1\u01ce\4\0\46\u01ce\32\0" - + "\1\u01cf\12\0\2\u01cf\2\0\1\u01cf\4\0\46\u01cf\32\0" - + "\1\u0188\5\0\1\u0185\1\u0186\3\0\2\u0188\2\0\1\u0188" - + "\4\0\46\u0188\40\0\1\u0186\1\0\1\u01d0\113\0\1\u01d1" - + "\1\u0187\3\0\1\115\1\u012c\2\0\2\u0187\2\u01d1\2\u0187" - + "\1\u01d1\4\0\46\u01d1\23\0\1\u0187\6\0\2\u0188\1\u01d2" - + "\3\0\1\u01d3\1\u0186\1\0\7\u0188\4\0\46\u0188\23\0" - + "\1\u0188\6\0\1\u018b\1\u0189\3\0\1\316\1\u0130\1\u0131" - + "\1\0\2\u0189\2\u018b\2\u0189\1\u018b\4\0\46\u018b\23\0" - + "\1\u0189\1\u018a\2\0\13\u018a\1\u01d4\105\u018a\6\0\2\u018b" - + "\1\u018c\2\0\1\316\1\u0130\1\u0131\1\0\7\u018b\4\0" - + "\46\u018b\23\0\1\u018b\6\0\1\u01d5\12\0\2\u01d5\2\0" - + "\1\u01d5\4\0\46\u01d5\40\0\1\u018d\1\u0131\125\0\2\u01d6" - + "\1\0\4\u01d6\4\0\1\u01d6\1\0\2\u01d6\1\0\1\u01d6" - + "\6\0\2\u01d6\12\0\1\u01d6\1\0\1\u01d6\5\0\2\u01d6" - + "\41\0\1\133\5\0\1\u01d7\1\144\2\0\2\u01d7\1\150" - + "\6\0\1\150\75\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u01d8\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u01d9\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\23\15\1\u01da\22\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u01db\31\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u01dc\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\41\15\1\u01dd\4\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\5\15\1\u01de\40\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\16\15\1\u01df\27\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15" - + "\1\u01e0\44\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\u01e1\44\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\20\15\1\u01e2\25\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u01e3\33\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u01e4\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\u01e5\44\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\21\15\1\u01e6\24\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\3\15\1\u01e7\42\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\11\15" - + "\1\u01e8\34\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u01e9\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\15\15\1\u01ea\30\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\10\15\1\u01eb\35\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u01ec\4\15\1\u01ed\30\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\23\15\1\u01ee\22\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\11\15\1\u01ef\34\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\23\15" - + "\1\u01f0\22\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\12\15\1\u01f1\33\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\14\15\1\u01f2\31\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\16\15\1\u01f3\27\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\u01f4\43\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\5\15\1\u01f5\40\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\u01f6\33\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u01f7\22\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15" - + "\1\u01f8\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\12\15\1\u01f9\33\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\20\15\1\u01fa\25\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\7\15\1\u01fb\36\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\3\15" - + "\1\u01fc\42\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\u01fd\44\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\5\15\1\u01fe\40\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\30\15\1\u01ff\13\15" - + "\1\u0200\1\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\11\15\1\u0201\34\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\26\15\1\u0202\17\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\5\15\1\u0203\40\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\6\15" - + "\1\u0204\37\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\26\15\1\u0205\17\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\16\15\1\u0206\27\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u0207\22\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\1\15" - + "\1\u0208\44\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\10\15\1\u0209\35\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\26\15\1\u020a\17\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\1\15\1\u020b\44\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15" - + "\1\u020c\33\15\23\0\1\15\6\0\2\u01ce\3\0\1\u0183" - + "\3\0\7\u01ce\4\0\46\u01ce\23\0\1\u01ce\6\0\1\u01d1" - + "\1\u01cf\3\0\1\115\1\u0185\1\u0186\1\0\2\u01cf\2\u01d1" - + "\2\u01cf\1\u01d1\4\0\46\u01d1\23\0\1\u01cf\1\u01d0\2\0" - + "\13\u01d0\1\u020d\105\u01d0\6\0\2\u01d1\1\u01d2\2\0\1\115" - + "\1\u0185\1\u0186\1\0\7\u01d1\4\0\46\u01d1\23\0\1\u01d1" - + "\6\0\1\u020e\12\0\2\u020e\2\0\1\u020e\4\0\46\u020e" - + "\40\0\1\u01d3\1\u0186\106\0\1\u018a\2\0\10\u018a\1\u020f" - + "\1\u01d4\1\u018a\1\u01d4\105\u018a\6\0\2\u01d5\4\0\1\u018d" - + "\1\u0131\1\0\7\u01d5\4\0\46\u01d5\23\0\1\u01d5\17\0" - + "\2\u0210\1\0\4\u0210\4\0\1\u0210\1\0\2\u0210\1\0" - + "\1\u0210\6\0\2\u0210\12\0\1\u0210\1\0\1\u0210\5\0" - + "\2\u0210\41\0\1\133\5\0\1\u0211\1\144\2\0\2\u0211" - + "\1\150\6\0\1\150\75\0\2\15\7\0\7\15\4\0" - + "\37\15\1\u0212\6\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u0213\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\13\15\1\u0214\32\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u0215" - + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\16\15\1\u0216\27\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u0217\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\14\15\1\u0218\31\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u0219" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\3\15\1\u021a\42\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u021b\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\1\15\1\u021c\44\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\43\15\1\u021d" - + "\2\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\34\15\1\u021e\11\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\5\15\1\u021f\40\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\u0220\42\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0221" - + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u0222\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u0223\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\10\15\1\u0224\35\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\37\15\1\u0225" - + "\6\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\11\15\1\u0226\34\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u0227\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\5\15\1\u0228\40\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\3\15\1\u0229" - + "\42\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\22\15\1\u022a\23\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\7\15\1\u022b\36\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\24\15\1\u022c\21\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\1\15\1\u022d" - + "\44\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\3\15\1\u022e\42\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\11\15\1\u022f\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\6\15\1\u0230\37\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u0231" - + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u0232\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\2\15\1\u0233\43\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u0234\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u0235" - + "\34\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u0236\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u0237\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\14\15\1\u0238\31\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\11\15\1\u0239" - + "\34\15\23\0\1\15\1\u01d0\2\0\10\u01d0\1\u023a\1\u020d" - + "\1\u01d0\1\u020d\105\u01d0\6\0\2\u020e\4\0\1\u01d3\1\u0186" - + "\1\0\7\u020e\4\0\46\u020e\23\0\1\u020e\17\0\2\u023b" - + "\1\0\4\u023b\4\0\1\u023b\1\0\2\u023b\1\0\1\u023b" - + "\6\0\2\u023b\12\0\1\u023b\1\0\1\u023b\5\0\2\u023b" - + "\41\0\1\133\5\0\1\u023c\1\144\2\0\2\u023c\1\150" - + "\6\0\1\150\75\0\2\15\7\0\7\15\4\0\7\15" - + "\1\u023d\36\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u023e\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\3\15\1\u023f\42\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\31\15\1\u0240\14\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\26\15" - + "\1\u0241\17\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u0242\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\23\15\1\u0243\22\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\5\15\1\u0244\40\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\26\15" - + "\1\u0245\17\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\3\15\1\u0246\42\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\u0247\33\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u0248\43\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15" - + "\1\u0249\27\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\5\15\1\u024a\40\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\36\15\1\u024b\7\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\10\15\1\u024c\35\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\u024d\43\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\7\15\1\u024e\36\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\11\15\1\u024f\34\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\10\15\1\u0250\35\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\10\15" - + "\1\u0251\35\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\12\15\1\u0252\33\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\u0253\33\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\23\15\1\u0254\22\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\u0255\43\15\23\0\1\15\6\0\2\15\7\0\3\15" - + "\1\u0256\3\15\4\0\46\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\23\15\1\u0257\22\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\1\15\1\u0258\44\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\20\15" - + "\1\u0259\25\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\1\15\1\u025a\44\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\12\15\1\u025b\33\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\31\15\1\u025c\11\15" - + "\1\u025d\2\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\22\15\1\u025e\23\15\23\0\1\15\17\0\2\u025f" - + "\1\0\4\u025f\4\0\1\u025f\1\0\2\u025f\1\0\1\u025f" - + "\6\0\2\u025f\12\0\1\u025f\1\0\1\u025f\5\0\2\u025f" - + "\41\0\1\133\5\0\1\u0260\1\144\2\0\2\u0260\1\150" - + "\6\0\1\150\75\0\2\15\7\0\7\15\4\0\24\15" - + "\1\u0261\21\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\26\15\1\u0262\17\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\7\15\1\u0263\36\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\2\15\1\u0264\43\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\u0265\43\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u0266\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\11\15\1\u0267\34\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\26\15\1\u0268\17\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\7\15" - + "\1\u0269\36\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\2\15\1\u026a\43\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\7\15\1\u026b\36\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\11\15\1\u026c\34\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\14\15" - + "\1\u026d\31\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\24\15\1\u026e\21\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\2\15\1\u026f\43\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u0270\31\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\2\15" - + "\1\u0271\43\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\3\15\1\u0272\42\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\2\15\1\u0273\43\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\14\15\1\u0274\31\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\12\15" - + "\1\u0275\33\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\12\15\1\u0276\33\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\7\15\1\u0277\36\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\11\15\1\u0278\34\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\16\15" - + "\1\u0279\27\15\23\0\1\15\17\0\2\u027a\1\0\4\u027a" - + "\4\0\1\u027a\1\0\2\u027a\1\0\1\u027a\6\0\2\u027a" - + "\12\0\1\u027a\1\0\1\u027a\5\0\2\u027a\41\0\1\133" - + "\5\0\1\u027b\1\144\2\0\2\u027b\1\150\6\0\1\150" - + "\75\0\2\15\7\0\7\15\4\0\12\15\1\u027c\33\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\13\15" - + "\1\u027d\32\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\11\15\1\u027e\34\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\20\15\1\u027f\25\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\20\15\1\u0280\25\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\15\15" - + "\1\u0281\30\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\3\15\1\u0282\42\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\6\15\1\u0283\37\15\23\0\1\15" - + "\6\0\2\15\7\0\7\15\4\0\12\15\1\u0284\33\15" - + "\23\0\1\15\6\0\2\15\7\0\7\15\4\0\37\15" - + "\1\u0285\6\15\23\0\1\15\6\0\2\15\7\0\7\15" - + "\4\0\44\15\1\u0286\1\15\23\0\1\15\6\0\2\15" - + "\7\0\7\15\4\0\1\u0287\45\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\11\15\1\u0288\34\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\10\15\1\u0289" - + "\35\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\10\15\1\u028a\35\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\7\15\1\u028b\36\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\3\15\1\u028c\42\15\23\0" - + "\1\15\11\0\1\133\5\0\1\u028d\1\144\2\0\2\u028d" - + "\1\150\6\0\1\150\75\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u028e\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\10\15\1\u028f\35\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\35\15\1\u0290\10\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\14\15\1\u0291" - + "\31\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u0292\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\7\15\1\u0293\36\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\13\15\1\u0294\32\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\16\15\1\u0295" - + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\23\15\1\u0296\22\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\26\15\1\u0297\17\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\21\15\1\u0298\24\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\22\15\1\u0299" - + "\23\15\23\0\1\15\11\0\1\133\5\0\1\u029a\1\144" - + "\2\0\2\u029a\1\150\6\0\1\150\75\0\2\15\7\0" - + "\7\15\4\0\40\15\1\u029b\5\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\14\15\1\u029c\31\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u029d" - + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u029e\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\44\15\1\u029f\1\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\24\15\1\u02a0\21\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\23\15\1\u02a1" - + "\22\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\2\15\1\u02a2\43\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u02a3\42\15\23\0\1\15\11\0" - + "\1\133\5\0\1\u02a4\1\144\2\0\2\u02a4\1\150\6\0" - + "\1\150\75\0\2\15\7\0\7\15\4\0\16\15\1\u02a5" - + "\27\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\6\15\1\u02a6\37\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\3\15\1\u02a7\42\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\14\15\1\u02a8\31\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u02a9" - + "\32\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u02aa\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\6\15\1\u02ab\37\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\21\15\1\u02ac\24\15\23\0" - + "\1\15\11\0\1\133\5\0\1\u02ad\1\144\2\0\2\u02ad" - + "\1\150\6\0\1\150\75\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u02ae\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\16\15\1\u02af\27\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\23\15\1\u02b0\22\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\2\15\1\u02b1" - + "\43\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\44\15\1\u02b2\1\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\44\15\1\u02b3\1\15\23\0\1\15\11\0" - + "\1\133\5\0\1\u02b4\1\144\2\0\2\u02b4\1\150\6\0" - + "\1\150\75\0\2\15\7\0\7\15\4\0\21\15\1\u02b5" - + "\24\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\12\15\1\u02b6\33\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\40\15\1\u02b7\5\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\13\15\1\u02b8\32\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\13\15\1\u02b9" - + "\32\15\23\0\1\15\11\0\1\133\5\0\1\u02ba\1\144" - + "\2\0\2\u02ba\1\150\6\0\1\150\75\0\2\15\7\0" - + "\7\15\4\0\11\15\1\u02bb\34\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\16\15\1\u02bc\27\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\23\15\1\u02bd" - + "\22\15\23\0\1\15\6\0\2\15\7\0\7\15\4\0" - + "\23\15\1\u02be\22\15\23\0\1\15\6\0\2\15\7\0" - + "\7\15\4\0\22\15\1\u02bf\23\15\23\0\1\15\6\0" - + "\2\15\7\0\7\15\4\0\12\15\1\u02c0\33\15\23\0" - + "\1\15\6\0\2\15\7\0\7\15\4\0\21\15\1\u02c1" - + "\24\15\23\0\1\15"; + /** the current state of the DFA */ + private int zzState; - private static int[] zzUnpackTrans() { - int[] result = new int[45864]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; - private static int zzUnpackTrans(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - int j = offset; /* index in unpacked array */ + /** the textposition at the last accepting state */ + private int zzMarkedPos; - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do { - result[j++] = value; - } while (--count > 0); - } - return j; - } + /** the current text position in the buffer */ + private int zzCurrentPos; + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; - private static final int ZZ_NO_MATCH = 1; + /** number of newlines encountered up to the start of the matched text */ + private int yyline; - private static final int ZZ_PUSHBACK_2BIG = 2; + /** the number of characters up to the start of the matched text */ + private int yychar; - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; - private static final String ZZ_ATTRIBUTE_PACKED_0 - = "\6\0\1\11\1\1\1\11\11\1\1\11\3\1\2\11" - + "\26\1\10\11\1\1\2\11\5\1\1\11\2\1\2\11" - + "\4\1\1\11\2\1\1\11\1\1\1\11\1\1\1\11" - + "\3\1\1\11\1\1\1\0\3\11\2\0\1\1\1\0" - + "\1\1\2\11\1\1\1\11\3\1\1\0\2\1\1\0" - + "\2\11\75\1\12\11\1\1\6\11\1\1\1\11\1\1" - + "\6\0\2\11\3\1\1\11\2\0\1\11\3\0\1\11" - + "\1\0\1\11\1\1\2\11\4\1\1\0\112\1\1\11" - + "\12\0\1\11\5\0\1\11\111\1\1\11\1\0\1\11" - + "\1\1\1\0\1\11\12\0\100\1\10\0\67\1\2\0" - + "\153\1\1\11\107\1"; + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; - private static int[] zzUnpackAttribute() { - int[] result = new int[705]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } + /** 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; - private static int zzUnpackAttribute(String packed, int offset, int[] result) { - int i = 0; /* index in packed string */ + /* user code: */ - 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 input device - */ - private java.io.Reader zzReader; - - /** - * the current state of the DFA - */ - private int zzState; - - /** - * the current lexical state - */ - private int zzLexicalState = YYINITIAL; - - /** - * this buffer contains the current text to be matched and is the source of - * the yytext() string - */ - private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; - - /** - * the textposition at the last accepting state - */ - private int zzMarkedPos; - - /** - * the current text position in the buffer - */ - private int zzCurrentPos; - - /** - * startRead marks the beginning of the yytext() string in the buffer - */ - private int zzStartRead; - - /** - * endRead marks the last character in the buffer, that has been read from - * input - */ - private int zzEndRead; - - /** - * number of newlines encountered up to the start of the matched text - */ - private int yyline; - - /** - * the number of characters up to the start of the matched text - */ - private int yychar; - - /** - * the number of characters from the last newline up to the start of the - * matched text - */ - private int yycolumn; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** - * zzAtEOF == true <=> the scanner is at the EOF - */ - private boolean zzAtEOF; - - /** - * denotes if the user-EOF-code has already been executed - */ - private boolean zzEOFDone; - - /** - * 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: */ StringBuffer string = new StringBuffer(); private static String xmlTagName = ""; @@ -1280,22 +1234,22 @@ public final class ActionScriptLexer { private final List listeners = new ArrayList<>(); - public void addListener(LexListener listener) { + public void addListener(LexListener listener){ listeners.add(listener); } - public void removeListener(LexListener listener) { + public void removeListener(LexListener listener){ listeners.remove(listener); } - public void informListenersLex(ParsedSymbol s) { - for (LexListener l : listeners) { + public void informListenersLex(ParsedSymbol s){ + for(LexListener l:listeners){ l.onLex(s); } } - public void informListenersPushBack(ParsedSymbol s) { - for (LexListener l : listeners) { + public void informListenersPushBack(ParsedSymbol s){ + for(LexListener l:listeners){ l.onPushBack(s); } } @@ -1307,10 +1261,9 @@ public final class ActionScriptLexer { } ParsedSymbol last; - - public ParsedSymbol lex() throws java.io.IOException, ActionParseException { + public ParsedSymbol lex() throws java.io.IOException, ActionParseException{ ParsedSymbol ret = null; - if (!pushedBack.isEmpty()) { + if (!pushedBack.isEmpty()){ ret = last = pushedBack.pop(); } else { ret = last = yylex(); @@ -1319,1284 +1272,1098 @@ public final class ActionScriptLexer { return ret; } - /** - * Creates a new scanner - * - * @param in the java.io.Reader to read input from. - */ - public ActionScriptLexer(java.io.Reader in) { - this.zzReader = in; + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(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 < 2916) { + 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; } - /** - * 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 */ + /* 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; + } - int j = 0; /* index in unpacked array */ + /* 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; + } - while (i < 2916) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do { - map[j++] = value; - } while (--count > 0); + if (totalRead > 0) { + zzEndRead += totalRead; + if (totalRead == requested) { /* possibly more input available */ + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; } - return map; + } + return false; } - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { + // totalRead = 0: End of stream + return true; + } - /* first: make room (if you can) */ - if (zzStartRead > 0) { - zzEndRead += zzFinalHighSurrogate; - zzFinalHighSurrogate = 0; - System.arraycopy(zzBuffer, zzStartRead, - zzBuffer, 0, - zzEndRead - zzStartRead); + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ - /* translate stored positions */ - zzEndRead -= zzStartRead; - zzCurrentPos -= zzStartRead; - zzMarkedPos -= zzStartRead; - zzStartRead = 0; - } + if (zzReader != null) + zzReader.close(); + } - /* 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; - } + /** + * 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]; + } - if (totalRead > 0) { - zzEndRead += totalRead; - if (totalRead == requested) { /* possibly more input available */ - if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { - --zzEndRead; - zzFinalHighSurrogate = 1; - } - } - return false; - } + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } - // totalRead = 0: End of stream - return true; + + /** + * 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]; } - /** - * Closes the input stream. - * - * @throws java.io.IOException - */ - public final void yyclose() throws java.io.IOException { - zzAtEOF = true; /* indicate end of file */ + throw new Error(message); + } - zzEndRead = zzStartRead; /* invalidate buffer */ - if (zzReader != null) { - zzReader.close(); - } - } + /** + * 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); - /** - * 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]; - } - } + zzMarkedPos -= number; + } - /** - * Returns the current lexical state. - * - * @return - */ - 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; - } + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public ParsedSymbol yylex() throws java.io.IOException, ActionParseException { + int zzInput; + int zzAction; - /** - * Returns the text matched by the current regular expression. - * - * @return - */ - public final String yytext() { - return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); - } + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; - /** - * 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]; - } + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; - /** - * Returns the length of the matched text region. - * - * @return - */ - public final int yylength() { - return zzMarkedPos - zzStartRead; - } + while (true) { + zzMarkedPosL = zzMarkedPos; - /** - * 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]; - } + yychar+= zzMarkedPosL-zzStartRead; - throw new Error(message); - } + zzAction = -1; - /** - * 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); - } + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; - zzMarkedPos -= number; - } + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } - /** - * 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 - * @throws com.jpexs.decompiler.flash.action.parser.ActionParseException - */ - public ParsedSymbol 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; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - // set up zzAction for empty match case: - int zzAttributes = zzAttrL[zzState]; - if ((zzAttributes & 1) == 1) { - zzAction = zzState; + + 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; } - - 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; - } - } - - } + 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; - // store back cached position - zzMarkedPos = zzMarkedPosL; + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 1: { - } - case 186: - break; - case 2: { - yyline++; - } - case 187: - break; - case 3: { /*ignore*/ - - } - case 188: - break; - case 4: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); - } - case 189: - break; - case 5: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); - } - case 190: - break; - case 6: { - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); - } - case 191: - break; - case 7: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); - } - case 192: - break; - case 8: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); - } - case 193: - break; - case 9: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); - } - case 194: - break; - case 10: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); - } - case 195: - break; - case 11: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); - } - case 196: - break; - case 12: { - string.setLength(0); - yybegin(STRING); - } - case 197: - break; - case 13: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); - } - case 198: - break; - case 14: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); - } - case 199: - break; - case 15: { - string.setLength(0); - yybegin(CHARLITERAL); - } - case 200: - break; - case 16: { - string.setLength(0); - yybegin(OIDENTIFIER); - } - case 201: - break; - case 17: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); - } - case 202: - break; - case 18: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); - } - case 203: - break; - case 19: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); - } - case 204: - break; - case 20: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); - } - case 205: - break; - case 21: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); - } - case 206: - break; - case 22: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); - } - case 207: - break; - case 23: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); - } - case 208: - break; - case 24: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); - } - case 209: - break; - case 25: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); - } - case 210: - break; - case 26: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); - } - case 211: - break; - case 27: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); - } - case 212: - break; - case 28: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); - } - case 213: - break; - case 29: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); - } - case 214: - break; - case 30: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); - } - case 215: - break; - case 31: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); - } - case 216: - break; - case 32: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); - } - case 217: - break; - case 33: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); - } - case 218: - break; - case 34: { - string.append(yytext()); - } - case 219: - break; - case 35: { - yybegin(YYINITIAL); - yyline++; - } - case 220: - break; - case 36: { - yybegin(YYINITIAL); - // length also includes the trailing quote - return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); - } - case 221: - break; - case 37: { - string.append(yytext()); - yyline++; - } - case 222: - break; - case 38: { - yybegin(XML); - string.append(yytext()); - } - case 223: - break; - case 39: { - string.append(yytext()); - yyline++; - } - case 224: - break; - case 40: { - yybegin(YYINITIAL); - // length also includes the trailing quote - return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); - } - case 225: - break; - case 41: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); - } - case 226: - break; - case 42: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); - } - case 227: - break; - case 43: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); - } - case 228: - break; - case 44: { - return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); - } - case 229: - break; - case 45: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); - } - case 230: - break; - case 46: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); - } - case 231: - break; - case 47: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); - } - case 232: - break; - case 48: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); - } - case 233: - break; - case 49: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); - } - case 234: - break; - case 50: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); - } - case 235: - break; - case 51: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); - } - case 236: - break; - case 52: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); - } - case 237: - break; - case 53: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); - } - case 238: - break; - case 54: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); - } - case 239: - break; - case 55: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLOR, yytext()); - } - case 240: - break; - case 56: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); - } - case 241: - break; - case 57: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); - } - case 242: - break; - case 58: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); - } - case 243: - break; - case 59: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); - } - case 244: - break; - case 60: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); - } - case 245: - break; - case 61: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); - } - case 246: - break; - case 62: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); - } - case 247: - break; - case 63: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); - } - case 248: - break; - case 64: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); - } - case 249: - break; - case 65: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); - } - case 250: - break; - case 66: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); - } - case 251: - break; - case 67: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); - } - case 252: - break; - case 68: { - string.append('\\'); /*illegal escape sequence*/ - - } - case 253: - break; - case 69: { - string.append('\"'); - } - case 254: - break; - case 70: { - string.append('\\'); - } - case 255: - break; - case 71: { - string.append('\''); - } - case 256: - break; - case 72: { - string.append('\b'); - } - case 257: - break; - case 73: { - string.append('\r'); - } - case 258: - break; - case 74: { - string.append('\n'); - } - case 259: - break; - case 75: { - string.append('\t'); - } - case 260: - break; - case 76: { - string.append('\f'); - } - case 261: - break; - case 77: { - throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); - } - case 262: - break; - case 78: { - string.append('\u00A7'); - } - case 263: - break; - case 79: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); - } - case 264: - break; - case 80: { - string.setLength(0); - yybegin(XML); - String s = yytext(); - s = s.substring(1, s.length() - 1); - if (s.contains(" ")) { - s = s.substring(0, s.indexOf(' ')); - } - xmlTagName = s; - string.append(yytext()); - } - case 265: - break; - case 81: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); - } - case 266: - break; - case 82: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); - } - case 267: - break; - case 83: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); - } - case 268: - break; - case 84: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); - } - case 269: - break; - case 85: { - return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); - } - case 270: - break; - case 86: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLAND, yytext()); - } - case 271: - break; - case 87: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CHR, yytext()); - } - case 272: - break; - case 88: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SET, yytext()); - } - case 273: - break; - case 89: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.ORD, yytext()); - } - case 274: - break; - case 90: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); - } - case 275: - break; - case 91: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); - } - case 276: - break; - case 92: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.INT, yytext()); - } - case 277: - break; - case 93: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); - } - case 278: - break; - case 94: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); - } - case 279: - break; - case 95: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); - } - case 280: - break; - case 96: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.GET, yytext()); - } - case 281: - break; - case 97: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); - } - case 282: - break; - case 98: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); - } - case 283: - break; - case 99: { - String t = yytext(); - return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, t.substring(2, t.length() - 1)); - } - case 284: - break; - case 100: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); - } - case 285: - break; - case 101: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EACH, yytext()); - } - case 286: - break; - case 102: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); - } - case 287: - break; - case 103: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.EVAL, yytext()); - } - case 288: - break; - case 104: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); - } - case 289: - break; - case 105: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CALL, yytext()); - } - case 290: - break; - case 106: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOP, yytext()); - } - case 291: - break; - case 107: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); - } - case 292: - break; - case 108: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); - } - case 293: - break; - case 109: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); - } - case 294: - break; - case 110: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); - } - case 295: - break; - case 111: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PLAY, yytext()); - } - case 296: - break; - case 112: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); - } - case 297: - break; - case 113: { - char val = (char) Integer.parseInt(yytext().substring(1), 8); - string.append(val); - } - case 298: - break; - case 114: { - char val = (char) Integer.parseInt(yytext().substring(2), 16); - string.append(val); - } - case 299: - break; - case 115: { - string.append(yytext()); - String endtagname = yytext(); - endtagname = endtagname.substring(2, endtagname.length() - 1); - if (endtagname.equals(xmlTagName)) { - yybegin(YYINITIAL); - return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML, string.toString()); - } - } - case 300: - break; - case 116: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); - } - case 301: - break; - case 117: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); - } - case 302: - break; - case 118: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); - } - case 303: - break; - case 119: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); - } - case 304: - break; - case 120: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); - } - case 305: - break; - case 121: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TRACE, yytext()); - } - case 306: - break; - case 122: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); - } - case 307: - break; - case 123: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); - } - case 308: - break; - case 124: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); - } - case 309: - break; - case 125: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINT, yytext()); - } - case 310: - break; - case 126: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBCHR, yytext()); - } - case 311: - break; - case 127: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBORD, yytext()); - } - case 312: - break; - case 128: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); - } - case 313: - break; - case 129: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.RANDOM, yytext()); - } - case 314: - break; - case 130: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.STATIC, yytext()); - } - case 315: - break; - case 131: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.SUBSTR, yytext()); - } - case 316: - break; - case 132: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); - } - case 317: - break; - case 133: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); - } - case 318: - break; - case 134: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); - } - case 319: - break; - case 135: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); - } - case 320: - break; - case 136: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LENGTH, yytext()); - } - case 321: - break; - case 137: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); - } - case 322: - break; - case 138: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETURL, yytext()); - } - case 323: - break; - case 139: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STRING_OP, yytext()); - } - case 324: - break; - case 140: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NUMBER_OP, yytext()); - } - case 325: - break; - case 141: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); - } - case 326: - break; - case 142: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NEWLINE, yytext()); - } - case 327: - break; - case 143: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); - } - case 328: - break; - case 144: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DYNAMIC, yytext()); - } - case 329: - break; - case 145: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); - } - case 330: - break; - case 146: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); - } - case 331: - break; - case 147: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); - } - case 332: - break; - case 148: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); - } - case 333: - break; - case 149: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPDRAG, yytext()); - } - case 334: - break; - case 150: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.OVERRIDE, yytext()); - } - case 335: - break; - case 151: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); - } - case 336: - break; - case 152: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); - } - case 337: - break; - case 153: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTNUM, yytext()); - } - case 338: - break; - case 154: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBLENGTH, yytext()); - } - case 339: - break; - case 155: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETTIMER, yytext()); - } - case 340: - break; - case 156: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); - } - case 341: - break; - case 157: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STARTDRAG, yytext()); - } - case 342: - break; - case 158: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NEXTFRAME, yytext()); - } - case 343: - break; - case 159: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.NAMESPACE, yytext()); - } - case 344: - break; - case 160: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); - } - case 345: - break; - case 161: { - return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); - } - case 346: - break; - case 162: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.FSCOMMAND, yytext()); - } - case 347: - break; - case 163: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIE, yytext()); - } - case 348: - break; - case 164: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PREVFRAME, yytext()); - } - case 349: - break; - case 165: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); - } - case 350: - break; - case 166: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TELLTARGET, yytext()); - } - case 351: - break; - case 167: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TARGETPATH, yytext()); - } - case 352: - break; - case 168: { - return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); - } - case 353: - break; - case 169: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); - } - case 354: - break; - case 170: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETVERSION, yytext()); - } - case 355: - break; - case 171: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIE, yytext()); - } - case 356: - break; - case 172: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBSUBSTRING, yytext()); - } - case 357: - break; - case 173: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDSTOP, yytext()); - } - case 358: - break; - case 174: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDPLAY, yytext()); - } - case 359: - break; - case 175: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIENUM, yytext()); - } - case 360: - break; - case 176: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPALLSOUNDS, yytext()); - } - case 361: - break; - case 177: { - return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IFFRAMELOADED, yytext()); - } - case 362: - break; - case 178: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLES, yytext()); - } - case 363: - break; - case 179: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAP, yytext()); - } - case 364: - break; - case 180: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIENUM, yytext()); - } - case 365: - break; - case 181: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.REMOVEMOVIECLIP, yytext()); - } - case 366: - break; - case 182: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLESNUM, yytext()); - } - case 367: - break; - case 183: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAPNUM, yytext()); - } - case 368: - break; - case 184: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TOGGLEHIGHQUALITY, yytext()); - } - case 369: - break; - case 185: { - return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.DUPLICATEMOVIECLIP, yytext()); - } - case 370: - break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - { - return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); - } - } else { - zzScanError(ZZ_NO_MATCH); - } - } } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { + } + case 187: break; + case 2: + { yyline++; + } + case 188: break; + case 3: + { /*ignore*/ + } + case 189: break; + case 4: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DIVIDE, yytext()); + } + case 190: break; + case 5: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MULTIPLY, yytext()); + } + case 191: break; + case 6: + { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); + } + case 192: break; + case 7: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COLON, yytext()); + } + case 193: break; + case 8: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DOT, yytext()); + } + case 194: break; + case 9: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_THAN, yytext()); + } + case 195: break; + case 10: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_THAN, yytext()); + } + case 196: break; + case 11: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN, yytext()); + } + case 197: break; + case 12: + { string.setLength(0); + yybegin(STRING); + } + case 198: break; + case 13: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong((yytext()))); + } + case 199: break; + case 14: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MINUS, yytext()); + } + case 200: break; + case 15: + { string.setLength(0); + yybegin(CHARLITERAL); + } + case 201: break; + case 16: + { string.setLength(0); + yybegin(OIDENTIFIER); + } + case 202: break; + case 17: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_OPEN, yytext()); + } + case 203: break; + case 18: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PARENT_CLOSE, yytext()); + } + case 204: break; + case 19: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_OPEN, yytext()); + } + case 205: break; + case 20: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.CURLY_CLOSE, yytext()); + } + case 206: break; + case 21: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_OPEN, yytext()); + } + case 207: break; + case 22: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BRACKET_CLOSE, yytext()); + } + case 208: break; + case 23: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SEMICOLON, yytext()); + } + case 209: break; + case 24: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.COMMA, yytext()); + } + case 210: break; + case 25: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT, yytext()); + } + case 211: break; + case 26: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEGATE, yytext()); + } + case 212: break; + case 27: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TERNAR, yytext()); + } + case 213: break; + case 28: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITAND, yytext()); + } + case 214: break; + case 29: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.BITOR, yytext()); + } + case 215: break; + case 30: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.PLUS, yytext()); + } + case 216: break; + case 31: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.XOR, yytext()); + } + case 217: break; + case 32: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.MODULO, yytext()); + } + case 218: break; + case 33: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ATTRIBUTE, yytext()); + } + case 219: break; + case 34: + { string.append(yytext()); + } + case 220: break; + case 35: + { yybegin(YYINITIAL); yyline++; + } + case 221: break; + case 36: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString()); + } + case 222: break; + case 37: + { string.append(yytext()); yyline++; + } + case 223: break; + case 38: + { yybegin(XML); string.append(yytext()); + } + case 224: break; + case 39: + { string.append(yytext()); yyline++; + } + case 225: break; + case 40: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString()); + } + case 226: break; + case 41: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_DIVIDE, yytext()); + } + case 227: break; + case 42: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MULTIPLY, yytext()); + } + case 228: break; + case 43: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NAMESPACE_OP, yytext()); + } + case 229: break; + case 44: + { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, Double.parseDouble((yytext()))); + } + case 230: break; + case 45: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_LEFT, yytext()); + } + case 231: break; + case 46: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NOT_EQUAL, yytext()); + } + case 232: break; + case 47: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.LOWER_EQUAL, yytext()); + } + case 233: break; + case 48: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.SHIFT_RIGHT, yytext()); + } + case 234: break; + case 49: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.GREATER_EQUAL, yytext()); + } + case 235: break; + case 50: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.EQUALS, yytext()); + } + case 236: break; + case 51: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext(), 8)); + } + case 237: break; + case 52: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MINUS, yytext()); + } + case 238: break; + case 53: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DECREMENT, yytext()); + } + case 239: break; + case 54: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AS, yytext()); + } + case 240: break; + case 55: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLOR, yytext()); + } + case 241: break; + case 56: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.IS, yytext()); + } + case 242: break; + case 57: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); + } + case 243: break; + case 58: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); + } + case 244: break; + case 59: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); + } + case 245: break; + case 60: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITAND, yytext()); + } + case 246: break; + case 61: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.AND, yytext()); + } + case 247: break; + case 62: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_BITOR, yytext()); + } + case 248: break; + case 63: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.OR, yytext()); + } + case 249: break; + case 64: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_PLUS, yytext()); + } + case 250: break; + case 65: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INCREMENT, yytext()); + } + case 251: break; + case 66: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_XOR, yytext()); + } + case 252: break; + case 67: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_MODULO, yytext()); + } + case 253: break; + case 68: + { string.append('\\'); /*illegal escape sequence*/ + } + case 254: break; + case 69: + { string.append('\"'); + } + case 255: break; + case 70: + { string.append('\\'); + } + case 256: break; + case 71: + { string.append('\''); + } + case 257: break; + case 72: + { string.append('\b'); + } + case 258: break; + case 73: + { string.append('\r'); + } + case 259: break; + case 74: + { string.append('\n'); + } + case 260: break; + case 75: + { string.append('\t'); + } + case 261: break; + case 76: + { string.append('\f'); + } + case 262: break; + case 77: + { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); + } + case 263: break; + case 78: + { string.append('\u00A7'); + } + case 264: break; + case 79: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.REST, yytext()); + } + case 265: break; + case 80: + { string.setLength(0); + yybegin(XML); + String s = yytext(); + s = s.substring(1, s.length() - 1); + if (s.contains(" ")){ + s = s.substring(0, s.indexOf(' ')); + } + xmlTagName = s; + string.append(yytext()); + } + case 266: break; + case 81: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_LEFT, yytext()); + } + case 267: break; + case 82: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.USHIFT_RIGHT, yytext()); + } + case 268: break; + case 83: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_SHIFT_RIGHT, yytext()); + } + case 269: break; + case 84: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_EQUALS, yytext()); + } + case 270: break; + case 85: + { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, Long.parseLong(yytext().substring(2), 16)); + } + case 271: break; + case 86: + { return new ParsedSymbol(SymbolGroup.PREPROCESSOR, SymbolType.PREPROCESSOR, yytext().substring(2)); + } + case 272: break; + case 87: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.FULLAND, yytext()); + } + case 273: break; + case 88: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CHR, yytext()); + } + case 274: break; + case 89: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SET, yytext()); + } + case 275: break; + case 90: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.ORD, yytext()); + } + case 276: break; + case 91: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.NEW, yytext()); + } + case 277: break; + case 92: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); + } + case 278: break; + case 93: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.INT, yytext()); + } + case 279: break; + case 94: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); + } + case 280: break; + case 95: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); + } + case 281: break; + case 96: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); + } + case 282: break; + case 97: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.GET, yytext()); + } + case 283: break; + case 98: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); + } + case 284: break; + case 99: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.STRICT_NOT_EQUAL, yytext()); + } + case 285: break; + case 100: + { String t = yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, t.substring(2, t.length() - 1)); + } + case 286: break; + case 101: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.ASSIGN_USHIFT_RIGHT, yytext()); + } + case 287: break; + case 102: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EACH, yytext()); + } + case 288: break; + case 103: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); + } + case 289: break; + case 104: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.EVAL, yytext()); + } + case 290: break; + case 105: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); + } + case 291: break; + case 106: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CALL, yytext()); + } + case 292: break; + case 107: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOP, yytext()); + } + case 293: break; + case 108: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NULL, yytext()); + } + case 294: break; + case 109: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRUE, yytext()); + } + case 295: break; + case 110: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THIS, yytext()); + } + case 296: break; + case 111: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); + } + case 297: break; + case 112: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PLAY, yytext()); + } + case 298: break; + case 113: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.VOID, yytext()); + } + case 299: break; + case 114: + { char val = (char) Integer.parseInt(yytext().substring(1), 8); + string.append(val); + } + case 300: break; + case 115: + { char val = (char) Integer.parseInt(yytext().substring(2), 16); + string.append(val); + } + case 301: break; + case 116: + { string.append(yytext()); + String endtagname = yytext(); + endtagname = endtagname.substring(2, endtagname.length() - 1); + if (endtagname.equals(xmlTagName)){ + yybegin(YYINITIAL); + return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML, string.toString()); + } + } + case 302: break; + case 117: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); + } + case 303: break; + case 118: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); + } + case 304: break; + case 119: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); + } + case 305: break; + case 120: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); + } + case 306: break; + case 121: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); + } + case 307: break; + case 122: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TRACE, yytext()); + } + case 308: break; + case 123: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); + } + case 309: break; + case 124: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FALSE, yytext()); + } + case 310: break; + case 125: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); + } + case 311: break; + case 126: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINT, yytext()); + } + case 312: break; + case 127: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBCHR, yytext()); + } + case 313: break; + case 128: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBORD, yytext()); + } + case 314: break; + case 129: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); + } + case 315: break; + case 130: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.RANDOM, yytext()); + } + case 316: break; + case 131: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.STATIC, yytext()); + } + case 317: break; + case 132: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.SUBSTR, yytext()); + } + case 318: break; + case 133: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); + } + case 319: break; + case 134: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.TYPEOF, yytext()); + } + case 320: break; + case 135: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); + } + case 321: break; + case 136: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.DELETE, yytext()); + } + case 322: break; + case 137: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LENGTH, yytext()); + } + case 323: break; + case 138: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); + } + case 324: break; + case 139: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETURL, yytext()); + } + case 325: break; + case 140: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STRING_OP, yytext()); + } + case 326: break; + case 141: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NUMBER_OP, yytext()); + } + case 327: break; + case 142: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); + } + case 328: break; + case 143: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NEWLINE, yytext()); + } + case 329: break; + case 144: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); + } + case 330: break; + case 145: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DYNAMIC, yytext()); + } + case 331: break; + case 146: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); + } + case 332: break; + case 147: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); + } + case 333: break; + case 148: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); + } + case 334: break; + case 149: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); + } + case 335: break; + case 150: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPDRAG, yytext()); + } + case 336: break; + case 151: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.OVERRIDE, yytext()); + } + case 337: break; + case 152: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); + } + case 338: break; + case 153: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); + } + case 339: break; + case 154: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTNUM, yytext()); + } + case 340: break; + case 155: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBLENGTH, yytext()); + } + case 341: break; + case 156: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETTIMER, yytext()); + } + case 342: break; + case 157: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); + } + case 343: break; + case 158: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STARTDRAG, yytext()); + } + case 344: break; + case 159: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NEXTFRAME, yytext()); + } + case 345: break; + case 160: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.NAMESPACE, yytext()); + } + case 346: break; + case 161: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); + } + case 347: break; + case 162: + { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); + } + case 348: break; + case 163: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.FSCOMMAND, yytext()); + } + case 349: break; + case 164: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIE, yytext()); + } + case 350: break; + case 165: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PREVFRAME, yytext()); + } + case 351: break; + case 166: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); + } + case 352: break; + case 167: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TELLTARGET, yytext()); + } + case 353: break; + case 168: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TARGETPATH, yytext()); + } + case 354: break; + case 169: + { return new ParsedSymbol(SymbolGroup.OPERATOR, SymbolType.INSTANCEOF, yytext()); + } + case 355: break; + case 170: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); + } + case 356: break; + case 171: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETVERSION, yytext()); + } + case 357: break; + case 172: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIE, yytext()); + } + case 358: break; + case 173: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBSUBSTRING, yytext()); + } + case 359: break; + case 174: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDSTOP, yytext()); + } + case 360: break; + case 175: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDPLAY, yytext()); + } + case 361: break; + case 176: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIENUM, yytext()); + } + case 362: break; + case 177: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPALLSOUNDS, yytext()); + } + case 363: break; + case 178: + { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IFFRAMELOADED, yytext()); + } + case 364: break; + case 179: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLES, yytext()); + } + case 365: break; + case 180: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAP, yytext()); + } + case 366: break; + case 181: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.UNLOADMOVIENUM, yytext()); + } + case 367: break; + case 182: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.REMOVEMOVIECLIP, yytext()); + } + case 368: break; + case 183: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLESNUM, yytext()); + } + case 369: break; + case 184: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAPNUM, yytext()); + } + case 370: break; + case 185: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TOGGLEHIGHQUALITY, yytext()); + } + case 371: break; + case 186: + { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.DUPLICATEMOVIECLIP, yytext()); + } + case 372: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } } + } + + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index cceb4fb21..f8f203340 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -1,794 +1,806 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.action.parser.script; - -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SourceGeneratorLocalData; -import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; -import com.jpexs.decompiler.flash.action.model.FunctionActionItem; -import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; -import com.jpexs.decompiler.flash.action.model.GetVariableActionItem; -import com.jpexs.decompiler.flash.action.model.operations.Inverted; -import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable; -import com.jpexs.decompiler.flash.action.swf4.ActionIf; -import com.jpexs.decompiler.flash.action.swf4.ActionJump; -import com.jpexs.decompiler.flash.action.swf4.ActionNot; -import com.jpexs.decompiler.flash.action.swf4.ActionPop; -import com.jpexs.decompiler.flash.action.swf4.ActionPush; -import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; -import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; -import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; -import com.jpexs.decompiler.flash.action.swf5.ActionCallFunction; -import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; -import com.jpexs.decompiler.flash.action.swf5.ActionGetMember; -import com.jpexs.decompiler.flash.action.swf5.ActionNewObject; -import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; -import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; -import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; -import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; -import com.jpexs.decompiler.flash.action.swf7.ActionExtends; -import com.jpexs.decompiler.flash.action.swf7.ActionImplementsOp; -import com.jpexs.decompiler.flash.ecma.Null; -import com.jpexs.decompiler.flash.helpers.collections.MyEntry; -import com.jpexs.decompiler.graph.CompilationException; -import com.jpexs.decompiler.graph.GraphSourceItem; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.SourceGenerator; -import com.jpexs.decompiler.graph.TypeItem; -import com.jpexs.decompiler.graph.model.AndItem; -import com.jpexs.decompiler.graph.model.BreakItem; -import com.jpexs.decompiler.graph.model.CommaExpressionItem; -import com.jpexs.decompiler.graph.model.ContinueItem; -import com.jpexs.decompiler.graph.model.DoWhileItem; -import com.jpexs.decompiler.graph.model.DuplicateItem; -import com.jpexs.decompiler.graph.model.ForItem; -import com.jpexs.decompiler.graph.model.IfItem; -import com.jpexs.decompiler.graph.model.NotItem; -import com.jpexs.decompiler.graph.model.OrItem; -import com.jpexs.decompiler.graph.model.SwitchItem; -import com.jpexs.decompiler.graph.model.TernarOpItem; -import com.jpexs.decompiler.graph.model.WhileItem; -import com.jpexs.helpers.Helper; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -/** - * - * @author JPEXS - */ -public class ActionSourceGenerator implements SourceGenerator { - - @Override - public List generate(SourceGeneratorLocalData localData, AndItem item) throws CompilationException { - List ret = new ArrayList<>(); - ret.addAll(generateToActionList(localData, item.leftSide)); - ret.add(new ActionPushDuplicate()); - ret.add(new ActionNot()); - List andExpr = generateToActionList(localData, item.rightSide); - andExpr.add(0, new ActionPop()); - int andExprLen = Action.actionsToBytes(andExpr, false, SWF.DEFAULT_VERSION).length; - ret.add(new ActionIf(andExprLen)); - ret.addAll(andExpr); - return ret; - - } - - @Override - public List generate(SourceGeneratorLocalData localData, OrItem item) throws CompilationException { - List ret = new ArrayList<>(); - ret.addAll(generateToActionList(localData, item.leftSide)); - ret.add(new ActionPushDuplicate()); - List orExpr = generateToActionList(localData, item.rightSide); - orExpr.add(0, new ActionPop()); - int orExprLen = Action.actionsToBytes(orExpr, false, SWF.DEFAULT_VERSION).length; - ret.add(new ActionIf(orExprLen)); - ret.addAll(orExpr); - return ret; - } - - public List toActionList(List items) { - List ret = new ArrayList<>(); - for (GraphSourceItem s : items) { - if (s instanceof Action) { - ret.add((Action) s); - } - } - return ret; - } - - private List nonempty(List list) { - if (list == null) { - return new ArrayList<>(); - } - return list; - } - - private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) throws CompilationException { - List ret = new ArrayList<>(); - if (expression instanceof Inverted) { - ret.addAll(((Inverted) expression).invert().toSource(localData, this)); - } else { - ret.addAll(expression.toSource(localData, this)); - ret.add(new ActionNot()); - } - List onTrue = null; - List onFalse = null; - if (ternar) { - onTrue = toActionList(onTrueCmds.get(0).toSource(localData, this)); - } else { - onTrue = generateToActionList(localData, onTrueCmds); - } - - if (onFalseCmds != null && !onFalseCmds.isEmpty()) { - if (ternar) { - onFalse = toActionList(onFalseCmds.get(0).toSource(localData, this)); - } else { - onFalse = generateToActionList(localData, onFalseCmds); - } - } - byte[] onTrueBytes = Action.actionsToBytes(onTrue, false, SWF.DEFAULT_VERSION); - int onTrueLen = onTrueBytes.length; - - ActionIf ifaif = new ActionIf(0); - ret.add(ifaif); - ret.addAll(onTrue); - ifaif.setJumpOffset(onTrueLen); - ActionJump ajmp = null; - if (onFalse != null) { - if (!((!nonempty(onTrue).isEmpty()) - && (onTrue.get(onTrue.size() - 1) instanceof ActionJump) - && ((((ActionJump) onTrue.get(onTrue.size() - 1)).isContinue) - || (((ActionJump) onTrue.get(onTrue.size() - 1)).isBreak)))) { - ajmp = new ActionJump(0); - ret.add(ajmp); - onTrueLen += ajmp.getTotalActionLength(); - } - ifaif.setJumpOffset(onTrueLen); - byte[] onFalseBytes = Action.actionsToBytes(onFalse, false, SWF.DEFAULT_VERSION); - int onFalseLen = onFalseBytes.length; - if (ajmp != null) { - ajmp.setJumpOffset(onFalseLen); - } - ret.addAll(onFalse); - } - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, IfItem item) throws CompilationException { - return generateIf(localData, item.expression, item.onTrue, item.onFalse, false); - } - - private void fixLoop(List code, int breakOffset) { - fixLoop(code, breakOffset, Integer.MAX_VALUE); - } - - private void fixLoop(List code, int breakOffset, int continueOffset) { - int pos = 0; - for (Action a : code) { - pos += a.getTotalActionLength(); - if (a instanceof ActionJump) { - ActionJump aj = (ActionJump) a; - if (aj.isContinue && (continueOffset != Integer.MAX_VALUE)) { - aj.setJumpOffset(-pos + continueOffset); - aj.isContinue = false; - } - if (aj.isBreak) { - aj.setJumpOffset(-pos + breakOffset); - aj.isBreak = false; - } - } - } - } - - @Override - public List generate(SourceGeneratorLocalData localData, TernarOpItem item) throws CompilationException { - List onTrue = new ArrayList<>(); - onTrue.add(item.onTrue); - List onFalse = new ArrayList<>(); - onFalse.add(item.onFalse); - return generateIf(localData, item.expression, onTrue, onFalse, true); - } - - @Override - public List generate(SourceGeneratorLocalData localData, WhileItem item) throws CompilationException { - List ret = new ArrayList<>(); - List whileExpr = new ArrayList<>(); - - List ex = new ArrayList<>(item.expression); - if (!ex.isEmpty()) { - GraphTargetItem lastItem = ex.remove(ex.size() - 1); - whileExpr.addAll(generateToActionList(localData, ex)); - whileExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result - } - - List whileBody = generateToActionList(localData, item.commands); - whileExpr.add(new ActionNot()); - ActionIf whileaif = new ActionIf(0); - whileExpr.add(whileaif); - ActionJump whileajmp = new ActionJump(0); - whileBody.add(whileajmp); - int whileExprLen = Action.actionsToBytes(whileExpr, false, SWF.DEFAULT_VERSION).length; - int whileBodyLen = Action.actionsToBytes(whileBody, false, SWF.DEFAULT_VERSION).length; - whileajmp.setJumpOffset(-(whileExprLen - + whileBodyLen)); - whileaif.setJumpOffset(whileBodyLen); - ret.addAll(whileExpr); - fixLoop(whileBody, whileBodyLen, -whileExprLen); - ret.addAll(whileBody); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, DoWhileItem item) throws CompilationException { - List ret = new ArrayList<>(); - List doExpr = generateToActionList(localData, item.expression); - List doBody = generateToActionList(localData, item.commands); - - int doBodyLen = Action.actionsToBytes(doBody, false, SWF.DEFAULT_VERSION).length; - int doExprLen = Action.actionsToBytes(doExpr, false, SWF.DEFAULT_VERSION).length; - - ret.addAll(doBody); - ret.addAll(doExpr); - ActionIf doif = new ActionIf(0); - ret.add(doif); - int offset = doBodyLen + doExprLen + doif.getTotalActionLength(); - doif.setJumpOffset(-offset); - fixLoop(doBody, offset, doBodyLen); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, ForItem item) throws CompilationException { - List ret = new ArrayList<>(); - List forExpr = generateToActionList(localData, item.expression); - List forBody = generateToActionList(localData, item.commands); - List forFinalCommands = generateToActionList(localData, item.finalCommands); - - forExpr.add(new ActionNot()); - ActionIf foraif = new ActionIf(0); - forExpr.add(foraif); - ActionJump forajmp = new ActionJump(0); - int forajmpLen = forajmp.getTotalActionLength(); - int forExprLen = Action.actionsToBytes(forExpr, false, SWF.DEFAULT_VERSION).length; - int forBodyLen = Action.actionsToBytes(forBody, false, SWF.DEFAULT_VERSION).length; - int forFinalLen = Action.actionsToBytes(forFinalCommands, false, SWF.DEFAULT_VERSION).length; - forajmp.setJumpOffset(-(forExprLen - + forBodyLen + forFinalLen + forajmpLen)); - foraif.setJumpOffset(forBodyLen + forFinalLen + forajmpLen); - ret.addAll(forExpr); - ret.addAll(forBody); - ret.addAll(forFinalCommands); - ret.add(forajmp); - fixLoop(forBody, forBodyLen + forFinalLen + forajmpLen, forBodyLen); - return ret; - } - - private long uniqLast = 0; - - public String uniqId() { - uniqLast++; - return "" + uniqLast; - } - - @Override - public List generate(SourceGeneratorLocalData localData, SwitchItem item) throws CompilationException { - List ret = new ArrayList<>(); - HashMap registerVars = getRegisterVars(localData); - int exprReg = 0; - for (int i = 0; i < 256; i++) { - if (!registerVars.containsValue(i)) { - registerVars.put("__switch" + uniqId(), i); - exprReg = i; - break; - } - } - - ret.addAll(toActionList(item.switchedObject.toSource(localData, this))); - - boolean firstCase = true; - List> caseIfs = new ArrayList<>(); - List> caseCmds = new ArrayList<>(); - List>> caseExprsAll = new ArrayList<>(); - - loopm: - for (int m = 0; m < item.caseValues.size(); m++) { - List> caseExprs = new ArrayList<>(); - List caseIfsOne = new ArrayList<>(); - int mapping = item.valuesMapping.get(m); - for (; m < item.caseValues.size(); m++) { - int newmapping = item.valuesMapping.get(m); - if (newmapping != mapping) { - m--; - break; - } - List curCaseExpr = generateToActionList(localData, item.caseValues.get(m)); - caseExprs.add(curCaseExpr); - if (firstCase) { - curCaseExpr.add(0, new ActionStoreRegister(exprReg)); - } else { - curCaseExpr.add(0, new ActionPush(new RegisterNumber(exprReg))); - } - curCaseExpr.add(new ActionStrictEquals()); - ActionIf aif = new ActionIf(0); - caseIfsOne.add(aif); - curCaseExpr.add(aif); - ret.addAll(curCaseExpr); - firstCase = false; - } - caseExprsAll.add(caseExprs); - caseIfs.add(caseIfsOne); - List caseCmd = generateToActionList(localData, item.caseCommands.get(mapping)); - caseCmds.add(caseCmd); - } - ActionJump defJump = new ActionJump(0); - ret.add(defJump); - List defCmd = new ArrayList<>(); - if (!item.defaultCommands.isEmpty()) { - defCmd = generateToActionList(localData, item.defaultCommands); - } - for (List caseCmd : caseCmds) { - ret.addAll(caseCmd); - } - ret.addAll(defCmd); - - List> exprLengths = new ArrayList<>(); - for (List> caseExprs : caseExprsAll) { - List lengths = new ArrayList<>(); - for (List caseExpr : caseExprs) { - lengths.add(Action.actionsToBytes(caseExpr, false, SWF.DEFAULT_VERSION).length); - } - exprLengths.add(lengths); - } - List caseLengths = new ArrayList<>(); - for (List caseCmd : caseCmds) { - caseLengths.add(Action.actionsToBytes(caseCmd, false, SWF.DEFAULT_VERSION).length); - } - int defLength = Action.actionsToBytes(defCmd, false, SWF.DEFAULT_VERSION).length; - - for (int i = 0; i < caseIfs.size(); i++) { - for (int c = 0; c < caseIfs.get(i).size(); c++) { - int jmpPos = 0; - for (int j = c + 1; j < caseIfs.get(i).size(); j++) { - jmpPos += exprLengths.get(i).get(j); - } - for (int k = i + 1; k < caseIfs.size(); k++) { - for (int m = 0; m < caseIfs.get(k).size(); m++) { - jmpPos += exprLengths.get(k).get(m); - } - } - jmpPos += defJump.getTotalActionLength(); - for (int n = 0; n < i; n++) { - jmpPos += caseLengths.get(n); - } - caseIfs.get(i).get(c).setJumpOffset(jmpPos); - } - } - int defJmpPos = 0; - for (int i = 0; i < caseIfs.size(); i++) { - defJmpPos += caseLengths.get(i); - } - - defJump.setJumpOffset(defJmpPos); - List caseCmdsAll = new ArrayList<>(); - int breakOffset = 0; - for (int i = 0; i < caseCmds.size(); i++) { - caseCmdsAll.addAll(caseCmds.get(i)); - breakOffset += caseLengths.get(i); - } - breakOffset += defLength; - fixLoop(caseCmdsAll, breakOffset); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, NotItem item) throws CompilationException { - if (item.getOriginal() instanceof Inverted) { - GraphTargetItem norig = ((Inverted) item).invert(); - return norig.toSource(localData, this); - } - List ret = new ArrayList<>(); - ret.addAll(item.getOriginal().toSource(localData, this)); - ret.add(new ActionNot()); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, DuplicateItem item) { - List ret = new ArrayList<>(); - ret.add(new ActionPushDuplicate()); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, BreakItem item) { - List ret = new ArrayList<>(); - ActionJump abreak = new ActionJump(0); - abreak.isBreak = true; - ret.add(abreak); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, ContinueItem item) { - List ret = new ArrayList<>(); - ActionJump acontinue = new ActionJump(0); - acontinue.isContinue = true; - ret.add(acontinue); - return ret; - } - - private List generateToActionList(SourceGeneratorLocalData localData, List commands) throws CompilationException { - return toActionList(generate(localData, commands)); - } - - private List generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) throws CompilationException { - return toActionList(command.toSource(localData, this)); - } - - @Override - public List generate(SourceGeneratorLocalData localData, List commands) throws CompilationException { - List ret = new ArrayList<>(); - for (GraphTargetItem item : commands) { - ret.addAll(item.toSourceIgnoreReturnValue(localData, this)); - } - return ret; - } - - public HashMap getRegisterVars(SourceGeneratorLocalData localData) { - return localData.registerVars; - } - - public void setRegisterVars(SourceGeneratorLocalData localData, HashMap value) { - localData.registerVars = value; - } - - public void setInFunction(SourceGeneratorLocalData localData, int value) { - localData.inFunction = value; - } - - public int isInFunction(SourceGeneratorLocalData localData) { - return localData.inFunction; - } - - public boolean isInMethod(SourceGeneratorLocalData localData) { - return localData.inMethod; - } - - public void setInMethod(SourceGeneratorLocalData localData, boolean value) { - localData.inMethod = value; - } - - public int getForInLevel(SourceGeneratorLocalData localData) { - return localData.forInLevel; - } - - public void setForInLevel(SourceGeneratorLocalData localData, int value) { - localData.forInLevel = value; - } - - public int getTempRegister(SourceGeneratorLocalData localData) { - HashMap registerVars = getRegisterVars(localData); - for (int tmpReg = 0; tmpReg < 256; tmpReg++) { - if (!registerVars.containsValue(tmpReg)) { - registerVars.put("__temp" + tmpReg, tmpReg); - return tmpReg; - } - } - return 0; //? - } - - public void releaseTempRegister(SourceGeneratorLocalData localData, int tmp) { - HashMap registerVars = getRegisterVars(localData); - registerVars.remove("__temp" + tmp); - } - - private String getName(GraphTargetItem item) { - if (item instanceof VariableActionItem) { - return ((VariableActionItem) item).getVariableName(); - } - if (item instanceof DirectValueActionItem) { - DirectValueActionItem dv = (DirectValueActionItem) item; - return (String) dv.getResult(); - } - if (item instanceof GetVariableActionItem) { - GetVariableActionItem gv = (GetVariableActionItem) item; - return getName(gv.name); - } - if (item instanceof GetMemberActionItem) { - GetMemberActionItem mem = (GetMemberActionItem) item; - return getName(mem.memberName); - } - return null; - } - - private List getVarParts(GraphTargetItem item) { - List ret = new ArrayList<>(); - do { - if (item instanceof GetMemberActionItem) { - GetMemberActionItem mem = (GetMemberActionItem) item; - ret.add(0, getName(mem)); - item = mem.object; - } - } while (item instanceof GetMemberActionItem); - String f = getName(item); - if (f != null) { - ret.add(0, f); - } - return ret; - } - - private int getVarLength(GraphTargetItem item) { - int len = 1; - do { - if (item instanceof GetMemberActionItem) { - GetMemberActionItem mem = (GetMemberActionItem) item; - item = mem.object; - len++; - } - } while (item instanceof GetMemberActionItem); - return len; - } - - private GraphTargetItem removeVarLast(GraphTargetItem item, int cnt) { - item = Helper.deepCopy(item); - - for (int i = 0; i < cnt; i++) { - if (item instanceof GetMemberActionItem) { - GetMemberActionItem mem = (GetMemberActionItem) item; - item = mem.object; - } - } - return item; - } - - private GraphTargetItem addGlobalPrefix(GraphTargetItem item) { - item = Helper.deepCopy(item); - GraphTargetItem first = item; - GetMemberActionItem mem = null; - do { - if (item instanceof GetMemberActionItem) { - mem = (GetMemberActionItem) item; - item = mem.object; - } - } while (item instanceof GetMemberActionItem); - if (item instanceof GetVariableActionItem) { - GetVariableActionItem v = (GetVariableActionItem) item; - item = new GetMemberActionItem(null, new GetVariableActionItem(null, new DirectValueActionItem(null, 0, "_global", new ArrayList<>())), v.name); - if (mem != null) { - mem.object = item; - } - } - return first; - } - - private List typeToActions(List type, List value) { - List ret = new ArrayList<>(); - if (type.isEmpty()) { - return ret; - } - ret.add(pushConst(type.get(0))); - if (type.size() == 1 && (value != null)) { - ret.addAll(value); - ret.add(new ActionSetVariable()); - } else { - ret.add(new ActionGetVariable()); - } - for (int i = 1; i < type.size(); i++) { - ret.add(pushConst(type.get(i))); - if ((i == type.size() - 1) && (value != null)) { - ret.addAll(value); - ret.add(new ActionSetMember()); - } else { - ret.add(new ActionGetMember()); - } - } - return ret; - } - - private final List constantPool; - - private final int swfVersion; - - public int getSwfVersion() { - return swfVersion; - } - - public ActionSourceGenerator(int swfVersion, List constantPool) { - this.constantPool = constantPool; - this.swfVersion = swfVersion; - } - - public List getConstantPool() { - return constantPool; - } - - public DirectValueActionItem pushConstTargetItem(String s) { - int index = constantPool.indexOf(s); - if (index == -1) { - constantPool.add(s); - index = constantPool.indexOf(s); - } - return new DirectValueActionItem(null, 0, new ConstantIndex(index), constantPool); - } - - public ActionPush pushConst(String s) { - int index = constantPool.indexOf(s); - if (index == -1) { - constantPool.add(s); - index = constantPool.indexOf(s); - } - return new ActionPush(new ConstantIndex(index)); - } - - public List generateTraits(SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) throws CompilationException { - List extendsStr = getVarParts(extendsVal); - List ret = new ArrayList<>(); - List nameStr = getVarParts(name); - for (int i = 0; i < nameStr.size() - 1; i++) { - List notBody = new ArrayList<>(); - List globalClassTypeStr = new ArrayList<>(); - globalClassTypeStr.add("_global"); - for (int j = 0; j <= i; j++) { - globalClassTypeStr.add(nameStr.get(j)); - } - - List val = new ArrayList<>(); - val.add(new ActionPush((Long) 0L)); - val.add(pushConst("Object")); - val.add(new ActionNewObject()); - notBody.addAll(typeToActions(globalClassTypeStr, val)); - ret.addAll(typeToActions(globalClassTypeStr, null)); - ret.add(new ActionNot()); - ret.add(new ActionNot()); - ret.add(new ActionIf(Action.actionsToBytes(notBody, false, SWF.DEFAULT_VERSION).length)); - ret.addAll(notBody); - } - List ifbody = new ArrayList<>(); - List globalClassTypeStr = new ArrayList<>(); - globalClassTypeStr.add("_global"); - globalClassTypeStr.addAll(nameStr); - - ParsedSymbol s = null; - List constr = new ArrayList<>(); - - if (constructor == null) { - List val = new ArrayList<>(); - val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION)); - if (!isInterface) { - val.add(new ActionStoreRegister(1)); - } - constr.addAll(typeToActions(globalClassTypeStr, val)); - } else { - constr.addAll(toActionList(((FunctionActionItem) constructor).toSource(localData, this))); - constr.add(new ActionStoreRegister(1)); - constr = (typeToActions(globalClassTypeStr, constr)); - } - if (!isInterface) { - for (GraphTargetItem f : staticFunctions) { - FunctionActionItem fi = (FunctionActionItem) f; - ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); - ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); - ifbody.addAll(toActionList(fi.toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (GraphTargetItem f : functions) { - FunctionActionItem fi = (FunctionActionItem) f; - ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); - ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); - ifbody.addAll(toActionList(fi.toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (MyEntry en : staticVars) { - ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); - ifbody.add(new ActionPush(getName(en.getKey()))); - ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - for (MyEntry en : vars) { - ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); - ifbody.add(new ActionPush(getName(en.getKey()))); - ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); - ifbody.add(new ActionSetMember()); - } - } - - if (!isInterface) { - ifbody.add(new ActionPush((Long) 1L)); - ifbody.add(new ActionPush(new Null())); - ifbody.addAll(typeToActions(globalClassTypeStr, null)); - ifbody.add(pushConst("prototype")); - ifbody.add(new ActionGetMember()); - ifbody.add(new ActionPush((Long) 3L)); - ifbody.add(pushConst("ASSetPropFlags")); - ifbody.add(new ActionCallFunction()); - } - - if (constr.isEmpty()) { - List val = new ArrayList<>(); - val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION)); - if (!isInterface) { - val.add(new ActionStoreRegister(1)); - } - constr.addAll(typeToActions(globalClassTypeStr, val)); - } - if (!extendsStr.isEmpty()) { - constr.addAll(typeToActions(globalClassTypeStr, null)); - constr.addAll(typeToActions(extendsStr, null)); - constr.add(new ActionExtends()); - } - if (!isInterface) { - constr.add(new ActionPush(new RegisterNumber(1))); - constr.add(pushConst("prototype")); - constr.add(new ActionGetMember()); - constr.add(new ActionStoreRegister(2)); - constr.add(new ActionPop()); - } - - if (!implementsStr.isEmpty()) { - for (GraphTargetItem imp : implementsStr) { - List impList = getVarParts(imp); - List globImp = new ArrayList<>(); - globImp.add("_global"); - globImp.addAll(impList); - constr.addAll(typeToActions(globImp, null)); - } - constr.add(new ActionPush((long) implementsStr.size())); - constr.addAll(typeToActions(globalClassTypeStr, null)); - constr.add(new ActionImplementsOp()); - } - ifbody.addAll(0, constr); - - ret.addAll(typeToActions(globalClassTypeStr, null)); - ret.add(new ActionNot()); - ret.add(new ActionNot()); - ret.add(new ActionIf(Action.actionsToBytes(ifbody, false, SWF.DEFAULT_VERSION).length)); - ret.addAll(ifbody); - ret.add(new ActionPop()); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, CommaExpressionItem item) throws CompilationException { - if (item.commands.isEmpty()) { - return new ArrayList<>(); - } - - //We need to handle commands and last expression separately, otherwise last expression result will be popped - List cmds = new ArrayList<>(item.commands); - GraphTargetItem lastExpr = cmds.remove(cmds.size() - 1); - List ret = new ArrayList<>(); - ret.addAll(generate(localData, cmds)); - ret.addAll(lastExpr.toSource(localData, this)); - return ret; - } - - @Override - public List generate(SourceGeneratorLocalData localData, TypeItem item) throws CompilationException { - //Unsupported in AS1/2 - return new ArrayList<>(); - } - - @Override - public List generateDiscardValue(SourceGeneratorLocalData localData, GraphTargetItem item) throws CompilationException { - List ret = item.toSource(localData, this); - ret.add(new ActionPop()); - return ret; - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action.parser.script; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; +import com.jpexs.decompiler.flash.action.model.FunctionActionItem; +import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; +import com.jpexs.decompiler.flash.action.model.GetVariableActionItem; +import com.jpexs.decompiler.flash.action.model.operations.Inverted; +import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable; +import com.jpexs.decompiler.flash.action.swf4.ActionIf; +import com.jpexs.decompiler.flash.action.swf4.ActionJump; +import com.jpexs.decompiler.flash.action.swf4.ActionNot; +import com.jpexs.decompiler.flash.action.swf4.ActionPop; +import com.jpexs.decompiler.flash.action.swf4.ActionPush; +import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; +import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; +import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; +import com.jpexs.decompiler.flash.action.swf5.ActionCallFunction; +import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; +import com.jpexs.decompiler.flash.action.swf5.ActionGetMember; +import com.jpexs.decompiler.flash.action.swf5.ActionNewObject; +import com.jpexs.decompiler.flash.action.swf5.ActionPushDuplicate; +import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; +import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; +import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; +import com.jpexs.decompiler.flash.action.swf7.ActionExtends; +import com.jpexs.decompiler.flash.action.swf7.ActionImplementsOp; +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.TypeItem; +import com.jpexs.decompiler.graph.model.AndItem; +import com.jpexs.decompiler.graph.model.BreakItem; +import com.jpexs.decompiler.graph.model.CommaExpressionItem; +import com.jpexs.decompiler.graph.model.ContinueItem; +import com.jpexs.decompiler.graph.model.DoWhileItem; +import com.jpexs.decompiler.graph.model.DuplicateItem; +import com.jpexs.decompiler.graph.model.FalseItem; +import com.jpexs.decompiler.graph.model.ForItem; +import com.jpexs.decompiler.graph.model.IfItem; +import com.jpexs.decompiler.graph.model.NotItem; +import com.jpexs.decompiler.graph.model.OrItem; +import com.jpexs.decompiler.graph.model.SwitchItem; +import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.TrueItem; +import com.jpexs.decompiler.graph.model.WhileItem; +import com.jpexs.helpers.Helper; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class ActionSourceGenerator implements SourceGenerator { + + @Override + public List generate(SourceGeneratorLocalData localData, FalseItem item) throws CompilationException { + return GraphTargetItem.toSourceMerge(localData, this, new ActionPush(Boolean.FALSE)); + } + + @Override + public List generate(SourceGeneratorLocalData localData, TrueItem item) throws CompilationException { + return GraphTargetItem.toSourceMerge(localData, this, new ActionPush(Boolean.TRUE)); + } + + @Override + public List generate(SourceGeneratorLocalData localData, AndItem item) throws CompilationException { + List ret = new ArrayList<>(); + ret.addAll(generateToActionList(localData, item.leftSide)); + ret.add(new ActionPushDuplicate()); + ret.add(new ActionNot()); + List andExpr = generateToActionList(localData, item.rightSide); + andExpr.add(0, new ActionPop()); + int andExprLen = Action.actionsToBytes(andExpr, false, SWF.DEFAULT_VERSION).length; + ret.add(new ActionIf(andExprLen)); + ret.addAll(andExpr); + return ret; + + } + + @Override + public List generate(SourceGeneratorLocalData localData, OrItem item) throws CompilationException { + List ret = new ArrayList<>(); + ret.addAll(generateToActionList(localData, item.leftSide)); + ret.add(new ActionPushDuplicate()); + List orExpr = generateToActionList(localData, item.rightSide); + orExpr.add(0, new ActionPop()); + int orExprLen = Action.actionsToBytes(orExpr, false, SWF.DEFAULT_VERSION).length; + ret.add(new ActionIf(orExprLen)); + ret.addAll(orExpr); + return ret; + } + + public List toActionList(List items) { + List ret = new ArrayList<>(); + for (GraphSourceItem s : items) { + if (s instanceof Action) { + ret.add((Action) s); + } + } + return ret; + } + + private List nonempty(List list) { + if (list == null) { + return new ArrayList<>(); + } + return list; + } + + private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) throws CompilationException { + List ret = new ArrayList<>(); + if (expression instanceof Inverted) { + ret.addAll(((Inverted) expression).invert(null).toSource(localData, this)); + } else { + ret.addAll(expression.toSource(localData, this)); + ret.add(new ActionNot()); + } + List onTrue = null; + List onFalse = null; + if (ternar) { + onTrue = toActionList(onTrueCmds.get(0).toSource(localData, this)); + } else { + onTrue = generateToActionList(localData, onTrueCmds); + } + + if (onFalseCmds != null && !onFalseCmds.isEmpty()) { + if (ternar) { + onFalse = toActionList(onFalseCmds.get(0).toSource(localData, this)); + } else { + onFalse = generateToActionList(localData, onFalseCmds); + } + } + byte[] onTrueBytes = Action.actionsToBytes(onTrue, false, SWF.DEFAULT_VERSION); + int onTrueLen = onTrueBytes.length; + + ActionIf ifaif = new ActionIf(0); + ret.add(ifaif); + ret.addAll(onTrue); + ifaif.setJumpOffset(onTrueLen); + ActionJump ajmp = null; + if (onFalse != null) { + if (!((!nonempty(onTrue).isEmpty()) + && (onTrue.get(onTrue.size() - 1) instanceof ActionJump) + && ((((ActionJump) onTrue.get(onTrue.size() - 1)).isContinue) + || (((ActionJump) onTrue.get(onTrue.size() - 1)).isBreak)))) { + ajmp = new ActionJump(0); + ret.add(ajmp); + onTrueLen += ajmp.getTotalActionLength(); + } + ifaif.setJumpOffset(onTrueLen); + byte[] onFalseBytes = Action.actionsToBytes(onFalse, false, SWF.DEFAULT_VERSION); + int onFalseLen = onFalseBytes.length; + if (ajmp != null) { + ajmp.setJumpOffset(onFalseLen); + } + ret.addAll(onFalse); + } + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, IfItem item) throws CompilationException { + return generateIf(localData, item.expression, item.onTrue, item.onFalse, false); + } + + private void fixLoop(List code, int breakOffset) { + fixLoop(code, breakOffset, Integer.MAX_VALUE); + } + + private void fixLoop(List code, int breakOffset, int continueOffset) { + int pos = 0; + for (Action a : code) { + pos += a.getTotalActionLength(); + if (a instanceof ActionJump) { + ActionJump aj = (ActionJump) a; + if (aj.isContinue && (continueOffset != Integer.MAX_VALUE)) { + aj.setJumpOffset(-pos + continueOffset); + aj.isContinue = false; + } + if (aj.isBreak) { + aj.setJumpOffset(-pos + breakOffset); + aj.isBreak = false; + } + } + } + } + + @Override + public List generate(SourceGeneratorLocalData localData, TernarOpItem item) throws CompilationException { + List onTrue = new ArrayList<>(); + onTrue.add(item.onTrue); + List onFalse = new ArrayList<>(); + onFalse.add(item.onFalse); + return generateIf(localData, item.expression, onTrue, onFalse, true); + } + + @Override + public List generate(SourceGeneratorLocalData localData, WhileItem item) throws CompilationException { + List ret = new ArrayList<>(); + List whileExpr = new ArrayList<>(); + + List ex = new ArrayList<>(item.expression); + if (!ex.isEmpty()) { + GraphTargetItem lastItem = ex.remove(ex.size() - 1); + whileExpr.addAll(generateToActionList(localData, ex)); + whileExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result + } + + List whileBody = generateToActionList(localData, item.commands); + whileExpr.add(new ActionNot()); + ActionIf whileaif = new ActionIf(0); + whileExpr.add(whileaif); + ActionJump whileajmp = new ActionJump(0); + whileBody.add(whileajmp); + int whileExprLen = Action.actionsToBytes(whileExpr, false, SWF.DEFAULT_VERSION).length; + int whileBodyLen = Action.actionsToBytes(whileBody, false, SWF.DEFAULT_VERSION).length; + whileajmp.setJumpOffset(-(whileExprLen + + whileBodyLen)); + whileaif.setJumpOffset(whileBodyLen); + ret.addAll(whileExpr); + fixLoop(whileBody, whileBodyLen, -whileExprLen); + ret.addAll(whileBody); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, DoWhileItem item) throws CompilationException { + List ret = new ArrayList<>(); + List doExpr = generateToActionList(localData, item.expression); + List doBody = generateToActionList(localData, item.commands); + + int doBodyLen = Action.actionsToBytes(doBody, false, SWF.DEFAULT_VERSION).length; + int doExprLen = Action.actionsToBytes(doExpr, false, SWF.DEFAULT_VERSION).length; + + ret.addAll(doBody); + ret.addAll(doExpr); + ActionIf doif = new ActionIf(0); + ret.add(doif); + int offset = doBodyLen + doExprLen + doif.getTotalActionLength(); + doif.setJumpOffset(-offset); + fixLoop(doBody, offset, doBodyLen); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, ForItem item) throws CompilationException { + List ret = new ArrayList<>(); + List forExpr = generateToActionList(localData, item.expression); + List forBody = generateToActionList(localData, item.commands); + List forFinalCommands = generateToActionList(localData, item.finalCommands); + + forExpr.add(new ActionNot()); + ActionIf foraif = new ActionIf(0); + forExpr.add(foraif); + ActionJump forajmp = new ActionJump(0); + int forajmpLen = forajmp.getTotalActionLength(); + int forExprLen = Action.actionsToBytes(forExpr, false, SWF.DEFAULT_VERSION).length; + int forBodyLen = Action.actionsToBytes(forBody, false, SWF.DEFAULT_VERSION).length; + int forFinalLen = Action.actionsToBytes(forFinalCommands, false, SWF.DEFAULT_VERSION).length; + forajmp.setJumpOffset(-(forExprLen + + forBodyLen + forFinalLen + forajmpLen)); + foraif.setJumpOffset(forBodyLen + forFinalLen + forajmpLen); + ret.addAll(forExpr); + ret.addAll(forBody); + ret.addAll(forFinalCommands); + ret.add(forajmp); + fixLoop(forBody, forBodyLen + forFinalLen + forajmpLen, forBodyLen); + return ret; + } + + private long uniqLast = 0; + + public String uniqId() { + uniqLast++; + return "" + uniqLast; + } + + @Override + public List generate(SourceGeneratorLocalData localData, SwitchItem item) throws CompilationException { + List ret = new ArrayList<>(); + HashMap registerVars = getRegisterVars(localData); + int exprReg = 0; + for (int i = 0; i < 256; i++) { + if (!registerVars.containsValue(i)) { + registerVars.put("__switch" + uniqId(), i); + exprReg = i; + break; + } + } + + ret.addAll(toActionList(item.switchedObject.toSource(localData, this))); + + boolean firstCase = true; + List> caseIfs = new ArrayList<>(); + List> caseCmds = new ArrayList<>(); + List>> caseExprsAll = new ArrayList<>(); + + loopm: + for (int m = 0; m < item.caseValues.size(); m++) { + List> caseExprs = new ArrayList<>(); + List caseIfsOne = new ArrayList<>(); + int mapping = item.valuesMapping.get(m); + for (; m < item.caseValues.size(); m++) { + int newmapping = item.valuesMapping.get(m); + if (newmapping != mapping) { + m--; + break; + } + List curCaseExpr = generateToActionList(localData, item.caseValues.get(m)); + caseExprs.add(curCaseExpr); + if (firstCase) { + curCaseExpr.add(0, new ActionStoreRegister(exprReg)); + } else { + curCaseExpr.add(0, new ActionPush(new RegisterNumber(exprReg))); + } + curCaseExpr.add(new ActionStrictEquals()); + ActionIf aif = new ActionIf(0); + caseIfsOne.add(aif); + curCaseExpr.add(aif); + ret.addAll(curCaseExpr); + firstCase = false; + } + caseExprsAll.add(caseExprs); + caseIfs.add(caseIfsOne); + List caseCmd = generateToActionList(localData, item.caseCommands.get(mapping)); + caseCmds.add(caseCmd); + } + ActionJump defJump = new ActionJump(0); + ret.add(defJump); + List defCmd = new ArrayList<>(); + if (!item.defaultCommands.isEmpty()) { + defCmd = generateToActionList(localData, item.defaultCommands); + } + for (List caseCmd : caseCmds) { + ret.addAll(caseCmd); + } + ret.addAll(defCmd); + + List> exprLengths = new ArrayList<>(); + for (List> caseExprs : caseExprsAll) { + List lengths = new ArrayList<>(); + for (List caseExpr : caseExprs) { + lengths.add(Action.actionsToBytes(caseExpr, false, SWF.DEFAULT_VERSION).length); + } + exprLengths.add(lengths); + } + List caseLengths = new ArrayList<>(); + for (List caseCmd : caseCmds) { + caseLengths.add(Action.actionsToBytes(caseCmd, false, SWF.DEFAULT_VERSION).length); + } + int defLength = Action.actionsToBytes(defCmd, false, SWF.DEFAULT_VERSION).length; + + for (int i = 0; i < caseIfs.size(); i++) { + for (int c = 0; c < caseIfs.get(i).size(); c++) { + int jmpPos = 0; + for (int j = c + 1; j < caseIfs.get(i).size(); j++) { + jmpPos += exprLengths.get(i).get(j); + } + for (int k = i + 1; k < caseIfs.size(); k++) { + for (int m = 0; m < caseIfs.get(k).size(); m++) { + jmpPos += exprLengths.get(k).get(m); + } + } + jmpPos += defJump.getTotalActionLength(); + for (int n = 0; n < i; n++) { + jmpPos += caseLengths.get(n); + } + caseIfs.get(i).get(c).setJumpOffset(jmpPos); + } + } + int defJmpPos = 0; + for (int i = 0; i < caseIfs.size(); i++) { + defJmpPos += caseLengths.get(i); + } + + defJump.setJumpOffset(defJmpPos); + List caseCmdsAll = new ArrayList<>(); + int breakOffset = 0; + for (int i = 0; i < caseCmds.size(); i++) { + caseCmdsAll.addAll(caseCmds.get(i)); + breakOffset += caseLengths.get(i); + } + breakOffset += defLength; + fixLoop(caseCmdsAll, breakOffset); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, NotItem item) throws CompilationException { + if (item.getOriginal() instanceof Inverted) { + GraphTargetItem norig = ((Inverted) item).invert(null); + return norig.toSource(localData, this); + } + List ret = new ArrayList<>(); + ret.addAll(item.getOriginal().toSource(localData, this)); + ret.add(new ActionNot()); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, DuplicateItem item) { + List ret = new ArrayList<>(); + ret.add(new ActionPushDuplicate()); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, BreakItem item) { + List ret = new ArrayList<>(); + ActionJump abreak = new ActionJump(0); + abreak.isBreak = true; + ret.add(abreak); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, ContinueItem item) { + List ret = new ArrayList<>(); + ActionJump acontinue = new ActionJump(0); + acontinue.isContinue = true; + ret.add(acontinue); + return ret; + } + + private List generateToActionList(SourceGeneratorLocalData localData, List commands) throws CompilationException { + return toActionList(generate(localData, commands)); + } + + private List generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) throws CompilationException { + return toActionList(command.toSource(localData, this)); + } + + @Override + public List generate(SourceGeneratorLocalData localData, List commands) throws CompilationException { + List ret = new ArrayList<>(); + for (GraphTargetItem item : commands) { + ret.addAll(item.toSourceIgnoreReturnValue(localData, this)); + } + return ret; + } + + public HashMap getRegisterVars(SourceGeneratorLocalData localData) { + return localData.registerVars; + } + + public void setRegisterVars(SourceGeneratorLocalData localData, HashMap value) { + localData.registerVars = value; + } + + public void setInFunction(SourceGeneratorLocalData localData, int value) { + localData.inFunction = value; + } + + public int isInFunction(SourceGeneratorLocalData localData) { + return localData.inFunction; + } + + public boolean isInMethod(SourceGeneratorLocalData localData) { + return localData.inMethod; + } + + public void setInMethod(SourceGeneratorLocalData localData, boolean value) { + localData.inMethod = value; + } + + public int getForInLevel(SourceGeneratorLocalData localData) { + return localData.forInLevel; + } + + public void setForInLevel(SourceGeneratorLocalData localData, int value) { + localData.forInLevel = value; + } + + public int getTempRegister(SourceGeneratorLocalData localData) { + HashMap registerVars = getRegisterVars(localData); + for (int tmpReg = 0; tmpReg < 256; tmpReg++) { + if (!registerVars.containsValue(tmpReg)) { + registerVars.put("__temp" + tmpReg, tmpReg); + return tmpReg; + } + } + return 0; //? + } + + public void releaseTempRegister(SourceGeneratorLocalData localData, int tmp) { + HashMap registerVars = getRegisterVars(localData); + registerVars.remove("__temp" + tmp); + } + + private String getName(GraphTargetItem item) { + if (item instanceof VariableActionItem) { + return ((VariableActionItem) item).getVariableName(); + } + if (item instanceof DirectValueActionItem) { + DirectValueActionItem dv = (DirectValueActionItem) item; + return (String) dv.getResult(); + } + if (item instanceof GetVariableActionItem) { + GetVariableActionItem gv = (GetVariableActionItem) item; + return getName(gv.name); + } + if (item instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) item; + return getName(mem.memberName); + } + return null; + } + + private List getVarParts(GraphTargetItem item) { + List ret = new ArrayList<>(); + do { + if (item instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) item; + ret.add(0, getName(mem)); + item = mem.object; + } + } while (item instanceof GetMemberActionItem); + String f = getName(item); + if (f != null) { + ret.add(0, f); + } + return ret; + } + + private int getVarLength(GraphTargetItem item) { + int len = 1; + do { + if (item instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) item; + item = mem.object; + len++; + } + } while (item instanceof GetMemberActionItem); + return len; + } + + private GraphTargetItem removeVarLast(GraphTargetItem item, int cnt) { + item = Helper.deepCopy(item); + + for (int i = 0; i < cnt; i++) { + if (item instanceof GetMemberActionItem) { + GetMemberActionItem mem = (GetMemberActionItem) item; + item = mem.object; + } + } + return item; + } + + private GraphTargetItem addGlobalPrefix(GraphTargetItem item) { + item = Helper.deepCopy(item); + GraphTargetItem first = item; + GetMemberActionItem mem = null; + do { + if (item instanceof GetMemberActionItem) { + mem = (GetMemberActionItem) item; + item = mem.object; + } + } while (item instanceof GetMemberActionItem); + if (item instanceof GetVariableActionItem) { + GetVariableActionItem v = (GetVariableActionItem) item; + item = new GetMemberActionItem(null, new GetVariableActionItem(null, new DirectValueActionItem(null, 0, "_global", new ArrayList())), v.name); + if (mem != null) { + mem.object = item; + } + } + return first; + } + + private List typeToActions(List type, List value) { + List ret = new ArrayList<>(); + if (type.isEmpty()) { + return ret; + } + ret.add(pushConst(type.get(0))); + if (type.size() == 1 && (value != null)) { + ret.addAll(value); + ret.add(new ActionSetVariable()); + } else { + ret.add(new ActionGetVariable()); + } + for (int i = 1; i < type.size(); i++) { + ret.add(pushConst(type.get(i))); + if ((i == type.size() - 1) && (value != null)) { + ret.addAll(value); + ret.add(new ActionSetMember()); + } else { + ret.add(new ActionGetMember()); + } + } + return ret; + } + + private final List constantPool; + + private final int swfVersion; + + public int getSwfVersion() { + return swfVersion; + } + + public ActionSourceGenerator(int swfVersion, List constantPool) { + this.constantPool = constantPool; + this.swfVersion = swfVersion; + } + + public List getConstantPool() { + return constantPool; + } + + public DirectValueActionItem pushConstTargetItem(String s) { + int index = constantPool.indexOf(s); + if (index == -1) { + constantPool.add(s); + index = constantPool.indexOf(s); + } + return new DirectValueActionItem(null, 0, new ConstantIndex(index), constantPool); + } + + public ActionPush pushConst(String s) { + int index = constantPool.indexOf(s); + if (index == -1) { + constantPool.add(s); + index = constantPool.indexOf(s); + } + return new ActionPush(new ConstantIndex(index)); + } + + public List generateTraits(SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) throws CompilationException { + List extendsStr = getVarParts(extendsVal); + List ret = new ArrayList<>(); + List nameStr = getVarParts(name); + for (int i = 0; i < nameStr.size() - 1; i++) { + List notBody = new ArrayList<>(); + List globalClassTypeStr = new ArrayList<>(); + globalClassTypeStr.add("_global"); + for (int j = 0; j <= i; j++) { + globalClassTypeStr.add(nameStr.get(j)); + } + + List val = new ArrayList<>(); + val.add(new ActionPush((Long) 0L)); + val.add(pushConst("Object")); + val.add(new ActionNewObject()); + notBody.addAll(typeToActions(globalClassTypeStr, val)); + ret.addAll(typeToActions(globalClassTypeStr, null)); + ret.add(new ActionNot()); + ret.add(new ActionNot()); + ret.add(new ActionIf(Action.actionsToBytes(notBody, false, SWF.DEFAULT_VERSION).length)); + ret.addAll(notBody); + } + List ifbody = new ArrayList<>(); + List globalClassTypeStr = new ArrayList<>(); + globalClassTypeStr.add("_global"); + globalClassTypeStr.addAll(nameStr); + + ParsedSymbol s = null; + List constr = new ArrayList<>(); + + if (constructor == null) { + List val = new ArrayList<>(); + val.add(new ActionDefineFunction("", new ArrayList(), 0, SWF.DEFAULT_VERSION)); + if (!isInterface) { + val.add(new ActionStoreRegister(1)); + } + constr.addAll(typeToActions(globalClassTypeStr, val)); + } else { + constr.addAll(toActionList(((FunctionActionItem) constructor).toSource(localData, this))); + constr.add(new ActionStoreRegister(1)); + constr = (typeToActions(globalClassTypeStr, constr)); + } + if (!isInterface) { + for (GraphTargetItem f : staticFunctions) { + FunctionActionItem fi = (FunctionActionItem) f; + ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); + ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); + ifbody.addAll(toActionList(fi.toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } + for (GraphTargetItem f : functions) { + FunctionActionItem fi = (FunctionActionItem) f; + ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); + ifbody.add(new ActionPush(getName(fi.calculatedFunctionName))); + ifbody.addAll(toActionList(fi.toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } + for (MyEntry en : staticVars) { + ifbody.add(new ActionPush(new RegisterNumber(1/*static*/))); + ifbody.add(new ActionPush(getName(en.getKey()))); + ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } + for (MyEntry en : vars) { + ifbody.add(new ActionPush(new RegisterNumber(2/*instance*/))); + ifbody.add(new ActionPush(getName(en.getKey()))); + ifbody.addAll(toActionList(en.getValue().toSource(localData, this))); + ifbody.add(new ActionSetMember()); + } + } + + if (!isInterface) { + ifbody.add(new ActionPush((Long) 1L)); + ifbody.add(new ActionPush(new Null())); + ifbody.addAll(typeToActions(globalClassTypeStr, null)); + ifbody.add(pushConst("prototype")); + ifbody.add(new ActionGetMember()); + ifbody.add(new ActionPush((Long) 3L)); + ifbody.add(pushConst("ASSetPropFlags")); + ifbody.add(new ActionCallFunction()); + } + + if (constr.isEmpty()) { + List val = new ArrayList<>(); + val.add(new ActionDefineFunction("", new ArrayList(), 0, SWF.DEFAULT_VERSION)); + if (!isInterface) { + val.add(new ActionStoreRegister(1)); + } + constr.addAll(typeToActions(globalClassTypeStr, val)); + } + if (!extendsStr.isEmpty()) { + constr.addAll(typeToActions(globalClassTypeStr, null)); + constr.addAll(typeToActions(extendsStr, null)); + constr.add(new ActionExtends()); + } + if (!isInterface) { + constr.add(new ActionPush(new RegisterNumber(1))); + constr.add(pushConst("prototype")); + constr.add(new ActionGetMember()); + constr.add(new ActionStoreRegister(2)); + constr.add(new ActionPop()); + } + + if (!implementsStr.isEmpty()) { + for (GraphTargetItem imp : implementsStr) { + List impList = getVarParts(imp); + List globImp = new ArrayList<>(); + globImp.add("_global"); + globImp.addAll(impList); + constr.addAll(typeToActions(globImp, null)); + } + constr.add(new ActionPush((long) implementsStr.size())); + constr.addAll(typeToActions(globalClassTypeStr, null)); + constr.add(new ActionImplementsOp()); + } + ifbody.addAll(0, constr); + + ret.addAll(typeToActions(globalClassTypeStr, null)); + ret.add(new ActionNot()); + ret.add(new ActionNot()); + ret.add(new ActionIf(Action.actionsToBytes(ifbody, false, SWF.DEFAULT_VERSION).length)); + ret.addAll(ifbody); + ret.add(new ActionPop()); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, CommaExpressionItem item) throws CompilationException { + if (item.commands.isEmpty()) { + return new ArrayList<>(); + } + + //We need to handle commands and last expression separately, otherwise last expression result will be popped + List cmds = new ArrayList<>(item.commands); + GraphTargetItem lastExpr = cmds.remove(cmds.size() - 1); + List ret = new ArrayList<>(); + ret.addAll(generate(localData, cmds)); + ret.addAll(lastExpr.toSource(localData, this)); + return ret; + } + + @Override + public List generate(SourceGeneratorLocalData localData, TypeItem item) throws CompilationException { + //Unsupported in AS1/2 + return new ArrayList<>(); + } + + @Override + public List generateDiscardValue(SourceGeneratorLocalData localData, GraphTargetItem item) throws CompilationException { + List ret = item.toSource(localData, this); + ret.add(new ActionPop()); + return ret; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolGroup.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolGroup.java index 6b162a4fd..afc76fa4f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolGroup.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolGroup.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.parser.script; /** @@ -32,5 +33,6 @@ public enum SymbolGroup { TYPENAME, EOF, GLOBALFUNC, - GLOBALCONST + GLOBALCONST, + PREPROCESSOR } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolType.java index 7e46c3ce5..4493f9c3d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/SymbolType.java @@ -1,222 +1,223 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.action.parser.script; - -import com.jpexs.decompiler.graph.GraphTargetItem; - -/** - * - * @author JPEXS - */ -public enum SymbolType { - //Keywords - - BREAK, - CASE, - CONTINUE, - DEFAULT, - DO, - WHILE, - ELSE, - FOR, - EACH, - IN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - IF, - RETURN, - SUPER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - SWITCH, - THROW, - TRY, - CATCH, - FINALLY, - WITH, - DYNAMIC, - INTERNAL, - OVERRIDE, - PRIVATE, - PROTECTED, - PUBLIC, - STATIC, - CLASS, - CONST, - EXTENDS, - FUNCTION(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GET, - IMPLEMENTS, - INTERFACE, - NAMESPACE, - PACKAGE, - SET, - VAR, - IMPORT, - USE, - FALSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NULL(GraphTargetItem.PRECEDENCE_PRIMARY, false), - THIS(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TRUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - //Operators - PARENT_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PARENT_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CURLY_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CURLY_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - BRACKET_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - BRACKET_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - SEMICOLON, - COMMA(GraphTargetItem.PRECEDENCE_COMMA, false), - REST, - DOT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - ASSIGN(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - GREATER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - LOWER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NOT(GraphTargetItem.PRECEDENCE_UNARY, false), - NEGATE(GraphTargetItem.PRECEDENCE_UNARY, false), - TERNAR(GraphTargetItem.PRECEDENCE_CONDITIONAL, true, true), /*!! ternar !!!*/ - COLON(GraphTargetItem.PRECEDENCE_CONDITIONAL, false),/*!! ternar !!!*/ - EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), - STRICT_EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), - LOWER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - GREATER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), - STRICT_NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), - AND(GraphTargetItem.PRECEDENCE_LOGICALAND, true), - OR(GraphTargetItem.PRECEDENCE_LOGICALOR, true), - FULLAND(GraphTargetItem.PRECEDENCE_LOGICALAND, true), - FULLOR(GraphTargetItem.PRECEDENCE_LOGICALOR, true), - INCREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false),//OR Unary - DECREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false), //OR Unary - PLUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), - MINUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), //OR Unary - MULTIPLY(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), - DIVIDE(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), - BITAND(GraphTargetItem.PRECEDENCE_BITWISEAND, true), - BITOR(GraphTargetItem.PRECEDENCE_BITWISEOR, true), - XOR(GraphTargetItem.PRECEDENCE_BITWISEXOR, true), - MODULO(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - SHIFT_LEFT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), - ASSIGN_PLUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MINUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MULTIPLY(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_DIVIDE(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_BITAND(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_BITOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_XOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_MODULO(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_SHIFT_LEFT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - ASSIGN_USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), - AS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - DELETE(GraphTargetItem.PRECEDENCE_UNARY, false), - INSTANCEOF(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - IS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), - NAMESPACE_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NEW(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TYPEOF(GraphTargetItem.PRECEDENCE_UNARY, false), - VOID, - ATTRIBUTE, - //Other - STRING(GraphTargetItem.PRECEDENCE_PRIMARY, false), - COMMENT, - XML, - IDENTIFIER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - INTEGER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - DOUBLE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TYPENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), - EOF, - TRACE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GETURL(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GOTOANDSTOP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NEXTFRAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PLAY(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PREVFRAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TELLTARGET(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STOP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STOPALLSOUNDS(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TOGGLEHIGHQUALITY(GraphTargetItem.PRECEDENCE_PRIMARY, false), - ORD(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CHR(GraphTargetItem.PRECEDENCE_PRIMARY, false), - DUPLICATEMOVIECLIP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STOPDRAG(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GETTIMER(GraphTargetItem.PRECEDENCE_PRIMARY, false), - LOADVARIABLES(GraphTargetItem.PRECEDENCE_PRIMARY, false), - LOADMOVIE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GOTOANDPLAY(GraphTargetItem.PRECEDENCE_PRIMARY, false), - MBORD(GraphTargetItem.PRECEDENCE_PRIMARY, false), - MBCHR(GraphTargetItem.PRECEDENCE_PRIMARY, false), - MBLENGTH(GraphTargetItem.PRECEDENCE_PRIMARY, false), - MBSUBSTRING(GraphTargetItem.PRECEDENCE_PRIMARY, false), - RANDOM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - REMOVEMOVIECLIP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STARTDRAG(GraphTargetItem.PRECEDENCE_PRIMARY, false), - SUBSTR(GraphTargetItem.PRECEDENCE_PRIMARY, false), - LENGTH(GraphTargetItem.PRECEDENCE_PRIMARY, false), //string.length - INT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - TARGETPATH(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NUMBER_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - STRING_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - IFFRAMELOADED, - INFINITY(GraphTargetItem.PRECEDENCE_PRIMARY, false), - EVAL(GraphTargetItem.PRECEDENCE_PRIMARY, false), - UNDEFINED(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NEWLINE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - NAN(GraphTargetItem.PRECEDENCE_PRIMARY, false), - GETVERSION(GraphTargetItem.PRECEDENCE_PRIMARY, false), - CALL(GraphTargetItem.PRECEDENCE_PRIMARY, false), - LOADMOVIENUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - LOADVARIABLESNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PRINT(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PRINTNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PRINTASBITMAP(GraphTargetItem.PRECEDENCE_PRIMARY, false), - PRINTASBITMAPNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - UNLOADMOVIE(GraphTargetItem.PRECEDENCE_PRIMARY, false), - UNLOADMOVIENUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), - FSCOMMAND(GraphTargetItem.PRECEDENCE_PRIMARY, false); - - private int precedence = GraphTargetItem.NOPRECEDENCE; - - private boolean binary = false; - - private boolean rightAssociative = false; - - public boolean isBinary() { - return binary; - } - - public boolean isRightAssociative() { - return rightAssociative; - } - - public int getPrecedence() { - return precedence; - } - - private SymbolType(int precedence, boolean binary) { - this.precedence = precedence; - this.binary = binary; - } - - private SymbolType(int precedence, boolean binary, boolean rightAssociative) { - this.precedence = precedence; - this.binary = binary; - this.rightAssociative = rightAssociative; - } - - private SymbolType() { - - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action.parser.script; + +import com.jpexs.decompiler.graph.GraphTargetItem; + +/** + * + * @author JPEXS + */ +public enum SymbolType { + //Keywords + + BREAK, + CASE, + CONTINUE, + DEFAULT, + DO, + WHILE, + ELSE, + FOR, + EACH, + IN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + IF, + RETURN, + SUPER(GraphTargetItem.PRECEDENCE_PRIMARY, false), + SWITCH, + THROW, + TRY, + CATCH, + FINALLY, + WITH, + DYNAMIC, + INTERNAL, + OVERRIDE, + PRIVATE, + PROTECTED, + PUBLIC, + STATIC, + CLASS, + CONST, + EXTENDS, + FUNCTION(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GET, + IMPLEMENTS, + INTERFACE, + NAMESPACE, + PACKAGE, + SET, + VAR, + IMPORT, + USE, + FALSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NULL(GraphTargetItem.PRECEDENCE_PRIMARY, false), + THIS(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TRUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + //Operators + PARENT_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PARENT_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + CURLY_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), + CURLY_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + BRACKET_OPEN(GraphTargetItem.PRECEDENCE_PRIMARY, false), + BRACKET_CLOSE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + SEMICOLON, + COMMA(GraphTargetItem.PRECEDENCE_COMMA, false), + REST, + DOT(GraphTargetItem.PRECEDENCE_PRIMARY, false), + ASSIGN(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + GREATER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + LOWER_THAN(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + NOT(GraphTargetItem.PRECEDENCE_UNARY, false), + NEGATE(GraphTargetItem.PRECEDENCE_UNARY, false), + TERNAR(GraphTargetItem.PRECEDENCE_CONDITIONAL, true, true), /*!! ternar !!!*/ + COLON(GraphTargetItem.PRECEDENCE_CONDITIONAL, false),/*!! ternar !!!*/ + EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), + STRICT_EQUALS(GraphTargetItem.PRECEDENCE_EQUALITY, true), + LOWER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + GREATER_EQUAL(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), + STRICT_NOT_EQUAL(GraphTargetItem.PRECEDENCE_EQUALITY, true), + AND(GraphTargetItem.PRECEDENCE_LOGICALAND, true), + OR(GraphTargetItem.PRECEDENCE_LOGICALOR, true), + FULLAND(GraphTargetItem.PRECEDENCE_LOGICALAND, true), + FULLOR(GraphTargetItem.PRECEDENCE_LOGICALOR, true), + INCREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false),//OR Unary + DECREMENT(GraphTargetItem.PRECEDENCE_POSTFIX, false), //OR Unary + PLUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), + MINUS(GraphTargetItem.PRECEDENCE_ADDITIVE, true), //OR Unary + MULTIPLY(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), + DIVIDE(GraphTargetItem.PRECEDENCE_MULTIPLICATIVE, true), + BITAND(GraphTargetItem.PRECEDENCE_BITWISEAND, true), + BITOR(GraphTargetItem.PRECEDENCE_BITWISEOR, true), + XOR(GraphTargetItem.PRECEDENCE_BITWISEXOR, true), + MODULO(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), + SHIFT_LEFT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), + SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), + USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_BITWISESHIFT, true), + ASSIGN_PLUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_MINUS(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_MULTIPLY(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_DIVIDE(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_BITAND(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_BITOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_XOR(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_MODULO(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_SHIFT_LEFT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_SHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + ASSIGN_USHIFT_RIGHT(GraphTargetItem.PRECEDENCE_ASSIGMENT, true, true), + AS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + DELETE(GraphTargetItem.PRECEDENCE_UNARY, false), + INSTANCEOF(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + IS(GraphTargetItem.PRECEDENCE_RELATIONAL, true), + NAMESPACE_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NEW(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TYPEOF(GraphTargetItem.PRECEDENCE_UNARY, false), + VOID, + ATTRIBUTE, + //Other + STRING(GraphTargetItem.PRECEDENCE_PRIMARY, false), + COMMENT, + XML, + IDENTIFIER(GraphTargetItem.PRECEDENCE_PRIMARY, false), + INTEGER(GraphTargetItem.PRECEDENCE_PRIMARY, false), + DOUBLE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TYPENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), + EOF, + TRACE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GETURL(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GOTOANDSTOP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NEXTFRAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PLAY(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PREVFRAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TELLTARGET(GraphTargetItem.PRECEDENCE_PRIMARY, false), + STOP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + STOPALLSOUNDS(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TOGGLEHIGHQUALITY(GraphTargetItem.PRECEDENCE_PRIMARY, false), + ORD(GraphTargetItem.PRECEDENCE_PRIMARY, false), + CHR(GraphTargetItem.PRECEDENCE_PRIMARY, false), + DUPLICATEMOVIECLIP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + STOPDRAG(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GETTIMER(GraphTargetItem.PRECEDENCE_PRIMARY, false), + LOADVARIABLES(GraphTargetItem.PRECEDENCE_PRIMARY, false), + LOADMOVIE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GOTOANDPLAY(GraphTargetItem.PRECEDENCE_PRIMARY, false), + MBORD(GraphTargetItem.PRECEDENCE_PRIMARY, false), + MBCHR(GraphTargetItem.PRECEDENCE_PRIMARY, false), + MBLENGTH(GraphTargetItem.PRECEDENCE_PRIMARY, false), + MBSUBSTRING(GraphTargetItem.PRECEDENCE_PRIMARY, false), + RANDOM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + REMOVEMOVIECLIP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + STARTDRAG(GraphTargetItem.PRECEDENCE_PRIMARY, false), + SUBSTR(GraphTargetItem.PRECEDENCE_PRIMARY, false), + LENGTH(GraphTargetItem.PRECEDENCE_PRIMARY, false), //string.length + INT(GraphTargetItem.PRECEDENCE_PRIMARY, false), + TARGETPATH(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NUMBER_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + STRING_OP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + IFFRAMELOADED, + INFINITY(GraphTargetItem.PRECEDENCE_PRIMARY, false), + EVAL(GraphTargetItem.PRECEDENCE_PRIMARY, false), + UNDEFINED(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NEWLINE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + NAN(GraphTargetItem.PRECEDENCE_PRIMARY, false), + GETVERSION(GraphTargetItem.PRECEDENCE_PRIMARY, false), + CALL(GraphTargetItem.PRECEDENCE_PRIMARY, false), + LOADMOVIENUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + LOADVARIABLESNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PRINT(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PRINTNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PRINTASBITMAP(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PRINTASBITMAPNUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + UNLOADMOVIE(GraphTargetItem.PRECEDENCE_PRIMARY, false), + UNLOADMOVIENUM(GraphTargetItem.PRECEDENCE_PRIMARY, false), + FSCOMMAND(GraphTargetItem.PRECEDENCE_PRIMARY, false), + PREPROCESSOR(GraphTargetItem.PRECEDENCE_PRIMARY, false); + + private int precedence = GraphTargetItem.NOPRECEDENCE; + + private boolean binary = false; + + private boolean rightAssociative = false; + + public boolean isBinary() { + return binary; + } + + public boolean isRightAssociative() { + return rightAssociative; + } + + public int getPrecedence() { + return precedence; + } + + private SymbolType(int precedence, boolean binary) { + this.precedence = precedence; + this.binary = binary; + } + + private SymbolType(int precedence, boolean binary, boolean rightAssociative) { + this.precedence = precedence; + this.binary = binary; + this.rightAssociative = rightAssociative; + } + + private SymbolType() { + + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java index 93f887a6c..339791567 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.action.Action; @@ -36,6 +37,6 @@ public class ActionNot extends Action { @Override public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem a = stack.pop(); - stack.push(new NotItem(this, a)); + stack.push(a.invert(this)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java index 4156119da..d95cc43c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf4; import com.jpexs.decompiler.flash.action.Action; @@ -35,13 +36,7 @@ public class ActionPop extends Action { @Override public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { - if (stack.isEmpty()) { - return; - } GraphTargetItem val = stack.pop(); - if (val instanceof DirectValueActionItem) { - return; - } output.add(val); } } 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 ab88fd0e1..9b9a790f0 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 @@ -37,6 +37,8 @@ import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.FalseItem; +import com.jpexs.decompiler.graph.model.TrueItem; import com.jpexs.helpers.Helper; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -360,18 +362,27 @@ public class ActionPush extends Action { } } }*/ - DirectValueActionItem dvt = new DirectValueActionItem(this, pos, o, constantPool); - - if (o instanceof RegisterNumber) {//TemporaryRegister - dvt.computedRegValue = variables.get("__register" + ((RegisterNumber) o).number); - if (regNames.containsKey(((RegisterNumber) o).number)) { - ((RegisterNumber) o).name = regNames.get(((RegisterNumber) o).number); + if (o instanceof Boolean) { + Boolean b = (Boolean) o; + if (b) { + stack.push(new TrueItem(this)); + } else { + stack.push(new FalseItem(this)); } - } - if (dvt.computedRegValue instanceof TemporaryRegister) { - stack.push(new TemporaryRegister(((RegisterNumber) o).number, ((TemporaryRegister) dvt.computedRegValue).value)); } else { - stack.push(dvt); + DirectValueActionItem dvt = new DirectValueActionItem(this, pos, o, constantPool); + + if (o instanceof RegisterNumber) {//TemporaryRegister + dvt.computedRegValue = variables.get("__register" + ((RegisterNumber) o).number); + if (regNames.containsKey(((RegisterNumber) o).number)) { + ((RegisterNumber) o).name = regNames.get(((RegisterNumber) o).number); + } + } + if (dvt.computedRegValue instanceof TemporaryRegister) { + stack.push(new TemporaryRegister(((RegisterNumber) o).number, ((TemporaryRegister) dvt.computedRegValue).value)); + } else { + stack.push(dvt); + } } pos++; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java index d2332ea9d..fb5e7bf96 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf5; import com.jpexs.decompiler.flash.action.Action; @@ -39,7 +40,7 @@ public class ActionEnumerate extends Action { @Override public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem object = stack.pop(); - stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>())); - stack.push(new EnumerateActionItem(this, object)); + //stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); + output.add(new EnumerateActionItem(this, object)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java index 5ffa6770f..f00e5bc70 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java @@ -12,13 +12,15 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf5; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; +import com.jpexs.decompiler.graph.model.DuplicateItem; import java.util.HashMap; import java.util.List; @@ -36,7 +38,7 @@ public class ActionPushDuplicate extends Action { @Override public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { GraphTargetItem value = stack.peek(); - stack.push(value); + stack.push(new DuplicateItem(this, value)); value.moreSrc.add(new GraphSourceItemPos(this, 0)); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java index fd05ef6e7..9e56b1868 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java @@ -1,42 +1,42 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash.action.swf6; - -import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; -import com.jpexs.decompiler.graph.GraphTargetItem; -import com.jpexs.decompiler.graph.TranslateStack; -import java.util.HashMap; -import java.util.List; - -public class ActionEnumerate2 extends Action { - - public ActionEnumerate2() { - super(0x55, 0); - } - - @Override - public String toString() { - return "Enumerate2"; - } - - @Override - public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { - GraphTargetItem object = stack.pop(); - stack.push(new EnumerateActionItem(this, object)); - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.action.swf6; + +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.TranslateStack; +import java.util.HashMap; +import java.util.List; + +public class ActionEnumerate2 extends Action { + + public ActionEnumerate2() { + super(0x55, 0); + } + + @Override + public String toString() { + return "Enumerate2"; + } + + @Override + public void translate(TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions, int staticOperation, String path) { + GraphTargetItem object = stack.pop(); + output.add(new EnumerateActionItem(this, object)); + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index 620b9dd18..ad8d72a54 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -16,6 +16,8 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.graph.model.PushItem; +import com.jpexs.decompiler.graph.model.PopItem; import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.FinalProcessLocalData; import com.jpexs.decompiler.flash.action.Action; @@ -25,7 +27,9 @@ import com.jpexs.decompiler.graph.model.AndItem; import com.jpexs.decompiler.graph.model.BreakItem; import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.DoWhileItem; +import com.jpexs.decompiler.graph.model.DuplicateItem; import com.jpexs.decompiler.graph.model.ExitItem; +import com.jpexs.decompiler.graph.model.FalseItem; import com.jpexs.decompiler.graph.model.ForItem; import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.IntegerValueItem; @@ -37,8 +41,10 @@ import com.jpexs.decompiler.graph.model.OrItem; import com.jpexs.decompiler.graph.model.ScriptEndItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.TrueItem; import com.jpexs.decompiler.graph.model.UniversalLoopItem; import com.jpexs.decompiler.graph.model.WhileItem; +import com.jpexs.helpers.Helper; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -422,7 +428,7 @@ public class Graph { for (GraphPart head : heads) { populateParts(head, allParts); } - TranslateStack stack = new TranslateStack(); + TranslateStack stack = new TranslateStack(path); List loops = new ArrayList<>(); getLoops(localData, heads.get(0), loops, null); /*System.out.println(""); @@ -461,8 +467,59 @@ public class Graph { finalProcessAfter(list, level, localData); } - protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData) { + private boolean processSubBlk(Block b, GraphTargetItem replacement) { + boolean allSubPush = true; + boolean atleastOne = false; + for (List sub : b.getSubs()) { + if (!sub.isEmpty()) { + int lastPos = sub.size() - 1; + GraphTargetItem last = sub.get(sub.size() - 1); + GraphTargetItem br = null; + + if ((last instanceof BreakItem) && (sub.size() >= 2)) { + br = last; + lastPos--; + last = sub.get(lastPos); + } + if (last instanceof Block) { + if (!processSubBlk((Block) last, replacement)) { + allSubPush = false; + } else { + atleastOne = true; + } + } else if (last instanceof PushItem) { + if (replacement != null) { + GraphTargetItem e2 = (((GraphTargetItem) replacement).clone()); + e2.value = last.value; + sub.set(lastPos, e2); + if (br != null) { + sub.remove(sub.size() - 1); + } + } + atleastOne = true; + } else if (!(last instanceof ExitItem)) { + allSubPush = false; + } + } + } + return allSubPush && atleastOne; + } + + protected void finalProcessAfter(List list, int level, FinalProcessLocalData localData) { + if (list.size() >= 2) { + if (list.get(list.size() - 1) instanceof ExitItem) { + ExitItem e = (ExitItem) list.get(list.size() - 1); + if (list.get(list.size() - 1).value instanceof PopItem) { + if (list.get(list.size() - 2) instanceof Block) { + Block b = (Block) list.get(list.size() - 2); + if (processSubBlk(b, (GraphTargetItem) e)) { + list.remove(list.size() - 1); + } + } + } + } + } } protected void finalProcess(List list, int level, FinalProcessLocalData localData) { @@ -527,7 +584,7 @@ public class Graph { } private void processIfs(List list) { - //if(true) return; + for (int i = 0; i < list.size(); i++) { GraphTargetItem item = list.get(i); if (item instanceof Block) { @@ -1382,7 +1439,11 @@ public class Graph { } List currentRet = ret; UniversalLoopItem loopItem = null; + TranslateStack sPreLoop = stack; if (isLoop) { + //makeAllCommands(currentRet, stack); + stack = (TranslateStack) stack.clone(); + stack.clear(); loopItem = new UniversalLoopItem(null, currentLoop); //loopItem.commands=printGraph(visited, localData, stack, allParts, parent, part, stopPart, loops); currentRet.add(loopItem); @@ -1412,23 +1473,6 @@ public class Graph { } } - //Assuming part with two nextparts is an IF - - /* //If with both branches empty - if (part.nextParts.size() == 2) { - if (part.nextParts.get(0) == part.nextParts.get(1)) { - if (!stack.isEmpty()) { - GraphTargetItem expr = stack.pop(); - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } - output.add(new IfItem(null, expr, new ArrayList(), new ArrayList())); - } - part.nextParts.remove(0); - } - }*/ if (parseNext) { List retCheck = check(code, localData, allParts, stack, parent, part, stopPart, loops, output, currentLoop, staticOperation, path); if (retCheck != null) { @@ -1441,134 +1485,15 @@ public class Graph { currentRet.addAll(output); } } - - /** - * AND / OR detection - */ - if (parseNext && part.nextParts.size() == 2) { - if ((stack.size() >= 2) && (stack.get(stack.size() - 1) instanceof NotItem) && (((NotItem) (stack.get(stack.size() - 1))).getOriginal().getNotCoerced() == stack.get(stack.size() - 2).getNotCoerced())) { - GraphPart sp0 = getNextNoJump(part.nextParts.get(0), localData); - GraphPart sp1 = getNextNoJump(part.nextParts.get(1), localData); - boolean reversed = false; - loopContinues = getLoopsContinues(loops); - loopContinues.add(part);//??? - if (sp1.leadsTo(localData, this, code, sp0, loops)) { - } else if (sp0.leadsTo(localData, this, code, sp1, loops)) { - reversed = true; - } - GraphPart next = reversed ? sp0 : sp1; - GraphTargetItem ti; - if ((ti = checkLoop(next, stopPart, loops)) != null) { - currentRet.add(ti); - } else { - List stopPart2 = new ArrayList<>(stopPart); - GraphPart andOrStopPart = reversed ? sp1 : sp0; - stopPart2.add(andOrStopPart); - GraphTargetItem first = ((NotItem) stack.pop()).getOriginal(); - stack.pop(); - stack.push(new MarkItem("disposable")); - printGraph(visited, localData, stack, allParts, parent, next, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); - GraphTargetItem second = stack.pop(); - - if (!reversed) { - AndItem a = new AndItem(null, first, second); - stack.push(a); - a.firstPart = part; - if (second instanceof AndItem) { - a.firstPart = ((AndItem) second).firstPart; - } - if (second instanceof OrItem) { - a.firstPart = ((OrItem) second).firstPart; - } - } else { - OrItem o = new OrItem(null, first, second); - stack.push(o); - o.firstPart = part; - if (second instanceof AndItem) { - o.firstPart = ((AndItem) second).firstPart; - } - if (second instanceof OrItem) { - o.firstPart = ((OrItem) second).firstPart; - } - } - next = reversed ? sp1 : sp0; - if ((ti = checkLoop(next, stopPart, loops)) != null) { - currentRet.add(ti); - } else { - currentRet.addAll(printGraph(visited, localData, stack, allParts, parent, next, stopPart, loops, null, staticOperation, path, recursionLevel + 1)); - } - } - parseNext = false; - //return ret; - } else if ((stack.size() >= 2) && (stack.get(stack.size() - 1).getNotCoerced() == stack.get(stack.size() - 2).getNotCoerced())) { - GraphPart sp0 = getNextNoJump(part.nextParts.get(0), localData); - GraphPart sp1 = getNextNoJump(part.nextParts.get(1), localData); - boolean reversed = false; - loopContinues = getLoopsContinues(loops); - loopContinues.add(part);//??? - if (sp1.leadsTo(localData, this, code, sp0, loops)) { - } else if (sp0.leadsTo(localData, this, code, sp1, loops)) { - reversed = true; - } - GraphPart next = reversed ? sp0 : sp1; - GraphTargetItem ti; - if ((ti = checkLoop(next, stopPart, loops)) != null) { - currentRet.add(ti); - } else { - List stopPart2 = new ArrayList<>(stopPart); - GraphPart andOrStopPart = reversed ? sp1 : sp0; - //andOrStopPart.stopPartType = GraphPart.StopPartType.AND_OR; - stopPart2.add(andOrStopPart); - GraphTargetItem first = stack.pop(); - stack.pop(); - stack.push(new MarkItem("disposable")); - printGraph(visited, localData, stack, allParts, parent, next, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); - //stack = andOrStopPart.andOrStack; // Use stack that was stored upon reaching AND_OR stopPart - GraphTargetItem second = stack.pop(); - //GraphTargetItem first = stack.pop(); - //andOrStopPart.stopPartType = GraphPart.StopPartType.NONE; // Reset stopPartType - - if (reversed) { - AndItem a = new AndItem(null, first, second); - stack.push(a); - a.firstPart = part; - if (second instanceof AndItem) { - a.firstPart = ((AndItem) second).firstPart; - } - if (second instanceof OrItem) { - a.firstPart = ((OrItem) second).firstPart; - } - } else { - OrItem o = new OrItem(null, first, second); - stack.push(o); - o.firstPart = part; - if (second instanceof OrItem) { - o.firstPart = ((OrItem) second).firstPart; - } - if (second instanceof AndItem) { - o.firstPart = ((AndItem) second).firstPart; - } - } - - next = reversed ? sp1 : sp0; - if ((ti = checkLoop(next, stopPart, loops)) != null) { - currentRet.add(ti); - } else { - currentRet.addAll(printGraph(visited, localData, stack, allParts, parent, next, stopPart, loops, null, staticOperation, path, recursionLevel + 1)); - } - } - parseNext = false; - //return ret; - } - } //********************************END PART DECOMPILING - if (parseNext) { if (part.nextParts.size() > 2) {//direct switch, seen in the wild... GraphPart next = getMostCommonPart(localData, part.nextParts, loops); List vis = new ArrayList<>(); GraphTargetItem switchedItem = stack.pop(); + makeAllCommands(currentRet, stack); + List caseValues = new ArrayList<>(); List> caseCommands = new ArrayList<>(); List defaultCommands = new ArrayList<>(); @@ -1604,10 +1529,15 @@ public class Graph { } } if (next != p) { + //int stackLenBefore = stack.size(); + TranslateStack s2 = (TranslateStack) stack.clone(); + s2.clear(); + List nextCommands = printGraph(visited, prepareBranchLocalData(localData), s2, allParts, part, p, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); + makeAllCommands(nextCommands, s2); if (first) { - defaultCommands = printGraph(visited, prepareBranchLocalData(localData), stack, allParts, part, p, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); + defaultCommands = nextCommands; } else { - caseCommands.add(printGraph(visited, prepareBranchLocalData(localData), stack, allParts, part, p, stopPart2, loops, null, staticOperation, path, recursionLevel + 1)); + caseCommands.add(nextCommands); } vis.add(p); } @@ -1623,41 +1553,23 @@ public class Graph { GraphPart nextOnePart = null; if (part.nextParts.size() == 2) { GraphTargetItem expr = stack.pop(); - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } - if (staticOperation != SOP_USE_STATIC) { - if (expr.isCompileTime()) { - boolean doJump = EcmaScript.toBoolean(expr.getResult()); - if (doJump) { - nextOnePart = part.nextParts.get(0); - } else { - nextOnePart = part.nextParts.get(1); - } - if (staticOperation == SOP_REMOVE_STATIC) { - //TODO - } - } - } + /*if (expr instanceof LogicalOpItem) { + expr = ((LogicalOpItem) expr).invert(); + } else { + expr = new NotItem(null, expr); + }*/ if (nextOnePart == null) { List nps; - /*nps = new ArrayList<>(part.nextParts); - for(int i=0;i onTrue = new ArrayList<>(); + trueStack.clear(); + falseStack.clear(); + /*int trueStackSizeBefore = trueStack.size(); + int falseStackSizeBefore = falseStack.size(); + */ boolean isEmpty = nps.get(0) == nps.get(1); if (isEmpty) { @@ -1665,59 +1577,63 @@ public class Graph { } List stopPart2 = new ArrayList<>(stopPart); - //GraphPart.CommonPartStack commonPartStack = null; + if ((!isEmpty) && (next != null)) { - /*commonPartStack = next.new CommonPartStack(); - if (next.commonPartStacks == null) { - next.commonPartStacks = new ArrayList<>(); - } - next.stopPartType = GraphPart.StopPartType.COMMONPART; - */ stopPart2.add(next); } + List onTrue = new ArrayList<>(); if (!isEmpty) { onTrue = printGraph(visited, prepareBranchLocalData(localData), trueStack, allParts, part, nps.get(1), stopPart2, loops, null, staticOperation, path, recursionLevel + 1); } List onFalse = new ArrayList<>(); if (!isEmpty) { - /*if (next != null) { - commonPartStack.isTrueStack = false; //stopPart must know it needs to store falseStack - }*/ onFalse = printGraph(visited, prepareBranchLocalData(localData), falseStack, allParts, part, nps.get(0), stopPart2, loops, null, staticOperation, path, recursionLevel + 1); } + //List out2 = new ArrayList<>(); + //makeAllCommands(out2, stack); + makeAllCommands(onTrue, trueStack); + makeAllCommands(onFalse, falseStack); - /* if there is a stopPart (next), then Graph will be further analyzed starting from the stopPart: - * trueStack and falseStack must be set equal to corresponding stack that was built upon reaching stopPart. - if ((!isEmpty) && (next != null)) { - if ((commonPartStack.trueStack != null) && (commonPartStack.falseStack != null)) { - trueStack = commonPartStack.trueStack; - falseStack = commonPartStack.falseStack; - } - next.commonPartStacks.remove(next.commonPartStacks.size() - 1); - if (next.commonPartStacks.isEmpty()) { - next.stopPartType = GraphPart.StopPartType.NONE; // reset StopPartType - } - }*/ - if (isEmpty(onTrue) && isEmpty(onFalse) && (trueStack.size() == trueStackSizeBefore + 1) && (falseStack.size() == falseStackSizeBefore + 1)) { - stack.push(new TernarOpItem(null, expr, trueStack.pop(), falseStack.pop())); + if (!isEmpty(onTrue) && !isEmpty(onFalse) && onTrue.size() == 1 && onFalse.size() == 1 && (onTrue.get(0) instanceof PushItem) && (onFalse.get(0) instanceof PushItem)) { + stack.push(new TernarOpItem(null, expr.invert(null), ((PushItem) onTrue.get(0)).value, ((PushItem) onFalse.get(0)).value)); } else { - currentRet.add(new IfItem(null, expr, onTrue, onFalse)); - } - if (next != null) { - if (trueStack.size() != trueStackSizeBefore || falseStack.size() != falseStackSizeBefore) { - // it's a hack, because duplicates all instructions in the next part, but better than EmptyStackException - onTrue = printGraph(visited, localData, trueStack, allParts, part, next, stopPart, loops, null, staticOperation, path, recursionLevel + 1); - onFalse = printGraph(visited, localData, falseStack, allParts, part, next, stopPart, loops, null, staticOperation, path, recursionLevel + 1); - if (isEmpty(onTrue) && isEmpty(onFalse) && (trueStack.size() == trueStackSizeBefore + 1) && (falseStack.size() == falseStackSizeBefore + 1)) { - stack.push(new TernarOpItem(null, expr, trueStack.pop(), falseStack.pop())); + boolean isIf = true; + if (!stack.isEmpty() && onFalse.isEmpty() && onTrue.size() == 2 && (onTrue.get(0) instanceof PopItem) && (onTrue.get(1) instanceof PushItem)) { + GraphTargetItem prevExpr = stack.pop(); + GraphTargetItem leftSide = expr; + + GraphTargetItem rightSide = ((PushItem) onTrue.get(1)).value; + if (leftSide instanceof DuplicateItem) { + isIf = false; + stack.push(new OrItem(null, prevExpr, rightSide)); + } else if (leftSide.invert(null) instanceof DuplicateItem) { + isIf = false; + stack.push(new AndItem(null, prevExpr, rightSide)); + } else if (prevExpr instanceof FalseItem) { + isIf = false; + stack.push(new OrItem(null, leftSide, rightSide)); + } else if (prevExpr instanceof TrueItem) { + isIf = false; + stack.push(new AndItem(null, leftSide, rightSide)); } else { - currentRet.add(new IfItem(null, expr, onTrue, onFalse)); + //:-( } - } else { - printGraph(visited, localData, stack, allParts, part, next, stopPart, loops, currentRet, staticOperation, path, recursionLevel + 1); } + + if (isIf) { + makeAllCommands(currentRet, stack); + IfItem b = new IfItem(null, expr.invert(null), onTrue, onFalse); + currentRet.add(b); + if (processSubBlk(b, null)) { + stack.push(new PopItem(null)); + } + } + } + //currentRet.addAll(out2); + if (next != null) { + printGraph(visited, localData, stack, allParts, part, next, stopPart, loops, currentRet, staticOperation, path, recursionLevel + 1); //currentRet.addAll(); } } @@ -1751,7 +1667,7 @@ public class Graph { stopContPart.add(currentLoop.loopContinue); GraphPart precoBackup = currentLoop.loopPreContinue; currentLoop.loopPreContinue = null; - loopItem.commands.addAll(printGraph(visited, localData, new TranslateStack(), allParts, null, precoBackup, stopContPart, loops, null, staticOperation, path, recursionLevel + 1)); + loopItem.commands.addAll(printGraph(visited, localData, new TranslateStack(path), allParts, null, precoBackup, stopContPart, loops, null, staticOperation, path, recursionLevel + 1)); } } @@ -1788,7 +1704,7 @@ public class Graph { GraphTargetItem expr = ifi.expression; if (inverted) { if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); + expr = ((LogicalOpItem) expr).invert(null); } else { expr = new NotItem(null, expr); } @@ -1808,7 +1724,7 @@ public class Graph { currentLoop.loopPreContinue = null; List stopPart2 = new ArrayList<>(stopPart); stopPart2.add(currentLoop.loopContinue); - finalComm = printGraph(visited, localData, new TranslateStack(), allParts, null, backup, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); + finalComm = printGraph(visited, localData, new TranslateStack(path), allParts, null, backup, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); currentLoop.loopPreContinue = backup; checkContinueAtTheEnd(finalComm, currentLoop); } @@ -1848,11 +1764,7 @@ public class Graph { List exprList = new ArrayList<>(); GraphTargetItem expr = ifi.expression; if (inverted) { - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } + expr = expr.invert(null); } checkContinueAtTheEnd(bodyBranch, currentLoop); @@ -1889,7 +1801,7 @@ public class Graph { currentLoop.loopPreContinue = null; List stopPart2 = new ArrayList<>(stopPart); stopPart2.add(currentLoop.loopContinue); - List finalComm = printGraph(visited, localData, new TranslateStack(), allParts, null, backup, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); + List finalComm = printGraph(visited, localData, new TranslateStack(path), allParts, null, backup, stopPart2, loops, null, staticOperation, path, recursionLevel + 1); currentLoop.loopPreContinue = backup; checkContinueAtTheEnd(finalComm, currentLoop); @@ -1914,11 +1826,7 @@ public class Graph { List exprList = new ArrayList<>(finalComm); GraphTargetItem expr = ifi.expression; if (invert) { - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } + expr = expr.invert(null); } exprList.add(expr); ret.add(index, li = new DoWhileItem(null, currentLoop, loopItem.commands, exprList)); @@ -1943,7 +1851,7 @@ public class Graph { } if (currentLoop.loopBreak != null) { - ret.addAll(printGraph(visited, localData, stack, allParts, part, currentLoop.loopBreak, stopPart, loops, null, staticOperation, path, recursionLevel + 1)); + ret.addAll(printGraph(visited, localData, sPreLoop, allParts, part, currentLoop.loopBreak, stopPart, loops, null, staticOperation, path, recursionLevel + 1)); } } @@ -2157,4 +2065,35 @@ public class Graph { } while (part != null); return ret; } + + protected static void makeAllStack(List commands, TranslateStack stack) { + int pcnt = 0; + for (int i = commands.size() - 1; i >= 0; i--) { + if (commands.get(i) instanceof PushItem) { + pcnt++; + } else { + break; + } + } + for (int i = commands.size() - pcnt; i < commands.size(); i++) { + stack.push(commands.remove(i).value); + i--; + } + } + + protected static void makeAllCommands(List commands, TranslateStack stack) { + int clen = commands.size(); + BreakItem br = null; + if (!commands.isEmpty()) { + if (commands.get(commands.size() - 1) instanceof BreakItem) { + clen--; + } + } + while (stack.size() > 0) { + GraphTargetItem p = stack.pop(); + if (!(p instanceof PopItem)) { + commands.add(clen, new PushItem(p)); + } + } + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSourceItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSourceItem.java index 2e4e823b4..39c25a6a6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSourceItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSourceItem.java @@ -1,52 +1,52 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.graph; - -import com.jpexs.decompiler.flash.BaseLocalData; -import java.io.Serializable; -import java.util.List; - -/** - * - * @author JPEXS - */ -public interface GraphSourceItem extends Serializable { - - public void translate(BaseLocalData localData, TranslateStack stack, List output, int staticOperation, String path) throws InterruptedException; - - public boolean isJump(); - - public boolean isBranch(); - - public boolean isExit(); - - public long getOffset(); - - public boolean ignoredLoops(); - - public List getBranches(GraphSource code); - - public boolean isIgnored(); - - public void setIgnored(boolean ignored, int pos); - - public boolean isDeobfuscatePop(); - - public int getLine(); - - public String getFile(); -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.graph; + +import com.jpexs.decompiler.flash.BaseLocalData; +import java.io.Serializable; +import java.util.List; + +/** + * + * @author JPEXS + */ +public interface GraphSourceItem extends Serializable, Cloneable { + + public void translate(BaseLocalData localData, TranslateStack stack, List output, int staticOperation, String path) throws InterruptedException; + + public boolean isJump(); + + public boolean isBranch(); + + public boolean isExit(); + + public long getOffset(); + + public boolean ignoredLoops(); + + public List getBranches(GraphSource code); + + public boolean isIgnored(); + + public void setIgnored(boolean ignored, int pos); + + public boolean isDeobfuscatePop(); + + public int getLine(); + + public String getFile(); +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 8ccf9786e..34318ea16 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -1,298 +1,319 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.graph; - -import com.jpexs.decompiler.flash.SourceGeneratorLocalData; -import com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.helpers.GraphTextWriter; -import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; -import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; -import com.jpexs.decompiler.graph.model.BinaryOp; -import com.jpexs.decompiler.graph.model.LocalData; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * - * @author JPEXS - */ -public abstract class GraphTargetItem implements Serializable { - - public static final int PRECEDENCE_PRIMARY = 0; - - public static final int PRECEDENCE_POSTFIX = 1; - - public static final int PRECEDENCE_UNARY = 2; - - public static final int PRECEDENCE_MULTIPLICATIVE = 3; - - public static final int PRECEDENCE_ADDITIVE = 4; - - public static final int PRECEDENCE_BITWISESHIFT = 5; - - public static final int PRECEDENCE_RELATIONAL = 6; - - public static final int PRECEDENCE_EQUALITY = 7; - - public static final int PRECEDENCE_BITWISEAND = 8; - - public static final int PRECEDENCE_BITWISEXOR = 9; - - public static final int PRECEDENCE_BITWISEOR = 10; - - public static final int PRECEDENCE_LOGICALAND = 11; - - public static final int PRECEDENCE_LOGICALOR = 12; - - public static final int PRECEDENCE_CONDITIONAL = 13; - - public static final int PRECEDENCE_ASSIGMENT = 14; - - public static final int PRECEDENCE_COMMA = 15; - - public static final int NOPRECEDENCE = 16; - - public GraphSourceItem src; - - public int pos = -1; - - protected int precedence; - - public List moreSrc = new ArrayList<>(); - - public GraphPart firstPart; - - public GraphTargetItem value; - - protected HighlightData srcData = new HighlightData(); - - public int getLine() { - if (src != null) { - return src.getLine(); - } - return 0; - } - - public String getFile() { - if (src != null) { - return src.getFile(); - } - return null; - } - - public GraphPart getFirstPart() { - if (value == null) { - return firstPart; - } - GraphPart ret = value.getFirstPart(); - if (ret == null) { - return firstPart; - } - return ret; - } - - public GraphTargetItem() { - this(null, NOPRECEDENCE); - } - - public GraphTargetItem(GraphSourceItem src, int precedence) { - this.src = src; - this.precedence = precedence; - } - - public List getNeededSources() { - List ret = new ArrayList<>(); - ret.add(new GraphSourceItemPos(src, pos)); - ret.addAll(moreSrc); - if (value != null) { - ret.addAll(value.getNeededSources()); - } - return ret; - } - - public GraphTextWriter toStringSemicoloned(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); - appendTo(writer, localData); - if (needsSemicolon()) { - writer.appendNoHilight(";"); - } - writer.endOffset(); - return writer; - } - - public boolean needsSemicolon() { - return true; - } - - @Override - public String toString() { - return this.getClass().getName(); - } - - public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); - appendTo(writer, localData); - writer.endOffset(); - return writer; - } - - public abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException; - - public String toString(LocalData localData) throws InterruptedException { - HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); - toString(writer, localData); - return writer.toString(); - } - - public int getPrecedence() { - return precedence; - } - - public boolean isCompileTime() { - Set dependencies = new HashSet<>(); - dependencies.add(this); - return isCompileTime(dependencies); - } - - public boolean isCompileTime(Set dependencies) { - return false; - } - - public boolean hasSideEffect() { - return false; - } - - public boolean isVariableComputed() { - return false; - } - - public Object getResult() { - return null; - } - - public String toStringNoQuotes(LocalData localData) { - return toString(); - } - - public GraphTextWriter toStringNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); - appendToNoQuotes(writer, localData); - writer.endOffset(); - return writer; - } - - public GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { - return toString(writer, localData); - } - - public GraphTargetItem getNotCoerced() { - return this; - } - - public GraphTargetItem getThroughRegister() { - return this; - } - - public boolean needsNewLine() { - return false; - } - - public GraphTextWriter toStringNL(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); - appendTo(writer, localData); - if (needsNewLine()) { - writer.newLine(); - } - writer.endOffset(); - return writer; - } - - public boolean isEmpty() { - return false; - } - - public GraphTargetItem getThroughNotCompilable() { - return this; - } - - public GraphTargetItem getThroughDuplicate() { - return this; - } - - public boolean valueEquals(GraphTargetItem target) { - return equals(target); - } - - public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - return new ArrayList<>(); - } - - public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - if (!hasReturnValue()) { - return toSource(localData, generator); - } - return generator.generateDiscardValue(localData, this); - } - - protected List toSourceBinary(BinaryOp op, GraphSourceItem action) { - List ret = new ArrayList<>(); - - return ret; - } - - public static List toSourceMerge(SourceGeneratorLocalData localData, SourceGenerator gen, Object... tar) throws CompilationException { - List ret = new ArrayList<>(); - for (Object o : tar) { - if (o == null) { - continue; - } - if (o instanceof GraphTargetItem) { - ret.addAll(((GraphTargetItem) o).toSource(localData, gen)); - } - if (o instanceof GraphSourceItem) { - ret.add((GraphSourceItem) o); - } - if (o instanceof List) { - List l = (List) o; - for (Object o2 : l) { - if (o2 instanceof GraphSourceItem) { - ret.add((GraphSourceItem) o2); - } - if (o2 instanceof GraphTargetItem) { - ret.addAll(((GraphTargetItem) o2).toSource(localData, gen)); - } - } - } - } - return ret; - } - - public abstract boolean hasReturnValue(); - - public List getAllSubItems() { - List ret = new ArrayList<>(); - if (value != null) { - ret.add(value); - } - return ret; - } - - public abstract GraphTargetItem returnType(); -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.graph; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; +import com.jpexs.decompiler.graph.model.BinaryOp; +import com.jpexs.decompiler.graph.model.LocalData; +import com.jpexs.decompiler.graph.model.LogicalOpItem; +import com.jpexs.decompiler.graph.model.NotItem; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author JPEXS + */ +public abstract class GraphTargetItem implements Serializable, Cloneable { + + public static final int PRECEDENCE_PRIMARY = 0; + + public static final int PRECEDENCE_POSTFIX = 1; + + public static final int PRECEDENCE_UNARY = 2; + + public static final int PRECEDENCE_MULTIPLICATIVE = 3; + + public static final int PRECEDENCE_ADDITIVE = 4; + + public static final int PRECEDENCE_BITWISESHIFT = 5; + + public static final int PRECEDENCE_RELATIONAL = 6; + + public static final int PRECEDENCE_EQUALITY = 7; + + public static final int PRECEDENCE_BITWISEAND = 8; + + public static final int PRECEDENCE_BITWISEXOR = 9; + + public static final int PRECEDENCE_BITWISEOR = 10; + + public static final int PRECEDENCE_LOGICALAND = 11; + + public static final int PRECEDENCE_LOGICALOR = 12; + + public static final int PRECEDENCE_CONDITIONAL = 13; + + public static final int PRECEDENCE_ASSIGMENT = 14; + + public static final int PRECEDENCE_COMMA = 15; + + public static final int NOPRECEDENCE = 16; + + public GraphSourceItem src; + + public int pos = -1; + + protected int precedence; + + public List moreSrc = new ArrayList<>(); + + public GraphPart firstPart; + + public GraphTargetItem value; + + protected HighlightData srcData = new HighlightData(); + + public int getLine() { + if (src != null) { + return src.getLine(); + } + return 0; + } + + public String getFile() { + if (src != null) { + return src.getFile(); + } + return null; + } + + public GraphPart getFirstPart() { + if (value == null) { + return firstPart; + } + GraphPart ret = value.getFirstPart(); + if (ret == null) { + return firstPart; + } + return ret; + } + + public GraphTargetItem() { + this(null, NOPRECEDENCE); + } + + public GraphTargetItem(GraphSourceItem src, int precedence) { + this.src = src; + this.precedence = precedence; + } + + public List getNeededSources() { + List ret = new ArrayList<>(); + ret.add(new GraphSourceItemPos(src, pos)); + ret.addAll(moreSrc); + if (value != null) { + ret.addAll(value.getNeededSources()); + } + return ret; + } + + public GraphTextWriter toStringSemicoloned(GraphTextWriter writer, LocalData localData) throws InterruptedException { + writer.startOffset(src, pos, srcData); + appendTo(writer, localData); + if (needsSemicolon()) { + writer.appendNoHilight(";"); + } + writer.endOffset(); + return writer; + } + + public boolean needsSemicolon() { + return true; + } + + @Override + public String toString() { + return this.getClass().getName(); + } + + public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) throws InterruptedException { + writer.startOffset(src, pos, srcData); + appendTo(writer, localData); + writer.endOffset(); + return writer; + } + + public abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException; + + public String toString(LocalData localData) throws InterruptedException { + HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); + toString(writer, localData); + return writer.toString(); + } + + public int getPrecedence() { + return precedence; + } + + public boolean isCompileTime() { + Set dependencies = new HashSet<>(); + dependencies.add(this); + return isCompileTime(dependencies); + } + + public boolean isCompileTime(Set dependencies) { + return false; + } + + public boolean hasSideEffect() { + return false; + } + + public boolean isVariableComputed() { + return false; + } + + public Object getResult() { + return null; + } + + public String toStringNoQuotes(LocalData localData) { + return toString(); + } + + public GraphTextWriter toStringNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { + writer.startOffset(src, pos, srcData); + appendToNoQuotes(writer, localData); + writer.endOffset(); + return writer; + } + + public GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { + return toString(writer, localData); + } + + public GraphTargetItem getNotCoerced() { + return this; + } + + public GraphTargetItem getThroughRegister() { + return this; + } + + public boolean needsNewLine() { + return false; + } + + public GraphTextWriter toStringNL(GraphTextWriter writer, LocalData localData) throws InterruptedException { + writer.startOffset(src, pos, srcData); + appendTo(writer, localData); + if (needsNewLine()) { + writer.newLine(); + } + writer.endOffset(); + return writer; + } + + public boolean isEmpty() { + return false; + } + + public GraphTargetItem getThroughNotCompilable() { + return this; + } + + public GraphTargetItem getThroughDuplicate() { + return this; + } + + public boolean valueEquals(GraphTargetItem target) { + return equals(target); + } + + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { + return new ArrayList<>(); + } + + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { + if (!hasReturnValue()) { + return toSource(localData, generator); + } + return generator.generateDiscardValue(localData, this); + } + + protected List toSourceBinary(BinaryOp op, GraphSourceItem action) { + List ret = new ArrayList<>(); + + return ret; + } + + public static List toSourceMerge(SourceGeneratorLocalData localData, SourceGenerator gen, Object... tar) throws CompilationException { + List ret = new ArrayList<>(); + for (Object o : tar) { + if (o == null) { + continue; + } + if (o instanceof GraphTargetItem) { + ret.addAll(((GraphTargetItem) o).toSource(localData, gen)); + } + if (o instanceof GraphSourceItem) { + ret.add((GraphSourceItem) o); + } + if (o instanceof List) { + List l = (List) o; + for (Object o2 : l) { + if (o2 instanceof GraphSourceItem) { + ret.add((GraphSourceItem) o2); + } + if (o2 instanceof GraphTargetItem) { + ret.addAll(((GraphTargetItem) o2).toSource(localData, gen)); + } + } + } + } + return ret; + } + + public abstract boolean hasReturnValue(); + + public List getAllSubItems() { + List ret = new ArrayList<>(); + if (value != null) { + ret.add(value); + } + return ret; + } + + public abstract GraphTargetItem returnType(); + + @Override + protected GraphTargetItem clone() { + try { + return (GraphTargetItem) super.clone(); + } catch (CloneNotSupportedException ex) { + return null; + } + } + + /*public GraphTargetItem invert() { + return invert(null); + }*/ + public GraphTargetItem invert(GraphSourceItem src) { + return new NotItem(src, this); + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SimpleValue.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SimpleValue.java new file mode 100644 index 000000000..e9bd81880 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SimpleValue.java @@ -0,0 +1,10 @@ +package com.jpexs.decompiler.graph; + +/** + * + * @author JPEXS + */ +public interface SimpleValue { + + public boolean isSimpleValue(); +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SourceGenerator.java index 7c1694d78..0eb8d34b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/SourceGenerator.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -22,12 +23,14 @@ import com.jpexs.decompiler.graph.model.CommaExpressionItem; import com.jpexs.decompiler.graph.model.ContinueItem; import com.jpexs.decompiler.graph.model.DoWhileItem; import com.jpexs.decompiler.graph.model.DuplicateItem; +import com.jpexs.decompiler.graph.model.FalseItem; import com.jpexs.decompiler.graph.model.ForItem; import com.jpexs.decompiler.graph.model.IfItem; import com.jpexs.decompiler.graph.model.NotItem; import com.jpexs.decompiler.graph.model.OrItem; import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.TernarOpItem; +import com.jpexs.decompiler.graph.model.TrueItem; import com.jpexs.decompiler.graph.model.WhileItem; import java.util.List; @@ -37,6 +40,10 @@ import java.util.List; */ public interface SourceGenerator { + public List generate(SourceGeneratorLocalData localData, TrueItem item) throws CompilationException; + + public List generate(SourceGeneratorLocalData localData, FalseItem item) throws CompilationException; + public List generate(SourceGeneratorLocalData localData, AndItem item) throws CompilationException; public List generate(SourceGeneratorLocalData localData, OrItem item) throws CompilationException; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java index 647519182..cc68f15ea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java @@ -16,11 +16,51 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.graph.model.PopItem; import java.util.Stack; +import java.util.logging.Level; +import java.util.logging.Logger; /** * * @author JPEXS */ public class TranslateStack extends Stack { + + private static PopItem pop = new PopItem(null); + + private String path; + + public TranslateStack(String path) { + this.path = path; + } + + public String getPath() { + return path; + } + + @Override + public synchronized GraphTargetItem peek() { + if (path != null) { + if (this.isEmpty()) { + Logger.getLogger(TranslateStack.class.getName()).log(Level.FINE, "{0}: Attemp to Peek empty stack", path); + return pop; + } + } + return super.peek(); + } + + @Override + public synchronized GraphTargetItem pop() { + if (path != null) { + if (this.isEmpty()) { + PopItem oldpop = pop; + pop = new PopItem(null); + Logger.getLogger(TranslateStack.class.getName()).log(Level.FINE, "{0}: Attemp to Pop empty stack", path); + return oldpop; + } + } + return super.pop(); + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index c1f8f8f87..3e655bdf3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -20,6 +21,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; import java.util.List; @@ -29,7 +31,7 @@ import java.util.Set; * * @author JPEXS */ -public class DuplicateItem extends GraphTargetItem { +public class DuplicateItem extends GraphTargetItem implements SimpleValue { public DuplicateItem(GraphSourceItem src, GraphTargetItem value) { super(src, value.getPrecedence()); @@ -43,7 +45,12 @@ public class DuplicateItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { - return value.toString(writer, localData); + if ((value instanceof SimpleValue) && (((SimpleValue) value).isSimpleValue())) { + return value.appendTo(writer, localData); + } + writer.append("§§dup("); + value.appendTo(writer, localData); + return writer.append(")"); } @Override @@ -89,4 +96,14 @@ public class DuplicateItem extends GraphTargetItem { public GraphTargetItem returnType() { return TypeItem.UNBOUNDED; } + + /*@Override + public GraphTargetItem invert(GraphSourceItem src) { + return //new DuplicateItem(src, value instanceof NotItem ? (value.value) : new NotItem(src, value)); + }*/ + @Override + public boolean isSimpleValue() { + return ((value instanceof SimpleValue) && ((SimpleValue) value).isSimpleValue()); + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ExitItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ExitItem.java index b02e93c69..b1a6fefe6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ExitItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ExitItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/FalseItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/FalseItem.java new file mode 100644 index 000000000..f9704f06f --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/FalseItem.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. */ +package com.jpexs.decompiler.graph.model; + +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; +import com.jpexs.decompiler.graph.SourceGenerator; +import com.jpexs.decompiler.graph.TypeItem; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class FalseItem extends GraphTargetItem implements LogicalOpItem, SimpleValue { + + public FalseItem(GraphSourceItem src) { + super(src, PRECEDENCE_PRIMARY); + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + return writer.append("false"); + } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public GraphTargetItem returnType() { + return TypeItem.BOOLEAN; + } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { + return generator.generate(localData, this); + } + + @Override + public GraphTargetItem invert(GraphSourceItem neqSrc) { + return new TrueItem(null); + } + + @Override + public boolean isSimpleValue() { + return true; + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IfItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IfItem.java index c3bd312ca..43f9f7caf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IfItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/IfItem.java @@ -75,11 +75,7 @@ public class IfItem extends GraphTargetItem implements Block { expr = ((NotItem) expr).getOriginal(); } } else { - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } + expr = expr.invert(null); ifBranch = onFalse; elseBranch = onTrue; } @@ -112,7 +108,10 @@ public class IfItem extends GraphTargetItem implements Block { } for (GraphTargetItem ti : elseBranch) { if (!ti.isEmpty()) { - ti.toStringSemicoloned(writer, localData).newLine(); + ti.toStringSemicoloned(writer, localData); + if (!elseIf) { + writer.newLine(); + } } } if (!elseIf) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LogicalOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LogicalOpItem.java index 3cfd1eaad..de055b908 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LogicalOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LogicalOpItem.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; /** @@ -23,5 +25,5 @@ import com.jpexs.decompiler.graph.GraphTargetItem; */ public interface LogicalOpItem { - public GraphTargetItem invert(); + public GraphTargetItem invert(GraphSourceItem src); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/NotItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/NotItem.java index a7369764f..5becbe13e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/NotItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/NotItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -57,11 +58,6 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted { return value.isCompileTime(dependencies); } - @Override - public GraphTargetItem invert() { - return value; - } - public GraphTargetItem getOriginal() { return value; } @@ -80,4 +76,10 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted { public GraphTargetItem returnType() { return TypeItem.BOOLEAN; } + + @Override + public GraphTargetItem invert(GraphSourceItem src) { + return value; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PopItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PopItem.java new file mode 100644 index 000000000..68ed404f5 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PopItem.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.graph.model; + +import com.jpexs.decompiler.flash.ecma.Null; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.TypeItem; + +/** + * + * @author JPEXS + */ +public class PopItem extends GraphTargetItem { + + public PopItem(GraphSourceItem src) { + super(src, PRECEDENCE_PRIMARY); + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + //Logger.getLogger(PopItem.class.getName()).log(Level.WARNING, "Pop item left in the source code"); + writer.append("§§pop()"); + return writer; + } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public GraphTargetItem returnType() { + return TypeItem.UNBOUNDED; + } + + @Override + public Object getResult() { + return new Null(); + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java new file mode 100644 index 000000000..a26566786 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.graph.model; + +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.GraphTargetItem; + +/** + * + * @author JPEXS + */ +public class PushItem extends GraphTargetItem { + + public PushItem(GraphTargetItem val) { + super(val.src, val.getPrecedence()); + this.value = val; + } + + @Override + public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + //Logger.getLogger(PushItem.class.getName()).log(Level.WARNING, "Push item left in the source code"); + writer.append("§§push("); + value.appendTo(writer, localData); + writer.append(")"); + return writer; + } + + @Override + public boolean hasReturnValue() { + return true; + } + + @Override + public GraphTargetItem returnType() { + return value.returnType(); + } + + @Override + public GraphTargetItem getNotCoerced() { + return value.getNotCoerced(); + } + + @Override + public GraphTargetItem getThroughDuplicate() { + return value.getThroughDuplicate(); + } + + @Override + public GraphTargetItem getThroughRegister() { + return value.getThroughRegister(); + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/TrueItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/TrueItem.java index 07ebbbd62..99069a463 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/TrueItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/TrueItem.java @@ -1,30 +1,36 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; +import com.jpexs.decompiler.graph.SimpleValue; +import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.TypeItem; +import java.util.List; /** * * @author JPEXS */ -public class TrueItem extends GraphTargetItem { +public class TrueItem extends GraphTargetItem implements LogicalOpItem, SimpleValue { public TrueItem(GraphSourceItem src) { super(src, PRECEDENCE_PRIMARY); @@ -44,4 +50,19 @@ public class TrueItem extends GraphTargetItem { public GraphTargetItem returnType() { return TypeItem.BOOLEAN; } + + @Override + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { + return generator.generate(localData, this); + } + + @Override + public GraphTargetItem invert(GraphSourceItem neqSrc) { + return new FalseItem(null); + } + + @Override + public boolean isSimpleValue() { + return true; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index 9c4d3f434..d9fa93719 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -25,8 +25,6 @@ import java.util.Set; public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { - public GraphTargetItem value; - public String operator; public UnaryOpItem(GraphSourceItem instruction, int precedence, GraphTargetItem value, String operator) { diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java index 2d4d117ff..afe5c4f7b 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2Test.java @@ -1,806 +1,807 @@ -/* - * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3.0 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. - */ -package com.jpexs.decompiler.flash; - -import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.helpers.CodeFormatting; -import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; -import com.jpexs.decompiler.flash.tags.DoActionTag; -import com.jpexs.decompiler.flash.tags.ShowFrameTag; -import com.jpexs.decompiler.flash.tags.Tag; -import java.io.BufferedInputStream; -import java.io.FileInputStream; -import java.io.IOException; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.fail; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** - * - * @author JPEXS - */ -public class ActionScript2Test extends ActionStript2TestBase { - - @BeforeClass - public void init() throws IOException, InterruptedException { - //Main.initLogging(false); - Configuration.autoDeobfuscate.set(false); - Configuration.decompile.set(true); - Configuration.registerNameFormat.set("_loc%d_"); - swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as2/as2.swf")), false); - } - - private void compareSrc(int frame, String expectedResult) { - DoActionTag doa = getFrameSource(frame); - assertNotNull(doa); - HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); - try { - Action.actionsToSource(doa, doa.getActions(), "", writer); - } catch (InterruptedException ex) { - fail(); - } - String actualResult = cleanPCode(writer.toString()); - expectedResult = cleanPCode(expectedResult); - assertEquals(actualResult, expectedResult); - - } - - private DoActionTag getFrameSource(int frame) { - int f = 0; - DoActionTag lastDoa = null; - - for (Tag t : swf.tags) { - if (t instanceof DoActionTag) { - lastDoa = (DoActionTag) t; - } - if (t instanceof ShowFrameTag) { - f++; - if (f == frame) { - return lastDoa; - } - lastDoa = null; - } - } - return null; - } - - @Test - public void frame23_Test() { - compareSrc(23, "stop();\r\n" - ); - } - - @Test - public void frame24_unicodeTest() { - compareSrc(24, "trace(\"unicodeTest\");\r\n" - + "var k = \"\u05d4\u05d9\u05e4\u05d5\u05e4\u05d5\u05d8\u05de\u05d9, \u05d0\u05d5 \u05d0\";\r\n" - + "trace(k);\r\n" - ); - } - - @Test - public void frame25_ifWithElseTest() { - compareSrc(25, "trace(\"ifWithElseTest\");\r\n" - + "var i = 5;\r\n" - + "if(i == 258)\r\n" - + "{\r\n" - + "trace(\"onTrue\");\r\n" - + "}\r\n" - + "else\r\n" - + "{\r\n" - + "trace(\"onFalse\" + i);\r\n" - + "}\r\n" - ); - } - - @Test - public void frame26_forTest() { - compareSrc(26, "trace(\"forTest\");\r\n" - + "var i = 0;\r\n" - + "while(i < 10)\r\n" - + "{\r\n" - + "trace(\"hello:\" + i);\r\n" - + "i++;\r\n" - + "}\r\n" - ); - } - - @Test - public void frame27_whileTest() { - compareSrc(27, "trace(\"whileTest\");\r\n" - + "var i = 0;\r\n" - + "while(i < 10)\r\n" - + "{\r\n" - + "trace(\"hello:\" + i);\r\n" - + "i++;\r\n" - + "}\r\n" - ); - } - - @Test - public void frame28_forWithContinueTest() { - compareSrc(28, "trace(\"forWithContinueTest\");\r\n" - + "var i = 0;\r\n" - + "for(; i < 10; i++)\r\n" - + "{\r\n" - + "trace(\"hello:\" + i);\r\n" - + "if(i == 5)\r\n" - + "{\r\n" - + "trace(\"i==5\");\r\n" - + "if(i == 7)\r\n" - + "{\r\n" - + "continue;\r\n" - + "}\r\n" - + "trace(\"hawk\");\r\n" - + "}\r\n" - + "trace(\"end of the loop\");\r\n" - + "}\r\n" - ); - } - - @Test - public void frame29_doWhileTest() { - compareSrc(29, "trace(\"doWhileTest\");\r\n" - + "var i = 0;\r\n" - + "do\r\n" - + "{\r\n" - + "trace(\"i=\" + i);\r\n" - + "i++;\r\n" - + "}\r\n" - + "while(i < 10);\r\n" - + "trace(\"end\");\r\n" - ); - } - - @Test - public void frame30_switchTest() { - compareSrc(30, "trace(\"switchTest\");\r\n" - + "var i = 5;\r\n" - + "switch(i)\r\n" - + "{\r\n" - + "case 0:\r\n" - + "case 1:\r\n" - + "trace(\"one\");\r\n" - + "break;\r\n" - + "case 2:\r\n" - + "trace(\"two\");\r\n" - + "case 3:\r\n" - + "trace(\"three\");\r\n" - + "break;\r\n" - + "case 4:\r\n" - + "trace(\"four\");\r\n" - + "break;\r\n" - + "default:\r\n" - + "trace(\"default clause\");\r\n" - + "}\r\n" - + "trace(\"scriptend\");\r\n" - ); - } - - @Test - public void frame31_strictEqualsTest() { - compareSrc(31, "trace(\"strictEqualsTest\");\r\n" - + "var i = 5;\r\n" - + "if(i === 5)\r\n" - + "{\r\n" - + "trace(\"equals strict\");\r\n" - + "}\r\n" - + "if(!(i === 5))\r\n" - + "{\r\n" - + "trace(\"not equals strict\");\r\n" - + "}\r\n" - ); - } - - @Test - public void frame32_switchForTest() { - compareSrc(32, "trace(\"switchForTest\");\r\n" - + "var i = 0;\r\n" - + "for(; i < 10; i++)\r\n" - + "{\r\n" - + "switch(i)\r\n" - + "{\r\n" - + "case 0:\r\n" - + "trace(\"zero\");\r\n" - + "continue;\r\n" - + "case 5:\r\n" - + "trace(\"five\");\r\n" - + "break;\r\n" - + "case 10:\r\n" - + "trace(\"ten\");\r\n" - + "break;\r\n" - + "case 1:\r\n" - + "if(i == 7)\r\n" - + "{\r\n" - + "continue;\r\n" - + "}\r\n" - + "trace(\"one\");\r\n" - + "default:\r\n" - + "trace(\"def\");\r\n" - + "}\r\n" - + "trace(\"before loop end\");\r\n" - + "}\r\n" - ); - } - - @Test - public void frame33_functionTest() { - compareSrc(33, "function hello(what, second)\r\n" - + "{\r\n" - + "trace(\"hello \" + what + \"! \" + second);\r\n" - + "}\r\n" - + "trace(\"functionTest\");\r\n" - + "hello(\"friend\",7);\r\n" - ); - } - - @Test - public void frame34_multipleConditionsTest() { - compareSrc(34, "trace(\"multipleConditionsTest\");\r\n" - + "var k = 5;\r\n" - + "if(k == 7 && k == 8)\r\n" - + "{\r\n" - + "trace(\"first\");\r\n" - + "}\r\n" - + "if(k == 9)\r\n" - + "{\r\n" - + "trace(\"second\");\r\n" - + "}\r\n" - + "trace(\"finish\");\r\n" - ); - } - - @Test - public void frame35_multipleConditions2Test() { - compareSrc(35, "trace(\"multipleConditions2Test\");\r\n" - + "var k = 5;\r\n" - + "if(k == 7 && k == 8)\r\n" - + "{\r\n" - + "trace(\"first\");\r\n" - + "}\r\n" - + "if(k == 9 || k == 6)\r\n" - + "{\r\n" - + "trace(\"second\");\r\n" - + "}\r\n" - + "trace(\"finish\");\r\n" - ); - } - - @Test - public void frame36_chainedAssignmentsTest() { - compareSrc(36, "trace(\"chainedAssignmentsTest\");\r\n" - + "var a = 7;\r\n" - + "var b = 8;\r\n" - + "var c = 9;\r\n" - + "var d = c = b = a = 10;\r\n" - + "trace(d);\r\n" - ); - } - - @Test - public void frame37_objectsTest() { - compareSrc(37, "trace(\"objectsTest\");\r\n" - + "var flashBox = new Box(box1);\r\n" - + "_root.onEnterFrame = function()\r\n" - + "{\r\n" - + "flashBox.moveUp();\r\n" - + "};\r\n" - + "var ship = new Ship(200);\r\n" - + "var enemy = new Enemy(56);\r\n" - + "ship.moveDown(0.5);\r\n" - + "ship.moveUp(0.2);\r\n" - + "enemy.moveRight(230);\r\n" - + "enemy.moveLeft(100);\r\n" - + "var mt = new com.jpexs.MyTest();\r\n" - + "mt.test();\r\n" - + "var c = new Cox(box1);\r\n" - ); - } - - @Test - public void frame38_doWhile2Test() { - compareSrc(38, "trace(\"doWhile2Test\");\r\n" - + "var k = 5;\r\n" - + "do\r\n" - + "{\r\n" - + "k++;\r\n" - + "if(k == 7)\r\n" - + "{\r\n" - + "k = 5 * k;\r\n" - + "}\r\n" - + "else\r\n" - + "{\r\n" - + "k = 5 + k;\r\n" - + "}\r\n" - + "}\r\n" - + "while(k < 9);\r\n" - ); - } - - @Test - public void frame39_whileAndTest() { - compareSrc(39, "trace(\"whileAndTest\");\r\n" - + "var a = 5;\r\n" - + "var b = 10;\r\n" - + "while(a < 10 && b > 1)\r\n" - + "{\r\n" - + "a++;\r\n" - + "b--;\r\n" - + "}\r\n" - + "a = 7;\r\n" - + "b = 9;\r\n" - ); - } - - @Test - public void frame40_forInTest() { - compareSrc(40, "function testForIn()\r\n" - + "{\r\n" - + "var _loc1_ = [];\r\n" - + "for(var _loc2_ in _loc1_)\r\n" - + "{\r\n" - + "if(_loc2_ > 3)\r\n" - + "{\r\n" - + "if(_loc2_ == 5)\r\n" - + "{\r\n" - + "return 7;\r\n" - + "}\r\n" - + "return 8;\r\n" - + "}\r\n" - + "}\r\n" - + "}\r\n" - + "trace(\"forInTest\");\r\n" - + "trace(testForIn());\r\n" - + "var arr = [];\r\n" - + "for(var a in arr)\r\n" - + "{\r\n" - + "trace(a);\r\n" - + "}\r\n" - ); - } - - @Test - public void frame41_tryTest() { - compareSrc(41, "trace(\"tryTest\");\r\n" - + "var k = 5;\r\n" - + "try\r\n" - + "{\r\n" - + "k = Infinity;\r\n" - + "}\r\n" - + "catch(e)\r\n" - + "{\r\n" - + "trace(\"bug \" + e);\r\n" - + "}\r\n" - + "finally\r\n" - + "{\r\n" - + "trace(\"huu\");\r\n" - + "}\r\n" - + "trace(\"next\");\r\n" - + "try\r\n" - + "{\r\n" - + "k = 6;\r\n" - + "}\r\n" - + "catch(e)\r\n" - + "{\r\n" - + "trace(\"bug2 \" + e);\r\n" - + "}\r\n" - + "trace(\"next2\");\r\n" - + "var k = 5;\r\n" - + "try\r\n" - + "{\r\n" - + "k = Infinity;\r\n" - + "}\r\n" - + "finally\r\n" - + "{\r\n" - + "trace(\"final\");\r\n" - + "}\r\n" - + "trace(\"end\");\r\n" - ); - } - - @Test - public void frame42_indicesTest() { - compareSrc(42, "trace(\"indicesTest\");\r\n" - + "var k = [1,2,3];\r\n" - + "var b = k[1];\r\n" - + "trace(b);\r\n" - ); - } - - @Test - public void frame43_incDecTest() { - compareSrc(43, "function tst()\r\n" - + "{\r\n" - + "return 1;\r\n" - + "}\r\n" - + "trace(\"incDecTest\");\r\n" - + "var i = 5;\r\n" - + "var b = i++;\r\n" - + "var c = --i + 5;\r\n" - + "trace(\"a:\" + a + \" b:\" + b + \" c:\" + c);\r\n" - + "var arr = [1,2,3];\r\n" - + "arr[tst()]++;\r\n" - + "var d = arr[tst()];\r\n" - + "trace(d);\r\n" - ); - } - - @Test - public void frame44_chainedAssignments2Test() { - compareSrc(44, "trace(\"chainedAssignments2Test\");\r\n" - + "var a = 5;\r\n" - + "var b = 6;\r\n" - + "var c = 7;\r\n" - + "var d = c = b = a = 4;\r\n" - + "if((d = c = b = a = 7) > 2)\r\n" - + "{\r\n" - + "trace(d);\r\n" - + "}\r\n" - + "trace(d + 1);\r\n" - + "var i = 0;\r\n" - + "while(i < 5)\r\n" - + "{\r\n" - + "if(i == 7)\r\n" - + "{\r\n" - + "}\r\n" - + "i++;\r\n" - + "}\r\n" - ); - } - - @Test - public void frame45_function2Test() { - compareSrc(45, "function a()\r\n" - + "{\r\n" - + "trace(\"hi\");\r\n" - + "var _loc1_ = 5;\r\n" - + "if(_loc1_ == 7)\r\n" - + "{\r\n" - + "return undefined;\r\n" - + "}\r\n" - + "_loc1_ = _loc1_ * 9;\r\n" - + "trace(_loc1_);\r\n" - + "}\r\n" - + "trace(\"function2Test\");\r\n" - ); - } - - @Test - public void frame46_tryFunctionTest() { - compareSrc(46, "function testtry()\r\n" - + "{\r\n" - + "var _loc1_ = 5;\r\n" - + "try\r\n" - + "{\r\n" - + "if(_loc1_ == 3)\r\n" - + "{\r\n" - + "return undefined;\r\n" - + "}\r\n" - + "if(_loc1_ == 4)\r\n" - + "{\r\n" - + "throw new Error();\r\n" - + "}\r\n" - + "else\r\n" - + "{\r\n" - + "_loc1_ = 7;\r\n" - + "}\r\n" - + "}\r\n" - + "catch(e)\r\n" - + "{\r\n" - + "trace(\"error\");\r\n" - + "}\r\n" - + "finally\r\n" - + "{\r\n" - + "trace(\"finally\");\r\n" - + "}\r\n" - + "}\r\n" - + "trace(\"tryFunctionTest\");\r\n" - ); - } - - @Test - public void frame47_ternarTest() { - compareSrc(47, "trace(\"ternarTest\");\r\n" - + "var a = 5;\r\n" - + "var b = a != 4?3:2;\r\n" - + "trace(b);\r\n" - ); - } - - @Test - public void frame48_forInInTest() { - compareSrc(48, "function tst()\r\n" - + "{\r\n" - + "var _loc2_ = [];\r\n" - + "_loc2_[0] = [];\r\n" - + "for(var _loc3_ in _loc2_)\r\n" - + "{\r\n" - + "for(var _loc1_ in _loc3_)\r\n" - + "{\r\n" - + "if(_loc1_ == 5)\r\n" - + "{\r\n" - + "return 5;\r\n" - + "}\r\n" - + "}\r\n" - + "if(_loc3_ == 8)\r\n" - + "{\r\n" - + "return 3;\r\n" - + "}\r\n" - + "}\r\n" - + "return 8;\r\n" - + "}\r\n" - + "trace(\"forInInTest\");\r\n" - + "tst();\r\n" - ); - } - - @Test - public void frame49_registersFuncTest() { - compareSrc(49, "function tst(px)\r\n" - + "{\r\n" - + "var _loc1_ = 57;\r\n" - + "_loc1_ = _loc1_ * 27;\r\n" - + "}\r\n" - + "trace(\"registersFuncTest\");\r\n" - + "tst(5);\r\n" - + "var s = String(5);\r\n" - ); - } - - @Test - public void frame50_ifFrameLoadedTest() { - compareSrc(50, "trace(\"ifFrameLoadedTest\");\r\n" - + "ifFrameLoaded(9)\r\n" - + "{\r\n" - + "trace(\"loaded\");\r\n" - + "}\r\n" - ); - } - - @Test - public void frame51_function3Test() { - compareSrc(51, "function tst()\r\n" - + "{\r\n" - + "var _loc1_ = 5;\r\n" - + "c = _loc1_ = 8;\r\n" - + "trace(\"hi\");\r\n" - + "trace(_loc1_);\r\n" - + "if((e = d = f = c = 9) > 5)\r\n" - + "{\r\n" - + "trace(\"dd\");\r\n" - + "}\r\n" - + "}\r\n" - + "trace(\"function3Test\");\r\n" - + "var c = 7;\r\n" - + "var d = 7;\r\n" - + "var e = 8;\r\n" - + "tst();\r\n" - ); - } - - @Test - public void frame52_commaOperatorTest() { - compareSrc(52, "trace(\"commaOperatorTest\");\r\n" - + "var a = 0;\r\n" - + "var b = 0;\r\n" - + "var c = 0;\r\n" - + "while(true)\r\n" - + "{\r\n" - + "a++;\r\n" - + "b = b + 2;\r\n" - + "if(c < 10)\r\n" - + "{\r\n" - + "trace(c);\r\n" - + "c++;\r\n" - + "continue;\r\n" - + "}\r\n" - + "break;\r\n" - + "}\r\n" - + "trace(\"konec\");\r\n" - ); - } - - @Test - public void frame53_commaOperator2Test() { - compareSrc(53, "trace(\"commaOperator2Test\");\r\n" - + "var k = 8;\r\n" - + "do\r\n" - + "{\r\n" - + "if(k == 9)\r\n" - + "{\r\n" - + "trace(\"h\");\r\n" - + "if(k == 9)\r\n" - + "{\r\n" - + "trace(\"f\");\r\n" - + "continue;\r\n" - + "}\r\n" - + "trace(\"b\");\r\n" - + "}\r\n" - + "trace(\"gg\");\r\n" - + "}\r\n" - + "while(k++, k < 10);\r\n" - + "trace(\"ss\");\r\n" - ); - } - - @Test - public void frame54_function4Test() { - compareSrc(54, "function tst()\r\n" - + "{\r\n" - + "var _loc1_ = 5;\r\n" - + "while(_loc1_ < 10)\r\n" - + "{\r\n" - + "if(_loc1_ == 5)\r\n" - + "{\r\n" - + "if(_loc1_ == 6)\r\n" - + "{\r\n" - + "return true;\r\n" - + "}\r\n" - + "_loc1_ = _loc1_ + 1;\r\n" - + "continue;\r\n" - + "}\r\n" - + "return false;\r\n" - + "}\r\n" - + "}\r\n" - + "trace(\"function4Test\");\r\n" - + "tst();\r\n" - ); - } - - @Test - public void frame55_pushTest() { - compareSrc(55, "trace(\"pushTest\");\r\n" - ); - } - - @Test - public void frame56_commaOperator3Test() { - compareSrc(56, "trace(\"commaOperator3Test\");\r\n" - + "var k = 1;\r\n" - + "while(true)\r\n" - + "{\r\n" - + "k++;\r\n" - + "if(k < 10)\r\n" - + "{\r\n" - + "k = k * 5;\r\n" - + "trace(k);\r\n" - + "continue;\r\n" - + "}\r\n" - + "break;\r\n" - + "}\r\n" - + "trace(\"end\");\r\n" - ); - } - - @Test - public void frame57_commaOperator4Test() { - compareSrc(57, "trace(\"commaOperator4Test\");\r\n" - + "var k = 0;\r\n" - + "do\r\n" - + "{\r\n" - + "trace(k);\r\n" - + "if(k == 8)\r\n" - + "{\r\n" - + "trace(\"a\");\r\n" - + "if(k == 9)\r\n" - + "{\r\n" - + "continue;\r\n" - + "}\r\n" - + "trace(\"d\");\r\n" - + "trace(\"b\");\r\n" - + "}\r\n" - + "k++;\r\n" - + "}\r\n" - + "while(k = k + 5, k < 20);\r\n" - + "trace(\"end\");\r\n" - ); - } - - @Test - public void frame58_globalFunctionsTest() { - compareSrc(58, "function tst(p1)\r\n" - + "{\r\n" - + "trace(\"test\");\r\n" - + "}\r\n" - + "trace(\"globalFunctionsTest\");\r\n" - + "var k = Array(1,2,3);\r\n" - + "var a = 1;\r\n" - + "var b = Boolean(a);\r\n" - + "call(5);\r\n" - + "var c = \"A\";\r\n" - + "clearInterval(5);\r\n" - + "clearTimeout(4);\r\n" - + "var mc;\r\n" - + "duplicateMovieClip(mc,\"copy\",16389);\r\n" - + "a = escape(\"how\");\r\n" - + "var f = a;\r\n" - + "fscommand(\"alert(\\\"hi\\\");\");\r\n" - + "a = mc._alpha;\r\n" - + "a = getTimer();\r\n" - + "getURL(\"http://localhost/\",\"wnd\",\"POST\");\r\n" - + "a = getVersion();\r\n" - + "gotoAndPlay(5);\r\n" - + "gotoAndStop(8);\r\n" - + "ifFrameLoaded(4)\r\n" - + "{\r\n" - + "trace(\"loaded\");\r\n" - + "}\r\n" - + "a = int(f);\r\n" - + "a = isFinite(f);\r\n" - + "a = isNaN(f);\r\n" - + "a = length(f);\r\n" - + "loadMovie(\"http://localhost/test.swf\",a,\"GET\");\r\n" - + "loadMovieNum(\"http://localhost/test.swf\",5,\"GET\");\r\n" - + "loadVariables(\"http://localhost/vars.txt\",a,\"GET\");\r\n" - + "loadVariablesNum(\"http://localhost/vars.txt\",4,\"GET\");\r\n" - + "a = mbchr(f);\r\n" - + "a = mblength(f);\r\n" - + "a = mbord(f);\r\n" - + "a = mbsubstring(\"aaaa\",5,4);\r\n" - + "MMExecute(\"destroyPC\");\r\n" - + "nextFrame();\r\n" - + "gotoAndStop(1);\r\n" - + "a = Number(f);\r\n" - + "a = Object(f);\r\n" - + "a = ord(f);\r\n" - + "a = parseFloat(f);\r\n" - + "a = parseInt(f,16);\r\n" - + "play();\r\n" - + "prevFrame();\r\n" - + "gotoAndStop(1);\r\n" - + "print(mc,\"bframe\");\r\n" - + "printAsBitmap(mc,\"bframe\");\r\n" - + "printAsBitmapNum(5,\"bframe\");\r\n" - + "printNum(4,\"bframe\");\r\n" - + "a = random(10);\r\n" - + "removeMovieClip(mc);\r\n" - + "setInterval(tst,5,f);\r\n" - + "mc._alpha = 25;\r\n" - + "setTimeout(tst,5,f);\r\n" - + "showRedrawRegions(false,0);\r\n" - + "startDrag(mc,1,5,5,6,6);\r\n" - + "stop();\r\n" - + "stopAllSounds();\r\n" - + "stopDrag();\r\n" - + "a = String(f);\r\n" - + "a = \"aa\";\r\n" - + "targetPath(f);\r\n" - + "tellTarget(mc)\r\n" - + "{\r\n" - + "trace(\"told\");\r\n" - + "}\r\n" - + "toggleHighQuality();\r\n" - + "a = unescape(f);\r\n" - + "unloadMovie(mc);\r\n" - + "unloadMovieNum(4);\r\n" - + "updateAfterEvent();\r\n" - ); - } - - @Test - public void frame59_unaryOpTest() { - compareSrc(59, "trace(\"unaryOpTest\");\r\n" - + "var a = 5;\r\n" - + "var c = ~a;\r\n" - + "var d = ~(a + c);\r\n" - + "var e = - c;\r\n" - ); - } -} +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash; + +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.helpers.CodeFormatting; +import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.flash.tags.DoActionTag; +import com.jpexs.decompiler.flash.tags.ShowFrameTag; +import com.jpexs.decompiler.flash.tags.Tag; +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * + * @author JPEXS + */ +public class ActionScript2Test extends ActionStript2TestBase { + + @BeforeClass + public void init() throws IOException, InterruptedException { + //Main.initLogging(false); + Configuration.autoDeobfuscate.set(false); + Configuration.decompile.set(true); + Configuration.registerNameFormat.set("_loc%d_"); + swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/as2/as2.swf")), false); + } + + private void compareSrc(int frame, String expectedResult) { + DoActionTag doa = getFrameSource(frame); + assertNotNull(doa); + HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); + try { + Action.actionsToSource(doa, doa.getActions(), "", writer); + } catch (InterruptedException ex) { + fail(); + } + String actualResult = cleanPCode(writer.toString()); + expectedResult = cleanPCode(expectedResult); + assertEquals(actualResult, expectedResult); + + } + + private DoActionTag getFrameSource(int frame) { + int f = 0; + DoActionTag lastDoa = null; + + for (Tag t : swf.tags) { + if (t instanceof DoActionTag) { + lastDoa = (DoActionTag) t; + } + if (t instanceof ShowFrameTag) { + f++; + if (f == frame) { + return lastDoa; + } + lastDoa = null; + } + } + return null; + } + + @Test + public void frame23_Test() { + compareSrc(23, "stop();\r\n" + ); + } + + @Test + public void frame24_unicodeTest() { + compareSrc(24, "trace(\"unicodeTest\");\r\n" + + "var k = \"\u05d4\u05d9\u05e4\u05d5\u05e4\u05d5\u05d8\u05de\u05d9, \u05d0\u05d5 \u05d0\";\r\n" + + "trace(k);\r\n" + ); + } + + @Test + public void frame25_ifWithElseTest() { + compareSrc(25, "trace(\"ifWithElseTest\");\r\n" + + "var i = 5;\r\n" + + "if(i == 258)\r\n" + + "{\r\n" + + "trace(\"onTrue\");\r\n" + + "}\r\n" + + "else\r\n" + + "{\r\n" + + "trace(\"onFalse\" + i);\r\n" + + "}\r\n" + ); + } + + @Test + public void frame26_forTest() { + compareSrc(26, "trace(\"forTest\");\r\n" + + "var i = 0;\r\n" + + "while(i < 10)\r\n" + + "{\r\n" + + "trace(\"hello:\" + i);\r\n" + + "i++;\r\n" + + "}\r\n" + ); + } + + @Test + public void frame27_whileTest() { + compareSrc(27, "trace(\"whileTest\");\r\n" + + "var i = 0;\r\n" + + "while(i < 10)\r\n" + + "{\r\n" + + "trace(\"hello:\" + i);\r\n" + + "i++;\r\n" + + "}\r\n" + ); + } + + @Test + public void frame28_forWithContinueTest() { + compareSrc(28, "trace(\"forWithContinueTest\");\r\n" + + "var i = 0;\r\n" + + "for(; i < 10; i++)\r\n" + + "{\r\n" + + "trace(\"hello:\" + i);\r\n" + + "if(i == 5)\r\n" + + "{\r\n" + + "trace(\"i==5\");\r\n" + + "if(i == 7)\r\n" + + "{\r\n" + + "continue;\r\n" + + "}\r\n" + + "trace(\"hawk\");\r\n" + + "}\r\n" + + "trace(\"end of the loop\");\r\n" + + "}\r\n" + ); + } + + @Test + public void frame29_doWhileTest() { + compareSrc(29, "trace(\"doWhileTest\");\r\n" + + "var i = 0;\r\n" + + "do\r\n" + + "{\r\n" + + "trace(\"i=\" + i);\r\n" + + "i++;\r\n" + + "}\r\n" + + "while(i < 10);\r\n" + + "trace(\"end\");\r\n" + ); + } + + @Test + public void frame30_switchTest() { + compareSrc(30, "trace(\"switchTest\");\r\n" + + "var i = 5;\r\n" + + "switch(i)\r\n" + + "{\r\n" + + "case 0:\r\n" + + "case 1:\r\n" + + "trace(\"one\");\r\n" + + "break;\r\n" + + "case 2:\r\n" + + "trace(\"two\");\r\n" + + "case 3:\r\n" + + "trace(\"three\");\r\n" + + "break;\r\n" + + "case 4:\r\n" + + "trace(\"four\");\r\n" + + "break;\r\n" + + "default:\r\n" + + "trace(\"default clause\");\r\n" + + "}\r\n" + + "trace(\"scriptend\");\r\n" + ); + } + + @Test + public void frame31_strictEqualsTest() { + compareSrc(31, "trace(\"strictEqualsTest\");\r\n" + + "var i = 5;\r\n" + + "if(i === 5)\r\n" + + "{\r\n" + + "trace(\"equals strict\");\r\n" + + "}\r\n" + + "if(i !== 5)\r\n" + + "{\r\n" + + "trace(\"not equals strict\");\r\n" + + "}\r\n" + ); + } + + @Test + public void frame32_switchForTest() { + compareSrc(32, "trace(\"switchForTest\");\r\n" + + "var i = 0;\r\n" + + "for(; i < 10; i++)\r\n" + + "{\r\n" + + "switch(i)\r\n" + + "{\r\n" + + "case 0:\r\n" + + "trace(\"zero\");\r\n" + + "continue;\r\n" + + "case 5:\r\n" + + "trace(\"five\");\r\n" + + "break;\r\n" + + "case 10:\r\n" + + "trace(\"ten\");\r\n" + + "break;\r\n" + + "case 1:\r\n" + + "if(i == 7)\r\n" + + "{\r\n" + + "continue;\r\n" + + "}\r\n" + + "trace(\"one\");\r\n" + + "default:\r\n" + + "trace(\"def\");\r\n" + + "}\r\n" + + "trace(\"before loop end\");\r\n" + + "}\r\n" + ); + } + + @Test + public void frame33_functionTest() { + compareSrc(33, "function hello(what, second)\r\n" + + "{\r\n" + + "trace(\"hello \" + what + \"! \" + second);\r\n" + + "}\r\n" + + "trace(\"functionTest\");\r\n" + + "hello(\"friend\",7);\r\n" + ); + } + + @Test + public void frame34_multipleConditionsTest() { + compareSrc(34, "trace(\"multipleConditionsTest\");\r\n" + + "var k = 5;\r\n" + + "if(k == 7 && k == 8)\r\n" + + "{\r\n" + + "trace(\"first\");\r\n" + + "}\r\n" + + "if(k == 9)\r\n" + + "{\r\n" + + "trace(\"second\");\r\n" + + "}\r\n" + + "trace(\"finish\");\r\n" + ); + } + + @Test + public void frame35_multipleConditions2Test() { + compareSrc(35, "trace(\"multipleConditions2Test\");\r\n" + + "var k = 5;\r\n" + + "if(k == 7 && k == 8)\r\n" + + "{\r\n" + + "trace(\"first\");\r\n" + + "}\r\n" + + "if(k == 9 || k == 6)\r\n" + + "{\r\n" + + "trace(\"second\");\r\n" + + "}\r\n" + + "trace(\"finish\");\r\n" + ); + } + + @Test + public void frame36_chainedAssignmentsTest() { + compareSrc(36, "trace(\"chainedAssignmentsTest\");\r\n" + + "var a = 7;\r\n" + + "var b = 8;\r\n" + + "var c = 9;\r\n" + + "var d = c = b = a = 10;\r\n" + + "trace(d);\r\n" + ); + } + + @Test + public void frame37_objectsTest() { + compareSrc(37, "trace(\"objectsTest\");\r\n" + + "var flashBox = new Box(box1);\r\n" + + "_root.onEnterFrame = function()\r\n" + + "{\r\n" + + "flashBox.moveUp();\r\n" + + "};\r\n" + + "var ship = new Ship(200);\r\n" + + "var enemy = new Enemy(56);\r\n" + + "ship.moveDown(0.5);\r\n" + + "ship.moveUp(0.2);\r\n" + + "enemy.moveRight(230);\r\n" + + "enemy.moveLeft(100);\r\n" + + "var mt = new com.jpexs.MyTest();\r\n" + + "mt.test();\r\n" + + "var c = new Cox(box1);\r\n" + ); + } + + @Test + public void frame38_doWhile2Test() { + compareSrc(38, "trace(\"doWhile2Test\");\r\n" + + "var k = 5;\r\n" + + "do\r\n" + + "{\r\n" + + "k++;\r\n" + + "if(k == 7)\r\n" + + "{\r\n" + + "k = 5 * k;\r\n" + + "}\r\n" + + "else\r\n" + + "{\r\n" + + "k = 5 + k;\r\n" + + "}\r\n" + + "}\r\n" + + "while(k < 9);\r\n" + ); + } + + @Test + public void frame39_whileAndTest() { + compareSrc(39, "trace(\"whileAndTest\");\r\n" + + "var a = 5;\r\n" + + "var b = 10;\r\n" + + "while(a < 10 && b > 1)\r\n" + + "{\r\n" + + "a++;\r\n" + + "b--;\r\n" + + "}\r\n" + + "a = 7;\r\n" + + "b = 9;\r\n" + ); + } + + @Test + public void frame40_forInTest() { + compareSrc(40, "function testForIn()\r\n" + + "{\r\n" + + "var _loc1_ = [];\r\n" + + "for(var _loc2_ in _loc1_)\r\n" + + "{\r\n" + + "if(_loc2_ > 3)\r\n" + + "{\r\n" + + "if(_loc2_ == 5)\r\n" + + "{\r\n" + + "return 7;\r\n" + + "}\r\n" + + "return 8;\r\n" + + "}\r\n" + + "}\r\n" + + "}\r\n" + + "trace(\"forInTest\");\r\n" + + "trace(testForIn());\r\n" + + "var arr = [];\r\n" + + "for(var a in arr)\r\n" + + "{\r\n" + + "trace(a);\r\n" + + "}\r\n" + ); + } + + @Test + public void frame41_tryTest() { + compareSrc(41, "trace(\"tryTest\");\r\n" + + "var k = 5;\r\n" + + "try\r\n" + + "{\r\n" + + "k = Infinity;\r\n" + + "}\r\n" + + "catch(e)\r\n" + + "{\r\n" + + "trace(\"bug \" + e);\r\n" + + "}\r\n" + + "finally\r\n" + + "{\r\n" + + "trace(\"huu\");\r\n" + + "}\r\n" + + "trace(\"next\");\r\n" + + "try\r\n" + + "{\r\n" + + "k = 6;\r\n" + + "}\r\n" + + "catch(e)\r\n" + + "{\r\n" + + "trace(\"bug2 \" + e);\r\n" + + "}\r\n" + + "trace(\"next2\");\r\n" + + "var k = 5;\r\n" + + "try\r\n" + + "{\r\n" + + "k = Infinity;\r\n" + + "}\r\n" + + "finally\r\n" + + "{\r\n" + + "trace(\"final\");\r\n" + + "}\r\n" + + "trace(\"end\");\r\n" + ); + } + + @Test + public void frame42_indicesTest() { + compareSrc(42, "trace(\"indicesTest\");\r\n" + + "var k = [1,2,3];\r\n" + + "var b = k[1];\r\n" + + "trace(b);\r\n" + ); + } + + @Test + public void frame43_incDecTest() { + compareSrc(43, "function tst()\r\n" + + "{\r\n" + + "return 1;\r\n" + + "}\r\n" + + "trace(\"incDecTest\");\r\n" + + "var i = 5;\r\n" + + "var b = i++;\r\n" + + "var c = --i + 5;\r\n" + + "trace(\"a:\" + a + \" b:\" + b + \" c:\" + c);\r\n" + + "var arr = [1,2,3];\r\n" + + "arr[tst()]++;\r\n" + + "var d = arr[tst()];\r\n" + + "trace(d);\r\n" + ); + } + + @Test + public void frame44_chainedAssignments2Test() { + compareSrc(44, "trace(\"chainedAssignments2Test\");\r\n" + + "var a = 5;\r\n" + + "var b = 6;\r\n" + + "var c = 7;\r\n" + + "var d = c = b = a = 4;\r\n" + + "if((d = c = b = a = 7) > 2)\r\n" + + "{\r\n" + + "trace(d);\r\n" + + "}\r\n" + + "trace(d + 1);\r\n" + + "var i = 0;\r\n" + + "while(i < 5)\r\n" + + "{\r\n" + + "if(i == 7)\r\n" + + "{\r\n" + + "}\r\n" + + "i++;\r\n" + + "}\r\n" + ); + } + + @Test + public void frame45_function2Test() { + compareSrc(45, "function a()\r\n" + + "{\r\n" + + "trace(\"hi\");\r\n" + + "var _loc1_ = 5;\r\n" + + "if(_loc1_ == 7)\r\n" + + "{\r\n" + + "return undefined;\r\n" + + "}\r\n" + + "_loc1_ = _loc1_ * 9;\r\n" + + "trace(_loc1_);\r\n" + + "}\r\n" + + "trace(\"function2Test\");\r\n" + ); + } + + @Test + public void frame46_tryFunctionTest() { + compareSrc(46, "function testtry()\r\n" + + "{\r\n" + + "var _loc1_ = 5;\r\n" + + "try\r\n" + + "{\r\n" + + "if(_loc1_ == 3)\r\n" + + "{\r\n" + + "return undefined;\r\n" + + "}\r\n" + + "if(_loc1_ == 4)\r\n" + + "{\r\n" + + "throw new Error();\r\n" + + "}\r\n" + + "else\r\n" + + "{\r\n" + + "_loc1_ = 7;\r\n" + + "}\r\n" + + "}\r\n" + + "catch(e)\r\n" + + "{\r\n" + + "trace(\"error\");\r\n" + + "}\r\n" + + "finally\r\n" + + "{\r\n" + + "trace(\"finally\");\r\n" + + "}\r\n" + + "}\r\n" + + "trace(\"tryFunctionTest\");\r\n" + ); + } + + @Test + public void frame47_ternarTest() { + compareSrc(47, "trace(\"ternarTest\");\r\n" + + "var a = 5;\r\n" + + "var b = a != 4?3:2;\r\n" + + "trace(b);\r\n" + ); + } + + @Test + public void frame48_forInInTest() { + compareSrc(48, "function tst()\r\n" + + "{\r\n" + + "var _loc2_ = [];\r\n" + + "_loc2_[0] = [];\r\n" + + "for(var _loc3_ in _loc2_)\r\n" + + "{\r\n" + + "for(var _loc1_ in _loc3_)\r\n" + + "{\r\n" + + "if(_loc1_ == 5)\r\n" + + "{\r\n" + + "return 5;\r\n" + + "}\r\n" + + "}\r\n" + + "if(_loc3_ == 8)\r\n" + + "{\r\n" + + "return 3;\r\n" + + "}\r\n" + + "}\r\n" + + "return 8;\r\n" + + "}\r\n" + + "trace(\"forInInTest\");\r\n" + + "tst();\r\n" + ); + } + + @Test + public void frame49_registersFuncTest() { + compareSrc(49, "function tst(px)\r\n" + + "{\r\n" + + "var _loc1_ = 57;\r\n" + + "_loc1_ = _loc1_ * 27;\r\n" + + "}\r\n" + + "trace(\"registersFuncTest\");\r\n" + + "tst(5);\r\n" + + "var s = String(5);\r\n" + ); + } + + @Test + public void frame50_ifFrameLoadedTest() { + compareSrc(50, "trace(\"ifFrameLoadedTest\");\r\n" + + "ifFrameLoaded(9)\r\n" + + "{\r\n" + + "trace(\"loaded\");\r\n" + + "}\r\n" + ); + } + + @Test + public void frame51_function3Test() { + compareSrc(51, "function tst()\r\n" + + "{\r\n" + + "var _loc1_ = 5;\r\n" + + "c = _loc1_ = 8;\r\n" + + "trace(\"hi\");\r\n" + + "trace(_loc1_);\r\n" + + "if((e = d = f = c = 9) > 5)\r\n" + + "{\r\n" + + "trace(\"dd\");\r\n" + + "}\r\n" + + "}\r\n" + + "trace(\"function3Test\");\r\n" + + "var c = 7;\r\n" + + "var d = 7;\r\n" + + "var e = 8;\r\n" + + "tst();\r\n" + ); + } + + @Test + public void frame52_commaOperatorTest() { + compareSrc(52, "trace(\"commaOperatorTest\");\r\n" + + "var a = 0;\r\n" + + "var b = 0;\r\n" + + "var c = 0;\r\n" + + "while(true)\r\n" + + "{\r\n" + + "a++;\r\n" + + "b = b + 2;\r\n" + + "if(c < 10)\r\n" + + "{\r\n" + + "trace(c);\r\n" + + "c++;\r\n" + + "continue;\r\n" + + "}\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"konec\");\r\n" + ); + } + + @Test + public void frame53_commaOperator2Test() { + compareSrc(53, "trace(\"commaOperator2Test\");\r\n" + + "var k = 8;\r\n" + + "do\r\n" + + "{\r\n" + + "if(k == 9)\r\n" + + "{\r\n" + + "trace(\"h\");\r\n" + + "if(k == 9)\r\n" + + "{\r\n" + + "trace(\"f\");\r\n" + + "continue;\r\n" + + "}\r\n" + + "trace(\"b\");\r\n" + + "}\r\n" + + "trace(\"gg\");\r\n" + + "}\r\n" + + "while(k++, k < 10);\r\n" + + "trace(\"ss\");\r\n" + ); + } + + @Test + public void frame54_function4Test() { + compareSrc(54, "function tst()\r\n" + + "{\r\n" + + "var _loc1_ = 5;\r\n" + + "while(_loc1_ < 10)\r\n" + + "{\r\n" + + "if(_loc1_ == 5)\r\n" + + "{\r\n" + + "if(_loc1_ == 6)\r\n" + + "{\r\n" + + "return true;\r\n" + + "}\r\n" + + "_loc1_ = _loc1_ + 1;\r\n" + + "continue;\r\n" + + "}\r\n" + + "return false;\r\n" + + "}\r\n" + + "}\r\n" + + "trace(\"function4Test\");\r\n" + + "tst();\r\n" + ); + } + + @Test + public void frame55_pushTest() { + compareSrc(55, "trace(\"pushTest\");\r\n" + + "53;" + ); + } + + @Test + public void frame56_commaOperator3Test() { + compareSrc(56, "trace(\"commaOperator3Test\");\r\n" + + "var k = 1;\r\n" + + "while(true)\r\n" + + "{\r\n" + + "k++;\r\n" + + "if(k < 10)\r\n" + + "{\r\n" + + "k = k * 5;\r\n" + + "trace(k);\r\n" + + "continue;\r\n" + + "}\r\n" + + "break;\r\n" + + "}\r\n" + + "trace(\"end\");\r\n" + ); + } + + @Test + public void frame57_commaOperator4Test() { + compareSrc(57, "trace(\"commaOperator4Test\");\r\n" + + "var k = 0;\r\n" + + "do\r\n" + + "{\r\n" + + "trace(k);\r\n" + + "if(k == 8)\r\n" + + "{\r\n" + + "trace(\"a\");\r\n" + + "if(k == 9)\r\n" + + "{\r\n" + + "continue;\r\n" + + "}\r\n" + + "trace(\"d\");\r\n" + + "trace(\"b\");\r\n" + + "}\r\n" + + "k++;\r\n" + + "}\r\n" + + "while(k = k + 5, k < 20);\r\n" + + "trace(\"end\");\r\n" + ); + } + + @Test + public void frame58_globalFunctionsTest() { + compareSrc(58, "function tst(p1)\r\n" + + "{\r\n" + + "trace(\"test\");\r\n" + + "}\r\n" + + "trace(\"globalFunctionsTest\");\r\n" + + "var k = Array(1,2,3);\r\n" + + "var a = 1;\r\n" + + "var b = Boolean(a);\r\n" + + "call(5);\r\n" + + "var c = \"A\";\r\n" + + "clearInterval(5);\r\n" + + "clearTimeout(4);\r\n" + + "var mc;\r\n" + + "duplicateMovieClip(mc,\"copy\",16389);\r\n" + + "a = escape(\"how\");\r\n" + + "var f = a;\r\n" + + "fscommand(\"alert(\\\"hi\\\");\");\r\n" + + "a = mc._alpha;\r\n" + + "a = getTimer();\r\n" + + "getURL(\"http://localhost/\",\"wnd\",\"POST\");\r\n" + + "a = getVersion();\r\n" + + "gotoAndPlay(5);\r\n" + + "gotoAndStop(8);\r\n" + + "ifFrameLoaded(4)\r\n" + + "{\r\n" + + "trace(\"loaded\");\r\n" + + "}\r\n" + + "a = int(f);\r\n" + + "a = isFinite(f);\r\n" + + "a = isNaN(f);\r\n" + + "a = length(f);\r\n" + + "loadMovie(\"http://localhost/test.swf\",a,\"GET\");\r\n" + + "loadMovieNum(\"http://localhost/test.swf\",5,\"GET\");\r\n" + + "loadVariables(\"http://localhost/vars.txt\",a,\"GET\");\r\n" + + "loadVariablesNum(\"http://localhost/vars.txt\",4,\"GET\");\r\n" + + "a = mbchr(f);\r\n" + + "a = mblength(f);\r\n" + + "a = mbord(f);\r\n" + + "a = mbsubstring(\"aaaa\",5,4);\r\n" + + "MMExecute(\"destroyPC\");\r\n" + + "nextFrame();\r\n" + + "gotoAndStop(1);\r\n" + + "a = Number(f);\r\n" + + "a = Object(f);\r\n" + + "a = ord(f);\r\n" + + "a = parseFloat(f);\r\n" + + "a = parseInt(f,16);\r\n" + + "play();\r\n" + + "prevFrame();\r\n" + + "gotoAndStop(1);\r\n" + + "print(mc,\"bframe\");\r\n" + + "printAsBitmap(mc,\"bframe\");\r\n" + + "printAsBitmapNum(5,\"bframe\");\r\n" + + "printNum(4,\"bframe\");\r\n" + + "a = random(10);\r\n" + + "removeMovieClip(mc);\r\n" + + "setInterval(tst,5,f);\r\n" + + "mc._alpha = 25;\r\n" + + "setTimeout(tst,5,f);\r\n" + + "showRedrawRegions(false,0);\r\n" + + "startDrag(mc,1,5,5,6,6);\r\n" + + "stop();\r\n" + + "stopAllSounds();\r\n" + + "stopDrag();\r\n" + + "a = String(f);\r\n" + + "a = \"aa\";\r\n" + + "targetPath(f);\r\n" + + "tellTarget(mc)\r\n" + + "{\r\n" + + "trace(\"told\");\r\n" + + "}\r\n" + + "toggleHighQuality();\r\n" + + "a = unescape(f);\r\n" + + "unloadMovie(mc);\r\n" + + "unloadMovieNum(4);\r\n" + + "updateAfterEvent();\r\n" + ); + } + + @Test + public void frame59_unaryOpTest() { + compareSrc(59, "trace(\"unaryOpTest\");\r\n" + + "var a = 5;\r\n" + + "var c = ~a;\r\n" + + "var d = ~(a + c);\r\n" + + "var e = - c;\r\n" + ); + } +} diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex b/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex index a1760063a..870340e7c 100644 --- a/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex @@ -17,8 +17,8 @@ package jsyntaxpane.lexers; import jsyntaxpane.Token; import jsyntaxpane.TokenType; - -%% + +%% %public %class ActionScriptLexer @@ -58,7 +58,7 @@ InputCharacter = [^\r\n] WhiteSpace = {LineTerminator} | [ \t\f]+ /* comments */ -Comment = {TraditionalComment} | {EndOfLineComment} +Comment = {TraditionalComment} | {EndOfLineComment} TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? @@ -92,13 +92,13 @@ HexDigit = [0-9a-fA-F] OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} OctDigit = [0-7] - -/* floating point literals */ + +/* floating point literals */ DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? -FLit1 = [0-9]+ \. [0-9]* -FLit2 = \. [0-9]+ -FLit3 = [0-9]+ +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ Exponent = [eE] [+-]? [0-9]+ NewVector = "new" {WhiteSpace}* "<" @@ -108,6 +108,7 @@ StringCharacter = [^\r\n\"\\] SingleCharacter = [^\r\n\'\\] OIdentifierCharacter = [^\r\n\u00A7\\] +Preprocessor = \u00A7\u00A7 {Identifier} %state STRING, CHARLITERAL, XMLSTARTTAG, XML, OIDENTIFIER @@ -174,114 +175,117 @@ OIdentifierCharacter = [^\r\n\u00A7\\] "}" { return token(TokenType.OPERATOR, -CURLY); } "[" { return token(TokenType.OPERATOR, BRACKET); } "]" { return token(TokenType.OPERATOR, -BRACKET); } - ";" | - "," | - "..." | - "." | - "=" | - ">" | + ";" | + "," | + "..." | + "." | + "=" | + ">" | "<" | - "!" | - "~" | - "?" | - ":" | - "==" | - "<=" | - ">=" | - "!=" | - "&&" | - "||" | - "++" | - "--" | - "+" | - "-" | - "*" | - "/" | - "&" | - "|" | - "^" | - "%" | - "<<" | - ">>" | - ">>>" | - "+=" | - "-=" | - "*=" | - "/=" | - "&=" | - "|=" | - "^=" | - "%=" | - "<<=" | - ">>=" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | ">>>=" | - "as" | - "delete" | - "instanceof" | - "is" | - "::" | - "new" | - "typeof" | - "void" | + "as" | + "delete" | + "instanceof" | + "is" | + "::" | + "new" | + "typeof" | + "void" | {NewVector} | - "@" { return token(TokenType.OPERATOR); } - + "@" { return token(TokenType.OPERATOR); } + /* string literal */ - \" { - yybegin(STRING); - tokenStart = yychar; - tokenLength = 1; + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; } - "\u00A7" { - yybegin(OIDENTIFIER); - tokenStart = yychar; - tokenLength = 1; + {Preprocessor} { + return token(TokenType.REGEX); + } + "\u00A7" { + yybegin(OIDENTIFIER); + tokenStart = yychar; + tokenLength = 1; } /* character literal */ - \' { - yybegin(CHARLITERAL); - tokenStart = yychar; - tokenLength = 1; + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; } /* numeric literals */ {DecIntegerLiteral} | - + {HexIntegerLiteral} | - + {OctIntegerLiteral} | - + {DoubleLiteral} | {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } - + // JavaDoc comments need a state so that we can highlight the @ controls /* comments */ {Comment} { return token(TokenType.COMMENT); } /* whitespace */ - {WhiteSpace} { } + {WhiteSpace} { } {TypeNameSpec} { return token(TokenType.IDENTIFIER); } - {XMLBeginOneTag} { yybegin(XML); + {XMLBeginOneTag} { yybegin(XML); tokenStart = yychar; - tokenLength = yylength(); - String s=yytext(); + tokenLength = yylength(); + String s=yytext(); s=s.substring(1,s.length()-1); if(s.contains(" ")){ s=s.substring(0,s.indexOf(" ")); } xmlTagName = s; } - /*{XMLBeginTag} { yybegin(XMLSTARTTAG); + /*{XMLBeginTag} { yybegin(XMLSTARTTAG); tokenStart = yychar; - tokenLength = yylength(); - String s=yytext(); + tokenLength = yylength(); + String s=yytext(); xmlTagName = s.substring(1); }*/ - /* identifiers */ - {Identifier} { return token(TokenType.IDENTIFIER); } + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } } { @@ -293,7 +297,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\] {XMLBeginOneTag} { tokenLength += yylength();} {XMLEndTag} { tokenLength += yylength(); String endtagname=yytext(); - endtagname=endtagname.substring(2,endtagname.length()-1); + endtagname=endtagname.substring(2,endtagname.length()-1); if(endtagname.equals(xmlTagName)){ yybegin(YYINITIAL); return token(TokenType.STRING, tokenStart, tokenLength); @@ -303,16 +307,16 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \" { - yybegin(YYINITIAL); + \" { + yybegin(YYINITIAL); // length also includes the trailing quote return token(TokenType.STRING, tokenStart, tokenLength + 1); } - + {StringCharacter}+ { tokenLength += yylength(); } \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } - + /* escape sequences */ \\. { tokenLength += 2; } @@ -320,15 +324,15 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - "\u00A7" { - yybegin(YYINITIAL); + "\u00A7" { + yybegin(YYINITIAL); // length also includes the trailing quote return token(TokenType.REGEX, tokenStart, tokenLength + 1); } - + {OIdentifierCharacter}+ { tokenLength += yylength(); } - + /* escape sequences */ \\. { tokenLength += 2; } @@ -336,14 +340,14 @@ OIdentifierCharacter = [^\r\n\u00A7\\] } { - \' { - yybegin(YYINITIAL); + \' { + yybegin(YYINITIAL); // length also includes the trailing quote return token(TokenType.STRING, tokenStart, tokenLength + 1); } - + {SingleCharacter}+ { tokenLength += yylength(); } - + /* escape sequences */ \\. { tokenLength += 2; }