itec.minicompiler
Class MiniComp
java.lang.Object
itec.minicompiler.MiniComp
- public class MiniComp
- extends java.lang.Object
The MiniComp
class is the executable part of the MiniCompiler, including
the main
-method where the Scanner
, the Parser
and the
ErrorHandler
are initialised and the source file is read.
The source file is read into a String what implies some limitations regarding to the
length of the source code. But as the MiniCompiler isn't meant to handler big
programs this is the most comfortable way. To make it easier for the Scanner
the end of the source code is additionally marked with a \0
.
- Version:
- 1.0 (29.09.2004)
- Author:
- Stefan Leitner, Stefan Schauer
Method Summary |
static void |
main(java.lang.String[] args)
The main method of MiniComp . |
private static java.lang.String |
readFile(java.lang.String sourceFile)
Read characters from a sourceFile into a String object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MiniComp
public MiniComp()
readFile
private static java.lang.String readFile(java.lang.String sourceFile)
- Read characters from a
sourceFile
into a String object.
- Parameters:
sourceFile
- The file which should be read
- Returns:
- The String object created by the characters read
from the
sourceFile
main
public static void main(java.lang.String[] args)
- The main method of
MiniComp
. Gets the filename of a source file
as first argument. Calls the Parser
and reports the errors occured
during parsing, if any.
- Parameters:
args
- List of arguments specified by the user