|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Compiler
org.multijava.mjc.Main
org.jmlspecs.checker.Main
org.jmlspecs.jmlrac.Main
A class implementing the entry point of the JML RAC compiler.
Main,
Main| Nested Class Summary | |
class |
Main.JavaParseTask
A parser class for the seconding round compilation. |
class |
Main.JmlGenerateAssertionTask
A task for generating runtime assertion checker (RAC) code. |
class |
Main.JmlPrettyPrintTask
A task class for pretty-printing the trees in the AST forest. |
class |
Main.JmlWriteAssertionTask
A task class for generating RAC code. |
| Nested classes inherited from class org.jmlspecs.checker.Main |
Main.JmlCheckAssignableTask, Main.JmlParseTask, Main.JmlTypecheckTask |
| Nested classes inherited from class org.multijava.mjc.Main |
Main.CheckInitializerTask, Main.CheckInterfaceTask, Main.ContextBehavior, Main.DFilter, Main.ExpectedGF, Main.ExpectedIndifferent, Main.ExpectedResult, Main.ExpectedType, Main.ParseTask, Main.PreprocessTask, Main.PrettyPrintTask, Main.ResolveSpecializerTask, Main.ResolveTopMethodTask, Main.Task, Main.TaskTimes, Main.TranslateMJTask, Main.TreeProcessingTask, Main.Trees, Main.TypecheckTask |
| Field Summary | |
protected boolean |
isSecondRound
Indicates whether we are in the first or second round of compilation. |
static ModifierUtility |
modUtil
Default modifier utility to use. |
static int |
PRI_GENERATE_ASSERTION
Task priorities for tasks defined in this class. |
static int |
PRI_GENERATE_SYMBOL
|
private Map |
racFileMap
Map from temp RAC file names to their original file names |
static RacOptions |
racOptions
Command-line options. |
| Fields inherited from class org.jmlspecs.checker.Main |
jmlOptions, refinedFileSequenceSet |
| Fields inherited from class org.multijava.util.compiler.Compiler |
PRINT_TO_ERR, PRINT_TO_OUT |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
|
Main()
Constructs a JML RAC compiler with a default modifier utility. |
protected |
Main(ModifierUtility modUtil)
Constructs a JML RAC compiler with the given modifier utility, modUtil. |
| Method Summary | |
void |
classToGenerate(CSourceClass clazz)
Adds a class to the list of classes to be generated in bytecode. |
static boolean |
compile(String[] args)
Runs a JML RAC compiler on the given arguments. |
static boolean |
compile(String[] args,
RacOptions opt,
OutputStream os)
Entry point for the GUI |
CCompilationUnitContextType |
createCompilationUnitContext(JCompilationUnitType jc,
CCompilationUnit cunit)
Creates a compilation unit context for this compiler. |
protected JmlRacGenerator |
createRacGenerator(RacOptions opt,
Main main)
|
protected Main.Task |
createTaskAfter(Main.Task oldTask)
Returns the next task to be performed after oldTask. |
protected void |
exposeOptions(JmlCommonOptions opt)
Sets the static field, jmlOptions, to the given
arugment so that typechecking routines can access command-line
options. |
private static JmlCompilationUnit[] |
filterOut(CompilerPassEnterable[] trees)
Filter out files that aren't to be processed; we do however keep non-.java files, whatever their suffix. |
Main.ParseTask |
firstTask(File filename,
Main.ExpectedResult expected)
Generates the first task in the compilation sequence. |
Main.ParseTask |
firstTask(ArrayList infiles)
Generates the first task in the compilation sequence. |
protected Map |
getFileMap()
Accessor method to racFileMap. |
protected MjcCommonOptions |
getOptionsInstance(MjcCommonOptions opt)
Assigns opt to the local instance of RacOptions, assigns opt to an instance of jmlOptions in the checker, and returns opt as an instance of MjcCommonOptions so it can be assigned to the options variable in mjc's Main. |
static boolean |
hasOptionXsymr()
|
static boolean |
hasOptionXsymw()
|
protected void |
initSecondSession()
Initializes the "class loader" for the second round of compilation. |
static boolean |
isSpecMode(JmlTypeDeclaration decl)
Returns true if this type should be processed in spec mode - that is if methods and constructors without bodies are allowed. |
static void |
main(String[] args)
Runs a JML RAC compiler on the command line arguments. |
protected MjcCommonOptions |
makeOptionsInstance()
Creates an object to do the parsing of the command line arguments and to store the values of the flags and options so obtained (it does not actually do the argument parsing). |
protected void |
prepareSecondRound()
Prepares the second round of compilation by cleaning side-effects done by the first round. |
protected void |
setFileMap(Map map)
|
| Methods inherited from class org.jmlspecs.checker.Main |
canStopSequenceBeforeAllPasses, catchUpRefinedFile, catchUpTask, compile, filenameFilter, getDefaultFilter, getWarningFilterNameFromOptions, hasOptionXobspure, hasUnsafeOpWarningOption, includeAllRefinedCUnits, initialize, initSession, isCommandLineFile, isSpecOrJmlMode, jmlNoBodyOK, makeRelative, parseArguments |
| Methods inherited from class org.multijava.util.compiler.Compiler |
getTimestamp, inform, inform, inform, inform, inform, inform, inform, inform, inform, modUtil, run, setOutputStream, verifyFiles, verifyFiles |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PRI_GENERATE_ASSERTION
public static final int PRI_GENERATE_SYMBOL
private Map racFileMap
public static final ModifierUtility modUtil
protected boolean isSecondRound
public static RacOptions racOptions
invariant racOptions == options;
| Constructor Detail |
public Main()
protected Main(ModifierUtility modUtil)
modUtil.
| Method Detail |
public static void main(String[] args)
public static boolean compile(String[] args)
public static boolean compile(String[] args,
RacOptions opt,
OutputStream os)
args - the file, package, and directory namesopt - the options for the toolos - the output stream for the compiler messagespublic static boolean isSpecMode(JmlTypeDeclaration decl)
public Main.ParseTask firstTask(ArrayList infiles)
also requires infiles != null && (\forall Object o; infiles.contains(o); o instanceof String);
firstTask in class Main
public Main.ParseTask firstTask(File filename,
Main.ExpectedResult expected)
firstTask in class Mainprotected MjcCommonOptions makeOptionsInstance()
makeOptionsInstance in class MainRacOptionsprotected MjcCommonOptions getOptionsInstance(MjcCommonOptions opt)
getOptionsInstance in class Mainprotected void exposeOptions(JmlCommonOptions opt)
jmlOptions, to the given
arugment so that typechecking routines can access command-line
options.
also assignable jmlOptions; ensures jmlOptions == opt;
exposeOptions in class Main
public CCompilationUnitContextType createCompilationUnitContext(JCompilationUnitType jc,
CCompilationUnit cunit)
also requires cunit != null; ensures \result != null && contextsCreated.contains(\result);
createCompilationUnitContext in class Mainpublic void classToGenerate(CSourceClass clazz)
also requires clazz != null; assignable classes; ensures classes.contains(clazz);
classToGenerate in class Mainprotected void prepareSecondRound()
protected void initSecondSession()
protected Main.Task createTaskAfter(Main.Task oldTask)
oldTask.
This method uses the dynamic type of oldTask along
with the command line options to determine what task to add to
the task queue after the given task completes. It is overriden
here to add JML RAC specific tasks.
also requires oldTask != null;
createTaskAfter in class Mainprivate static JmlCompilationUnit[] filterOut(CompilerPassEnterable[] trees)
protected JmlRacGenerator createRacGenerator(RacOptions opt,
Main main)
protected Map getFileMap()
protected void setFileMap(Map map)
public static boolean hasOptionXsymr()
Main-Xsym or
-Xsymr is specified. This option lets the compiler
to parse external symbol table files instead of the source
files.
public static boolean hasOptionXsymw()
Main-Xsym or
-Xsymw is specified. This option lets the compiler
to generate external symbol table files as the compilation
result.
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||