pascalinterpreter.analysis
Class Compiler
java.lang.Object
pascalinterpreter.analysis.Compiler
- public class Compiler
- extends java.lang.Object
Constructor Summary |
Compiler(java.lang.String code)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tokens
private java.util.StringTokenizer tokens
line
private java.lang.String line
section
int section
isLineNext
boolean isLineNext
PROGRAM
private final int PROGRAM
- See Also:
- Constant Field Values
CONST
private final int CONST
- See Also:
- Constant Field Values
VAR
private final int VAR
- See Also:
- Constant Field Values
BEGIN
private final int BEGIN
- See Also:
- Constant Field Values
END
private final int END
- See Also:
- Constant Field Values
IF
private final int IF
- See Also:
- Constant Field Values
THEN
private final int THEN
- See Also:
- Constant Field Values
ELSE
private final int ELSE
- See Also:
- Constant Field Values
WHILE
private final int WHILE
- See Also:
- Constant Field Values
DO
private final int DO
- See Also:
- Constant Field Values
FOR
private final int FOR
- See Also:
- Constant Field Values
TO
private final int TO
- See Also:
- Constant Field Values
NEW
private final int NEW
- See Also:
- Constant Field Values
DISPOSE
private final int DISPOSE
- See Also:
- Constant Field Values
READLN
private final int READLN
- See Also:
- Constant Field Values
READ
private final int READ
- See Also:
- Constant Field Values
WRITELN
private final int WRITELN
- See Also:
- Constant Field Values
WRITE
private final int WRITE
- See Also:
- Constant Field Values
program
private Program program
analyser
private Analyser analyser
Compiler
public Compiler(java.lang.String code)
throws AnalyseException,
InternalException
createAnalyseException
private void createAnalyseException(AnalyseException exc)
throws AnalyseException
- Throws:
AnalyseException
getKeyword
private java.lang.String getKeyword(int keyword)
isVal
private boolean isVal(java.lang.String text)
createBinaryOperation
private BinaryOperation createBinaryOperation(java.lang.String opL,
java.lang.String oper,
java.lang.String opR)
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createUnaryOperation
private UnaryOperation createUnaryOperation(java.lang.String op,
java.lang.String operator)
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createConst
private Constant createConst(java.lang.String value)
throws InternalException
- Throws:
InternalException
checkType
private DataType checkType(java.lang.String value)
throws InternalException
- Throws:
InternalException
getType
private DataType getType(java.lang.String typeDescr)
throws InternalException
- Throws:
InternalException
getVariable
private Variable getVariable(java.lang.String name)
throws AnalyseException
- Throws:
AnalyseException
getOperator
private Operator getOperator(java.lang.String name)
throws InternalException
- Throws:
InternalException
createIfElse
private IfElse createIfElse()
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createWhile
private While createWhile()
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createFor
private For createFor()
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createIoOperation
private IoOperation createIoOperation(java.lang.String operation,
java.lang.String io)
throws InternalException,
AnalyseException
- Throws:
InternalException
AnalyseException
createBlock
private Block createBlock()
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException
createCommands
private Command[] createCommands()
throws AnalyseException,
InternalException
- Throws:
AnalyseException
InternalException