org.jmlspecs.jml4.rac
Class RacCompiler

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.Compiler
      extended by org.jmlspecs.jml4.rac.RacCompiler
All Implemented Interfaces:
ITypeRequestor, ProblemSeverities

public class RacCompiler
extends Compiler

A RAC compiler for JML.

Author:
Yoonsik Cheon and Amritam

Field Summary
 
Fields inherited from class org.eclipse.jdt.internal.compiler.Compiler
annotationProcessorManager, DEBUG, DebugRequestor, jmlBinaryLookup, jmlSourceLookup, lookupEnvironment, options, parser, parseThreshold, problemReporter, progress, referenceBindings, remainingIterations, requestor, stats, totalUnits, unitsToProcess, useSingleThread
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.problem.ProblemSeverities
Abort, AbortCompilation, AbortCompilationUnit, AbortMethod, AbortType, Error, Fatal, Ignore, Optional, SecondaryError, Warning
 
Constructor Summary
RacCompiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory)
          Creates a new compiler using the given name environment and compiler options.
RacCompiler(INameEnvironment environment, IErrorHandlingPolicy policy, CompilerOptions options, ICompilerRequestor requestor, IProblemFactory problemFactory, java.io.PrintWriter out, CompilationProgress progress)
          Creates a new compiler using the given parameters.
 
Method Summary
 void generateRacCode(CompilationUnitDeclaration currentUnit, java.util.Map<ASTNode,java.lang.Integer> dirtyBits, int index)
          Process a new compilation unit for RAC code generation.
 void initializeParser()
          Initializes a parser for this compiler.
 void process(CompilationUnitDeclaration unit, int i)
          Processes a compilation unit already parsed and built.
 
Methods inherited from class org.eclipse.jdt.internal.compiler.Compiler
accept, accept, accept, compile, getUnitToProcess, reset, resolve, resolve, setBinaryTypes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RacCompiler

public RacCompiler(INameEnvironment environment,
                   IErrorHandlingPolicy policy,
                   CompilerOptions options,
                   ICompilerRequestor requestor,
                   IProblemFactory problemFactory)
Creates a new compiler using the given name environment and compiler options. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requester.


RacCompiler

public RacCompiler(INameEnvironment environment,
                   IErrorHandlingPolicy policy,
                   CompilerOptions options,
                   ICompilerRequestor requestor,
                   IProblemFactory problemFactory,
                   java.io.PrintWriter out,
                   CompilationProgress progress)
Creates a new compiler using the given parameters. The environment and options will be in effect for the lifetime of the compiler. When the compiler is run, compilation results are sent to the given requester.

Method Detail

initializeParser

public void initializeParser()
Initializes a parser for this compiler. Overridden here to create a parser that can parse RAC code translated from JML specifications.

Overrides:
initializeParser in class Compiler
See Also:
RacParser

process

public void process(CompilationUnitDeclaration unit,
                    int i)
Processes a compilation unit already parsed and built. This method is overridden here to introduce RAC-specific steps such as RAC code generation and second round of compilation.

Overrides:
process in class Compiler

generateRacCode

public void generateRacCode(CompilationUnitDeclaration currentUnit,
                            java.util.Map<ASTNode,java.lang.Integer> dirtyBits,
                            int index)
Process a new compilation unit for RAC code generation. This method generates and parses RAC code for the given compilation unit, combines its parse tree with that of the source compilation unit, and finally does type and flow analysis for the combined parse tree.