mjc

org.multijava.mjc
Class Main.ParseTask

java.lang.Object
  extended byorg.multijava.mjc.Main.Task
      extended byorg.multijava.mjc.Main.ParseTask
All Implemented Interfaces:
Comparable, Main.Trees
Enclosing class:
Main

public class Main.ParseTask
extends Main.Task
implements Main.Trees

This class parses a group of files, given by filenames as strings, and generates a forest of ASTs.


Field Summary
private  Main.ExpectedResult expected
          The expected result of parsing files[0].
protected  File[] files
           
protected  CompilerPassEnterable[] trees
          The result of parsing the file(s) on which this was instantiated.
 
Fields inherited from class org.multijava.mjc.Main.Task
 
Constructor Summary
Main.ParseTask(File fileName, Main.ExpectedResult expected)
           
Main.ParseTask(ArrayList infiles)
           
 
Method Summary
 void execute()
          This is final so that subclasses do not eliminate check for file already being processed.
protected  JCompilationUnitType parseFile(File file)
          Parses the given file and returns an AST representing it.
 CompilerPassEnterable[] trees()
          Returns the result of parsing the file(s) on which this was instantiated.
 
Methods inherited from class org.multijava.mjc.Main.Task
compareTo, priority, sequenceID, setToMainSequenceID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

files

protected File[] files

trees

protected CompilerPassEnterable[] trees
The result of parsing the file(s) on which this was instantiated.


expected

private final Main.ExpectedResult expected
The expected result of parsing files[0].

Constructor Detail

Main.ParseTask

public Main.ParseTask(ArrayList infiles)

Main.ParseTask

public Main.ParseTask(File fileName,
                      Main.ExpectedResult expected)
Method Detail

execute

public final void execute()
This is final so that subclasses do not eliminate check for file already being processed. Subclasses change behavior by overriding parseFiles(File) method of this.


parseFile

protected JCompilationUnitType parseFile(File file)
Parses the given file and returns an AST representing it.

Parameters:
file - the file to be parsed
Returns:
the compilation unit defined by this file

 requires file!=null && (* file.exists() *); // !FIXME!
 

trees

public CompilerPassEnterable[] trees()
Returns the result of parsing the file(s) on which this was instantiated.

 also
 requires completed;
 

Specified by:
trees in interface Main.Trees

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.