CompilerBase
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.
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.
Type members
Classlikes
Inherited classlikes
Value members
Abstract methods
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.
Format an abstract syntax tree for printing. Default: return an empty document.
Format an abstract syntax tree for printing. Default: return an empty document.
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.
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.
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.
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.
Concrete methods
Clear any previously reported semantic messages. By default, do nothing.
Clear any previously reported semantic messages. By default, do nothing.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 methods
- Inherited from
- ServerWithConfig
- Inherited from
- ServerWithConfig
- Inherited from
- ServerWithConfig
- Inherited from
- ServerWithConfig