org.bitbucket.inkytonik.kiama.util

CompilerWithConfig

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

A compiler that uses Parsers to produce positioned ASTs. C is the type of the compiler configuration.

Source
Compiler.scala
Linear Supertypes
CompilerBase[N, T, C], ServerWithConfig[N, T, C], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CompilerWithConfig
  2. CompilerBase
  3. ServerWithConfig
  4. AnyRef
  5. 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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  3. 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.

    Definition Classes
    CompilerBase
  4. abstract def parse(source: Source): ParseResult[T]

    Parse a source, returning a parse result.

  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.

    Definition Classes
    CompilerBase

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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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).

    Definition Classes
    CompilerBase
  12. def compileFiles(config: C): Unit

    Compile the files one by one.

    Compile the files one by one.

    Definition Classes
    CompilerBase
  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.

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

    Compile input from a string.

    Compile input from a string.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    Definition Classes
    CompilerBase
  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.

    The entry point for this compiler.

    Definition Classes
    CompilerBase
  37. def makeast(source: Source, config: C): Either[T, Messages]

    Make an AST by running the parser on the given source, returning messages instead if the parse fails.

    Make an AST by running the parser on the given source, returning messages instead if the parse fails.

    Definition Classes
    CompilerWithConfigCompilerBase
  38. def messageToDiagnostic(message: Message): Diagnostic

    Definition Classes
    ServerWithConfig
  39. val messaging: Messaging

    The messaging facilitiy used by this compiler.

    The messaging facilitiy used by this compiler.

    Definition Classes
    CompilerBase
  40. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

    Definition Classes
    ServerWithConfig
  47. val positions: Positions

    The position store used by this compiler.

    The position store used by this compiler.

    Definition Classes
    CompilerBase
  48. def positionsOfDocument(document: Document): List[RangePair]

    Definition Classes
    ServerWithConfig
  49. val profiler: Profiler

    Profiler for this compiler.

    Profiler for this compiler.

    Definition Classes
    CompilerBase
  50. def publishDiagnostics(name: String, diagnostics: Vector[Diagnostic]): Unit

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

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

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

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

    Definition Classes
    CompilerBase
  55. def publishSourceTreeProduct(source: Source, document: ⇒ Document = emptyDocument): Unit

    Definition Classes
    CompilerBase
  56. def rangeOfNode(node: N): Range

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

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

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

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

    Definition Classes
    CompilerBase
  59. def run(config: C): Unit

    Run the compiler given a configuration.

    Run the compiler given a configuration.

    Definition Classes
    CompilerBase
  60. def setSettings(settings: AnyRef): Unit

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

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

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

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

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

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

    Definition Classes
    ServerWithConfig
  67. def settings(): JsonObject

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

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

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

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

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

    Definition Classes
    CompilerBase
  71. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  72. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CompilerBase[N, T, C]

Inherited from ServerWithConfig[N, T, C]

Inherited from AnyRef

Inherited from Any

Ungrouped