class MyDecafParser extends DecafParser
Constructor and Description |
---|
MyDecafParser() |
consumeNextToken, getCurrentSourceInfo, isNextToken, isNextTokenKeyword, isNextTokenSymbol, matchKeyword, matchSymbol
public ASTProgram parse(Queue<Token> tokens) throws InvalidSyntaxException
parse
in class DecafParser
tokens
- Input token streamInvalidSyntaxException
- Thrown if a syntax error is encounteredpublic ASTProgram parseProgram(Queue<Token> tokens) throws InvalidSyntaxException
tokens
- Input token streamInvalidSyntaxException
- Thrown if a syntax error is encounteredpublic ASTFunction parseFunction(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTFunction.Parameter parseParameter(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTVariable parseVariable(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTBlock parseBlock(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTStatement parseStatement(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTExpression parseExpression(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTExpression parseBinExpr(Queue<Token> tokens, int level) throws InvalidSyntaxException
InvalidSyntaxException
public ASTExpression parseNotExpr(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTExpression parseNegExpr(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTExpression parseBaseExpr(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTLiteral parseLiteral(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTNode.DataType parseType(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public int parseInt(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public String parseID(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTBinaryExpr.BinOp parseBinaryOperator(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
public ASTUnaryExpr.UnaryOp parseUnaryOperator(Queue<Token> tokens) throws InvalidSyntaxException
InvalidSyntaxException
Copyright © 2019. All rights reserved.