mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 03:20:45 +00:00
Issue #734 Support \xAB escape sequences in lexers
This commit is contained in:
+2888
-2711
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 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.
|
||||
*/
|
||||
/* Flash assembler language lexer specification */
|
||||
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.pcode;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
|
||||
import java.util.Stack;
|
||||
%%
|
||||
|
||||
@@ -14,7 +30,7 @@ import java.util.Stack;
|
||||
%line
|
||||
%column
|
||||
%type ParsedSymbol
|
||||
%throws ParseException
|
||||
%throws AVM2ParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -49,7 +65,7 @@ import java.util.Stack;
|
||||
last = null;
|
||||
}
|
||||
ParsedSymbol last;
|
||||
public ParsedSymbol lex() throws java.io.IOException, ParseException{
|
||||
public ParsedSymbol lex() throws java.io.IOException, AVM2ParseException{
|
||||
ParsedSymbol ret = null;
|
||||
if(!pushedBack.isEmpty()){
|
||||
ret = last = pushedBack.pop();
|
||||
@@ -94,6 +110,7 @@ FLit2 = \. [0-9]+
|
||||
FLit3 = [0-9]+
|
||||
Exponent = [eE] [+-]? [0-9]+
|
||||
|
||||
HexDigit = [0-9a-fA-F]
|
||||
OctDigit = [0-7]
|
||||
|
||||
/* string and character literals */
|
||||
@@ -127,7 +144,7 @@ ExceptionTarget = "exceptiontarget "{PositiveNumberLiteral}":"
|
||||
}
|
||||
{Label} {
|
||||
String s = yytext();
|
||||
return new ParsedSymbol(ParsedSymbol.TYPE_LABEL, s.substring(0,s.length() - 1));
|
||||
return new ParsedSymbol(ParsedSymbol.TYPE_LABEL, s.substring(0, s.length() - 1));
|
||||
}
|
||||
"name" { yybegin(PARAMETERS); return new ParsedSymbol(ParsedSymbol.TYPE_KEYWORD_NAME, yytext());}
|
||||
"try" { yybegin(PARAMETERS); return new ParsedSymbol(ParsedSymbol.TYPE_KEYWORD_TRY, yytext());}
|
||||
@@ -241,8 +258,8 @@ ExceptionTarget = "exceptiontarget "{PositiveNumberLiteral}":"
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{NumberLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER,new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT,new Double(Double.parseDouble((yytext())))); }
|
||||
{NumberLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER, new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT, new Double(Double.parseDouble((yytext())))); }
|
||||
{Identifier} { return new ParsedSymbol(ParsedSymbol.TYPE_IDENTIFIER, yytext()); }
|
||||
{LineTerminator} {yybegin(YYINITIAL);}
|
||||
{Comment} {return new ParsedSymbol(ParsedSymbol.TYPE_COMMENT, yytext().substring(1));}
|
||||
@@ -259,23 +276,25 @@ ExceptionTarget = "exceptiontarget "{PositiveNumberLiteral}":"
|
||||
}
|
||||
}
|
||||
|
||||
{StringCharacter}+ { string.append( yytext() ); }
|
||||
{StringCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* error cases */
|
||||
\\. { throw new ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { throw new ParseException("Unterminated string at end of line", yyline + 1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { throw new AVM2ParseException("Unterminated string at end of line", yyline + 1); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
+778
-766
File diff suppressed because it is too large
Load Diff
+209
-204
@@ -42,14 +42,14 @@ import java.io.StringReader;
|
||||
|
||||
public void yypushbackstr(String s, int state)
|
||||
{
|
||||
sourceCode = s + sourceCode.substring(yychar+yylength());
|
||||
sourceCode = s + sourceCode.substring(yychar + yylength());
|
||||
yyreset(new StringReader(sourceCode));
|
||||
yybegin(state);
|
||||
}
|
||||
|
||||
public void yypushbackstr(String s)
|
||||
{
|
||||
yypushbackstr(s,YYINITIAL);
|
||||
yypushbackstr(s, YYINITIAL);
|
||||
}
|
||||
|
||||
StringBuffer string = new StringBuffer();
|
||||
@@ -207,118 +207,118 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
<YYINITIAL> {
|
||||
|
||||
/* keywords */
|
||||
"break" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.BREAK, yytext()); }
|
||||
"case" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CASE, yytext()); }
|
||||
"continue" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONTINUE, yytext()); }
|
||||
"default" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DEFAULT, yytext()); }
|
||||
"do" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DO, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE, yytext()); }
|
||||
"else" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE, yytext()); }
|
||||
"for" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR, yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.EACH, yytext()); }
|
||||
"in" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN, yytext()); }
|
||||
"if" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF, yytext()); }
|
||||
"return" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN, yytext()); }
|
||||
"super" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SUPER, yytext()); }
|
||||
"switch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SWITCH, yytext()); }
|
||||
"throw" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THROW, yytext()); }
|
||||
"try" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRY, yytext()); }
|
||||
"catch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CATCH, yytext()); }
|
||||
"finally" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE, yytext()); }
|
||||
"with" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH, yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.DYNAMIC, yytext()); }
|
||||
"internal" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL, yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.OVERRIDE, yytext()); }
|
||||
"private" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE, yytext()); }
|
||||
"protected" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED, yytext()); }
|
||||
"public" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC, yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.STATIC, yytext()); }
|
||||
"class" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS, yytext()); }
|
||||
"const" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST, yytext()); }
|
||||
"extends" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS, yytext()); }
|
||||
"function" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION, yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.GET, yytext()); }
|
||||
"implements" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS, yytext()); }
|
||||
"interface" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE, yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.NAMESPACE, yytext()); }
|
||||
"package" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE, yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.SET, yytext()); }
|
||||
"var" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR, yytext()); }
|
||||
"import" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT, yytext()); }
|
||||
"use" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE, yytext()); }
|
||||
"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()); }
|
||||
"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()); }
|
||||
"final" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.FINAL, yytext()); }
|
||||
"native" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.NATIVE, yytext()); }
|
||||
"break" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); }
|
||||
"case" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); }
|
||||
"continue" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); }
|
||||
"default" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); }
|
||||
"do" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); }
|
||||
"else" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); }
|
||||
"for" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.EACH, yytext()); }
|
||||
"in" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); }
|
||||
"if" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); }
|
||||
"return" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); }
|
||||
"super" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); }
|
||||
"switch" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); }
|
||||
"throw" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); }
|
||||
"try" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); }
|
||||
"catch" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); }
|
||||
"finally" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); }
|
||||
"with" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.DYNAMIC, yytext()); }
|
||||
"internal" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.OVERRIDE, yytext()); }
|
||||
"private" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); }
|
||||
"protected" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); }
|
||||
"public" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.STATIC, yytext()); }
|
||||
"class" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); }
|
||||
"const" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); }
|
||||
"extends" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); }
|
||||
"function" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.GET, yytext()); }
|
||||
"implements" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); }
|
||||
"interface" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NAMESPACE, yytext()); }
|
||||
"package" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.SET, yytext()); }
|
||||
"var" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); }
|
||||
"import" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); }
|
||||
"use" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); }
|
||||
"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()); }
|
||||
"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()); }
|
||||
"final" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.FINAL, yytext()); }
|
||||
"native" { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.NATIVE, 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()); }
|
||||
".(" { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.FILTER, yytext()); }
|
||||
".." { return new ParsedSymbol(SymbolGroup.OPERATOR,SymbolType.DESCENDANTS, 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 */
|
||||
\" {
|
||||
@@ -338,13 +338,13 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong((yytext())))); }
|
||||
{DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong((yytext())))); }
|
||||
|
||||
{HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext().substring(2),16))); }
|
||||
{HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext().substring(2), 16))); }
|
||||
|
||||
{OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext(),8))); }
|
||||
{OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext(), 8))); }
|
||||
|
||||
{DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE,SymbolType.DOUBLE,new Double(Double.parseDouble((yytext())))); }
|
||||
{DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, new Double(Double.parseDouble((yytext())))); }
|
||||
|
||||
/* comments */
|
||||
{Comment} { /*ignore*/ }
|
||||
@@ -352,57 +352,57 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
{LineTerminator} { yyline++;}
|
||||
/* whitespace */
|
||||
{WhiteSpace} { /*ignore*/ }
|
||||
{TypeNameSpec} { return new ParsedSymbol(SymbolGroup.TYPENAME,SymbolType.TYPENAME, yytext()); }
|
||||
{TypeNameSpec} { return new ParsedSymbol(SymbolGroup.TYPENAME, SymbolType.TYPENAME, yytext()); }
|
||||
{XmlOpenTagStart} {
|
||||
yybegin(XMLOPENTAG);
|
||||
string.setLength(0);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTTAG_BEGIN, yytext());
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext());
|
||||
}
|
||||
"<{" { return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTVARTAG_BEGIN, yytext()); }
|
||||
"<{" { return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext()); }
|
||||
/* identifiers */
|
||||
{Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER, yytext()); }
|
||||
{Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); }
|
||||
|
||||
}
|
||||
|
||||
<XMLOPENTAG> {
|
||||
{XmlAttribute} {
|
||||
yybegin(XMLOPENTAGATTRIB);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRIBUTENAME, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
"{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRNAMEVAR_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRNAMEVAR_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{XmlOpenTagEnd} {
|
||||
yybegin(XML);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTTAG_END, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_END, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{XmlOpenTagClose} {
|
||||
yybegin(XML);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTFINISHTAG_END, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTFINISHTAG_END, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
{WhiteSpace} { string.append( yytext() ); }
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
{WhiteSpace} { string.append(yytext()); }
|
||||
}
|
||||
|
||||
|
||||
@@ -410,11 +410,11 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
<XMLOPENTAGATTRIB> {
|
||||
\"{XmlDQuoteStringChar}*\" {
|
||||
yybegin(XMLOPENTAG);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRIBUTEVALUE, yytext());
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext());
|
||||
}
|
||||
"{" {
|
||||
yybegin(YYINITIAL);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRVALVAR_BEGIN, yytext());
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,47 +422,47 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
<XMLINSTROPENTAG> {
|
||||
{XmlAttribute} {
|
||||
yybegin(XMLINSTRATTRIB);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRIBUTENAME, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTENAME, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
"{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_INSTRATTRNAMEVAR_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRATTRNAMEVAR_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{XmlInstrEnd} {
|
||||
yybegin(XML);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_INSTR_END, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_END, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
{WhiteSpace} { string.append( yytext() ); }
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
{WhiteSpace} { string.append(yytext()); }
|
||||
}
|
||||
|
||||
<XMLINSTRATTRIB> {
|
||||
\"{XmlDQuoteStringChar}*\" {
|
||||
yybegin(XMLINSTROPENTAG);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRIBUTEVALUE, yytext());
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext());
|
||||
}
|
||||
\"{XmlSQuoteStringChar}*\" {
|
||||
yybegin(XMLINSTROPENTAG);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_ATTRIBUTEVALUE, yytext());
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,10 +473,10 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
yybegin(XML);
|
||||
String ret = string.toString();
|
||||
string.setLength(0);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_CDATA, ret);
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_CDATA, ret);
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
.|\n { string.append( yytext() ); }
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
.|\n { string.append(yytext()); }
|
||||
}
|
||||
|
||||
<XMLCOMMENT> {
|
||||
@@ -485,52 +485,52 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
yybegin(XML);
|
||||
String ret = string.toString();
|
||||
string.setLength(0);
|
||||
return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_COMMENT, ret);
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_COMMENT, ret);
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
.|\n { string.append(yytext());}
|
||||
}
|
||||
|
||||
<XML> {
|
||||
{XmlCDataStart} {
|
||||
String ret=string.toString(); string.setLength(0); string.append(yytext() ); yybegin(XMLCDATA);
|
||||
if(!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT,ret);
|
||||
if(!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT,ret);
|
||||
}
|
||||
{XmlInstrStart} {
|
||||
yybegin(XMLINSTROPENTAG);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_INSTR_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTR_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
"<?{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_INSTRVARTAG_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_INSTRVARTAG_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{XmlCommentStart} {
|
||||
String ret=string.toString(); string.setLength(0); string.append(yytext()); yybegin(XMLCOMMENT);
|
||||
if(!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT,ret);
|
||||
if(!ret.isEmpty()) return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT,ret);
|
||||
}
|
||||
{XmlOpenTagStart} {
|
||||
yybegin(XMLOPENTAG);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTTAG_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTTAG_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{XmlCloseTag} {
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_FINISHTAG, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHTAG, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
@@ -538,56 +538,58 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
"<{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_STARTVARTAG_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_STARTVARTAG_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
"</{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_FINISHVARTAG_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_FINISHVARTAG_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
"{" {
|
||||
yybegin(YYINITIAL);
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_VAR_BEGIN, yytext()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_VAR_BEGIN, yytext()));
|
||||
if(string.length()>0){
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML,SymbolType.XML_TEXT, string.toString()));
|
||||
pushback(new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_TEXT, string.toString()));
|
||||
string.setLength(0);
|
||||
}
|
||||
return lex();
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
.|\n { string.append( yytext() ); }
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
.|\n { string.append(yytext()); }
|
||||
}
|
||||
|
||||
<OIDENTIFIER> {
|
||||
"\u00A7" {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString());
|
||||
}
|
||||
|
||||
{OIdentifierCharacter}+ { string.append( yytext() ); }
|
||||
{OIdentifierCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\§" { string.append( '\u00A7' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\§" { string.append('\u00A7'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
@@ -595,57 +597,60 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
\" {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString());
|
||||
}
|
||||
|
||||
{StringCharacter}+ { string.append( yytext() ); }
|
||||
{StringCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
<CHARLITERAL> {
|
||||
\' {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString());
|
||||
}
|
||||
|
||||
{SingleCharacter}+ { string.append( yytext() ); }
|
||||
{SingleCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+ yytext() +"\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
/* error fallback */
|
||||
.|\n { }
|
||||
<<EOF>> { return new ParsedSymbol(SymbolGroup.EOF,SymbolType.EOF,null); }
|
||||
<<EOF>> { return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); }
|
||||
|
||||
+594
-463
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
public class MethodInfoParser {
|
||||
|
||||
public static boolean parseSlotConst(String text, TraitSlotConst trait, ABC abc) throws MethodInfoParseException {
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new ByteArrayInputStream(text.getBytes()));
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new java.io.InputStreamReader(new ByteArrayInputStream(text.getBytes())));
|
||||
ParsedSymbol symb;
|
||||
int type_index = -1;
|
||||
ValueKind value = new ValueKind(0, 0);
|
||||
@@ -122,7 +122,7 @@ public class MethodInfoParser {
|
||||
}
|
||||
|
||||
public static boolean parseReturnType(String text, MethodInfo update) throws MethodInfoParseException {
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new ByteArrayInputStream(text.getBytes()));
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new java.io.InputStreamReader(new ByteArrayInputStream(text.getBytes())));
|
||||
ParsedSymbol symb;
|
||||
int type = -1;
|
||||
try {
|
||||
@@ -146,7 +146,7 @@ public class MethodInfoParser {
|
||||
}
|
||||
|
||||
public static boolean parseParams(String text, MethodInfo update, ABC abc) throws MethodInfoParseException {
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new ByteArrayInputStream(text.getBytes()));
|
||||
MethodInfoLexer lexer = new MethodInfoLexer(new java.io.InputStreamReader(new ByteArrayInputStream(text.getBytes())));
|
||||
List<String> paramNames = new ArrayList<>();
|
||||
List<Long> paramTypes = new ArrayList<>();
|
||||
List<ValueKind> optionalValues = new ArrayList<>();
|
||||
|
||||
+38
-20
@@ -1,5 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 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.
|
||||
*/
|
||||
/* Method info lexer specification */
|
||||
|
||||
package com.jpexs.decompiler.flash.abc.methodinfo_parser;
|
||||
|
||||
%%
|
||||
@@ -12,7 +27,7 @@ package com.jpexs.decompiler.flash.abc.methodinfo_parser;
|
||||
%line
|
||||
%column
|
||||
%type ParsedSymbol
|
||||
%throws ParseException
|
||||
%throws MethodInfoParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -34,7 +49,7 @@ package com.jpexs.decompiler.flash.abc.methodinfo_parser;
|
||||
}
|
||||
|
||||
public int yyline() {
|
||||
return yyline+1;
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
%}
|
||||
@@ -67,6 +82,7 @@ FLit2 = \. [0-9]+
|
||||
FLit3 = [0-9]+
|
||||
Exponent = [eE] [+-]? [0-9]+
|
||||
|
||||
HexDigit = [0-9a-fA-F]
|
||||
OctDigit = [0-7]
|
||||
|
||||
/* string and character literals */
|
||||
@@ -82,7 +98,7 @@ StringCharacter = [^\r\n\"\\]
|
||||
{Multiname}\" {
|
||||
isMultiname = true;
|
||||
String s = yytext();
|
||||
multinameId = Long.parseLong(s.substring(2,s.length()-2));
|
||||
multinameId = Long.parseLong(s.substring(2, s.length() - 2));
|
||||
yybegin(STRING);
|
||||
string.setLength(0);
|
||||
}
|
||||
@@ -96,8 +112,8 @@ StringCharacter = [^\r\n\"\\]
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{NumberLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER,new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT,new Double(Double.parseDouble((yytext())))); }
|
||||
{NumberLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER, new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT, new Double(Double.parseDouble((yytext())))); }
|
||||
|
||||
":" {return new ParsedSymbol(ParsedSymbol.TYPE_COLON);}
|
||||
"," {return new ParsedSymbol(ParsedSymbol.TYPE_COMMA);}
|
||||
@@ -113,7 +129,7 @@ StringCharacter = [^\r\n\"\\]
|
||||
explicit {return new ParsedSymbol(ParsedSymbol.TYPE_EXPLICIT);}
|
||||
{Namespace} {
|
||||
String s = yytext();
|
||||
long ns = Long.parseLong(s.substring(3, s.length()-2));
|
||||
long ns = Long.parseLong(s.substring(3, s.length() - 2));
|
||||
return new ParsedSymbol(ParsedSymbol.TYPE_NAMESPACE, new Long(ns));
|
||||
}
|
||||
true {return new ParsedSymbol(ParsedSymbol.TYPE_TRUE);}
|
||||
@@ -135,23 +151,25 @@ StringCharacter = [^\r\n\"\\]
|
||||
}
|
||||
}
|
||||
|
||||
{StringCharacter}+ { string.append( yytext() ); }
|
||||
{StringCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* error cases */
|
||||
\\. { throw new ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { throw new ParseException("Unterminated string at end of line", yyline + 1); }
|
||||
\\. { throw new MethodInfoParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { throw new MethodInfoParseException("Unterminated string at end of line", yyline + 1); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
+522
-416
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 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.
|
||||
*/
|
||||
/* Flash assembler language lexer specification */
|
||||
|
||||
package com.jpexs.decompiler.flash.action.parser.pcode;
|
||||
|
||||
import com.jpexs.decompiler.flash.action.parser.ParseException;
|
||||
import com.jpexs.decompiler.flash.action.parser.ActionParseException;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ConstantIndex;
|
||||
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.action.swf4.Undefined;
|
||||
import com.jpexs.decompiler.flash.action.swf4.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
|
||||
%%
|
||||
|
||||
@@ -18,7 +33,7 @@ import com.jpexs.decompiler.flash.action.swf4.Null;
|
||||
%line
|
||||
%column
|
||||
%type ASMParsedSymbol
|
||||
%throws ParseException
|
||||
%throws ActionParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -37,7 +52,7 @@ import com.jpexs.decompiler.flash.action.swf4.Null;
|
||||
}
|
||||
|
||||
public int yyline() {
|
||||
return yyline+1;
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
%}
|
||||
@@ -85,6 +100,7 @@ FLit2 = \. [0-9]+
|
||||
FLit3 = [0-9]+
|
||||
Exponent = [eE] [+-]? [0-9]+
|
||||
|
||||
HexDigit = [0-9a-fA-F]
|
||||
OctDigit = [0-7]
|
||||
|
||||
/* string and character literals */
|
||||
@@ -124,18 +140,18 @@ Constant= constant{PositiveNumberLiteral}
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{NumberLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INTEGER,new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_FLOAT,new Double(Double.parseDouble((yytext())))); }
|
||||
{NumberLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_INTEGER, new Long(Long.parseLong((yytext())))); }
|
||||
{FloatLiteral} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_FLOAT, new Double(Double.parseDouble((yytext())))); }
|
||||
{LineTerminator} {yybegin(YYINITIAL); return new ASMParsedSymbol(ASMParsedSymbol.TYPE_EOL); }
|
||||
{Comment} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_COMMENT, yytext().substring(1));}
|
||||
{StartOfBlock} { yybegin(YYINITIAL); return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BLOCK_START); }
|
||||
{True} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BOOLEAN,Boolean.TRUE);}
|
||||
{False} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_BOOLEAN,Boolean.FALSE);}
|
||||
{Null} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_NULL,new Null());}
|
||||
{Undefined} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_UNDEFINED,new Undefined());}
|
||||
{Null} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_NULL, new Null());}
|
||||
{Undefined} {return new ASMParsedSymbol(ASMParsedSymbol.TYPE_UNDEFINED, new Undefined());}
|
||||
|
||||
{Register} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_REGISTER,new RegisterNumber(Integer.parseInt(yytext().substring(8)))); }
|
||||
{Constant} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_CONSTANT,new ConstantIndex(Integer.parseInt(yytext().substring(8)))); }
|
||||
{Register} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_REGISTER, new RegisterNumber(Integer.parseInt(yytext().substring(8)))); }
|
||||
{Constant} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_CONSTANT, new ConstantIndex(Integer.parseInt(yytext().substring(8)))); }
|
||||
|
||||
{Identifier} { return new ASMParsedSymbol(ASMParsedSymbol.TYPE_IDENTIFIER, yytext()); }
|
||||
|
||||
@@ -148,23 +164,25 @@ Constant= constant{PositiveNumberLiteral}
|
||||
return new ASMParsedSymbol(ASMParsedSymbol.TYPE_STRING, string.toString());
|
||||
}
|
||||
|
||||
{StringCharacter}+ { string.append( yytext() ); }
|
||||
{StringCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* error cases */
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"", yyline + 1); }
|
||||
{LineTerminator} { throw new ParseException("Unterminated string at end of line", yyline + 1); }
|
||||
\\. { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { throw new ActionParseException("Unterminated string at end of line", yyline + 1); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1308
-1258
File diff suppressed because it is too large
Load Diff
+216
-214
@@ -15,7 +15,7 @@
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.parser.script;
|
||||
import com.jpexs.decompiler.flash.action.parser.ParseException;
|
||||
import com.jpexs.decompiler.flash.action.parser.ActionParseException;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +28,7 @@ import java.util.ArrayList;
|
||||
%unicode
|
||||
%char
|
||||
%type ParsedSymbol
|
||||
%throws ParseException
|
||||
%throws ActionParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -73,7 +73,7 @@ import java.util.ArrayList;
|
||||
informListenersPushBack(symb);
|
||||
}
|
||||
ParsedSymbol last;
|
||||
public ParsedSymbol lex() throws java.io.IOException, ParseException{
|
||||
public ParsedSymbol lex() throws java.io.IOException, ActionParseException{
|
||||
ParsedSymbol ret = null;
|
||||
if(!pushedBack.isEmpty()){
|
||||
ret = last = pushedBack.pop();
|
||||
@@ -142,162 +142,162 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
<YYINITIAL> {
|
||||
|
||||
/* keywords */
|
||||
"break" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.BREAK, yytext()); }
|
||||
"case" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CASE, yytext()); }
|
||||
"continue" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONTINUE, yytext()); }
|
||||
"default" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DEFAULT, yytext()); }
|
||||
"do" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DO, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE, yytext()); }
|
||||
"else" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE, yytext()); }
|
||||
"for" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR, yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EACH, yytext()); }
|
||||
"in" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN, yytext()); }
|
||||
"if" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF, yytext()); }
|
||||
"return" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN, yytext()); }
|
||||
"super" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SUPER, yytext()); }
|
||||
"switch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SWITCH, yytext()); }
|
||||
"throw" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.THROW, yytext()); }
|
||||
"try" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.TRY, yytext()); }
|
||||
"catch" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CATCH, yytext()); }
|
||||
"finally" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE, yytext()); }
|
||||
"with" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH, yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DYNAMIC, yytext()); }
|
||||
"internal" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL, yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.OVERRIDE, yytext()); }
|
||||
"private" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE, yytext()); }
|
||||
"protected" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED, yytext()); }
|
||||
"public" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC, yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.STATIC, yytext()); }
|
||||
"class" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS, yytext()); }
|
||||
"const" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST, yytext()); }
|
||||
"extends" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS, yytext()); }
|
||||
"function" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION, yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.GET, yytext()); }
|
||||
"implements" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS, yytext()); }
|
||||
"interface" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE, yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.NAMESPACE, yytext()); }
|
||||
"package" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE, yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SET, yytext()); }
|
||||
"var" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR, yytext()); }
|
||||
"import" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT, yytext()); }
|
||||
"use" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE, yytext()); }
|
||||
"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()); }
|
||||
"getUrl" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.GETURL, yytext()); }
|
||||
"trace" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.TRACE, yytext()); }
|
||||
"gotoAndStop" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.GOTOANDSTOP, yytext()); }
|
||||
"nextFrame" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.NEXTFRAME, yytext()); }
|
||||
"play" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PLAY, yytext()); }
|
||||
"prevFrame" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PREVFRAME, yytext()); }
|
||||
"tellTarget" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.TELLTARGET, yytext()); }
|
||||
"stop" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.STOP, yytext()); }
|
||||
"stopAllSounds" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.STOPALLSOUNDS, yytext()); }
|
||||
"toggleHighQuality" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.TOGGLEHIGHQUALITY, yytext()); }
|
||||
"ifFrameLoaded" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IFFRAMELOADED, yytext()); }
|
||||
"ord" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.ORD, yytext()); }
|
||||
"chr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.CHR, yytext()); }
|
||||
"duplicateMovieClip" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.DUPLICATEMOVIECLIP, yytext()); }
|
||||
"stopDrag" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.STOPDRAG, yytext()); }
|
||||
"getTimer" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.GETTIMER, yytext()); }
|
||||
"loadVariables" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.LOADVARIABLES, yytext()); }
|
||||
"loadMovie" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.LOADMOVIE, yytext()); }
|
||||
"gotoAndPlay" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.GOTOANDPLAY, yytext()); }
|
||||
"mbord" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.MBORD, yytext()); }
|
||||
"mbchr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.MBCHR, yytext()); }
|
||||
"mblength" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.MBLENGTH, yytext()); }
|
||||
"mbsubstring" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.MBSUBSTRING, yytext()); }
|
||||
"random" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.RANDOM, yytext()); }
|
||||
"removeMovieClip" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.REMOVEMOVIECLIP, yytext()); }
|
||||
"startDrag" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.STARTDRAG, yytext()); }
|
||||
"substr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.SUBSTR, yytext()); }
|
||||
"length" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.LENGTH, yytext()); }
|
||||
"int" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.INT, yytext()); }
|
||||
"targetPath" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.TARGETPATH, yytext()); }
|
||||
"Number" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.NUMBER_OP, yytext()); }
|
||||
"String" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.STRING_OP, yytext()); }
|
||||
"eval" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.EVAL, yytext()); }
|
||||
"undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED, yytext()); }
|
||||
"newline" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NEWLINE, yytext()); }
|
||||
"Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY, yytext()); }
|
||||
"NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN, yytext()); }
|
||||
"getVersion" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.GETVERSION, yytext()); }
|
||||
"call" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.CALL, yytext()); }
|
||||
"loadMovieNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.LOADMOVIENUM, yytext()); }
|
||||
"loadVariablesNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.LOADVARIABLESNUM, yytext()); }
|
||||
"printAsBitmapNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PRINTASBITMAPNUM, yytext()); }
|
||||
"printNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PRINTNUM, yytext()); }
|
||||
"printAsBitmap" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PRINTASBITMAP, yytext()); }
|
||||
"print" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC,SymbolType.PRINT, yytext()); }
|
||||
"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()); }
|
||||
"break" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.BREAK, yytext()); }
|
||||
"case" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CASE, yytext()); }
|
||||
"continue" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONTINUE, yytext()); }
|
||||
"default" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DEFAULT, yytext()); }
|
||||
"do" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DO, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); }
|
||||
"else" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.ELSE, yytext()); }
|
||||
"for" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FOR, yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EACH, yytext()); }
|
||||
"in" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IN, yytext()); }
|
||||
"if" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IF, yytext()); }
|
||||
"return" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.RETURN, yytext()); }
|
||||
"super" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SUPER, yytext()); }
|
||||
"switch" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SWITCH, yytext()); }
|
||||
"throw" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.THROW, yytext()); }
|
||||
"try" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.TRY, yytext()); }
|
||||
"catch" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CATCH, yytext()); }
|
||||
"finally" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FINALLY, yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WHILE, yytext()); }
|
||||
"with" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.WITH, yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.DYNAMIC, yytext()); }
|
||||
"internal" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERNAL, yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.OVERRIDE, yytext()); }
|
||||
"private" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PRIVATE, yytext()); }
|
||||
"protected" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PROTECTED, yytext()); }
|
||||
"public" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PUBLIC, yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.STATIC, yytext()); }
|
||||
"class" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CLASS, yytext()); }
|
||||
"const" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.CONST, yytext()); }
|
||||
"extends" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.EXTENDS, yytext()); }
|
||||
"function" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.FUNCTION, yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.GET, yytext()); }
|
||||
"implements" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPLEMENTS, yytext()); }
|
||||
"interface" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.INTERFACE, yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.NAMESPACE, yytext()); }
|
||||
"package" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.PACKAGE, yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.SET, yytext()); }
|
||||
"var" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.VAR, yytext()); }
|
||||
"import" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IMPORT, yytext()); }
|
||||
"use" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.USE, yytext()); }
|
||||
"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()); }
|
||||
"getUrl" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETURL, yytext()); }
|
||||
"trace" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TRACE, yytext()); }
|
||||
"gotoAndStop" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDSTOP, yytext()); }
|
||||
"nextFrame" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NEXTFRAME, yytext()); }
|
||||
"play" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PLAY, yytext()); }
|
||||
"prevFrame" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PREVFRAME, yytext()); }
|
||||
"tellTarget" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TELLTARGET, yytext()); }
|
||||
"stop" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOP, yytext()); }
|
||||
"stopAllSounds" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPALLSOUNDS, yytext()); }
|
||||
"toggleHighQuality" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TOGGLEHIGHQUALITY, yytext()); }
|
||||
"ifFrameLoaded" { return new ParsedSymbol(SymbolGroup.KEYWORD, SymbolType.IFFRAMELOADED, yytext()); }
|
||||
"ord" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.ORD, yytext()); }
|
||||
"chr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CHR, yytext()); }
|
||||
"duplicateMovieClip" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.DUPLICATEMOVIECLIP, yytext()); }
|
||||
"stopDrag" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STOPDRAG, yytext()); }
|
||||
"getTimer" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETTIMER, yytext()); }
|
||||
"loadVariables" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLES, yytext()); }
|
||||
"loadMovie" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIE, yytext()); }
|
||||
"gotoAndPlay" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GOTOANDPLAY, yytext()); }
|
||||
"mbord" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBORD, yytext()); }
|
||||
"mbchr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBCHR, yytext()); }
|
||||
"mblength" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBLENGTH, yytext()); }
|
||||
"mbsubstring" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.MBSUBSTRING, yytext()); }
|
||||
"random" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.RANDOM, yytext()); }
|
||||
"removeMovieClip" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.REMOVEMOVIECLIP, yytext()); }
|
||||
"startDrag" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STARTDRAG, yytext()); }
|
||||
"substr" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.SUBSTR, yytext()); }
|
||||
"length" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LENGTH, yytext()); }
|
||||
"int" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.INT, yytext()); }
|
||||
"targetPath" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.TARGETPATH, yytext()); }
|
||||
"Number" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.NUMBER_OP, yytext()); }
|
||||
"String" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.STRING_OP, yytext()); }
|
||||
"eval" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.EVAL, yytext()); }
|
||||
"undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.UNDEFINED, yytext()); }
|
||||
"newline" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NEWLINE, yytext()); }
|
||||
"Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.INFINITY, yytext()); }
|
||||
"NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST, SymbolType.NAN, yytext()); }
|
||||
"getVersion" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.GETVERSION, yytext()); }
|
||||
"call" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.CALL, yytext()); }
|
||||
"loadMovieNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADMOVIENUM, yytext()); }
|
||||
"loadVariablesNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.LOADVARIABLESNUM, yytext()); }
|
||||
"printAsBitmapNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAPNUM, yytext()); }
|
||||
"printNum" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTNUM, yytext()); }
|
||||
"printAsBitmap" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINTASBITMAP, yytext()); }
|
||||
"print" { return new ParsedSymbol(SymbolGroup.GLOBALFUNC, SymbolType.PRINT, yytext()); }
|
||||
"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 */
|
||||
\" {
|
||||
@@ -318,13 +318,13 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
/* numeric literals */
|
||||
|
||||
{DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong((yytext())))); }
|
||||
{DecIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong((yytext())))); }
|
||||
|
||||
{HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext().substring(2),16))); }
|
||||
{HexIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext().substring(2), 16))); }
|
||||
|
||||
{OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER,SymbolType.INTEGER,new Long(Long.parseLong(yytext(),8))); }
|
||||
{OctIntegerLiteral} { return new ParsedSymbol(SymbolGroup.INTEGER, SymbolType.INTEGER, new Long(Long.parseLong(yytext(), 8))); }
|
||||
|
||||
{DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE,SymbolType.DOUBLE,new Double(Double.parseDouble((yytext())))); }
|
||||
{DoubleLiteral} { return new ParsedSymbol(SymbolGroup.DOUBLE, SymbolType.DOUBLE, new Double(Double.parseDouble((yytext())))); }
|
||||
|
||||
/* comments */
|
||||
{Comment} { /*ignore*/ }
|
||||
@@ -332,62 +332,64 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
{LineTerminator} { yyline++;}
|
||||
/* whitespace */
|
||||
{WhiteSpace} { /*ignore*/ }
|
||||
{TypeNameSpec} { String t=yytext(); return new ParsedSymbol(SymbolGroup.TYPENAME,SymbolType.TYPENAME,t.substring(2,t.length()-1)); }
|
||||
{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();
|
||||
s=s.substring(1,s.length()-1);
|
||||
if(s.contains(" ")){
|
||||
s=s.substring(0,s.indexOf(" "));
|
||||
String s = yytext();
|
||||
s = s.substring(1, s.length() - 1);
|
||||
if (s.contains(" ")){
|
||||
s = s.substring(0, s.indexOf(" "));
|
||||
}
|
||||
xmlTagName = s;
|
||||
string.append(yytext());
|
||||
}
|
||||
/* identifiers */
|
||||
{Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER, yytext()); }
|
||||
{Identifier} { return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, yytext()); }
|
||||
}
|
||||
|
||||
<XMLSTARTTAG> {
|
||||
{XMLAttribute} { string.append( yytext() );}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
{WhiteSpace} { string.append( yytext() ); }
|
||||
">" { yybegin(XML); string.append( yytext() );}
|
||||
{XMLAttribute} { string.append(yytext());}
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
{WhiteSpace} { string.append(yytext()); }
|
||||
">" { yybegin(XML); string.append(yytext());}
|
||||
}
|
||||
<XML> {
|
||||
{XMLBeginOneTag} { string.append( yytext() );}
|
||||
{XMLEndTag} { string.append( yytext() );
|
||||
String endtagname=yytext();
|
||||
endtagname=endtagname.substring(2,endtagname.length()-1);
|
||||
if(endtagname.equals(xmlTagName)){
|
||||
{XMLBeginOneTag} { string.append(yytext());}
|
||||
{XMLEndTag} { 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());
|
||||
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML, string.toString());
|
||||
}
|
||||
}
|
||||
{LineTerminator} { string.append( yytext() ); yyline++;}
|
||||
.|\n { string.append( yytext() ); }
|
||||
{LineTerminator} { string.append(yytext()); yyline++;}
|
||||
.|\n { string.append(yytext()); }
|
||||
}
|
||||
|
||||
<OIDENTIFIER> {
|
||||
"\u00A7" {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.IDENTIFIER,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.IDENTIFIER, SymbolType.IDENTIFIER, string.toString());
|
||||
}
|
||||
|
||||
{OIdentifierCharacter}+ { string.append( yytext() ); }
|
||||
{OIdentifierCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\\u00A7" { string.append( '\u00A7' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\\u00A7" { string.append('\u00A7'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
@@ -395,26 +397,26 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
\" {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString());
|
||||
}
|
||||
|
||||
{StringCharacter}+ { string.append( yytext() ); }
|
||||
{StringCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
@@ -422,30 +424,30 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
\' {
|
||||
yybegin(YYINITIAL);
|
||||
// length also includes the trailing quote
|
||||
return new ParsedSymbol(SymbolGroup.STRING,SymbolType.STRING,string.toString());
|
||||
return new ParsedSymbol(SymbolGroup.STRING, SymbolType.STRING, string.toString());
|
||||
}
|
||||
|
||||
{SingleCharacter}+ { string.append( yytext() ); }
|
||||
{SingleCharacter}+ { string.append(yytext()); }
|
||||
|
||||
/* escape sequences */
|
||||
/* escape sequences */
|
||||
"\\b" { string.append( '\b' ); }
|
||||
"\\t" { string.append( '\t' ); }
|
||||
"\\n" { string.append( '\n' ); }
|
||||
"\\f" { string.append( '\f' ); }
|
||||
"\\r" { string.append( '\r' ); }
|
||||
"\\\"" { string.append( '\"' ); }
|
||||
"\\'" { string.append( '\'' ); }
|
||||
"\\\\" { string.append( '\\' ); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8);
|
||||
string.append( val ); }
|
||||
"\\b" { string.append('\b'); }
|
||||
"\\t" { string.append('\t'); }
|
||||
"\\n" { string.append('\n'); }
|
||||
"\\f" { string.append('\f'); }
|
||||
"\\r" { string.append('\r'); }
|
||||
"\\\"" { string.append('\"'); }
|
||||
"\\'" { string.append('\''); }
|
||||
"\\\\" { string.append('\\'); }
|
||||
\\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1), 8);
|
||||
string.append(val); }
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new ActionParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
/* error fallback */
|
||||
.|\n { }
|
||||
<<EOF>> { return new ParsedSymbol(SymbolGroup.EOF,SymbolType.EOF,null); }
|
||||
<<EOF>> { return new ParsedSymbol(SymbolGroup.EOF, SymbolType.EOF, null); }
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* The following code was generated by JFlex 1.6.0 */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS, All rights reserved.
|
||||
*
|
||||
@@ -18,9 +20,8 @@ package com.jpexs.decompiler.flash.tags.text;
|
||||
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3 on 2014.08.16. 13:36 from the
|
||||
* specification file
|
||||
* <tt>text.flex</tt>
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0 from the specification file
|
||||
* <tt>C:/Projects/FFDec/jpexs-decompiler/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/text/text.flex</tt>
|
||||
*/
|
||||
public final class TextLexer {
|
||||
|
||||
@@ -38,8 +39,8 @@ public final class TextLexer {
|
||||
* lexical states
|
||||
*/
|
||||
public static final int YYINITIAL = 0;
|
||||
public static final int VALUE = 4;
|
||||
public static final int PARAMETER = 2;
|
||||
public static final int VALUE = 4;
|
||||
|
||||
/**
|
||||
* ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
|
||||
@@ -54,10 +55,11 @@ public final class TextLexer {
|
||||
* Translates characters to character classes
|
||||
*/
|
||||
private static final String ZZ_CMAP_PACKED
|
||||
= "\12\0\1\15\2\0\1\3\22\0\1\3\1\0\1\13\4\0\1\14"
|
||||
+ "\10\0\12\1\41\0\1\4\1\5\1\2\1\0\1\1\1\0\1\1"
|
||||
+ "\1\6\3\1\1\11\7\1\1\10\3\1\1\12\1\1\1\7\6\1"
|
||||
+ "\uff85\0";
|
||||
= "\12\0\1\20\1\22\1\22\1\21\22\0\1\3\1\0\1\15\4\0"
|
||||
+ "\1\16\10\0\12\5\7\0\6\4\24\0\1\6\1\7\1\2\1\0"
|
||||
+ "\1\1\1\0\1\5\1\10\3\5\1\13\7\1\1\12\3\1\1\14"
|
||||
+ "\1\1\1\11\3\1\1\17\2\1\12\0\1\22\u1fa2\0\1\22\1\22"
|
||||
+ "\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
|
||||
|
||||
/**
|
||||
* Translates characters to character classes
|
||||
@@ -72,10 +74,10 @@ public final class TextLexer {
|
||||
private static final String ZZ_ACTION_PACKED_0
|
||||
= "\3\0\1\1\1\2\1\1\1\3\1\4\1\5\1\3"
|
||||
+ "\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\16\1\17\1\20\1\21\1\7\1\0\1\22";
|
||||
|
||||
private static int[] zzUnpackAction() {
|
||||
int[] result = new int[22];
|
||||
int[] result = new int[25];
|
||||
int offset = 0;
|
||||
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -103,12 +105,13 @@ public final class TextLexer {
|
||||
private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
|
||||
|
||||
private static final String ZZ_ROWMAP_PACKED_0
|
||||
= "\0\0\0\16\0\34\0\52\0\52\0\70\0\52\0\106"
|
||||
+ "\0\52\0\124\0\142\0\52\0\52\0\52\0\52\0\52"
|
||||
+ "\0\52\0\52\0\52\0\52\0\52\0\52";
|
||||
= "\0\0\0\23\0\46\0\71\0\71\0\114\0\71\0\137"
|
||||
+ "\0\71\0\162\0\205\0\71\0\71\0\71\0\71\0\71"
|
||||
+ "\0\71\0\71\0\71\0\71\0\71\0\71\0\230\0\253"
|
||||
+ "\0\71";
|
||||
|
||||
private static int[] zzUnpackRowMap() {
|
||||
int[] result = new int[22];
|
||||
int[] result = new int[25];
|
||||
int offset = 0;
|
||||
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -133,15 +136,18 @@ public final class TextLexer {
|
||||
private static final int[] ZZ_TRANS = zzUnpackTrans();
|
||||
|
||||
private static final String ZZ_TRANS_PACKED_0
|
||||
= "\4\4\1\5\1\6\7\4\2\7\1\10\1\11\1\12"
|
||||
+ "\2\7\5\10\2\7\1\12\2\13\1\11\1\12\11\13"
|
||||
+ "\1\12\16\0\2\14\1\15\1\14\1\16\1\17\1\20"
|
||||
+ "\1\21\1\22\1\23\1\24\1\25\1\26\2\0\1\10"
|
||||
+ "\4\0\5\10\6\0\1\12\11\0\1\12\2\13\2\0"
|
||||
+ "\11\13\1\0";
|
||||
= "\6\4\1\5\1\6\10\4\1\7\2\0\1\7\1\10"
|
||||
+ "\1\11\1\12\1\7\1\10\2\7\5\10\2\7\1\10"
|
||||
+ "\2\12\1\0\2\13\1\11\1\12\14\13\2\12\1\13"
|
||||
+ "\23\0\2\14\1\15\3\14\1\16\1\17\1\20\1\21"
|
||||
+ "\1\22\1\23\1\24\1\25\1\26\1\27\4\0\1\10"
|
||||
+ "\3\0\1\10\2\0\5\10\2\0\1\10\6\0\1\12"
|
||||
+ "\14\0\2\12\1\0\2\13\2\0\14\13\2\0\1\13"
|
||||
+ "\4\0\2\30\2\0\1\30\2\0\1\30\13\0\2\31"
|
||||
+ "\2\0\1\31\2\0\1\31\7\0";
|
||||
|
||||
private static int[] zzUnpackTrans() {
|
||||
int[] result = new int[112];
|
||||
int[] result = new int[190];
|
||||
int offset = 0;
|
||||
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -183,10 +189,11 @@ public final class TextLexer {
|
||||
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
|
||||
|
||||
private static final String ZZ_ATTRIBUTE_PACKED_0
|
||||
= "\3\0\2\11\1\1\1\11\1\1\1\11\2\1\13\11";
|
||||
= "\3\0\2\11\1\1\1\11\1\1\1\11\2\1\13\11"
|
||||
+ "\1\1\1\0\1\11";
|
||||
|
||||
private static int[] zzUnpackAttribute() {
|
||||
int[] result = new int[22];
|
||||
int[] result = new int[25];
|
||||
int offset = 0;
|
||||
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -281,6 +288,14 @@ public final class TextLexer {
|
||||
*/
|
||||
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 = null;
|
||||
boolean finish = false;
|
||||
@@ -303,8 +318,7 @@ public final class TextLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new scanner There is also a java.io.InputStream version of this
|
||||
* constructor.
|
||||
* Creates a new scanner
|
||||
*
|
||||
* @param in the java.io.Reader to read input from.
|
||||
*/
|
||||
@@ -312,16 +326,6 @@ public final class TextLexer {
|
||||
this.zzReader = in;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new scanner. There is also java.io.Reader version of this
|
||||
* constructor.
|
||||
*
|
||||
* @param in the java.io.Inputstream to read input from.
|
||||
*/
|
||||
public TextLexer(java.io.InputStream in) {
|
||||
this(new java.io.InputStreamReader(in));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpacks the compressed character translation table.
|
||||
*
|
||||
@@ -329,12 +333,12 @@ public final class TextLexer {
|
||||
* @return the unpacked character translation table
|
||||
*/
|
||||
private static char[] zzUnpackCMap(String packed) {
|
||||
char[] map = new char[0x10000];
|
||||
char[] map = new char[0x110000];
|
||||
int i = 0; /* index in packed string */
|
||||
|
||||
int j = 0; /* index in unpacked array */
|
||||
|
||||
while (i < 62) {
|
||||
while (i < 114) {
|
||||
int count = packed.charAt(i++);
|
||||
char value = packed.charAt(i++);
|
||||
do {
|
||||
@@ -355,6 +359,8 @@ public final class TextLexer {
|
||||
|
||||
/* first: make room (if you can) */
|
||||
if (zzStartRead > 0) {
|
||||
zzEndRead += zzFinalHighSurrogate;
|
||||
zzFinalHighSurrogate = 0;
|
||||
System.arraycopy(zzBuffer, zzStartRead,
|
||||
zzBuffer, 0,
|
||||
zzEndRead - zzStartRead);
|
||||
@@ -367,40 +373,44 @@ public final class TextLexer {
|
||||
}
|
||||
|
||||
/* is the buffer big enough? */
|
||||
if (zzCurrentPos >= zzBuffer.length) {
|
||||
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
|
||||
/* if not: blow it up */
|
||||
char newBuffer[] = new char[zzCurrentPos * 2];
|
||||
char newBuffer[] = new char[zzBuffer.length * 2];
|
||||
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
|
||||
zzBuffer = newBuffer;
|
||||
zzEndRead += zzFinalHighSurrogate;
|
||||
zzFinalHighSurrogate = 0;
|
||||
}
|
||||
|
||||
/* finally: fill the buffer with new input */
|
||||
int numRead = zzReader.read(zzBuffer, zzEndRead,
|
||||
zzBuffer.length - zzEndRead);
|
||||
/* 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 (numRead > 0) {
|
||||
zzEndRead += numRead;
|
||||
if (totalRead > 0) {
|
||||
zzEndRead += totalRead;
|
||||
if (totalRead == requested) { /* possibly more input available */
|
||||
|
||||
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
|
||||
--zzEndRead;
|
||||
zzFinalHighSurrogate = 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// unlikely but not impossible: read 0 characters, but not at end of stream
|
||||
if (numRead == 0) {
|
||||
int c = zzReader.read();
|
||||
if (c == -1) {
|
||||
return true;
|
||||
} else {
|
||||
zzBuffer[zzEndRead++] = (char) c;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// numRead < 0
|
||||
// totalRead = 0: End of stream
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the input stream.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public final void yyclose() throws java.io.IOException {
|
||||
zzAtEOF = true; /* indicate end of file */
|
||||
@@ -420,6 +430,9 @@ public final class TextLexer {
|
||||
* <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.
|
||||
*
|
||||
* @param reader the new input stream
|
||||
*/
|
||||
public final void yyreset(java.io.Reader reader) {
|
||||
@@ -429,14 +442,16 @@ public final class TextLexer {
|
||||
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.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yystate() {
|
||||
return zzLexicalState;
|
||||
@@ -453,8 +468,6 @@ public final class TextLexer {
|
||||
|
||||
/**
|
||||
* Returns the text matched by the current regular expression.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final String yytext() {
|
||||
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
|
||||
@@ -476,8 +489,6 @@ public final class TextLexer {
|
||||
|
||||
/**
|
||||
* Returns the length of the matched text region.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yylength() {
|
||||
return zzMarkedPos - zzStartRead;
|
||||
@@ -529,7 +540,6 @@ public final class TextLexer {
|
||||
*
|
||||
* @return the next token
|
||||
* @exception java.io.IOException if any I/O-Error occurs
|
||||
* @throws com.jpexs.decompiler.flash.tags.text.TextParseException
|
||||
*/
|
||||
public ParsedSymbol yylex() throws java.io.IOException, TextParseException {
|
||||
int zzInput;
|
||||
@@ -552,9 +562,14 @@ public final class TextLexer {
|
||||
yychar += zzMarkedPosL - zzStartRead;
|
||||
|
||||
boolean zzR = false;
|
||||
for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
|
||||
zzCurrentPosL++) {
|
||||
switch (zzBufferL[zzCurrentPosL]) {
|
||||
int zzCh;
|
||||
int zzCharCount;
|
||||
for (zzCurrentPosL = zzStartRead;
|
||||
zzCurrentPosL < zzMarkedPosL;
|
||||
zzCurrentPosL += zzCharCount) {
|
||||
zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL);
|
||||
zzCharCount = Character.charCount(zzCh);
|
||||
switch (zzCh) {
|
||||
case '\u000B':
|
||||
case '\u000C':
|
||||
case '\u0085':
|
||||
@@ -579,7 +594,7 @@ public final class TextLexer {
|
||||
break;
|
||||
default:
|
||||
zzR = false;
|
||||
yycolumn++;
|
||||
yycolumn += zzCharCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,12 +626,19 @@ public final class TextLexer {
|
||||
|
||||
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 = zzBufferL[zzCurrentPosL++];
|
||||
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
|
||||
zzCurrentPosL += Character.charCount(zzInput);
|
||||
} else if (zzAtEOF) {
|
||||
zzInput = YYEOF;
|
||||
break zzForAction;
|
||||
@@ -634,7 +656,8 @@ public final class TextLexer {
|
||||
zzInput = YYEOF;
|
||||
break zzForAction;
|
||||
} else {
|
||||
zzInput = zzBufferL[zzCurrentPosL++];
|
||||
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
|
||||
zzCurrentPosL += Character.charCount(zzInput);
|
||||
}
|
||||
}
|
||||
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
|
||||
@@ -643,7 +666,7 @@ public final class TextLexer {
|
||||
}
|
||||
zzState = zzNext;
|
||||
|
||||
int zzAttributes = zzAttrL[zzState];
|
||||
zzAttributes = zzAttrL[zzState];
|
||||
if ((zzAttributes & 1) == 1) {
|
||||
zzAction = zzState;
|
||||
zzMarkedPosL = zzCurrentPosL;
|
||||
@@ -665,57 +688,42 @@ public final class TextLexer {
|
||||
}
|
||||
string.append(yytext());
|
||||
}
|
||||
case 18:
|
||||
break;
|
||||
case 7: {
|
||||
throw new TextParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1);
|
||||
}
|
||||
case 19:
|
||||
break;
|
||||
case 13: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\n');
|
||||
}
|
||||
case 20:
|
||||
break;
|
||||
case 2: {
|
||||
yybegin(PARAMETER);
|
||||
if (string != null) {
|
||||
String ret = string.toString();
|
||||
string = null;
|
||||
return new ParsedSymbol(SymbolType.TEXT, ret);
|
||||
return new ParsedSymbol(SymbolType.TEXT, ret.toString());
|
||||
}
|
||||
}
|
||||
case 20:
|
||||
break;
|
||||
case 3: {
|
||||
}
|
||||
case 21:
|
||||
break;
|
||||
case 11: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\b');
|
||||
}
|
||||
case 22:
|
||||
break;
|
||||
case 17: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\'');
|
||||
}
|
||||
case 23:
|
||||
break;
|
||||
case 4: {
|
||||
parameterName = yytext();
|
||||
yybegin(VALUE);
|
||||
}
|
||||
case 24:
|
||||
case 22:
|
||||
break;
|
||||
case 5: {
|
||||
yybegin(YYINITIAL);
|
||||
}
|
||||
case 23:
|
||||
break;
|
||||
case 6: {
|
||||
yybegin(PARAMETER);
|
||||
return new ParsedSymbol(SymbolType.PARAMETER, new Object[]{parameterName, yytext()});
|
||||
}
|
||||
case 24:
|
||||
break;
|
||||
case 7: {
|
||||
throw new TextParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1);
|
||||
}
|
||||
case 25:
|
||||
break;
|
||||
case 8: {
|
||||
@@ -726,21 +734,13 @@ public final class TextLexer {
|
||||
}
|
||||
case 26:
|
||||
break;
|
||||
case 12: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\t');
|
||||
}
|
||||
case 27:
|
||||
break;
|
||||
case 9: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('[');
|
||||
}
|
||||
case 28:
|
||||
case 27:
|
||||
break;
|
||||
case 10: {
|
||||
if (string == null) {
|
||||
@@ -748,21 +748,29 @@ public final class TextLexer {
|
||||
}
|
||||
string.append('\\');
|
||||
}
|
||||
case 29:
|
||||
case 28:
|
||||
break;
|
||||
case 16: {
|
||||
case 11: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\"');
|
||||
string.append('\b');
|
||||
}
|
||||
case 29:
|
||||
break;
|
||||
case 12: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\t');
|
||||
}
|
||||
case 30:
|
||||
break;
|
||||
case 15: {
|
||||
case 13: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\r');
|
||||
string.append('\n');
|
||||
}
|
||||
case 31:
|
||||
break;
|
||||
@@ -774,15 +782,36 @@ public final class TextLexer {
|
||||
}
|
||||
case 32:
|
||||
break;
|
||||
case 5: {
|
||||
yybegin(YYINITIAL);
|
||||
case 15: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\r');
|
||||
}
|
||||
case 33:
|
||||
break;
|
||||
case 3: {
|
||||
case 16: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\"');
|
||||
}
|
||||
case 34:
|
||||
break;
|
||||
case 17: {
|
||||
if (string == null) {
|
||||
string = new StringBuffer();
|
||||
}
|
||||
string.append('\'');
|
||||
}
|
||||
case 35:
|
||||
break;
|
||||
case 18: {
|
||||
char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val);
|
||||
}
|
||||
case 36:
|
||||
break;
|
||||
default:
|
||||
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
|
||||
zzAtEOF = true;
|
||||
@@ -795,7 +824,7 @@ public final class TextLexer {
|
||||
return new ParsedSymbol(SymbolType.TEXT, string == null ? null : string.toString());
|
||||
}
|
||||
}
|
||||
case 23:
|
||||
case 26:
|
||||
break;
|
||||
default: {
|
||||
return null;
|
||||
|
||||
@@ -27,7 +27,7 @@ package com.jpexs.decompiler.flash.tags.text;
|
||||
%line
|
||||
%column
|
||||
%type ParsedSymbol
|
||||
%throws ParseException
|
||||
%throws TextParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -49,7 +49,7 @@ package com.jpexs.decompiler.flash.tags.text;
|
||||
}
|
||||
|
||||
public int yyline() {
|
||||
return yyline+1;
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
%}
|
||||
@@ -57,6 +57,7 @@ package com.jpexs.decompiler.flash.tags.text;
|
||||
Parameter = [a-z0-9_]+
|
||||
Value = [^ \r\n\]]+
|
||||
Divider = [ \r\n]+
|
||||
HexDigit = [0-9a-fA-F]
|
||||
|
||||
%state PARAMETER,VALUE
|
||||
|
||||
@@ -72,20 +73,22 @@ Divider = [ \r\n]+
|
||||
}
|
||||
}
|
||||
/* escape sequences */
|
||||
"\\[" { if (string == null) string = new StringBuffer(); string.append( '[' ); }
|
||||
"\\]" { if (string == null) string = new StringBuffer(); string.append( ']' ); }
|
||||
"\\b" { if (string == null) string = new StringBuffer(); string.append( '\b' ); }
|
||||
"\\t" { if (string == null) string = new StringBuffer(); string.append( '\t' ); }
|
||||
"\\n" { if (string == null) string = new StringBuffer(); string.append( '\n' ); }
|
||||
"\\f" { if (string == null) string = new StringBuffer(); string.append( '\f' ); }
|
||||
"\\r" { if (string == null) string = new StringBuffer(); string.append( '\r' ); }
|
||||
"\\\"" { if (string == null) string = new StringBuffer(); string.append( '\"' ); }
|
||||
"\\'" { if (string == null) string = new StringBuffer(); string.append( '\'' ); }
|
||||
"\\\\" { if (string == null) string = new StringBuffer(); string.append( '\\' ); }
|
||||
"\\[" { if (string == null) string = new StringBuffer(); string.append('['); }
|
||||
"\\]" { if (string == null) string = new StringBuffer(); string.append(']'); }
|
||||
"\\b" { if (string == null) string = new StringBuffer(); string.append('\b'); }
|
||||
"\\t" { if (string == null) string = new StringBuffer(); string.append('\t'); }
|
||||
"\\n" { if (string == null) string = new StringBuffer(); string.append('\n'); }
|
||||
"\\f" { if (string == null) string = new StringBuffer(); string.append('\f'); }
|
||||
"\\r" { if (string == null) string = new StringBuffer(); string.append('\r'); }
|
||||
"\\\"" { if (string == null) string = new StringBuffer(); string.append('\"'); }
|
||||
"\\'" { if (string == null) string = new StringBuffer(); string.append('\''); }
|
||||
"\\\\" { if (string == null) string = new StringBuffer(); string.append('\\'); }
|
||||
\\x{HexDigit}{HexDigit} { char val = (char) Integer.parseInt(yytext().substring(2), 16);
|
||||
string.append(val); }
|
||||
|
||||
/* error cases */
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
. { if (string == null) string = new StringBuffer(); string.append( yytext() ); }
|
||||
\\. { throw new TextParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); }
|
||||
. { if (string == null) string = new StringBuffer(); string.append(yytext()); }
|
||||
<<EOF>> { if (finish) {return null;} else {finish=true; return new ParsedSymbol(SymbolType.TEXT, string == null ? null : string.toString());}}
|
||||
}
|
||||
|
||||
|
||||
+57
-53
@@ -1,3 +1,5 @@
|
||||
/* The following code was generated by JFlex 1.6.0 */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS, All rights reserved.
|
||||
*
|
||||
@@ -20,9 +22,8 @@ import java.util.Stack;
|
||||
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.5.0-SNAPSHOT from the
|
||||
* specification file
|
||||
* <tt>D:/Dropbox/Programovani/JavaSE/FFDec/trunk/src/com/jpexs/decompiler/flash/types/annotations/parser/conditions.flex</tt>
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.6.0 from the specification file
|
||||
* <tt>C:/Projects/FFDec/jpexs-decompiler/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/annotations/parser/conditions.flex</tt>
|
||||
*/
|
||||
public final class ConditionLexer {
|
||||
|
||||
@@ -57,7 +58,7 @@ public final class ConditionLexer {
|
||||
= "\12\0\1\10\1\10\1\10\1\10\23\0\1\5\4\0\1\3\1\0"
|
||||
+ "\1\6\1\7\2\0\1\4\1\0\1\1\1\0\12\1\7\0\32\1"
|
||||
+ "\4\0\1\1\1\0\32\1\1\0\1\2\10\0\1\10\u1fa2\0\1\10"
|
||||
+ "\1\10\udfd6\0";
|
||||
+ "\1\10\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
|
||||
|
||||
/**
|
||||
* Translates characters to character classes
|
||||
@@ -275,6 +276,14 @@ 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.
|
||||
*/
|
||||
private int zzFinalHighSurrogate = 0;
|
||||
|
||||
/* user code: */
|
||||
/**
|
||||
* Create an empty lexer, yyrset will be called later to reset and assign
|
||||
@@ -292,7 +301,7 @@ public final class ConditionLexer {
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
private final Stack<ConditionToken> pushedBack = new Stack<>();
|
||||
private Stack<ConditionToken> pushedBack = new Stack<ConditionToken>();
|
||||
|
||||
public void pushback(ConditionToken symb) {
|
||||
pushedBack.push(symb);
|
||||
@@ -309,8 +318,7 @@ public final class ConditionLexer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new scanner There is also a java.io.InputStream version of this
|
||||
* constructor.
|
||||
* Creates a new scanner
|
||||
*
|
||||
* @param in the java.io.Reader to read input from.
|
||||
*/
|
||||
@@ -318,16 +326,6 @@ public final class ConditionLexer {
|
||||
this.zzReader = in;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new scanner. There is also java.io.Reader version of this
|
||||
* constructor.
|
||||
*
|
||||
* @param in the java.io.Inputstream to read input from.
|
||||
*/
|
||||
public ConditionLexer(java.io.InputStream in) {
|
||||
this(new java.io.InputStreamReader(in, java.nio.charset.Charset.forName("UTF-8")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpacks the compressed character translation table.
|
||||
*
|
||||
@@ -335,12 +333,12 @@ public final class ConditionLexer {
|
||||
* @return the unpacked character translation table
|
||||
*/
|
||||
private static char[] zzUnpackCMap(String packed) {
|
||||
char[] map = new char[0x10000];
|
||||
char[] map = new char[0x110000];
|
||||
int i = 0; /* index in packed string */
|
||||
|
||||
int j = 0; /* index in unpacked array */
|
||||
|
||||
while (i < 64) {
|
||||
while (i < 96) {
|
||||
int count = packed.charAt(i++);
|
||||
char value = packed.charAt(i++);
|
||||
do {
|
||||
@@ -361,6 +359,8 @@ public final class ConditionLexer {
|
||||
|
||||
/* first: make room (if you can) */
|
||||
if (zzStartRead > 0) {
|
||||
zzEndRead += zzFinalHighSurrogate;
|
||||
zzFinalHighSurrogate = 0;
|
||||
System.arraycopy(zzBuffer, zzStartRead,
|
||||
zzBuffer, 0,
|
||||
zzEndRead - zzStartRead);
|
||||
@@ -373,40 +373,44 @@ public final class ConditionLexer {
|
||||
}
|
||||
|
||||
/* is the buffer big enough? */
|
||||
if (zzCurrentPos >= zzBuffer.length) {
|
||||
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
|
||||
/* if not: blow it up */
|
||||
char newBuffer[] = new char[zzCurrentPos * 2];
|
||||
char newBuffer[] = new char[zzBuffer.length * 2];
|
||||
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
|
||||
zzBuffer = newBuffer;
|
||||
zzEndRead += zzFinalHighSurrogate;
|
||||
zzFinalHighSurrogate = 0;
|
||||
}
|
||||
|
||||
/* finally: fill the buffer with new input */
|
||||
int numRead = zzReader.read(zzBuffer, zzEndRead,
|
||||
zzBuffer.length - zzEndRead);
|
||||
/* 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 (numRead > 0) {
|
||||
zzEndRead += numRead;
|
||||
if (totalRead > 0) {
|
||||
zzEndRead += totalRead;
|
||||
if (totalRead == requested) { /* possibly more input available */
|
||||
|
||||
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
|
||||
--zzEndRead;
|
||||
zzFinalHighSurrogate = 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// unlikely but not impossible: read 0 characters, but not at end of stream
|
||||
if (numRead == 0) {
|
||||
int c = zzReader.read();
|
||||
if (c == -1) {
|
||||
return true;
|
||||
} else {
|
||||
zzBuffer[zzEndRead++] = (char) c;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// numRead < 0
|
||||
// totalRead = 0: End of stream
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the input stream.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public final void yyclose() throws java.io.IOException {
|
||||
zzAtEOF = true; /* indicate end of file */
|
||||
@@ -438,6 +442,7 @@ public final class ConditionLexer {
|
||||
zzEOFDone = false;
|
||||
zzEndRead = zzStartRead = 0;
|
||||
zzCurrentPos = zzMarkedPos = 0;
|
||||
zzFinalHighSurrogate = 0;
|
||||
yyline = yychar = yycolumn = 0;
|
||||
zzLexicalState = YYINITIAL;
|
||||
if (zzBuffer.length > ZZ_BUFFERSIZE) {
|
||||
@@ -447,8 +452,6 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Returns the current lexical state.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yystate() {
|
||||
return zzLexicalState;
|
||||
@@ -465,8 +468,6 @@ 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);
|
||||
@@ -488,8 +489,6 @@ public final class ConditionLexer {
|
||||
|
||||
/**
|
||||
* Returns the length of the matched text region.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public final int yylength() {
|
||||
return zzMarkedPos - zzStartRead;
|
||||
@@ -541,8 +540,6 @@ public final class ConditionLexer {
|
||||
*
|
||||
* @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;
|
||||
@@ -565,9 +562,14 @@ public final class ConditionLexer {
|
||||
yychar += zzMarkedPosL - zzStartRead;
|
||||
|
||||
boolean zzR = false;
|
||||
for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
|
||||
zzCurrentPosL++) {
|
||||
switch (zzBufferL[zzCurrentPosL]) {
|
||||
int zzCh;
|
||||
int zzCharCount;
|
||||
for (zzCurrentPosL = zzStartRead;
|
||||
zzCurrentPosL < zzMarkedPosL;
|
||||
zzCurrentPosL += zzCharCount) {
|
||||
zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL);
|
||||
zzCharCount = Character.charCount(zzCh);
|
||||
switch (zzCh) {
|
||||
case '\u000B':
|
||||
case '\u000C':
|
||||
case '\u0085':
|
||||
@@ -592,7 +594,7 @@ public final class ConditionLexer {
|
||||
break;
|
||||
default:
|
||||
zzR = false;
|
||||
yycolumn++;
|
||||
yycolumn += zzCharCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +637,8 @@ public final class ConditionLexer {
|
||||
while (true) {
|
||||
|
||||
if (zzCurrentPosL < zzEndReadL) {
|
||||
zzInput = zzBufferL[zzCurrentPosL++];
|
||||
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
|
||||
zzCurrentPosL += Character.charCount(zzInput);
|
||||
} else if (zzAtEOF) {
|
||||
zzInput = YYEOF;
|
||||
break zzForAction;
|
||||
@@ -653,7 +656,8 @@ public final class ConditionLexer {
|
||||
zzInput = YYEOF;
|
||||
break zzForAction;
|
||||
} else {
|
||||
zzInput = zzBufferL[zzCurrentPosL++];
|
||||
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
|
||||
zzCurrentPosL += Character.charCount(zzInput);
|
||||
}
|
||||
}
|
||||
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
|
||||
|
||||
+3
-3
@@ -28,7 +28,7 @@ import java.util.Stack;
|
||||
%line
|
||||
%column
|
||||
%type ConditionToken
|
||||
%throws ParseException
|
||||
%throws AnnotationParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Stack;
|
||||
}
|
||||
|
||||
public int yyline() {
|
||||
return yyline+1;
|
||||
return yyline + 1;
|
||||
}
|
||||
|
||||
private Stack<ConditionToken> pushedBack = new Stack<ConditionToken>();
|
||||
@@ -55,7 +55,7 @@ import java.util.Stack;
|
||||
pushedBack.push(symb);
|
||||
}
|
||||
|
||||
public ConditionToken lex() throws java.io.IOException, ParseException{
|
||||
public ConditionToken lex() throws java.io.IOException, AnnotationParseException{
|
||||
ConditionToken ret = null;
|
||||
if(!pushedBack.isEmpty()){
|
||||
ret = pushedBack.pop();
|
||||
|
||||
Reference in New Issue
Block a user