mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-20 16:35:42 +00:00
Changed AS1/2 P-code action parameters are now separated by commas, code without commas is still accepted
This commit is contained in:
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.action.swf4.ConstantIndex;
|
||||
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import java.util.Stack;
|
||||
|
||||
%%
|
||||
|
||||
@@ -57,6 +58,24 @@ import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
private Stack<ASMParsedSymbol> pushedBack = new Stack<>();
|
||||
|
||||
public void pushback(ASMParsedSymbol symb) {
|
||||
pushedBack.push(symb);
|
||||
last = null;
|
||||
}
|
||||
|
||||
ASMParsedSymbol last;
|
||||
public ASMParsedSymbol lex() throws java.io.IOException, ActionParseException{
|
||||
ASMParsedSymbol ret = null;
|
||||
if (!pushedBack.isEmpty()){
|
||||
ret = last = pushedBack.pop();
|
||||
} else {
|
||||
ret = last = yylex();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
/* main character classes */
|
||||
@@ -139,6 +158,9 @@ Constant= constant{PositiveNumberLiteral}
|
||||
string.setLength(0);
|
||||
}
|
||||
|
||||
"," { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_COMMA); }
|
||||
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{NumberLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INTEGER, Long.parseLong((yytext()))); }
|
||||
|
||||
Reference in New Issue
Block a user