Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
C
E
F
G
I
K
L
M
N
O
P
R
S
T
U
V
A
acceptCurrentCharacter()
- Method in class
Scanner
Accept the previously returned character, and advance the index to the next available character.
asm
- Variable in class
CompilerIO
C
cio
- Variable in class
Parser
The CompilerIO object that we can use to write on the output stream if needed.
close()
- Method in class
CompilerIO
Close the input and output streams.
COMMA
- Static variable in class
Token
CompilerIO
- class
CompilerIO
.
This class handles all IO for the compiler application.
CompilerIO(String)
- Constructor for class
CompilerIO
Create a new CompilerIO object, using the file name given for the input file, and creating the output file name based on the input file name.
CompilerIO(String, String)
- Constructor for class
CompilerIO
Create a new CompilerIO object, using the two file names given.
E
echoing
- Variable in class
CompilerIO
echoPrefix
- Variable in class
CompilerIO
EOF
- Static variable in class
Token
F
firstSets
- Variable in class
Parser
HashMap containing int arrays of Token types, keyed by the non-terminal whose FIRST set each array represents.
FUNCTION
- Static variable in class
Symbol
Symbol type: function.
G
getCurrentCharacter()
- Method in class
Scanner
Get the current character from the source file.
getEchoing()
- Method in class
CompilerIO
Get the echoing property.
getEchoPrefix()
- Method in class
CompilerIO
Get the echo prefix string.
getLabel()
- Method in class
Symbol
Get the label attribute of this object.
getLabel()
- Method in class
Token
Get the String attribute of this object.
getScope()
- Method in class
Symbol
Get the scope of this Symbol.
getType()
- Method in class
Symbol
Get the type of this Symbol.
getType()
- Method in class
Token
Get the type of this Token.
getValue()
- Method in class
Token
Get the integer attribute of this object.
GLOBAL
- Static variable in class
Symbol
Symbol scope: global.
I
ID
- Static variable in class
Token
idx
- Variable in class
Scanner
Zero-based offset to the next unaccepted character in the srcLine.
INT
- Static variable in class
Token
invalidCharacter(char)
- Method in class
Scanner
Report invalid character.
io
- Variable in class
Scanner
The CompilerIO object that is managing all of our IO.
isFirst(Token, String)
- Method in class
Parser
Check to see if tokens of the given type are in the FIRST set of the given non-terminal.
K
keywords
- Variable in class
Scanner
The keywords HashMap stores the identifiers that are to be recognized as keywords, along with their specific Token.xyz values.
KW_ELSE
- Static variable in class
Token
KW_IF
- Static variable in class
Token
KW_INT
- Static variable in class
Token
KW_RETURN
- Static variable in class
Token
KW_WHILE
- Static variable in class
Token
L
label
- Variable in class
Symbol
label
- Variable in class
Token
LCURLY
- Static variable in class
Token
LOCAL
- Static variable in class
Symbol
Symbol scope: local.
LPAREN
- Static variable in class
Token
M
main(String[])
- Static method in class
CompilerIO
Run a simple test of this CompilerIO class.
main(String[])
- Static method in class
ParseTest
Test harness for the Parser class.pathname to parse.
main(String[])
- Static method in class
ScanTest
Test harness for the Scanner class.
main(String[])
- Static method in class
TokenTest
Super simple test case.
matchToken(int)
- Method in class
Parser
Check that the current Token is of the expected type, and advance past it if it is okay.
matchTokenArray(int[])
- Method in class
Parser
Check that the current Token is one of the expected types, and advance past it if it is okay.
N
nextToken()
- Method in class
Scanner
Starting with the current character, identify the next Token and return the appropriate Token object to the caller.
O
OP_ADD
- Static variable in class
Token
OP_ASSIGN
- Static variable in class
Token
OP_EQ
- Static variable in class
Token
OP_GT
- Static variable in class
Token
OP_MUL
- Static variable in class
Token
OP_NOT
- Static variable in class
Token
OP_SUB
- Static variable in class
Token
P
PARAMETER
- Static variable in class
Symbol
Symbol scope: parameter.
parse()
- Method in class
Parser
Starting with the first Token in the input stream, try to derive a parse tree for the entire program.
parseBoolExpr()
- Method in class
Parser
Parse non-terminal: boolExpr.
parseDeclaration()
- Method in class
Parser
Parse non-terminal: declaration.
parseDeclarations()
- Method in class
Parser
Parse non-terminal: declarations.
parseExpr()
- Method in class
Parser
Parse non-terminal: expr.
parseExprList()
- Method in class
Parser
Parse non-terminal: exprList.
parseExprListTail()
- Method in class
Parser
Parse non-terminal: exprListTail.
parseExprTail()
- Method in class
Parser
Parse non-terminal: exprTail.
parseFactor()
- Method in class
Parser
Parse non-terminal: factor.
parseFunctionDefinition()
- Method in class
Parser
Parse non-terminal: functionDefinition.
parseParameter()
- Method in class
Parser
Parse non-terminal: parameter.
parseParameters()
- Method in class
Parser
Parse non-terminal: parameters.
parseParametersTail()
- Method in class
Parser
Parse non-terminal: parametersTail.
parseProgram()
- Method in class
Parser
Parse non-terminal: program.
parseProgramTail()
- Method in class
Parser
Parse non-terminal: programTail.
Parser
- class
Parser
.
Parse an input stream containing a D language source file.
Parser(CompilerIO)
- Constructor for class
Parser
Construct a new Parser object.
parseRelExpr()
- Method in class
Parser
Parse non-terminal: relExpr.
parseStatement()
- Method in class
Parser
Parse non-terminal: statement.
parseStatements()
- Method in class
Parser
Parse non-terminal: statements.
parseStatementsTail()
- Method in class
Parser
Parse non-terminal: statementsTail.
parseTerm()
- Method in class
Parser
Parse non-terminal: term.
parseTermTail()
- Method in class
Parser
Parse non-terminal: termTail.
ParseTest
- class
ParseTest
.
Simple Parser driver.
ParseTest()
- Constructor for class
ParseTest
prevToken
- Variable in class
Parser
prevToken is always the last Token that has been matched.
printAsmLine(String)
- Method in class
CompilerIO
Write a string out to the output file.
processSyntaxException(SyntaxException)
- Method in class
Parser
Handle the reporting and processing required by a parse error.
R
RCURLY
- Static variable in class
Token
readSrcLine()
- Method in class
CompilerIO
Read one line of input from the originally specified input file.
RPAREN
- Static variable in class
Token
S
scan
- Variable in class
Parser
The Scanner that actually reads the input stream and reports the tokens that it finds.
Scanner
- class
Scanner
.
Scan an input stream looking for tokens defined for a simple language.
Scanner(CompilerIO)
- Constructor for class
Scanner
Construct a new Scanner object.
ScanTest
- class
ScanTest
.
Simple Scanner driver
ScanTest()
- Constructor for class
ScanTest
scope
- Variable in class
Symbol
SEMICOLON
- Static variable in class
Token
setEchoing(boolean)
- Method in class
CompilerIO
Set the echoing property.
setEchoPrefix(String)
- Method in class
CompilerIO
Set the echo prefix that is written out before each echoed line.
setLabel(String)
- Method in class
Symbol
Set the label attribute of this object.
setScope(int)
- Method in class
Symbol
Set the scope of this Symbol.
setShowMethods(boolean)
- Method in class
Parser
Mutator method to set the state of method entry/exit tracing.
setShowSymbols(boolean)
- Method in class
Parser
Mutator method to set the state of Symbol entry display.
setType(int)
- Method in class
Symbol
Set the type of this Symbol.
showMethods
- Variable in class
Parser
Enable / disable method entry/exit tracing.
showSymbols
- Variable in class
Parser
Enable / disable Symbol entry display.
skipWhitespace()
- Method in class
Scanner
Skip over whitespace characters.
src
- Variable in class
CompilerIO
srcLine
- Variable in class
Scanner
the current line of the source file, null if we have read to end of file.
status
- Variable in class
Parser
This status variable is set to true before the parse begins.
Symbol
- class
Symbol
.
Each Symbol object represents one entry in a SymbolTable.
Symbol()
- Constructor for class
Symbol
Construct a new Symbol with unknown values for all fields.
Symbol(String, int, int)
- Constructor for class
Symbol
Construct a new Symbol.
symbolScope
- Static variable in class
Symbol
symbolType
- Static variable in class
Symbol
SyntaxException
- exception
SyntaxException
.
Simple Exception class for reporting syntax errors found by the Parser.
SyntaxException()
- Constructor for class
SyntaxException
Create a new SyntaxException with no information.
SyntaxException(String)
- Constructor for class
SyntaxException
Create a new SyntaxException with a description.
T
theToken
- Variable in class
Parser
theToken is always the Token that we should look at next.
Token
- class
Token
.
Each Token object represents one token from the compiler input stream.
Token(int)
- Constructor for class
Token
Construct a new Token with no attributes except its type.
Token(int, int)
- Constructor for class
Token
Construct a new Token with an associated integer value attribute.
Token(int, String)
- Constructor for class
Token
Construct a new Token with an associated String attribute.
TokenTest
- class
TokenTest
.
Provide a simple test harness for the Token class.
TokenTest()
- Constructor for class
TokenTest
tokenTypes
- Static variable in class
Token
toString()
- Method in class
Symbol
Provide the String that describes this Symbol.
toString()
- Method in class
Token
Provide the String that describes this Token.
toString(int)
- Static method in class
Token
Provide the String that describes this Token type.
traceEntry()
- Method in class
Parser
Optionally print a message that we are entering a method.
traceEntry(String)
- Method in class
Parser
Optionally print a message that we are entering a method.
traceExit()
- Method in class
Parser
Optionally print a message that we are exiting a method.
traceExit(String)
- Method in class
Parser
Optionally print a message that we are exiting a method.
tracer
- Variable in class
Parser
This Throwable is used to get stack trace information
traceSymbol(Symbol)
- Method in class
Parser
Optionally display a Symbol
type
- Variable in class
Symbol
type
- Variable in class
Token
U
UNKNOWN_SCOPE
- Static variable in class
Symbol
Symbol scope: unknown.
UNKNOWN_TYPE
- Static variable in class
Symbol
Symbol type: unknown.
V
value
- Variable in class
Token
VARIABLE
- Static variable in class
Symbol
Symbol type: variable.
A
C
E
F
G
I
K
L
M
N
O
P
R
S
T
U
V
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes