coins.drivergen
Class Generator

java.lang.Object
  extended bycoins.drivergen.Generator

public class Generator
extends java.lang.Object

A driver generator for the COINS Compiler Driver API. The Generator generate a new driver which is one of the the COINS Compiler. the new driver class is created as the subclass of Driver class, and the Generator generate its Compile method in order to the input file which orders the compile processes.


Field Summary
protected static java.lang.String[] classDecl
          class declaration line
protected static java.lang.String[] compileFooter
          compile method footer part
protected static java.lang.String[] compileHeader
          compile method header part
protected static java.lang.String defaultDriverName
          File name of new driver
protected static java.lang.String[] footer1
          The footer part of the new driver (1/3).
protected static java.lang.String[] footer2
          The footer part of the new driver (2/3).
protected static java.lang.String[] footer3
          The footer part of the new driver (3/3).
protected static java.lang.String[] header
          The header part of the new driver.
protected  java.lang.String myName
          A name in trace messages.
protected static java.io.FileWriter out
          FileWriter for new driver
 
Constructor Summary
Generator()
           
 
Method Summary
protected  void generateCompile(java.io.File orderFile)
          Output the contents of compile methos part of the mydriver.java
protected  void go(java.lang.String[] args)
          Output the contents of mydriver.java
static void main(java.lang.String[] args)
          A main function to generate a driver program file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDriverName

protected static final java.lang.String defaultDriverName
File name of new driver

See Also:
Constant Field Values

out

protected static java.io.FileWriter out
FileWriter for new driver


header

protected static final java.lang.String[] header
The header part of the new driver.


classDecl

protected static final java.lang.String[] classDecl
class declaration line


compileHeader

protected static final java.lang.String[] compileHeader
compile method header part


compileFooter

protected static final java.lang.String[] compileFooter
compile method footer part


footer1

protected static final java.lang.String[] footer1
The footer part of the new driver (1/3).


footer2

protected static final java.lang.String[] footer2
The footer part of the new driver (2/3).


footer3

protected static final java.lang.String[] footer3
The footer part of the new driver (3/3).


myName

protected java.lang.String myName
A name in trace messages. Derived classes can override it.

Constructor Detail

Generator

public Generator()
Method Detail

generateCompile

protected void generateCompile(java.io.File orderFile)
                        throws java.io.FileNotFoundException,
                               java.io.IOException
Output the contents of compile methos part of the mydriver.java

Parameters:
orderFile - input file name
Throws:
java.io.FileNotFoundException
java.io.IOException

go

protected void go(java.lang.String[] args)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Output the contents of mydriver.java

Parameters:
args - input file name
Throws:
java.io.FileNotFoundException
java.io.IOException

main

public static void main(java.lang.String[] args)
A main function to generate a driver program file.

Parameters:
args - a order file which order the processes of the driver.