Modifier and Type | Method and Description |
---|---|
Token |
DecafLexer.nextToken(StringBuffer text)
Extract a token from the given buffer.
|
Modifier and Type | Method and Description |
---|---|
Queue<Token> |
DecafLexer.lex(BufferedReader input,
String filename)
Perform lexical analysis, converting Decaf source code into a stream of
Token objects. |
Queue<Token> |
MyDecafLexer.lex(BufferedReader input,
String filename)
Perform lexical analysis, converting Decaf source code into a stream of
Token objects. |
Queue<Token> |
DecafLexer.lex(File file)
Perform lexical analysis, converting Decaf source code into a stream of
Token objects. |
Queue<Token> |
DecafLexer.lex(InputStream input)
Perform lexical analysis, converting Decaf source code into a stream of
Token objects. |
Queue<Token> |
DecafLexer.lex(String text)
Perform lexical analysis, converting Decaf source code into a stream of
Token objects. |
Modifier and Type | Method and Description |
---|---|
void |
DecafParser.consumeNextToken(Queue<Token> tokens)
Discard the next token.
|
SourceInfo |
DecafParser.getCurrentSourceInfo(Queue<Token> tokens)
Retrieve the source info associated with the token at the head of the
queue.
|
boolean |
DecafParser.isNextToken(Queue<Token> tokens,
Token.Type type)
Returns true if and only if the head of the queue is a token of the
expected type.
|
boolean |
MyDecafParser.isNextTokenBinOp(Queue<Token> tokens,
int level) |
boolean |
DecafParser.isNextTokenKeyword(Queue<Token> tokens,
String keyword)
Returns true if and only if the head of the queue is a keyword token with
the expected text.
|
boolean |
DecafParser.isNextTokenSymbol(Queue<Token> tokens,
String symbol)
Returns true if and only if the head of the queue is a symbol token with
the expected text.
|
void |
DecafParser.matchKeyword(Queue<Token> tokens,
String keyword)
Match and discard the given keyword from the head of the token queue.
|
void |
DecafParser.matchSymbol(Queue<Token> tokens,
String symbol)
Match and discard the given symbol from the head of the token queue.
|
ASTProgram |
MyDecafParser.parse(Queue<Token> tokens)
Top-level parsing routine.
|
ASTProgram |
DecafParser.parse(Queue<Token> tokens)
Perform syntax analysis, converting a stream of
Token objects
into an ASTProgram . |
ASTExpression |
MyDecafParser.parseBaseExpr(Queue<Token> tokens) |
ASTBinaryExpr.BinOp |
MyDecafParser.parseBinaryOperator(Queue<Token> tokens) |
ASTExpression |
MyDecafParser.parseBinExpr(Queue<Token> tokens,
int level) |
ASTBlock |
MyDecafParser.parseBlock(Queue<Token> tokens) |
ASTExpression |
MyDecafParser.parseExpression(Queue<Token> tokens) |
ASTFunction |
MyDecafParser.parseFunction(Queue<Token> tokens) |
String |
MyDecafParser.parseID(Queue<Token> tokens) |
int |
MyDecafParser.parseInt(Queue<Token> tokens) |
ASTLiteral |
MyDecafParser.parseLiteral(Queue<Token> tokens) |
ASTExpression |
MyDecafParser.parseNegExpr(Queue<Token> tokens) |
ASTExpression |
MyDecafParser.parseNotExpr(Queue<Token> tokens) |
ASTFunction.Parameter |
MyDecafParser.parseParameter(Queue<Token> tokens) |
ASTProgram |
MyDecafParser.parseProgram(Queue<Token> tokens)
LL(1) parsing routine for the Program non-terminal.
|
ASTStatement |
MyDecafParser.parseStatement(Queue<Token> tokens) |
ASTNode.DataType |
MyDecafParser.parseType(Queue<Token> tokens) |
ASTUnaryExpr.UnaryOp |
MyDecafParser.parseUnaryOperator(Queue<Token> tokens) |
ASTVariable |
MyDecafParser.parseVariable(Queue<Token> tokens) |
Copyright © 2019. All rights reserved.