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.

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

trait CompilerBase[N, T, C]
trait ServerWithConfig[N, T, C]
class Object
trait Matchable
class Any
trait Compiler[N, T]

Type members

Inherited classlikes

case class RangePair(sstart: Int, send: Int, tstart: Int, tend: Int)
Inherited from
ServerWithConfig
case class TreeAction(name: String, uri: String, from: N, to: String)

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.

Inherited from
CompilerBase

Value members

Abstract methods

def parse(source: Source): ParseResult[T]

Parse a source, returning a parse result.

Parse a source, returning a parse result.

Concrete methods

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.

Inherited methods

def clearDiagnostics(name: String): Unit
Inherited from
ServerWithConfig
def clearSemanticMessages(source: Source, config: C): Unit

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

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

Inherited from
CompilerBase
def clearSyntacticMessages(source: Source, config: C): Unit

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

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

Inherited from
CompilerBase
def compileFile(filename: String, config: C, encoding: String): Unit

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

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

Inherited from
CompilerBase
def compileFiles(config: C): Unit

Compile the files one by one.

Compile the files one by one.

Inherited from
CompilerBase
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. If makeast produces messages, report them.

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.

Inherited from
CompilerBase
def compileString(name: String, input: String, config: C): Unit

Compile input from a string.

Compile input from a string.

Inherited from
CompilerBase
def connect(aClient: Client): Unit
Inherited from
ServerWithConfig
def convertPosition(optPos: Option[Position]): Position
Inherited from
ServerWithConfig
def convertRange(optStart: Option[Position], optFinish: Option[Position]): Range
Inherited from
ServerWithConfig
def convertSeverity(severity: Severity): DiagnosticSeverity
Inherited from
ServerWithConfig
def createAndInitConfig(args: Seq[String]): Either[String, C]

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.

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.

Inherited from
CompilerBase
def createConfig(args: Seq[String]): C

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

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

Inherited from
CompilerBase
def driver(args: Seq[String]): Unit

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.

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.

Inherited from
CompilerBase
def format(ast: T): Document

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

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

Inherited from
CompilerBase
def getCodeActions(position: Position): Option[Vector[TreeAction]]

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.

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.

Inherited from
CompilerBase
def getDefinition(position: Position): Option[N]

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

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

Inherited from
CompilerBase
def getFormatted(source: Source): Option[String]

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

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

Inherited from
CompilerBase
def getHover(position: Position): Option[String]

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

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

Inherited from
CompilerBase
def getReferences(position: Position, includeDecl: Boolean): Option[Vector[N]]

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.

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.

Inherited from
CompilerBase
def getSymbols(source: Source): Option[Vector[DocumentSymbol]]

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

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

Inherited from
CompilerBase
def launch(config: C): Unit
Inherited from
ServerWithConfig
def locationOfNode(node: N): Location
Inherited from
ServerWithConfig
def logMessage(msg: String): Unit
Inherited from
ServerWithConfig
def main(args: Array[String]): Unit

The entry point for this compiler.

The entry point for this compiler.

Inherited from
CompilerBase
def messageToDiagnostic(message: Message): Diagnostic
Inherited from
ServerWithConfig
def name: String

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

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

Inherited from
CompilerBase
def pairsToMap(pairs: List[RangePair], key: RangePair => OffsetRange, value: RangePair => OffsetRange): Array[RangeEntry]
Inherited from
ServerWithConfig
def positionOfStartFinish(optStart: Option[Position], optFinish: Option[Position]): Option[(Int, Int)]
Inherited from
ServerWithConfig
def positionsOfDocument(document: Document): List[RangePair]
Inherited from
ServerWithConfig
def process(source: Source, ast: T, config: C): Unit

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.

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.

Inherited from
CompilerBase
def publishDiagnostics(name: String, diagnostics: Vector[Diagnostic]): Unit
Inherited from
ServerWithConfig
def publishMessages(messages: Messages): Unit
Inherited from
ServerWithConfig
def publishProduct(source: Source, name: String, language: String, document: Document, append: Boolean): Unit
Inherited from
ServerWithConfig
def publishProductStr(source: Source, name: String, language: String, message: String, append: Boolean): Unit
Inherited from
ServerWithConfig
def publishSourceProduct(source: Source, document: => Document): Unit
Inherited from
CompilerBase
def publishSourceTreeProduct(source: Source, document: => Document): Unit
Inherited from
CompilerBase
def rangeOfNode(node: N): Range
Inherited from
ServerWithConfig
def registerCapability(id: String, method: String, options: Object): Unit
Inherited from
ServerWithConfig
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.

Inherited from
CompilerBase
def run(config: C): Unit

Run the compiler given a configuration.

Run the compiler given a configuration.

Inherited from
CompilerBase
def setSettings(settings: Object): Unit
Inherited from
ServerWithConfig
def setSettings(settings: JsonObject): Unit
Inherited from
ServerWithConfig
def setting[V](key: String, get: JsonElement => V, default: V): V
Inherited from
ServerWithConfig
def settingArray(key: String, default: JsonArray): JsonArray
Inherited from
ServerWithConfig
def settingBool(key: String, default: Boolean): Boolean
Inherited from
ServerWithConfig
def settingInt(key: String, default: Int): Int
Inherited from
ServerWithConfig
def settingStr(key: String, default: String): String
Inherited from
ServerWithConfig
def settings(): JsonObject
Inherited from
ServerWithConfig
def showMessage(tipe: MessageType, msg: String): Unit
Inherited from
ServerWithConfig
def sortBySourceRangeSize(pairs: Array[RangeEntry]): Array[RangeEntry]
Inherited from
ServerWithConfig

Inherited fields

val messaging: Messaging

The messaging facilitiy used by this compiler.

The messaging facilitiy used by this compiler.

Inherited from
CompilerBase
val positions: Positions

The position store used by this compiler.

The position store used by this compiler.

Inherited from
CompilerBase
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.

Inherited from
CompilerBase