mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-30 18:27:12 +00:00
faster syntax highlighting
This commit is contained in:
@@ -1788,7 +1788,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
// for..in return
|
||||
if (((ins instanceof ActionEquals) || (ins instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) {
|
||||
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>()));
|
||||
stack.push(new DirectValueActionItem(null, 0, Null.INSTANCE, new ArrayList<>()));
|
||||
}
|
||||
|
||||
if (ins instanceof ActionConstantPool) {
|
||||
|
||||
@@ -154,9 +154,9 @@ public class AVM2DeobfuscatorSimple implements SWFDecompilerListener {
|
||||
} else if (graphTargetItem instanceof FalseItem) {
|
||||
return makePush(Boolean.FALSE, cpool);
|
||||
} else if (graphTargetItem instanceof NullAVM2Item) {
|
||||
return makePush(new Null(), cpool);
|
||||
return makePush(Null.INSTANCE, cpool);
|
||||
} else if (graphTargetItem instanceof UndefinedAVM2Item) {
|
||||
return makePush(new Undefined(), cpool);
|
||||
return makePush(Undefined.INSTANCE, cpool);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class CoerceAVM2Item extends AVM2Item {
|
||||
return ret;
|
||||
}
|
||||
if (ret instanceof Undefined) {
|
||||
return new Null();
|
||||
return Null.INSTANCE;
|
||||
}
|
||||
return ret.toString();
|
||||
case "*":
|
||||
|
||||
@@ -49,7 +49,7 @@ public class NullAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return new Null();
|
||||
return Null.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,7 +49,7 @@ public class UndefinedAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return new Undefined();
|
||||
return Undefined.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,9 @@ import java.util.Stack;
|
||||
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0 from the specification file
|
||||
* <tt>D:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript3_pcode.flex</tt>
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0
|
||||
* from the specification file
|
||||
* <tt>C:/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/actionscript3_pcode.flex</tt>
|
||||
*/
|
||||
public final class Flasm3Lexer {
|
||||
|
||||
@@ -50,8 +51,9 @@ public final class Flasm3Lexer {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
@@ -2579,8 +2581,8 @@ public final class Flasm3Lexer {
|
||||
private int zzLexicalState = YYINITIAL;
|
||||
|
||||
/**
|
||||
* this buffer contains the current text to be matched and is the source of
|
||||
* the yytext() 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];
|
||||
|
||||
@@ -2600,8 +2602,8 @@ public final class Flasm3Lexer {
|
||||
private int zzStartRead;
|
||||
|
||||
/**
|
||||
* endRead marks the last character in the buffer, that has been read from
|
||||
* input
|
||||
* endRead marks the last character in the buffer, that has been read
|
||||
* from input
|
||||
*/
|
||||
private int zzEndRead;
|
||||
|
||||
@@ -2637,15 +2639,15 @@ public final class Flasm3Lexer {
|
||||
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.
|
||||
* 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();
|
||||
StringBuilder string = new StringBuilder();
|
||||
|
||||
boolean isMultiname = false;
|
||||
|
||||
@@ -2780,8 +2782,6 @@ public final class Flasm3Lexer {
|
||||
|
||||
/**
|
||||
* Closes the input stream.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public final void yyclose() throws java.io.IOException {
|
||||
zzAtEOF = true; /* indicate end of file */
|
||||
@@ -2794,12 +2794,12 @@ public final class Flasm3Lexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the scanner to read from a new input stream. Does not close the
|
||||
* old reader.
|
||||
* 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
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost). Lexical
|
||||
* state is set to <tt>ZZ_INITIAL</tt>.
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost).
|
||||
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
|
||||
*
|
||||
* Internal scan buffer is resized down to its initial length, if it has
|
||||
* grown.
|
||||
@@ -2823,8 +2823,6 @@ public final class Flasm3Lexer {
|
||||
|
||||
/**
|
||||
* Returns the current lexical state.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yystate() {
|
||||
return zzLexicalState;
|
||||
@@ -2841,20 +2839,19 @@ public final class Flasm3Lexer {
|
||||
|
||||
/**
|
||||
* Returns the text matched by the current regular expression.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final String yytext() {
|
||||
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the character at position <tt>pos</tt> from the matched text.
|
||||
* Returns the character at position <tt>pos</tt> 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.
|
||||
* @param pos the position of the character to fetch.
|
||||
* A value from 0 to yylength()-1.
|
||||
*
|
||||
* @return the character at position pos
|
||||
*/
|
||||
@@ -2864,8 +2861,6 @@ public final class Flasm3Lexer {
|
||||
|
||||
/**
|
||||
* Returns the length of the matched text region.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yylength() {
|
||||
return zzMarkedPos - zzStartRead;
|
||||
@@ -2874,13 +2869,14 @@ public final class Flasm3Lexer {
|
||||
/**
|
||||
* 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.).
|
||||
* 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.
|
||||
* Usual syntax/scanner level error handling should be done
|
||||
* in error fallback rules.
|
||||
*
|
||||
* @param errorCode the code of the errormessage to display
|
||||
*/
|
||||
@@ -2900,8 +2896,8 @@ public final class Flasm3Lexer {
|
||||
*
|
||||
* 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()!
|
||||
* @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()) {
|
||||
@@ -2912,12 +2908,11 @@ public final class Flasm3Lexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes scanning until the next regular expression is matched, the end of
|
||||
* input is encountered or an I/O-Error occurs.
|
||||
* 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.abc.avm2.parser.AVM2ParseException
|
||||
*/
|
||||
public ParsedSymbol yylex() throws java.io.IOException, AVM2ParseException {
|
||||
int zzInput;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,8 +21,9 @@ package com.jpexs.decompiler.flash.abc.methodinfo_parser;
|
||||
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0 from the specification file
|
||||
* <tt>D:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript3_methodinfo.flex</tt>
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0
|
||||
* from the specification file
|
||||
* <tt>C:/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/actionscript3_methodinfo.flex</tt>
|
||||
*/
|
||||
public final class MethodInfoLexer {
|
||||
|
||||
@@ -45,8 +46,9 @@ public final class MethodInfoLexer {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
@@ -547,8 +549,8 @@ public final class MethodInfoLexer {
|
||||
private int zzLexicalState = YYINITIAL;
|
||||
|
||||
/**
|
||||
* this buffer contains the current text to be matched and is the source of
|
||||
* the yytext() 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];
|
||||
|
||||
@@ -568,8 +570,8 @@ public final class MethodInfoLexer {
|
||||
private int zzStartRead;
|
||||
|
||||
/**
|
||||
* endRead marks the last character in the buffer, that has been read from
|
||||
* input
|
||||
* endRead marks the last character in the buffer, that has been read
|
||||
* from input
|
||||
*/
|
||||
private int zzEndRead;
|
||||
|
||||
@@ -605,15 +607,15 @@ public final class MethodInfoLexer {
|
||||
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.
|
||||
* 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();
|
||||
StringBuilder string = new StringBuilder();
|
||||
|
||||
boolean isMultiname = false;
|
||||
|
||||
@@ -729,8 +731,6 @@ public final class MethodInfoLexer {
|
||||
|
||||
/**
|
||||
* Closes the input stream.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public final void yyclose() throws java.io.IOException {
|
||||
zzAtEOF = true; /* indicate end of file */
|
||||
@@ -743,12 +743,12 @@ public final class MethodInfoLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the scanner to read from a new input stream. Does not close the
|
||||
* old reader.
|
||||
* 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
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost). Lexical
|
||||
* state is set to <tt>ZZ_INITIAL</tt>.
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost).
|
||||
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
|
||||
*
|
||||
* Internal scan buffer is resized down to its initial length, if it has
|
||||
* grown.
|
||||
@@ -772,8 +772,6 @@ public final class MethodInfoLexer {
|
||||
|
||||
/**
|
||||
* Returns the current lexical state.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yystate() {
|
||||
return zzLexicalState;
|
||||
@@ -790,20 +788,19 @@ public final class MethodInfoLexer {
|
||||
|
||||
/**
|
||||
* Returns the text matched by the current regular expression.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final String yytext() {
|
||||
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the character at position <tt>pos</tt> from the matched text.
|
||||
* Returns the character at position <tt>pos</tt> 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.
|
||||
* @param pos the position of the character to fetch.
|
||||
* A value from 0 to yylength()-1.
|
||||
*
|
||||
* @return the character at position pos
|
||||
*/
|
||||
@@ -813,8 +810,6 @@ public final class MethodInfoLexer {
|
||||
|
||||
/**
|
||||
* Returns the length of the matched text region.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yylength() {
|
||||
return zzMarkedPos - zzStartRead;
|
||||
@@ -823,13 +818,14 @@ public final class MethodInfoLexer {
|
||||
/**
|
||||
* 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.).
|
||||
* 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.
|
||||
* Usual syntax/scanner level error handling should be done
|
||||
* in error fallback rules.
|
||||
*
|
||||
* @param errorCode the code of the errormessage to display
|
||||
*/
|
||||
@@ -849,8 +845,8 @@ public final class MethodInfoLexer {
|
||||
*
|
||||
* 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()!
|
||||
* @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()) {
|
||||
@@ -861,13 +857,11 @@ public final class MethodInfoLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes scanning until the next regular expression is matched, the end of
|
||||
* input is encountered or an I/O-Error occurs.
|
||||
* 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.abc.methodinfo_parser.MethodInfoParseException
|
||||
*/
|
||||
public ParsedSymbol yylex() throws java.io.IOException, MethodInfoParseException {
|
||||
int zzInput;
|
||||
|
||||
@@ -268,7 +268,7 @@ public class ActionGraph extends Graph {
|
||||
}
|
||||
}
|
||||
if (switchedObject == null) {
|
||||
switchedObject = new DirectValueActionItem(null, -1, new Null(), null);
|
||||
switchedObject = new DirectValueActionItem(null, -1, Null.INSTANCE, null);
|
||||
}
|
||||
HashMap<Integer, GraphTargetItem> caseValuesMap = new HashMap<>();
|
||||
|
||||
|
||||
@@ -1065,10 +1065,10 @@ public class ActionListReader {
|
||||
} 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<>()));
|
||||
stack.push(new DirectValueActionItem(null, 0, Null.INSTANCE, new ArrayList<>()));
|
||||
}
|
||||
if ((a instanceof ActionStoreRegister) && stack.isEmpty()) {
|
||||
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>()));
|
||||
stack.push(new DirectValueActionItem(null, 0, Null.INSTANCE, new ArrayList<>()));
|
||||
}
|
||||
a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue {
|
||||
return (this.constants.get(((ConstantIndex) value).index));
|
||||
}
|
||||
if (value instanceof RegisterNumber) {
|
||||
return new Undefined(); //has not computed value
|
||||
return Undefined.INSTANCE; //has not computed value
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class GetVariableActionItem extends ActionItem {
|
||||
@Override
|
||||
public Object getResult() {
|
||||
if (computedValue == null) {
|
||||
return new Undefined();
|
||||
return Undefined.INSTANCE;
|
||||
}
|
||||
return computedResult;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem {
|
||||
int forinlevel = asGenerator.getForInLevel(localData);
|
||||
for (int i = 0; i < forinlevel; i++) { //Must POP all remaining values from enumerations (for..in)
|
||||
List<Action> forinret = new ArrayList<>();
|
||||
forinret.add(new ActionPush(new Null()));
|
||||
forinret.add(new ActionPush(Null.INSTANCE));
|
||||
forinret.add(new ActionEquals2());
|
||||
forinret.add(new ActionNot());
|
||||
ActionIf aforinif = new ActionIf(0);
|
||||
@@ -80,7 +80,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem {
|
||||
ret.addAll(forinret);
|
||||
}
|
||||
if (value == null) {
|
||||
ret.add(new ActionPush(new Undefined()));
|
||||
ret.add(new ActionPush(Undefined.INSTANCE));
|
||||
} else {
|
||||
ret.addAll(value.toSource(localData, generator));
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class ForInActionItem extends LoopActionItem implements Block {
|
||||
int exprReg = asGenerator.getTempRegister(localData);
|
||||
|
||||
loopExpr.add(new ActionStoreRegister(exprReg));
|
||||
loopExpr.add(new ActionPush(new Null()));
|
||||
loopExpr.add(new ActionPush(Null.INSTANCE));
|
||||
loopExpr.add(new ActionEquals2());
|
||||
ActionIf forInEndIf = new ActionIf(0);
|
||||
loopExpr.add(forInEndIf);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -947,7 +947,7 @@ public class ActionScript2Parser {
|
||||
List<GraphTargetItem> args = call(inFunction, inMethod, variables);
|
||||
VariableActionItem supItem = new VariableActionItem(s.value.toString(), null, false);
|
||||
variables.add(supItem);
|
||||
ret = new CallMethodActionItem(null, supItem, new DirectValueActionItem(null, 0, new Undefined(), constantPool), args);
|
||||
ret = new CallMethodActionItem(null, supItem, new DirectValueActionItem(null, 0, Undefined.INSTANCE, constantPool), args);
|
||||
} else {//no costructor call, but it could be calling parent methods... => handle in expression
|
||||
lexer.pushback(ss2);
|
||||
lexer.pushback(s);
|
||||
@@ -1142,7 +1142,7 @@ public class ActionScript2Parser {
|
||||
case RETURN:
|
||||
GraphTargetItem retexpr = expression(inFunction, inMethod, true, variables);
|
||||
if (retexpr == null) {
|
||||
retexpr = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<>());
|
||||
retexpr = new DirectValueActionItem(null, 0, Undefined.INSTANCE, new ArrayList<>());
|
||||
}
|
||||
ret = new ReturnActionItem(null, retexpr);
|
||||
break;
|
||||
@@ -1621,11 +1621,11 @@ public class ActionScript2Parser {
|
||||
|
||||
break;
|
||||
case NULL:
|
||||
ret = new DirectValueActionItem(null, 0, new Null(), new ArrayList<>());
|
||||
ret = new DirectValueActionItem(null, 0, Null.INSTANCE, new ArrayList<>());
|
||||
|
||||
break;
|
||||
case UNDEFINED:
|
||||
ret = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<>());
|
||||
ret = new DirectValueActionItem(null, 0, Undefined.INSTANCE, new ArrayList<>());
|
||||
break;
|
||||
case FALSE:
|
||||
ret = new DirectValueActionItem(null, 0, Boolean.FALSE, new ArrayList<>());
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Stack;
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0
|
||||
* from the specification file
|
||||
* <tt>C:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/actionscript_script.flex</tt>
|
||||
* <tt>C:/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/actionscript_script.flex</tt>
|
||||
*/
|
||||
public final class ActionScriptLexer {
|
||||
|
||||
@@ -1268,7 +1268,7 @@ public final class ActionScriptLexer {
|
||||
private int zzFinalHighSurrogate = 0;
|
||||
|
||||
/* user code: */
|
||||
StringBuffer string = new StringBuffer();
|
||||
StringBuilder string = new StringBuilder();
|
||||
|
||||
private static String xmlTagName = "";
|
||||
|
||||
|
||||
@@ -723,7 +723,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
|
||||
if (!isInterface) {
|
||||
ifbody.add(new ActionPush((Long) 1L));
|
||||
ifbody.add(new ActionPush(new Null()));
|
||||
ifbody.add(new ActionPush(Null.INSTANCE));
|
||||
ifbody.addAll(typeToActions(globalClassTypeStr, null));
|
||||
ifbody.add(pushConst("prototype"));
|
||||
ifbody.add(new ActionGetMember());
|
||||
|
||||
@@ -99,10 +99,10 @@ public class ActionPush extends Action {
|
||||
values.add(sis.readFLOAT("float"));
|
||||
break;
|
||||
case 2:
|
||||
values.add(new Null());
|
||||
values.add(Null.INSTANCE);
|
||||
break;
|
||||
case 3:
|
||||
values.add(new Undefined());
|
||||
values.add(Undefined.INSTANCE);
|
||||
break;
|
||||
case 4:
|
||||
values.add(new RegisterNumber(sis.readUI8("registerNumber")));
|
||||
|
||||
@@ -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.ecma;
|
||||
|
||||
/**
|
||||
@@ -93,11 +94,8 @@ public class EcmaScript {
|
||||
if (type(px) != EcmaType.STRING || type(py) != EcmaType.STRING) {
|
||||
Double nx = toNumber(px);
|
||||
Double ny = toNumber(py);
|
||||
Double ny = toNumber(py);
|
||||
if (nx.isNaN()) {
|
||||
return new Undefined();
|
||||
}
|
||||
if (ny.isNaN()) {
|
||||
if (nx.isNaN() || ny.isNaN()) {
|
||||
return Undefined.INSTANCE;
|
||||
}
|
||||
if ((nx).compareTo(ny) == 0) {
|
||||
return false;
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
/*
|
||||
* 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.ecma;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Null implements Serializable {
|
||||
|
||||
public static Null INSTANCE = new Null();
|
||||
|
||||
private Null() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
/*
|
||||
* 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.ecma;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Undefined implements Serializable {
|
||||
|
||||
public static Undefined INSTANCE = new Undefined();
|
||||
|
||||
private Undefined() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "undefined";
|
||||
|
||||
@@ -22,7 +22,7 @@ package com.jpexs.decompiler.flash.tags.text;
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0
|
||||
* from the specification file
|
||||
* <tt>C:/Projects/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/text.flex</tt>
|
||||
* <tt>C:/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/text.flex</tt>
|
||||
*/
|
||||
public final class TextLexer {
|
||||
|
||||
@@ -303,7 +303,7 @@ public final class TextLexer {
|
||||
private int zzFinalHighSurrogate = 0;
|
||||
|
||||
/* user code: */
|
||||
StringBuffer string = null;
|
||||
StringBuilder string = null;
|
||||
|
||||
boolean finish = false;
|
||||
|
||||
@@ -696,7 +696,7 @@ public final class TextLexer {
|
||||
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
|
||||
case 1: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append(yytext());
|
||||
}
|
||||
@@ -716,7 +716,7 @@ public final class TextLexer {
|
||||
case 3: {
|
||||
if (!parameter) {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append(yytext());
|
||||
}
|
||||
@@ -752,7 +752,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 9: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append(']');
|
||||
}
|
||||
@@ -760,7 +760,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 10: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('[');
|
||||
}
|
||||
@@ -768,7 +768,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 11: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\\');
|
||||
}
|
||||
@@ -776,7 +776,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 12: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\b');
|
||||
}
|
||||
@@ -784,7 +784,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 13: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\t');
|
||||
}
|
||||
@@ -792,7 +792,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 14: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\n');
|
||||
}
|
||||
@@ -800,7 +800,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 15: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\f');
|
||||
}
|
||||
@@ -808,7 +808,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 16: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\r');
|
||||
}
|
||||
@@ -816,7 +816,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 17: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\"');
|
||||
}
|
||||
@@ -824,7 +824,7 @@ public final class TextLexer {
|
||||
break;
|
||||
case 18: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
string = new StringBuilder();
|
||||
}
|
||||
string.append('\'');
|
||||
}
|
||||
|
||||
@@ -22,8 +22,9 @@ import java.util.Stack;
|
||||
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0 from the specification file
|
||||
* <tt>D:/Dropbox/Programovani/JavaSE/FFDec/libsrc/ffdec_lib/lexers/tag_conditions.flex</tt>
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0
|
||||
* from the specification file
|
||||
* <tt>C:/FFDec/jpexs-decompiler/libsrc/ffdec_lib/lexers/tag_conditions.flex</tt>
|
||||
*/
|
||||
public final class ConditionLexer {
|
||||
|
||||
@@ -44,8 +45,9 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
@@ -221,8 +223,8 @@ public final class ConditionLexer {
|
||||
private int zzLexicalState = YYINITIAL;
|
||||
|
||||
/**
|
||||
* this buffer contains the current text to be matched and is the source of
|
||||
* the yytext() 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];
|
||||
|
||||
@@ -242,8 +244,8 @@ public final class ConditionLexer {
|
||||
private int zzStartRead;
|
||||
|
||||
/**
|
||||
* endRead marks the last character in the buffer, that has been read from
|
||||
* input
|
||||
* endRead marks the last character in the buffer, that has been read
|
||||
* from input
|
||||
*/
|
||||
private int zzEndRead;
|
||||
|
||||
@@ -279,10 +281,10 @@ public final class ConditionLexer {
|
||||
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.
|
||||
* 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;
|
||||
|
||||
@@ -413,8 +415,6 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Closes the input stream.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public final void yyclose() throws java.io.IOException {
|
||||
zzAtEOF = true; /* indicate end of file */
|
||||
@@ -427,12 +427,12 @@ public final class ConditionLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the scanner to read from a new input stream. Does not close the
|
||||
* old reader.
|
||||
* 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
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost). Lexical
|
||||
* state is set to <tt>ZZ_INITIAL</tt>.
|
||||
* <b>cannot</b> be reused (internal buffer is discarded and lost).
|
||||
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
|
||||
*
|
||||
* Internal scan buffer is resized down to its initial length, if it has
|
||||
* grown.
|
||||
@@ -456,8 +456,6 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Returns the current lexical state.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yystate() {
|
||||
return zzLexicalState;
|
||||
@@ -474,20 +472,19 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Returns the text matched by the current regular expression.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final String yytext() {
|
||||
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the character at position <tt>pos</tt> from the matched text.
|
||||
* Returns the character at position <tt>pos</tt> 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.
|
||||
* @param pos the position of the character to fetch.
|
||||
* A value from 0 to yylength()-1.
|
||||
*
|
||||
* @return the character at position pos
|
||||
*/
|
||||
@@ -497,8 +494,6 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Returns the length of the matched text region.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yylength() {
|
||||
return zzMarkedPos - zzStartRead;
|
||||
@@ -507,13 +502,14 @@ public final class ConditionLexer {
|
||||
/**
|
||||
* 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.).
|
||||
* 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.
|
||||
* Usual syntax/scanner level error handling should be done
|
||||
* in error fallback rules.
|
||||
*
|
||||
* @param errorCode the code of the errormessage to display
|
||||
*/
|
||||
@@ -533,8 +529,8 @@ public final class ConditionLexer {
|
||||
*
|
||||
* 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()!
|
||||
* @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()) {
|
||||
@@ -545,13 +541,11 @@ public final class ConditionLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes scanning until the next regular expression is matched, the end of
|
||||
* input is encountered or an I/O-Error occurs.
|
||||
* 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.types.annotations.parser.AnnotationParseException
|
||||
*/
|
||||
public ConditionToken yylex() throws java.io.IOException, AnnotationParseException {
|
||||
int zzInput;
|
||||
|
||||
@@ -39,14 +39,12 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
Object ret = EcmaScript.toBoolean(value.getResult());
|
||||
if (ret == Boolean.TRUE) {
|
||||
boolean ret = EcmaScript.toBoolean(value.getResult());
|
||||
if (ret) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
if (ret == Boolean.FALSE) {
|
||||
} else {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,6 +51,6 @@ public class PopItem extends GraphTargetItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return new Null();
|
||||
return Null.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user