Interface of interactive compiler to a client such as an IDE The model the presentation compiler consists of the following parts:
Signals a request for a fresh background compiler run.
Signals a request for a fresh background compiler run. Note: The object has to stay top-level so that the PresentationCompilerThread may access it.
This is the interactive compiler of Jawa.
this object collects info from the symbol table and builds Global, JawaClass, and JawaMethod
A presentation compiler thread.
A presentation compiler thread. This is a lightweight class, delegating most of its functionality to the compiler instance.
Typical interaction, given a predicate <user-input>, a function <display>, and an exception handler <handle>:
Typical interaction, given a predicate <user-input>, a function <display>, and an exception handler <handle>:
val TIMEOUT = 100 // (milliseconds) or something like that val r = new Response() while (!r.isComplete && !r.isCancelled) { if (<user-input>) r.cancel() else r.get(TIMEOUT) match { case Some(Left(data)) => <display>(data) case Some(Right(exc)) => <handle>(exc) case None => } }
Signals a request for a shutdown of the presentation compiler.
Signals a request for a shutdown of the presentation compiler. Note: The object has to stay top-level so that the PresentationCompilerThread may access it.
Interface of interactive compiler to a client such as an IDE The model the presentation compiler consists of the following parts:
unitOfFile: The map from sourcefiles to loaded units. A sourcefile/unit is loaded if it occurs in that map.
manipulated by: removeUnitOf, reloadSources.
A call to reloadSources will add the given sources to the loaded units, and start a new background compiler pass to compile all loaded units (with the indicated sources first). The background compiler thread can be interrupted each time an AST node is completely resolved in the following ways:
Actions under 1-2 can themselves be interrupted. High-priority actions under 4 cannot; they always run to completion. So these high-priority actions should to be short.
Normally, an interrupted action continues after the interrupting action is finished. However, if the interrupting action created a new run, the interrupted action is aborted. If there's an outstanding response, it will be set to a Right value with a FreshRunReq exception.