org.bitbucket.inkytonik.kiama.util

CompilerBase

trait CompilerBase[N, T <: N, C <: Config] extends ServerWithConfig[N, T, C]

Trait to provide basic functionality for a compiler-like program constructed from phases, including profiling and timing support. N is the syntax tree node type used by this compiler. T is the type of the syntax tree communicated from the parser to the main processing of the compiler. C is the type of the configuration.

Source
Compiler.scala
Linear Supertypes
ServerWithConfig[N, T, C], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CompilerBase
  2. ServerWithConfig
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class RangePair(sstart: Int, send: Int, tstart: Int, tend: Int) extends scala.Product with Serializable

    Definition Classes
    ServerWithConfig
  2. case class TreeAction(name: String, uri: String, from: N, to: String) extends scala.Product with Serializable

    A representation of a simple named code action that replaces a tree node with other text.

Abstract Value Members

  1. abstract def createConfig(args: Seq[String]): C

    Create the configuration for a particular run of the compiler.

    Create the configuration for a particular run of the compiler. Override this if you have a custom configuration for your compiler.

  2. abstract def format(ast: T): Document

    Format an abstract syntax tree for printing.

    Format an abstract syntax tree for printing. Default: return an empty document.

  3. abstract def makeast(source: Source, config: C): Either[T, Messages]

    Make the contents of the given source, returning the AST wrapped in Left.

    Make the contents of the given source, returning the AST wrapped in Left. Return Right with messages if an AST cannot be made. config provides access to all aspects of the configuration.

  4. abstract def name: String

    The name of the language that this compiler processes.

    The name of the language that this compiler processes. The best choice is the extension used for files containing this language.

  5. abstract def process(source: Source, ast: T, config: C): Unit

    Function to process the input that was parsed.

    Function to process the input that was parsed. source is the input text processed by the compiler. ast is the abstract syntax tree produced by the parser from that text. config provides access to all aspects of the configuration.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clearDiagnostics(name: String): Unit

    Definition Classes
    ServerWithConfig
  8. def clearSemanticMessages(source: Source, config: C): Unit

    Clear any previously reported semantic messages.

    Clear any previously reported semantic messages. By default, do nothing.

  9. def clearSyntacticMessages(source: Source, config: C): Unit

    Clear any previously reported semantic messages.

    Clear any previously reported semantic messages. By default, clear the servers's source and sourcetree products.

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def compileFile(filename: String, config: C, encoding: String = "UTF-8"): Unit

    Compile input from a file.

    Compile input from a file. The character encoding of the file is given by the encoding argument (default: UTF-8).

  12. def compileFiles(config: C): Unit

    Compile the files one by one.

  13. def compileSource(source: Source, config: C): Unit

    Compile the given source by using makeast to turn its contents into an abstract syntax tree and then by process which conducts arbitrary processing on the AST.

    Compile the given source by using makeast to turn its contents into an abstract syntax tree and then by process which conducts arbitrary processing on the AST. If makeast produces messages, report them.

  14. def compileString(name: String, input: String, config: C): Unit

    Compile input from a string.

  15. def connect(aClient: Client): Unit

    Definition Classes
    ServerWithConfig
  16. def convertPosition(optPos: Option[Position]): eclipse.lsp4j.Position

    Definition Classes
    ServerWithConfig
  17. def convertRange(optStart: Option[Position], optFinish: Option[Position]): Range

    Definition Classes
    ServerWithConfig
  18. def convertSeverity(severity: Severity): DiagnosticSeverity

    Definition Classes
    ServerWithConfig
  19. def createAndInitConfig(args: Seq[String]): Either[String, C]

    Create and initialise the configuration for a particular run of the compiler.

    Create and initialise the configuration for a particular run of the compiler. Default: call createConfig and then initialise the resulting configuration. Returns either the created configuration or an error message describing why the configuration couldn't be created.

  20. def driver(args: Seq[String]): Unit

    Command-line driver for this compiler.

    Command-line driver for this compiler. First, use the argument list to create a configuration for this execution. Then, use the configuration to run the file compilation in the appropriate way.

  21. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  25. def getCodeActions(position: Position): Option[Vector[TreeAction]]

    Return applicable code actions for the given position (if any).

    Return applicable code actions for the given position (if any). Each action is in terms of an old tree node and a new node that replaces it. Default is to return no actions.

  26. def getDefinition(position: Position): Option[N]

    Return the corresponding definition node for the given position (if any).

    Return the corresponding definition node for the given position (if any). Default is to never return anything.

  27. def getFormatted(source: Source): Option[String]

    Return a formatted version of the whole of the given source.

    Return a formatted version of the whole of the given source. By default, return None meaning there is no formatter.

  28. def getHover(position: Position): Option[String]

    Return markdown hover markup for the given position (if any).

    Return markdown hover markup for the given position (if any). Default is to never return anything.

  29. def getReferences(position: Position, includeDecl: Boolean): Option[Vector[N]]

    Return the corresponding reference nodes (uses) of the symbol at the given position (if any).

    Return the corresponding reference nodes (uses) of the symbol at the given position (if any). If includeDecl is true, also include the declaration of the symbol. Default is to never return anything.

  30. def getSymbols(source: Source): Option[Vector[DocumentSymbol]]

    Return the symbols frmo a compilation unit.

    Return the symbols frmo a compilation unit. Default is to return no symbols.

  31. def hashCode(): Int

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

    Definition Classes
    Any
  33. def launch(config: C): Unit

    Definition Classes
    ServerWithConfig
  34. def locationOfNode(node: N): Location

    Definition Classes
    ServerWithConfig
  35. def logMessage(msg: String): Unit

    Definition Classes
    ServerWithConfig
  36. def main(args: Array[String]): Unit

    The entry point for this compiler.

  37. def messageToDiagnostic(message: Message): Diagnostic

    Definition Classes
    ServerWithConfig
  38. val messaging: Messaging

    The messaging facilitiy used by this compiler.

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

    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. def pairToSourceRange(pair: RangePair): OffsetRange

    Definition Classes
    ServerWithConfig
  43. def pairToTargetRange(pair: RangePair): OffsetRange

    Definition Classes
    ServerWithConfig
  44. def pairsToMap(pairs: List[RangePair], key: (RangePair) ⇒ OffsetRange, value: (RangePair) ⇒ OffsetRange): Array[RangeEntry]

    Definition Classes
    ServerWithConfig
  45. def positionOfStartFinish(optStart: Option[Position], optFinish: Option[Position]): Option[(Int, Int)]

    Definition Classes
    ServerWithConfig
  46. val positions: Positions

    The position store used by this compiler.

  47. def positionsOfDocument(document: Document): List[RangePair]

    Definition Classes
    ServerWithConfig
  48. val profiler: Profiler

    Profiler for this compiler.

  49. def publishDiagnostics(name: String, diagnostics: Vector[Diagnostic]): Unit

    Definition Classes
    ServerWithConfig
  50. def publishMessages(messages: Messages): Unit

    Definition Classes
    ServerWithConfig
  51. def publishProduct(source: Source, name: String, language: String, document: Document = emptyDocument, append: Boolean = false): Unit

    Definition Classes
    ServerWithConfig
  52. def publishProductStr(source: Source, name: String, language: String, message: String = "", append: Boolean = false): Unit

    Definition Classes
    ServerWithConfig
  53. def publishSourceProduct(source: Source, document: ⇒ Document = emptyDocument): Unit

  54. def publishSourceTreeProduct(source: Source, document: ⇒ Document = emptyDocument): Unit

  55. def rangeOfNode(node: N): Range

    Definition Classes
    ServerWithConfig
  56. def registerCapability(id: String, method: String, options: AnyRef): Unit

    Definition Classes
    ServerWithConfig
  57. def report(source: Source, messages: Messages, config: C): Unit

    Output the messages in order of position to the configuration's output.

  58. def run(config: C): Unit

    Run the compiler given a configuration.

  59. def setSettings(settings: AnyRef): Unit

    Definition Classes
    ServerWithConfig
  60. def setSettings(settings: JsonObject): Unit

    Definition Classes
    ServerWithConfig
  61. def setting[V](key: String, get: (JsonElement) ⇒ V, default: V): V

    Definition Classes
    ServerWithConfig
  62. def settingArray(key: String, default: JsonArray = new JsonArray()): JsonArray

    Definition Classes
    ServerWithConfig
  63. def settingBool(key: String, default: Boolean = false): Boolean

    Definition Classes
    ServerWithConfig
  64. def settingInt(key: String, default: Int = 0): Int

    Definition Classes
    ServerWithConfig
  65. def settingStr(key: String, default: String = ""): String

    Definition Classes
    ServerWithConfig
  66. def settings(): JsonObject

    Definition Classes
    ServerWithConfig
  67. def showMessage(tipe: MessageType, msg: String): Unit

    Definition Classes
    ServerWithConfig
  68. def sortBySourceRangeSize(pairs: Array[RangeEntry]): Array[RangeEntry]

    Definition Classes
    ServerWithConfig
  69. val sources: Map[String, Source]

    The sources previously used by the semantic analysis phase of this compiler, indexed by source name.

  70. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  71. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ServerWithConfig[N, T, C]

Inherited from AnyRef

Inherited from Any

Ungrouped