openjava.ojc
Class Compiler

java.lang.Object
  |
  +--openjava.ojc.Compiler
Direct Known Subclasses:
GUICompiler

public class Compiler
extends Object


Field Summary
(package private)  CompilationUnit[] added_cu
           
(package private)  CommandArguments arguments
           
(package private)  File[] files
           
(package private)  JavaCompiler java_compiler
           
private static int nonpubclassid
           
private static String unknownClassName
           
 
Constructor Summary
(package private) Compiler(CommandArguments arguments)
           
 
Method Summary
private static String baseName(File file)
           
private static String class2path(String cname)
           
(package private)  void configSpecifiedMetaBind()
           
(package private)  void generateAdditionalCompilationUnit()
           
(package private)  void generateParseTree(FileEnvironment[] file_env, CompilationUnit[] comp_unit)
           
private static String getMainClassName(FileEnvironment env, CompilationUnit comp_unit)
          Obtains the simple name of the public class in the given compilation unit.
private  File getOutputFile(File fin, FileEnvironment file_env, CompilationUnit comp_unit, String suffix)
           
private  File getOutputFile(File fin, String pack, String name, String suffix)
           
(package private)  void initDebug()
           
(package private)  void initParseTree(FileEnvironment[] file_env, CompilationUnit[] comp_unit)
           
private  void javac(FileEnvironment[] fenv, CompilationUnit[] comp_unit)
          Compiles the generated files into byte codes
private  OJClass makeOJClass(Environment env, ClassDeclaration cdecl)
          -> to move to OJClass.forParseTree()
(package private)  void outputToDebugFile(FileEnvironment[] fenv, CompilationUnit[] comp_unit, String suffix)
           
(package private)  void outputToFile(FileEnvironment[] fenv, CompilationUnit[] comp_unit)
           
private static CompilationUnit parse(File file)
           
private static void recordInnerClasses(OJClass c)
           
private  void resolveOrder(OJClass clazz)
           
 void run()
           
(package private)  void translateCalleeSide(FileEnvironment[] file_env, CompilationUnit[] comp_unit)
           
(package private)  void translateCallerSide(FileEnvironment[] file_env, CompilationUnit[] comp_unit)
           
private  void translateClassDecls(Hashtable table, OJClass clazz, Environment env)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arguments

CommandArguments arguments

files

File[] files

java_compiler

JavaCompiler java_compiler

added_cu

CompilationUnit[] added_cu

unknownClassName

private static final String unknownClassName
See Also:
Constant Field Values

nonpubclassid

private static int nonpubclassid
Constructor Detail

Compiler

Compiler(CommandArguments arguments)
Method Detail

run

public void run()

configSpecifiedMetaBind

void configSpecifiedMetaBind()
                       throws Exception
Exception

generateParseTree

void generateParseTree(FileEnvironment[] file_env,
                       CompilationUnit[] comp_unit)

getMainClassName

private static String getMainClassName(FileEnvironment env,
                                       CompilationUnit comp_unit)
                                throws ParseTreeException
Obtains the simple name of the public class in the given compilation unit.

ParseTreeException

recordInnerClasses

private static void recordInnerClasses(OJClass c)

generateAdditionalCompilationUnit

void generateAdditionalCompilationUnit()

makeOJClass

private OJClass makeOJClass(Environment env,
                            ClassDeclaration cdecl)
-> to move to OJClass.forParseTree()


initDebug

void initDebug()

outputToDebugFile

void outputToDebugFile(FileEnvironment[] fenv,
                       CompilationUnit[] comp_unit,
                       String suffix)

outputToFile

void outputToFile(FileEnvironment[] fenv,
                  CompilationUnit[] comp_unit)

class2path

private static final String class2path(String cname)

getOutputFile

private File getOutputFile(File fin,
                           FileEnvironment file_env,
                           CompilationUnit comp_unit,
                           String suffix)
                    throws ParseTreeException
ParseTreeException

getOutputFile

private File getOutputFile(File fin,
                           String pack,
                           String name,
                           String suffix)

baseName

private static String baseName(File file)

initParseTree

void initParseTree(FileEnvironment[] file_env,
                   CompilationUnit[] comp_unit)

translateCalleeSide

void translateCalleeSide(FileEnvironment[] file_env,
                         CompilationUnit[] comp_unit)

translateClassDecls

private void translateClassDecls(Hashtable table,
                                 OJClass clazz,
                                 Environment env)

resolveOrder

private void resolveOrder(OJClass clazz)
                   throws InterruptedException
InterruptedException

translateCallerSide

void translateCallerSide(FileEnvironment[] file_env,
                         CompilationUnit[] comp_unit)

parse

private static CompilationUnit parse(File file)

javac

private void javac(FileEnvironment[] fenv,
                   CompilationUnit[] comp_unit)
Compiles the generated files into byte codes


SourceForge.net_Logo