Trait

org.argus.jawa.compiler.interactive

CompilerControl

Related Doc: package interactive

Permalink

trait CompilerControl extends AnyRef

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:

  1. by a new call to reloadSources. This starts a new background compiler pass. 2. by a call to askScopeCompletion, askToDoFirst, askLinkPos, askLastType. 3. by raising an exception in the scheduler. 4. by passing a high-priority action wrapped in ask { ... }.

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.

Self Type
Global
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CompilerControl
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class AskLinkPosItem(sym: JawaSymbol, response: Global.Response[Position]) extends Global.WorkItem with Product with Serializable

    Permalink
  2. case class AskParsedEnteredItem(source: SourceFile, keepLoaded: Boolean, response: Global.Response[CompilationUnit]) extends Global.WorkItem with Product with Serializable

    Permalink
  3. class AskToDoFirstItem extends Global.WorkItem

    Permalink
  4. case class AskTypeAtItem(pos: Position, response: Global.Response[Option[JawaSymbol]]) extends Global.WorkItem with Product with Serializable

    Permalink
  5. case class FilesDeletedItem(sources: List[SourceFile], response: Global.Response[Unit]) extends Global.WorkItem with Product with Serializable

    Permalink
  6. class NoWorkScheduler extends WorkScheduler

    Permalink

    A do-nothing work scheduler that responds immediately with MissingResponse.

    A do-nothing work scheduler that responds immediately with MissingResponse.

    Used during compiler shutdown.

  7. case class ReloadItem(sources: List[SourceFile], response: Global.Response[Unit]) extends Global.WorkItem with Product with Serializable

    Permalink
  8. type Response[T] = interactive.Response[T]

    Permalink
  9. abstract class WorkItem extends () ⇒ Unit

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def ask[A](op: () ⇒ A): A

    Permalink

    Asks for a computation to be done quickly on the presentation compiler thread

  6. def askFilesDeleted(sources: List[SourceFile], response: Global.Response[Unit]): Unit

    Permalink

    Removes source files and toplevel symbols, and issues a new typer run.

    Removes source files and toplevel symbols, and issues a new typer run. Returns () to syncvar response on completion.

  7. def askForResponse[A](op: () ⇒ A): Global.Response[A]

    Permalink

    Asks for a computation to be done on presentation compiler thread, returning a response with the result or an exception

  8. def askLinkPos(sym: JawaSymbol, response: Global.Response[Position]): Unit

    Permalink

    Sets sync var response to the position of the definition of the given link in the given sourcefile.

    Sets sync var response to the position of the definition of the given link in the given sourcefile.

    sym

    The symbol referenced by the link (might come from a classfile)

    response

    A response that will be set to the following: If source contains a definition that is referenced by the given link the position of that definition, otherwise NoPosition. Note: This operation does not automatically load source. If source is unloaded, it stays that way.

  9. def askParsedEntered(source: SourceFile, keepLoaded: Boolean, response: Global.Response[CompilationUnit]): Unit

    Permalink

    Set sync var response to the parse tree of source with all top-level symbols entered.

    Set sync var response to the parse tree of source with all top-level symbols entered.

    source

    The source file to be analyzed

    keepLoaded

    If set to true, source file will be kept as a loaded unit afterwards. If keepLoaded is false the operation is run at low priority, only after everything is brought up to date in a regular type checker run.

    response

    The response.

  10. def askReload(sources: List[SourceFile], response: Global.Response[Unit]): Unit

    Permalink

    Makes sure a set of compilation units is loaded and parsed.

    Makes sure a set of compilation units is loaded and parsed. Returns () to syncvar response on completion. Afterwards a new background compiler run is started with the given sources at the head of the list of to-be-compiled sources.

  11. def askReset(): Unit

    Permalink

    Cancels current compiler run and start a fresh one where everything will be re-typechecked (but not re-loaded).

  12. def askShutdown(): Unit

    Permalink

    Tells the compile server to shutdown, and not to restart again

  13. def askStructure(keepSrcLoaded: Boolean)(source: SourceFile, response: Global.Response[CompilationUnit]): Unit

    Permalink

    If source if not yet loaded, get an outline view with askParseEntered.

    If source if not yet loaded, get an outline view with askParseEntered. If source is loaded, return it. In both cases, set response to parsed tree.

    keepSrcLoaded

    If set to true, source file will be kept as a loaded unit afterwards.

  14. def askToDoFirst(source: SourceFile): Unit

    Permalink

    Asks to do unit corresponding to given source file on present and subsequent type checking passes.

    Asks to do unit corresponding to given source file on present and subsequent type checking passes. If the file is in the 'crashedFiles' ignore list it is removed and typechecked normally.

  15. def askTypeAt(pos: Position, response: Global.Response[Option[JawaSymbol]]): Unit

    Permalink

    Sets sync var response to the smallest fully attributed tree that encloses position pos.

    Sets sync var response to the smallest fully attributed tree that encloses position pos. Note: Unlike for most other ask... operations, the source file belonging to pos needs not be loaded.

  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getUnitOf(s: SourceFile): Option[Global.RichCompilationUnit]

    Permalink

    Return the compilation unit attached to a source file, or None if source is not loaded.

  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def locateAst(pos: Position): JawaAstNode

    Permalink

    Locate smallest tree that encloses position

    Locate smallest tree that encloses position

    pos

    Position must be loaded

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def onCompilerThread: Boolean

    Permalink
  29. def onUnitOf[T](source: SourceFile)(op: (Global.RichCompilationUnit) ⇒ T): T

    Permalink

    Run operation op on a compilation unit associated with given source.

    Run operation op on a compilation unit associated with given source. If source has a loaded compilation unit, this one is passed to op. Otherwise a new compilation unit is created, but not added to the set of loaded units.

  30. def parseCompilationUnit(source: SourceFile): Option[CompilationUnit]

    Permalink

    Returns parse tree for source source.

    Returns parse tree for source source. No symbols are entered. Syntax errors are reported.

    This method is thread-safe and as such can safely run outside of the presentation compiler thread.

  31. def removeUnitOf(s: SourceFile): Option[Global.RichCompilationUnit]

    Permalink

    Removes the CompilationUnit corresponding to the given SourceFile from consideration for recompilation.

  32. var scheduler: WorkScheduler

    Permalink

    The scheduler by which client and compiler communicate Must be initialized before starting compilerRunner

    The scheduler by which client and compiler communicate Must be initialized before starting compilerRunner

    Attributes
    protected[org.argus.jawa.compiler.interactive]
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped