Trait

org.bitbucket.inkytonik.kiama.util

CompilerWithConfig

Related Doc: package util

Permalink

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
Visibility
  1. Public
  2. All

Type Members

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

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

    Permalink

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

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

    Definition Classes
    CompilerBase

Abstract Value Members

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

    Permalink

    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

    Permalink

    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

    Permalink

    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]

    Permalink

    Parse a source, returning a parse result.

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

    Permalink

    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: 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 clearDiagnostics(name: String): Unit

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

    Permalink

    Clear any previously reported semantic messages.

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

    Definition Classes
    CompilerBase
  7. def clearSyntacticMessages(source: Source, config: C): Unit

    Permalink

    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
  8. def clone(): AnyRef

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

    Permalink

    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
  10. def compileFiles(config: C): Unit

    Permalink

    Compile the files one by one.

    Compile the files one by one.

    Definition Classes
    CompilerBase
  11. def compileSource(source: Source, config: C): Unit

    Permalink

    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
  12. def compileString(name: String, input: String, config: C): Unit

    Permalink

    Compile input from a string.

    Compile input from a string.

    Definition Classes
    CompilerBase
  13. def connect(aClient: Client): Unit

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

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

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

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

    Permalink

    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
  18. def driver(args: Seq[String]): Unit

    Permalink

    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
  19. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Permalink

    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
  24. def getDefinition(position: Position): Option[N]

    Permalink

    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
  25. def getFormatted(source: Source): Option[String]

    Permalink

    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
  26. def getHover(position: Position): Option[String]

    Permalink

    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
  27. def getReferences(position: Position, includeDecl: Boolean): Option[Vector[N]]

    Permalink

    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
  28. def getSymbols(source: Source): Option[Vector[DocumentSymbol]]

    Permalink

    Return the symbols frmo a compilation unit.

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

    Definition Classes
    CompilerBase
  29. def hashCode(): Int

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

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

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

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

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

    Permalink

    The entry point for this compiler.

    The entry point for this compiler.

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

    Permalink

    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
  36. def messageToDiagnostic(message: Message): Diagnostic

    Permalink
    Definition Classes
    ServerWithConfig
  37. val messaging: Messaging

    Permalink

    The messaging facilitiy used by this compiler.

    The messaging facilitiy used by this compiler.

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    ServerWithConfig
  45. val positions: Positions

    Permalink

    The position store used by this compiler.

    The position store used by this compiler.

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

    Permalink
    Definition Classes
    ServerWithConfig
  47. val profiler: Profiler

    Permalink

    Profiler for this compiler.

    Profiler for this compiler.

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

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

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

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

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

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

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

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

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

    Permalink

    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
  57. def run(config: C): Unit

    Permalink

    Run the compiler given a configuration.

    Run the compiler given a configuration.

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    ServerWithConfig
  65. def settings(): JsonObject

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

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

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

    Permalink

    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
  69. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from CompilerBase[N, T, C]

Inherited from ServerWithConfig[N, T, C]

Inherited from AnyRef

Inherited from Any

Ungrouped