Package com.reportmill.parsing
Class RMASParser
java.lang.Object
com.reportmill.parsing.RMASParser
- All Implemented Interfaces:
RMASParserConstants
RMASParser parses ActionScript to generate the byte-codes and binary encoded actions that are executed by the Flash
Player.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String[]
Keys that identify the different types of error generated while #include directives are being processed and the script is being parsed.boolean
Fields inherited from interface com.reportmill.parsing.RMASParserConstants
ASR, ASSIGN, ASSIGN_ADD, ASSIGN_AND, ASSIGN_ASR, ASSIGN_DIV, ASSIGN_LSL, ASSIGN_LSR, ASSIGN_MOD, ASSIGN_MUL, ASSIGN_OR, ASSIGN_SUB, ASSIGN_XOR, BIT_AND, BIT_NOT, BIT_OR, BIT_XOR, BOOLEAN_LITERAL, BREAK, CONTINUE, DEC, DECIMAL_LITERAL, DEFAULT, DIGIT, DIVIDE, DO, ELSE, EOF, EQ, FOR, FUNCTION, GT, GTE, HEX_LITERAL, IDENTIFIER, IF, IN, INC, INTEGER_LITERAL, LETTER, LOGICAL_AND, LOGICAL_NOT, LOGICAL_OR, LSL, LSR, LT, LTE, MINUS, MOD, MULTIPLY, NE, NEW, NULL_LITERAL, ON, ONCLIPEVENT, PLUS, RETURN, STRING_LITERAL, tokenImage, VAR, WHILE, WITH
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new parser object initializing it to read characters from the standard input stream, System.in.RMASParser
(InputStream stream) RMASParser
(Reader stream) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a path to the array of pathnames.final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final void
final RMASNode
final void
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
Function()
final RMASNode
getError()
Returns the key identifying the type of error that occured while of parsing a script.Returns the name of the file that contained the line of code that generated an error while parsing a script.getLine()
Returns the line of code that generated an error while parsing a script.int
Returns the number of the the line of code that generated an error parsing a script.final Token
Returns the array of path names used when searching for a file.final Token
getToken
(int index) final RMASNode
final RMASNode
final RMASNode
final RMASNode
Literal()
final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
On()
final RMASNode
Parses the ActionScript string, script.final RMASNode
final RMASNode
final RMASNode
final RMASNode
void
void
ReInit
(InputStream stream) void
final RMASNode
final RMASNode
final RMASNode
Script()
void
Sets the array of path names used when searching for a file.void
Sets the array of path names used when searching for a file.final RMASNode
final RMASNode
final RMASNode
final RMASNode
final RMASNode
-
Field Details
-
errorKeys
Keys that identify the different types of error generated while #include directives are being processed and the script is being parsed. The key can be used with a ResourceBundle object to generate a localized string that describes the error in detail. -
token_source
-
token
-
jj_nt
-
lookingAhead
public boolean lookingAhead
-
-
Constructor Details
-
RMASParser
public RMASParser()Constructs a new parser object initializing it to read characters from the standard input stream, System.in. The current working directory "." is added to the list of directories that will be searched when looking for a file. -
RMASParser
-
RMASParser
-
RMASParser
-
-
Method Details
-
getPathNames
Returns the array of path names used when searching for a file.- Returns:
- an array of strings containing the names of directories to search.
-
setPaths
Sets the array of path names used when searching for a file.- Parameters:
paths
- an array of strings containing the names of directories to search.
-
setPaths
Sets the array of path names used when searching for a file. The string should contains paths which contain the system-dependent separator and pathSeparator characters.- Parameters:
paths
- a string containing the names of directories to search.
-
add
Add a path to the array of pathnames. The path should contain the system-dependent separator.- Parameters:
path
- a string containing the path to a directory.
-
getFilename
Returns the name of the file that contained the line of code that generated an error while parsing a script.- Returns:
- the name of the file which contained the line of code or an empty string if the line was in the 'root' script.
-
getLineNumber
public int getLineNumber()Returns the number of the the line of code that generated an error parsing a script.- Returns:
- the number of the line which that triggered the error.
-
getLine
Returns the line of code that generated an error while parsing a script.- Returns:
- the line which that triggered the error.
-
getError
Returns the key identifying the type of error that occured while of parsing a script.- Returns:
- the line which that triggered the error.
-
parse
Parses the ActionScript string, script.- Parameters:
script
- a String containing the ActionScript code to parse.- Throws:
ParseException
- if a parsing error occurs.
-
Literal
- Throws:
ParseException
-
Identifier
- Throws:
ParseException
-
Script
- Throws:
ParseException
-
Statement
- Throws:
ParseException
-
FunctionDefinition
- Throws:
ParseException
-
BlockStatement
- Throws:
ParseException
-
ExpressionStatement
- Throws:
ParseException
-
IfStatement
- Throws:
ParseException
-
WithStatement
- Throws:
ParseException
-
WhileStatement
- Throws:
ParseException
-
DoStatement
- Throws:
ParseException
-
ForStatement
- Throws:
ParseException
-
BreakStatement
- Throws:
ParseException
-
ContinueStatement
- Throws:
ParseException
-
ReturnStatement
- Throws:
ParseException
-
OnClipEvent
- Throws:
ParseException
-
On
- Throws:
ParseException
-
ExpressionList
- Throws:
ParseException
-
ArgumentList
- Throws:
ParseException
-
Expression
- Throws:
ParseException
-
AssignmentExpression
- Throws:
ParseException
-
ConditionalExpression
- Throws:
ParseException
-
LogicalOrExpression
- Throws:
ParseException
-
LogicalAndExpression
- Throws:
ParseException
-
InclusiveOrExpression
- Throws:
ParseException
-
ExclusiveOrExpression
- Throws:
ParseException
-
AndExpression
- Throws:
ParseException
-
EqualityExpression
- Throws:
ParseException
-
RelationalExpression
- Throws:
ParseException
-
ShiftExpression
- Throws:
ParseException
-
AdditiveExpression
- Throws:
ParseException
-
MultiplicativeExpression
- Throws:
ParseException
-
UnaryExpression
- Throws:
ParseException
-
PostfixExpression
- Throws:
ParseException
-
PrimaryExpression
- Throws:
ParseException
-
PrimaryPrefix
- Throws:
ParseException
-
PrimarySuffix
- Throws:
ParseException
-
Function
- Throws:
ParseException
-
Constructor
- Throws:
ParseException
-
AnonymousArray
- Throws:
ParseException
-
MethodDefinition
- Throws:
ParseException
-
AnonymousObject
- Throws:
ParseException
-
Attribute
- Throws:
ParseException
-
ReInit
-
ReInit
-
ReInit
-
getNextToken
-
getToken
-
generateParseException
-
enable_tracing
public final void enable_tracing() -
disable_tracing
public final void disable_tracing()
-