gnu.ecmascript
Class Parser
java.lang.Object
gnu.ecmascript.Parser
public class Parser
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eofExpr
public static Expression eofExpr
emptyArgs
public static final Expression[] emptyArgs
errors
public int errors
Parser
public Parser(InPort port)
parseConditionalExpression
public Expression parseConditionalExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseAssignmentExpression
public Expression parseAssignmentExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseExpression
public Expression parseExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
peekTokenOrLine
public java.lang.Object peekTokenOrLine()
throws java.io.IOException,
SyntaxException
- Return the next token from the lexer.
A LineTerminator is considered a token.
- Throws:
java.io.IOException
SyntaxException
peekToken
public java.lang.Object peekToken()
throws java.io.IOException,
SyntaxException
- Return the next non-whitespace token from the lexer.
LineTerminators are skipped until a non-eolToken is found.
- Throws:
java.io.IOException
SyntaxException
getToken
public java.lang.Object getToken()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
skipToken
public final void skipToken()
getSemicolon
public void getSemicolon()
throws java.io.IOException,
SyntaxException
- Skip an explicit or implicit semicolon.
- Throws:
java.io.IOException
SyntaxException
parsePrimaryExpression
public Expression parsePrimaryExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
makePropertyAccessor
public Expression makePropertyAccessor(Expression exp,
Expression prop)
parseArguments
public Expression[] parseArguments()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
makeNewExpression
public Expression makeNewExpression(Expression exp,
Expression[] args)
makeCallExpression
public Expression makeCallExpression(Expression exp,
Expression[] args)
getIdentifier
public java.lang.String getIdentifier()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseLeftHandSideExpression
public Expression parseLeftHandSideExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parsePostfixExpression
public Expression parsePostfixExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseUnaryExpression
public Expression parseUnaryExpression()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
syntaxError
public Expression syntaxError(java.lang.String message)
parseBinaryExpression
public Expression parseBinaryExpression(int prio)
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseIfStatement
public Expression parseIfStatement()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
buildLoop
public Expression buildLoop(Expression init,
Expression test,
Expression incr,
Expression body)
parseWhileStatement
public Expression parseWhileStatement()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseFunctionDefinition
public Expression parseFunctionDefinition()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseBlock
public Expression parseBlock()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
parseStatement
public Expression parseStatement()
throws java.io.IOException,
SyntaxException
- Throws:
java.io.IOException
SyntaxException
main
public static void main(java.lang.String[] args)