Package com.reportmill.parsing
Class RMASParser
- java.lang.Object
-
- com.reportmill.parsing.RMASParser
-
- All Implemented Interfaces:
RMASParserConstants
public class RMASParser extends java.lang.Object implements RMASParserConstants
RMASParser parses ActionScript to generate the byte-codes and binary encoded actions that are executed by the Flash Player.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
errorKeys
Keys that identify the different types of error generated while #include directives are being processed and the script is being parsed.Token
jj_nt
boolean
lookingAhead
Token
token
RMASParserTokenManager
token_source
-
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
Constructors Constructor Description RMASParser()
Constructs a new parser object initializing it to read characters from the standard input stream, System.in.RMASParser(RMASParserTokenManager tm)
RMASParser(java.io.InputStream stream)
RMASParser(java.io.Reader stream)
-
Method Summary
-
-
-
Field Detail
-
errorKeys
public static java.lang.String[] 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
public RMASParserTokenManager token_source
-
token
public Token token
-
jj_nt
public Token jj_nt
-
lookingAhead
public boolean lookingAhead
-
-
Constructor Detail
-
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
public RMASParser(java.io.InputStream stream)
-
RMASParser
public RMASParser(java.io.Reader stream)
-
RMASParser
public RMASParser(RMASParserTokenManager tm)
-
-
Method Detail
-
getPathNames
public java.util.ArrayList 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
public void setPaths(java.util.ArrayList paths)
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
public void setPaths(java.lang.String paths)
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
public void add(java.lang.String path)
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
public java.lang.String 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
public java.lang.String getLine()
Returns the line of code that generated an error while parsing a script.- Returns:
- the line which that triggered the error.
-
getError
public java.lang.String 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
public RMASNode parse(java.lang.String script) throws ParseException
Parses the ActionScript string, script.- Parameters:
script
- a String containing the ActionScript code to parse.- Throws:
ParseException
- if a parsing error occurs.
-
Literal
public final RMASNode Literal() throws ParseException
- Throws:
ParseException
-
Identifier
public final RMASNode Identifier() throws ParseException
- Throws:
ParseException
-
Script
public final RMASNode Script() throws ParseException
- Throws:
ParseException
-
Statement
public final RMASNode Statement() throws ParseException
- Throws:
ParseException
-
FunctionDefinition
public final RMASNode FunctionDefinition() throws ParseException
- Throws:
ParseException
-
BlockStatement
public final RMASNode BlockStatement() throws ParseException
- Throws:
ParseException
-
ExpressionStatement
public final RMASNode ExpressionStatement() throws ParseException
- Throws:
ParseException
-
IfStatement
public final RMASNode IfStatement() throws ParseException
- Throws:
ParseException
-
WithStatement
public final RMASNode WithStatement() throws ParseException
- Throws:
ParseException
-
WhileStatement
public final RMASNode WhileStatement() throws ParseException
- Throws:
ParseException
-
DoStatement
public final RMASNode DoStatement() throws ParseException
- Throws:
ParseException
-
ForStatement
public final RMASNode ForStatement() throws ParseException
- Throws:
ParseException
-
BreakStatement
public final RMASNode BreakStatement() throws ParseException
- Throws:
ParseException
-
ContinueStatement
public final RMASNode ContinueStatement() throws ParseException
- Throws:
ParseException
-
ReturnStatement
public final RMASNode ReturnStatement() throws ParseException
- Throws:
ParseException
-
OnClipEvent
public final RMASNode OnClipEvent() throws ParseException
- Throws:
ParseException
-
On
public final RMASNode On() throws ParseException
- Throws:
ParseException
-
ExpressionList
public final RMASNode ExpressionList() throws ParseException
- Throws:
ParseException
-
ArgumentList
public final RMASNode ArgumentList() throws ParseException
- Throws:
ParseException
-
Expression
public final RMASNode Expression() throws ParseException
- Throws:
ParseException
-
AssignmentExpression
public final RMASNode AssignmentExpression() throws ParseException
- Throws:
ParseException
-
ConditionalExpression
public final RMASNode ConditionalExpression() throws ParseException
- Throws:
ParseException
-
LogicalOrExpression
public final RMASNode LogicalOrExpression() throws ParseException
- Throws:
ParseException
-
LogicalAndExpression
public final RMASNode LogicalAndExpression() throws ParseException
- Throws:
ParseException
-
InclusiveOrExpression
public final RMASNode InclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
ExclusiveOrExpression
public final RMASNode ExclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
AndExpression
public final RMASNode AndExpression() throws ParseException
- Throws:
ParseException
-
EqualityExpression
public final RMASNode EqualityExpression() throws ParseException
- Throws:
ParseException
-
RelationalExpression
public final RMASNode RelationalExpression() throws ParseException
- Throws:
ParseException
-
ShiftExpression
public final RMASNode ShiftExpression() throws ParseException
- Throws:
ParseException
-
AdditiveExpression
public final RMASNode AdditiveExpression() throws ParseException
- Throws:
ParseException
-
MultiplicativeExpression
public final RMASNode MultiplicativeExpression() throws ParseException
- Throws:
ParseException
-
UnaryExpression
public final RMASNode UnaryExpression() throws ParseException
- Throws:
ParseException
-
PostfixExpression
public final RMASNode PostfixExpression() throws ParseException
- Throws:
ParseException
-
PrimaryExpression
public final RMASNode PrimaryExpression() throws ParseException
- Throws:
ParseException
-
PrimaryPrefix
public final RMASNode PrimaryPrefix() throws ParseException
- Throws:
ParseException
-
PrimarySuffix
public final RMASNode PrimarySuffix() throws ParseException
- Throws:
ParseException
-
Function
public final RMASNode Function() throws ParseException
- Throws:
ParseException
-
Constructor
public final RMASNode Constructor() throws ParseException
- Throws:
ParseException
-
AnonymousArray
public final RMASNode AnonymousArray() throws ParseException
- Throws:
ParseException
-
MethodDefinition
public final RMASNode MethodDefinition() throws ParseException
- Throws:
ParseException
-
AnonymousObject
public final RMASNode AnonymousObject() throws ParseException
- Throws:
ParseException
-
Attribute
public final RMASNode Attribute() throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(java.io.InputStream stream)
-
ReInit
public void ReInit(java.io.Reader stream)
-
ReInit
public void ReInit(RMASParserTokenManager tm)
-
getNextToken
public final Token getNextToken()
-
getToken
public final Token getToken(int index)
-
generateParseException
public ParseException generateParseException()
-
enable_tracing
public final void enable_tracing()
-
disable_tracing
public final void disable_tracing()
-
-