Пример #1
0
 /// <summary>
 /// Creates a new compiler
 /// </summary>
 /// <param name="inputFile">The file containing the source code</param>
 public Compiler(string inputFile)
 {
     Reporter   = new ErrorReporter();
     Reader     = new FileReader(inputFile);
     Tokenizer  = new Tokenizer(Reader, Reporter);
     Parser     = new Parser(Reporter);
     Identifier = new DeclarationIdentifier(Reporter);
     Checker    = new TypeChecker(Reporter);
 }
Пример #2
0
 /// <summary>
 /// Creates a new compiler
 /// </summary>
 /// <param name="inputFile">The file containing the source code</param>
 /// <param name="binaryOutputFile">The file to write the binary target code to</param>
 /// <param name="textOutputFile">The file to write the text asembly code to</param>
 public Compiler(string inputFile, string binaryOutputFile, string textOutputFile)
 {
     Reporter   = new ErrorReporter();
     Reader     = new FileReader(inputFile);
     Tokenizer  = new Tokenizer(Reader, Reporter);
     Parser     = new Parser(Reporter);
     Identifier = new DeclarationIdentifier(Reporter);
     Checker    = new TypeChecker(Reporter);
     Generator  = new CodeGenerator(Reporter);
     Writer     = new TargetCodeWriter(binaryOutputFile, textOutputFile, Reporter);
 }