A B C D 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.
attributes - Variable in class Symbol
 

B

buf - Variable in class CompilerIO
the temporary buffer

C

cio - Variable in class Parser
The CompilerIO object that we can use to write on the output stream if needed.
CLASSNAME - Static variable in class Symbol
 
closeAll() - Method in class CompilerIO
Close the input, output, and temporary streams.
closeBuffer() - Method in class CompilerIO
Close the temporary Writer that we've been using to buffer the output and switch back to the output file as the target of all the emit methods.
COLON - Static variable in class Token
 
COMMA - Static variable in class Token
 
CompilerIO - Class in <Unnamed>
This class handles all IO for the compiler application.
CompilerIO(String, 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, String) - Constructor for class CompilerIO
Create a new CompilerIO object, using the file names given for the input file and the output file.

D

DOT - Static variable in class Token
 
dst - Variable in class CompilerIO
the current output Writer, either the obj file or the buffer.

E

echoing - Variable in class CompilerIO
 
echoPrefix - Variable in class CompilerIO
 
emit(String) - Method in class CompilerIO
Write a string to the currently active output Writer.
emitBuffer() - Method in class CompilerIO
Write the contents of the temporary buffer to the output file.
emitFile(String) - Method in class CompilerIO
Copy an entire file to the currently active output Writer.
emitWithPrefix(String) - Method in class CompilerIO
Write the prefix and then the given string to the currently active output Writer.
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.
Flip - Class in <Unnamed>
Manage the phases of a compiler for the FM (flip movie) programming language.
Flip() - Constructor for class Flip
 

G

generateCode(String) - Method in class Parser
Emit a code string.
generateMovieEnd() - Method in class Parser
Format and emit the postscript trailer
generateMovieStart(String) - Method in class Parser
Format and emit the postscript title block section
generatePrologEnd() - Method in class Parser
Emit the end of the postscript prolog section
generatePrologStart() - Method in class Parser
Emit the beginning of the postscript prolog section
getAttribute(String) - Method in class Symbol
Get an attribute from a Symbol.
getCurrentCharacter() - Method in class Scanner
Get the current character from the source file.
getDoubleValue() - Method in class Token
Get the numeric attribute of this token as a double value.
getEchoing() - Method in class CompilerIO
Get the current state of the echoing property.
getEchoPrefix() - Method in class CompilerIO
Get the echo prefix string.
getIntValue() - Method in class Token
Get the numeric attribute of this token as an int value.
getLabel() - Method in class Symbol
Get the label attribute of this object.
getLabel() - Method in class Token
Get the String attribute of this object.
getSymbol(int, String) - Method in class SymbolTable
Get a symbol from table[k].
getType() - Method in class Symbol
Get the type of this Symbol.
getType() - Method in class Token
Get the type of this Token.

I

ID - Static variable in class Token
 
idx - Variable in class Scanner
Zero-based offset to the next unaccepted character in the srcLine.
INTEGER - 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.
isDeclared(int, String) - Method in class SymbolTable
Check to see if a symbol is in table[k].
isDeclared(String) - Method in class SymbolTable
Check to see if a symbol is in any of the defined tables.
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

KEYWORD - Static variable in class Symbol
 
keywords - Variable in class Scanner
Symbol table 0 stores the identifiers that are to be recognized as keywords, along with their specific Token.xyz values.
KW_CLASS - Static variable in class Token
 
KW_ELSE - Static variable in class Token
 
KW_IF - Static variable in class Token
 
KW_INTEGER - Static variable in class Token
 
KW_MOVIE - Static variable in class Token
 
KW_PROLOG - Static variable in class Token
 
KW_REAL - Static variable in class Token
 
KW_SHOW - Static variable in class Token
 
KW_STATIC - Static variable in class Token
 
KW_VOID - Static variable in class Token
 

L

label - Variable in class Symbol
 
label - Variable in class Token
 
LCURLY - Static variable in class Token
 
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 Flip
Manage the phases of a compiler for the FM (flip movie) programming language.
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.
METHOD - Static variable in class Symbol
 

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

obj - Variable in class CompilerIO
the output file
OP_ADD - Static variable in class Token
 
OP_ASSIGN - Static variable in class Token
 
OP_DIV - Static variable in class Token
 
OP_EQ - Static variable in class Token
 
OP_GT - Static variable in class Token
 
OP_LT - 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
 
openBuffer() - Method in class CompilerIO
Create a new temporary Writer for buffering and set it to be the target of all the emit methods.
operator(Token) - Method in class Parser
Convert an operator token into the appropriate postscript name

P

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.
parseCallEnd(Token) - Method in class Parser
Parse non-terminal: callEnd
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.
parseMovieBody() - Method in class Parser
Parse non-terminal: movieBody.
parsePageBlock() - Method in class Parser
Parse non-terminal: pageBlock.
parsePageBlocks() - Method in class Parser
Parse non-terminal: pageBlocks.
parsePageBlocksTail() - Method in class Parser
Parse non-terminal: pageBlocksTail.
parsePageStatement() - Method in class Parser
Parse non-terminal: pageStatement.
parsePageStatements() - Method in class Parser
Parse non-terminal: pageStatements.
parsePageTail() - Method in class Parser
Parse non-terminal: pageTail.
parseProgram() - Method in class Parser
Parse non-terminal: program.
parsePrologBlock() - Method in class Parser
Parse non-terminal: prologBlock.
parsePrologStatement() - Method in class Parser
Parse non-terminal: prologStatement.
parsePrologStatements() - Method in class Parser
Parse non-terminal: prologStatements.
parsePrologTail() - Method in class Parser
Parse non-terminal: prologTail.
Parser - Class in <Unnamed>
Parse an input stream containing an FM language source file and optionally generate postscript code to implement the movie.
Parser(CompilerIO, SymbolTable, Scanner) - Constructor for class Parser
Construct a new Parser object.
parseRelExpr() - Method in class Parser
Parse non-terminal: relExpr.
parseTerm() - Method in class Parser
Parse non-terminal: term.
parseTermTail() - Method in class Parser
Parse non-terminal: termTail.
ParseTest - Class in <Unnamed>
Simple Parser driver.
ParseTest() - Constructor for class ParseTest
 
parseVariableDeclaration() - Method in class Parser
Parse non-terminal: variableDeclaration.
prevToken - Variable in class Parser
prevToken is always the last Token that has been matched.
processIOException(IOException) - Method in class Parser
Handle the reporting and processing required by an IO error.
processSyntaxException(SyntaxException) - Method in class Parser
Handle the reporting and processing required by a parse error.
putAttribute(String, Object) - Method in class Symbol
Put an attribute in the HashMap of a Symbol.
putSymbol(int, String, Symbol) - Method in class SymbolTable
Add a symbol to table[k].

R

RCURLY - Static variable in class Token
 
readSrcLine() - Method in class CompilerIO
Read one line of input from the input file.
REAL - Static variable in class Token
 
RPAREN - Static variable in class Token
 

S

SC_VARIABLE - Static variable in class Parser
Define the symbol tables that we use in the parser.
scan - Variable in class Parser
The Scanner that actually reads the input stream and reports the tokens that it finds.
Scanner - Class in <Unnamed>
Scan an input stream looking for tokens defined for a simple language.
Scanner(CompilerIO, SymbolTable) - Constructor for class Scanner
Construct a new Scanner object.
ScanTest - Class in <Unnamed>
Simple Scanner driver
ScanTest() - Constructor for class ScanTest
 
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 or other String written with emitWithPrefix.
setLabel(String) - Method in class Symbol
Set the label attribute of this object.
setShowCode(boolean) - Method in class Parser
Mutator method to set the state of code generation
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.
showCode - Variable in class Parser
Enable / disable code generation.
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
the input file
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.
sw - Variable in class CompilerIO
the underlying StringWriter used in implementing the buffer
Symbol - Class in <Unnamed>
Each Symbol object represents one entry in a SymbolTable.
Symbol(String, int) - Constructor for class Symbol
Construct a new Symbol with the given name and type.
symbolTable - Variable in class Parser
Symbol table manager.
SymbolTable - Class in <Unnamed>
This class manages one or more symbol tables for a compiler.
SymbolTable() - Constructor for class SymbolTable
Construct a new SymbolTable manager with one table.
SymbolTable(int) - Constructor for class SymbolTable
Construct a new SymbolTable manager with n tables.
SyntaxException - Exception in <Unnamed>
Simple Exception class for reporting syntax errors found by the Parser.
SyntaxException() - Constructor for exception SyntaxException
Create a new SyntaxException with no information.
SyntaxException(String) - Constructor for exception SyntaxException
Create a new SyntaxException with a description.

T

tables - Variable in class SymbolTable
 
theToken - Variable in class Parser
theToken is always the Token that we should look at next.
Token - Class in <Unnamed>
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, String) - Constructor for class Token
Construct a new Token with an associated String attribute.
Token(int, int) - Constructor for class Token
Construct a new Token with an associated integer value attribute.
Token(int, double) - Constructor for class Token
Construct a new Token with an associated real value attribute.
TokenTest - Class in <Unnamed>
Provide a simple test harness for the Token class.
TokenTest() - Constructor for class TokenTest
 
tokenTypes - Static variable in class Token
The token types as Strings for use in toString.
toString() - Method in class Symbol
Provide the String that describes this Symbol.
toString() - Method in class Token
Provide the String that describes this Token.
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
 
typeLabel(int) - Static method in class Token
Provide the String that describes this Token type.

U

UNKNOWN_TYPE - Static variable in class Symbol
 

V

value - Variable in class Token
 
VARIABLE - Static variable in class Symbol
 

A B C D E F G I K L M N O P R S T U V