YarnSpinner.Compiler
A basic block is a run of instructions inside a Node. Basic blocks group
instructions up into segments such that execution only ever begins at
the start of a block (that is, a program never jumps into the middle of
a block), and execution only ever leaves at the end of a block.
Gets the name of the label that this block begins at, or null if this basic block does not begin at a labelled instruction.
Gets the name of the node that this block is in.
Gets the index of the first instruction of the node that this block is in.
Gets the Node that this block was extracted from.
Gets a descriptive name for the block.
If this block begins at a labelled instruction, the name will be [NodeName].[LabelName]. Otherwise, it will be [NodeName].[FirstInstructionIndex].
Gets a string containing the textual description of the instructions
in this .
The to use when
converting instructions to strings.
The
that produced .
A string containing the text version of the
instructions.
Get the ancestors of this block - that is, blocks that may run immediately before this block.
Gets the destinations of this block - that is, blocks or nodes that
may run immediately after this block.
Gets the Instructions that form this block.
Adds a new destination to this block, that points to another block.
The new descendant node.
The condition under which will be run.
Thrown when descendant is
.
Adds a new destination to this block, that points to a node.
The name of the destination node.
The condition under which will be jumped to.
Thrown when is .
Adds a new destination to this block that represents a detour to a
node.
The name of the destination node.
The condition under which will be jumped to.
The name of the block that will be
returned to when the detour returns.
Thrown when is .
Adds a new destination to this block that points at any other node
in the program.
Adds a new destination to this block that points to a node, with a
option's line ID for context.
The new descendant node.
The condition under which the node will be run.
The line ID of the option that must be selected
in order for to run.
Thrown when is .
A destination represents a or node that may
be run, following the execution of a .
Destination objects represent links between blocks, or between
blocks and nodes.
Initialises a new instance of the
class.
The condition under which the
destination will be run.
An optional block that may be returned to
later in the program execution.
The condition that causes this destination to be reached.
When this destination is taken, if this value is non-null, a VM
should push this block onto the call stack. When a Return
instruction is reached, pop a block off the call stack and
return to it. If the value is null, the VM should clear the call
stack.
A destination that represents a jump or detour to a node.
Initialises a new instance of the
class.
The condition under which the
destination will be run.
An optional block that may be returned to
later in the program execution.
The name of the node to jump or detour
to.
The name of the node that this destination refers to.
A destination that represents a jump or detour to any possible node.
Initialises a new instance of the
class.
An optional block that may be returned to
later in the program execution.
A destination that represents a jump to a specific block.
The block that this destination refers to.
Gets the index of the first instruction of the block in its
containing node.
Initialises a new instance of the class.
The block that is jumped to.
The condition under which the
destination is taken.
A destination that represents an option being selected.
Initialises a new instance of the class.
The ID of the line associated with
this option.
The block that is jumped to when this option
is selected.
Gets or sets the ID of the line associated with this option.
Gets all descendants (that is, destinations, and destinations of
those destinations, and so on), recursively.
Cycles are detected and avoided.
Gets all descendants (that is, destinations, and destinations of
those destinations, and so on) that have any player-visible content,
recursively.
Cycles are detected and avoided.
The conditions under which a may be
reached at the end of a BasicBlock.
The Destination is reached because the preceding BasicBlock
reached the end of its execution, and the Destination's target
is the block immediately following.
The Destination is reached beacuse of an explicit instruction to
go to this block or node.
The Destination is reached because an expression evaluated to
true.
The Destination is reached because an expression evaluated to
false.
The Destination is reached because the player made an in-game
choice to go to it.
An abstract class that represents some content that is shown to the
player.
This class is used, rather than the runtime classes Yarn.Line or
Yarn.OptionSet, because when the program is being analysed, no
values for any substitutions are available. Instead, these classes
represent the data that is available offline.
A line of dialogue that should be shown to the player.
The string table ID of the line that will be shown to the player.
Initialises a new instance of the
class.
The ID of the line that this element
represents.
A collection of options that should be shown to the player.
Represents a single option that may be presented to the player.
The string table ID that will be shown to the player.
The destination that will be run if this option is selected
by the player.
The collection of options that will be delivered to the player.
Initialises a new instance of the
class.
The options that will be delivered to the
player.
A command that will be executed.
The text of the command.
Initialises a new instance of the
class.
The text of the command.
Gets the collection of player-visible content that will be delivered
when this block is run.
Player-visible content means lines, options and commands. When this
block is run, the entire contents of this collection will be
displayed to the player, in the same order as they appear in this
collection.
If this collection is empty, then the block contains no visible
content. This is the case for blocks that only contain logic, and do
not contain any lines, options or commands.
To tell the difference between the different kinds of content, use
the operator to check the type of each item:
foreach (var item in block.PlayerVisibleContent) {
if (item is LineElement line) {
// Do something with line
}
}
Contains extension methods for producing
objects from a Node.
Produces objects from a Node.
The node to get basic blocks from.
An object containing debugging information for
the node.
Provides methods for constructing objects.
To use this class, create an instance of it, and call the
With-prefixed methods to set properties. When you're done, access
the property to get the final, constructed
.
Gets the instance constructed by this .
Sets the of the .
The name to apply to the Declaration.
The instance that received
this method call.
Sets the of the .
The default value to apply to the
Declaration.
Sets the of the .
The description to apply to the
Declaration.
Sets the of the .
The source file name to apply to the
Declaration.
Sets the of the .
The source node name to apply to the
Declaration.
Sets the of the .
The range to apply to the Declaration.
Sets the of the .
The is-implicit value to apply to the
Declaration.
Sets the of the .
The type to apply to the Declaration.
Provides methods for constructing objects.
To use this class, create an instance of it, and call the
With-prefixed methods to set properties. When you're done, access
the property to get the final, constructed .
Creates a new given a CLR enum type.
The type of the CLR enum.
An optional description to apply to the
new Yarn enum type.
A Yarn type representing the enum.
Gets the constructed enum type.
Sets the property of the constructed
enum type.
The new name.
The instance that received
this method call.
Sets the property of the
constructed enum type.
The new description.
The instance that received
this method call.
Sets the property of the constructed
enum type.
The new raw type.
The instance that received
this method call.
Thrown if the enum has
any cases added to it.
Thrown if is neither a string type nor a number
type.
Adds a new string case to the constructed enum type.
The name of the case, as it appears in Yarn
Spinner scripts.
The raw value of the case.
The optional description for the
case.
The instance that received
this method call.
Adds a new string case to the constructed enum type.
The instance that received
this method call.
Adds a new case to the constructed enum type.
The name of the case, as it appears in Yarn
Spinner scripts.
The raw value of the case.
The optional description for the
case.
The type of the case.
Thrown if the raw type doesn't
match the enum's type, if a case with the given name already exists,
or if a case with the given value already exists.
Provides methods for constructing
objects.
To use this class, create an instance of it, and call the
With-prefixed methods to set properties. When you're done, access
the property to get the final, constructed
.
Gets the instance constructed by this
.
Sets the of the .
The return type to apply to the
function.
The instance that
received this method call.
Adds a new parameter of type to the
.
The type of the new parameter to add to the function.
Creates a new based on a delegate
type.
The type of a delegate to produce a type builder
from. This type must be a delegate.
A newly created .
Thrown when the provided
type is not a delegate or has invalid components.
Sets the of the
.
The variadic parameter type to
apply to the function.
The instance that
received this method call.
An input into a Yarn Spinner compilation.
The name of the input.
An object that contains Yarn source code to compile, and instructions on
how to compile it.
Instances of this struct are used with to produce objects.
Represents the contents of a file to compile.
The name of the file.
This may be a full path, or just the filename or anything in
between. This is useful for diagnostics, and for attributing
objects to their original source
files.
The source code of this file.
The type of compilation that the compiler will do.
The compiler will do a full compilation, and
generate a , function declaration set,
and string table.
The compiler will derive only the variable and
function declarations, and file tags, found in the
script.
Generate declarations only. This is equivalent to .
The compiler will generate a string table
only.
The structs that represent the content to
parse..
The that contains declarations for
functions.
The type of compilation to perform.
The declarations for variables.
The declarations for variables and functions.
Gets or sets the version of the Yarn language.
The collection of type declarations that should be imported and made
available to the compiler, prior to compilation.
A cancellation token that can be used to signal that the compilation
should be cancelled.
Creates a new using the contents of a
collection of files.
The paths to the files.
The containing functions
to use for this compilation.
A new .
Creates a new using the contents of a
collection of source inputs.
The inputs to the compilation.
The containing functions
to use for this compilation.
A new .
Creates a new using the contents of a
string.
The name to assign to the compiled
file.
The text to compile.
Library of function definitions to use during
compilation.
The version of the Yarn language to
use.
A new .
The result of a compilation.
Instances of this class are produced as a result of supplying a to .
Gets the compiled Yarn program that the
produced.
This value will be if there were errors
in the compilation. If this is the case,
will contain information describing the errors.
It will also be if the object's value was not .
Gets a dictionary mapping line IDs to StringInfo objects.
The string table contains the extracted line text found in the
provided source code. The keys of this dictionary are the line IDs
for each line - either through explicit line tags indicated through
the #line: tag, or implicitly-generated line IDs that the
compiler added during compilation.
Gets the collection of variable declarations that were found during
compilation.
This value will be if the object's value was not or .
Gets a value indicating whether the compiler had to create line IDs
for lines in the source code that lacked #line: tags.
Every line is required to have a line ID. If a line doesn't have a
line ID specified in the source code (via a #line: tag), the
compiler will create one.
Implicit line IDs are guaranteed to remain the same between
compilations when the source file does not change. If you want line
IDs to remain the same when the source code may be modified in the
future, add a #line: tag to the line. This may be done by
hand, or added using the method.
Gets the collection of file-level tags found in the source code.
The keys of this dictionary are the file names (as
indicated by the property
of the 's collection), and the values are the
file tags associated with that file.
Gets the collection of objects that
describe problems in the source code.
If the compiler encounters errors while compiling source code, the
it produces will have a value of . To help figure out
what the error is, users should consult the contents of this
property.
Gets a value indicating whether this compilation result contains any
error diagnostics.
If this value is true, then the value contained in will not contain a valid output.
Gets the collection of objects for each node
in .
Gets the debugging information for this compiled project.
Gets a collection of any types that were defined by the user in the
input (for example, user-defined enum types.)
Contains the results of parsing each input of the compilation.
contains metadata about all nodes extracted during compilation for use by language server features
includes information about jumps, function calls, commands, variables, character names, tags, and structural information
The content identifier is a #line: tag.
The content identifier is a #shadow: tag.
Compiles Yarn code.
The maximum amount of time the type solver will spend attempting to
complete the type solution, in seconds.
Compiles Yarn code, as specified by a compilation job.
The compilation job to perform.
The results of the compilation.
Gets the name of the boolean variable that stores whether the
content identified by lineID has been seen by the player before.
The line ID to generate a variable name
for.
A variable name.
Checks every node name in , and
ensure that they're all unique and valid. If there are duplicates or
invalid node names, create diagnostics for them.
A collection of file parse results to
check.
A collection of diagnostics to add
to.
Returns a collection of structs that
describe the functions present in .
The to get declarations
from.
The structs found.
Reads the contents of a text file containing source code, and
returns a list of tokens found in that source code.
The path of the file to load the source code
from.
Reads a string containing source code, and returns a list of
tokens found in that source code.
The source code to extract tokens
from.
The list of tokens extracted from the source
code.
Finds all header parse contexts in the given node with the given key.
The node context to search.
The key to search for
A collection of header contexts.
Creates a new instruction, and appends it to a node in the .
The node to append instructions to.
The object to add
line debugging information to.
The range of source code corresponding to this instruction.
The instruction to add.
Extracts a line ID from a collection of s, if one exists.
The type of content identifier tag to
retrieve.
The hashtag parsing contexts.
The line ID if one is present in the hashtag contexts,
otherwise null.
Gets a string containing the line ID from a line statement parser
context.
The line ID is extracted from the #line: hashtag found on the
line. If it isn't present, then this method throws an exception.
The type of content identifier to retrieve.
The line statement to extract the line ID
from.
The line ID found in this line.
Thrown when the line does not
have a line ID.
Generates a line id for a raw text node
This should only be used when in raw text mode.
The name of the node
line id for the raw text node
Flattens a tree of objects by
recursively visiting their children, and converting them into a
flat .
The root node to begin work from.
An that contains a
flattened version of the hierarchy rooted at .
Gets the text of the documentation comments that either immediately
precede , or are on the same line as
.
Documentation comments begin with a triple-slash (///), and
are used to describe variable declarations. If documentation
comments precede a declaration (that is, they're not on the same
line as the declaration), then they may span multiple lines, as long
as each line begins with a triple-slash.
The token stream to search.
The parser rule context to get documentation
comments for.
If true, this method will search
for documentation comments that come after 's last token and are on the same line.
The text of the documentation comments, or if no documentation comments were
present.
Adds additional functionality to the
class.
Adds additional functionality to the
class.
Gets the path to the file that this node was parsed from, if any.
Gets the title of this node, as specified in its 'title'
header. If it is not present, returns . If
more than one is present, the first is returned.
Gets the name of the node group that this node is part of, if
any.
Gets the first header in this node named .
The key of the header to find.
A header whose
is .
This method returns only the first header with the specified
key. To fetch all headers with this key, use .
Gets all headers in this node named .
The key of the header to find.
A collection of headers whose
is .
Gets the computed total complexity of this node's 'when'
conditions.
If this node has no such conditions, this value is -1.
Gets the total number of binary boolean operations - ands, ors, and
xors - present in an expression and its sub-expressions.
An expression.
The total number of binary boolean operations in the
expression.
Gets the complexity of this line's condition.
Gets the complexity of this line's condition.
Gets or sets the localised line ID associated with this line
statement.
Gets or sets a value indiciating whether the line ID was added
implicitly.
Gets or sets the shadow line ID associated with this line
statement.
Gets or sets a value indicating whether this line is the last
one before a group of options.
Adds type properties to .
Adds type properties to .
A number literal value.
A true boolean literal value.
A false boolean literal value.
A string literal value.
Adds type properties to .
Adds type properties to .
Adds enum case type information to .
Gets or sets the 'raw value' of this enum case, which is the
underlying value that this enum represents.
Gets or sets the descriptive text for this enum case.
Adds 'once' variable information to .
The name of the variable that tracks whether once statement
primary clause has been seen before or not.
Marks that a type represents a that
represents a literal value.
Contains debugging information for compiled Yarn Projects.
The debugging info for the nodes in the project.
Gets the debugging info for a given node, if it exists.
The name of the node to get debugging info
for.
The debugging info for the node, or
if none is present.
Contains debug information for a node in a Yarn file.
Initialises a new instance of the NodeDebugInfo class.
The file that the node was defined
in.
The name of the node.
Gets or sets the file that this DebugInfo was produced from.
Gets or sets the node that this DebugInfo was produced from.
Gets or sets the mapping of instruction numbers to information in the file indicated by .
The range in the file in which the node appears.
Gets or sets a value indicating whether this node was created by the
compiler.
Nodes that exist in a .yarn file have an
value of . Nodes that are generated by the
compiler include smart variable implementations, and node group
'hub' nodes.
Gets a object that describes the specified
instruction at the index .
The index of the instruction to
retrieve information for.
A object that describes the position
of the instruction.
Thrown when is less than zero, or greater than the
number of instructions present in the node.
Contains positional information about an instruction.
The file name of the source that this instruction was produced
from.
The node name of the source that this instruction was produced
from.
The range in that contains the
statement or expression that this line was produced from.
Represents a range of text in a multi-line string.
Represents the default value for a Range.
Initializes a new instance of the class, given
start and end information.
The zero-indexed line number of the start of
the range.
The zero-indexed character number of
the start of the range.
The zero-indexed line number of the end of the
range.
The zero-indexed character number of the
end of the range.
Initializes a new instance of the class, given
start and end information.
The position at the start of
the range.
The position at the end of
the range.
Gets or sets the start position of this range.
Gets or sets the end position of this range.
Gets a value indicating whether this range is valid.
A range is valid when its start and end positions are both valid,
and the start position is not after the end position.
Represents a position in a multi-line string.
Gets or sets the zero-indexed line of this position.
Gets or sets the zero-indexed character number of this position.
Gets a value indicating whether this position has a zero or positive
line and character number.
Represents the default value for a Position.
Initialises a new instance of the Position class with the specified
line and character.
The zero-indexed line number.
The zero-index character number.
Initialises a new instance of the Position class.
Compares two positions and returns true if is
equal to or after .
The first position.
The second position.
true if a is after or equal to b; false
otherwise.
Compares two positions and returns true if is
equal to or before .
The first position.
The second position.
true if a is before or equal to b; false
otherwise.
Adds two positions by component and returns the result.
The first position.
The second position.
The resulting combined position.
Represents a variable declaration
Gets the name of this Declaration.
Creates a new instance of the class,
using the given name, type and default value.
The name of the new declaration.
The type of the declaration.
The default value of the
declaration. This must be a string, a number (integer or
floating-point), or boolean value.
The description of the new
declaration.
A new instance of the
class.
Gets the default value of this , if no
value has been specified in code or is available from a 's .
Gets a string describing the purpose of this .
Gets the name of the file in which this Declaration was found.
If this was not found in a Yarn
source file, this will be .
Gets the name of the node in which this Declaration was found.
If this was not found in a Yarn
source file, this will be .
Gets the line number at which this Declaration was found in the
source file.
If this was not found in a Yarn
source file, this will be -1.
Gets a value indicating that this Declaration does not refer to a
stored variable, and instead represents an inline-expanded
expression (a 'smart variable').
Gets a value indicating whether this Declaration was implicitly
inferred from usage.
If , this Declaration was implicitly
inferred from usage. If , this Declaration
appears in the source code.
Gets the type of the variable, as represented by an object that
implements .
The string used for if the
Declaration was found outside of a Yarn source file.
Gets the range of text at which this declaration occurs.
This range refers to the declaration of the symbol itself, and not
any syntax surrounding it. For example, the declaration
<<declare $x = 1>> would have a Range referring
to the $x symbol.
Gets or sets the parser context for the initial value provided in
this variable's 'declare' statement, if any. This is only valid for
variable declarations, not functions (because functions don't have a
value.)
Gets the collection of objects whose value
depends upon this .
Gets the collection of objects that this
depends upon the value of.
Gets a value indicating whether this Declaration represents a
variable, and not a function.
Describes a diagnostic message with a unique code and template.
This class ensures that diagnostic codes and their descriptions
are always paired correctly, preventing typos and mismatches.
All diagnostics should be created using the predefined descriptors
in this class.
Gets the unique error code for this diagnostic (e.g., "YS0001").
Gets the message template for this diagnostic.
The template may contain placeholders like {0}, {1}, etc. for
string formatting.
Gets the default severity for this diagnostic.
Gets a brief description of what this diagnostic means.
Creates a new Diagnostic using this descriptor.
The name of the file in which this error
occurred.
The arguments to use when composing the
diagnostic's message.
The diagnostic.
Creates a new Diagnostic using this descriptor.
The name of the file in which this error
occurred.
The parse context associated with this error.
The arguments to use when composing the
diagnostic's message.
The diagnostic.
Creates a new Diagnostic using this descriptor.
The name of the file in which this error
occurred.
The token associated with this error.
The arguments to use when composing the
diagnostic's message.
The diagnostic.
Creates a new Diagnostic using this descriptor.
The name of the file in which this error
occurred.
The range of the file associated with this error.
The arguments to use when composing the
diagnostic's message.
The diagnostic.
Formats the message template with the provided arguments.
Arguments to format the message template with.
The formatted message.
YS0001: A variable has been implicitly declared with multiple conflicting types.
This error occurs when a variable is used with different types across
different files or contexts without an explicit declaration, and the
compiler cannot determine which type is correct.
Format placeholders: 0: variable name, 1: type names.
YS0002: A type mismatch occurred during type checking.
Format placeholders: 0: expected type, 1: actual type.
YS0003: An undefined variable was referenced.
Format placeholders: 0: variable name.
YS0004: Missing node delimiter (=== or ---).
YS0005: Malformed dialogue or syntax error.
Format placeholders: 0: specific syntax error message.
YS0006: Unclosed command (missing >>).
YS0007: Unclosed control flow scope (missing endif, endonce, etc.).
Format placeholders: 0: missing token.
YS0008: Unreachable code detected.
YS0010: Variable is declared but never used.
Format placeholders: 0: variable name.
YS0011: Duplicate node title.
This diagnostic is not emitted for node groups where nodes
share a title but have different `when:` clauses.
Format placeholders: 0: node title.
YS0012: Jump to undefined node.
Format placeholders: 0: node title.
YS0013: Invalid function call.
Format placeholders: 0: function name.
YS0014: Invalid command.
Format placeholders: 0: command name
YS0015: Cyclic dependency detected.
Format placeholders: 0: error message.
YS0016: Unknown character name.
Format placeholders: 0: character name.
YS0017: Lines cannot have both a '#line' tag and a '#shadow' tag.
YS0018: Lines cannot have both a '#line' tag and a '#shadow' tag.
Format placeholders: 0: line ID.
YS0019: Line content after a non-flow-control command.
YS0020: Line content before a non-flow-control command.
YS0021: Stray command end marker without matching start marker.
YS0022: Command keyword outside of command block.
YS0027: Node title or subtitle contains invalid characters.
Format placeholders: 0: "title" or "subtitle", 1: the invalid name.
YS0039: Redeclaration of existing variable
Format placeholders: 0: variable name.
YS0040: Redeclaration of existing type
Format placeholders: 0: type name.
YS0041: Internal error.
Format placeholders: 0: error description.
YS0042: Unknown line ID {0} for shadow line.
Format placeholders: 0: line ID.
YS0043: Shadow lines must not have expressions
YS0044: Shadow lines must have the same text as their source
YS0045: Smart variables cannot contain reference loops.
Format placeholders: 0: variable reference, 1: smart variable name.
YS0046: Variable declaration has a null default value.
Format placeholders: 0: variable name, 1: type name.
YS0047: Expression failed to resolve in a reasonable time.
Format placeholders: 0: time limit in seconds.
YS0028: Can't determine type of variable given its usage.
Format placeholders: 0: variable name.
YS0029: Can't determine the type of an expression.
YS0030: Smart variable cannot be modified.
Format placeholders: 0: variable name.
YS0031: All nodes in a group must have a 'when' clause.
Format placeholders: 0: node group title.
YS0032: Duplicate subtitle in a node group.
Format placeholders: 0: group name, 1: subtitle.
YS0033: Node is empty and will not be compiled.
Format placeholders: 0: node title.
YS0034: Function cannot be used in Yarn Spinner scripts.
Format placeholders: 0: function name, 1: reason.
YS0035: Enum declaration error.
Format placeholders: 0: error message.
YS0036: Language version too low for feature.
Format placeholders: 0: error message.
YS0037: Invalid literal value.
Format placeholders: 0: error message.
YS0038: Invalid member access.
Format placeholders: 0: error message.
Gets a diagnostic descriptor by its code.
The diagnostic code to look up.
The descriptor, or null if not found.
A diagnostic message that describes an error, warning or informational
message that the user can take action on.
Diagnostics are presented to the user as the result of compilation,
through the class's property.
Gets or sets the path, URI or file-name that the issue occurred in.
Gets or sets the range of the file indicated by that the issue occurred in.
Gets or sets the description of the issue.
Gets or sets the source text of containing
the issue.
Gets or sets the severity of the issue.
Gets or sets the error code for this diagnostic.
Error codes help users look up documentation and categorize issues.
Follows the format YS0001, YS0002, etc.
Gets the zero-indexed line number in FileName at which the issue
begins.
Gets the zero-indexed character number in FileName at which the
issue begins.
Initializes a new instance of the class.
Initializes a new instance of the class.
Initializes a new instance of the class.
The parse node at which the error
occurred.
Initializes a new instance of the class.
The token at which the error
occurred.
Initializes a new instance of the class.
Creates a new using a .
The file where the diagnostic occurred.
The diagnostic descriptor defining the error code and message template.
Arguments to format the message template.
A new diagnostic instance.
Creates a new using a with range information.
The file where the diagnostic occurred.
The range in the file where the diagnostic occurred.
The diagnostic descriptor defining the error code and message template.
Arguments to format the message template.
A new diagnostic instance.
Creates a new using a with parser context.
The file where the diagnostic occurred.
The parser context where the diagnostic occurred.
The diagnostic descriptor defining the error code and message template.
Arguments to format the message template.
A new diagnostic instance.
Creates a new using a with token information.
The file where the diagnostic occurred.
The token where the diagnostic occurred.
The diagnostic descriptor defining the error code and message template.
Arguments to format the message template.
A new diagnostic instance.
The severity of the issue.
An informational diagnostic.
Infos represent possible issues or steps that the user may wish
to fix, but are unlikely to cause problems.
A warning.
Warnings represent possible problems that the user should fix,
but do not cause the compilation process to fail.
An error.
If a Yarn source file contains errors, it cannot be compiled,
and the compilation process will fail.
Categorizes parser errors from ANTLR messages and assigns appropriate error codes
An that generates code for a parsed file.
Gets the current node to which instructions are being added.
The current node.
Gets the current debug information that describes .
The collection of variable declarations known to the compiler.
This is supplied as part of a .
The Library, which contains the function declarations known to the
compiler.
This is supplied as part of a .
Initializes a new instance of the class.
Adds the specified instruction it to the current node in the , and associates it with the position of .
Called by instances of while
walking the parse tree.
The first token in the expression or
statement that was responsible for emitting this
instruction.
The last token in the expression or
statement that was responsible for emitting this
instruction.
The instruction to emit.
We have found a new node. Set up the currentNode var ready to hold
it, and otherwise continue.
We have left the current node. Store it into the program, wipe the
var, and make it ready to go again.
We have finished with the header, so we're about to enter the node
body, and all its statements. Do the initial setup required before
compiling.
Have entered the body. The header should have finished being parsed,
and the currentNode is ready. All we do is set up a body visitor and
tell it to run through all the statements. It handles everything
from that point onwards.
Closes off the node.
Contains the result of parsing a single file of source code.
This class provides only syntactic information about a parse - that is,
it provides access to the parse tree, and the stream of tokens used to
produce that parse tree.
>
Initializes a new instance of the
struct.
The name of the file.
The parse tree extracted from the file.
The tokens extracted from the file.
The diagnostics produced from parsing the file.
This class provides an empty implementation of ,
which can be extended to create a listener which only needs to handle a subset
of the available methods.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the lineCondition
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the lineCondition
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the lineOnceCondition
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the lineOnceCondition
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expParens
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expParens
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expMultDivMod
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expMultDivMod
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expComparison
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expComparison
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expNegative
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expNegative
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expAndOrXor
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expAndOrXor
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expAddSub
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expAddSub
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expNot
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expNot
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expValue
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expValue
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the expEquality
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the expEquality
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueNumber
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueNumber
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueTrue
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueTrue
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueFalse
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueFalse
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueVar
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueVar
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueString
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueString
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueFunc
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueFunc
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the jumpToNodeName
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the jumpToNodeName
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the jumpToExpression
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the jumpToExpression
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the detourToNodeName
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the detourToNodeName
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by the detourToExpression
labeled alternative in .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by the detourToExpression
labeled alternative in .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
Enter a parse tree produced by .
The default implementation does nothing.
The parse tree.
Exit a parse tree produced by .
The default implementation does nothing.
The parse tree.
The default implementation does nothing.
The default implementation does nothing.
The default implementation does nothing.
The default implementation does nothing.
This class provides an empty implementation of ,
which can be extended to create a visitor which only needs to handle a subset
of the available methods.
The return type of the visit operation.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the lineCondition
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the lineOnceCondition
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expParens
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expMultDivMod
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expComparison
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expNegative
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expAndOrXor
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expAddSub
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expNot
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expValue
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the expEquality
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueNumber
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueTrue
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueFalse
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueVar
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueString
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueFunc
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the jumpToNodeName
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the jumpToExpression
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the detourToNodeName
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by the detourToExpression
labeled alternative in .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The default implementation returns the result of calling
on .
The parse tree.
The visitor result.
Contains extension methods for objects.
Returns the original text of this ,
including all whitespace, comments, and other information that the
parser would otherwise not include.
The original text of this expression.
This interface defines a complete listener for a parse tree produced by
.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by the lineCondition
labeled alternative in .
The parse tree.
Exit a parse tree produced by the lineCondition
labeled alternative in .
The parse tree.
Enter a parse tree produced by the lineOnceCondition
labeled alternative in .
The parse tree.
Exit a parse tree produced by the lineOnceCondition
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expParens
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expParens
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expMultDivMod
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expMultDivMod
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expComparison
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expComparison
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expNegative
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expNegative
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expAndOrXor
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expAndOrXor
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expAddSub
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expAddSub
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expNot
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expNot
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expValue
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expValue
labeled alternative in .
The parse tree.
Enter a parse tree produced by the expEquality
labeled alternative in .
The parse tree.
Exit a parse tree produced by the expEquality
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueNumber
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueNumber
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueTrue
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueTrue
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueFalse
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueFalse
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueVar
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueVar
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueString
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueString
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueFunc
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueFunc
labeled alternative in .
The parse tree.
Enter a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The parse tree.
Exit a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by the jumpToNodeName
labeled alternative in .
The parse tree.
Exit a parse tree produced by the jumpToNodeName
labeled alternative in .
The parse tree.
Enter a parse tree produced by the jumpToExpression
labeled alternative in .
The parse tree.
Exit a parse tree produced by the jumpToExpression
labeled alternative in .
The parse tree.
Enter a parse tree produced by the detourToNodeName
labeled alternative in .
The parse tree.
Exit a parse tree produced by the detourToNodeName
labeled alternative in .
The parse tree.
Enter a parse tree produced by the detourToExpression
labeled alternative in .
The parse tree.
Exit a parse tree produced by the detourToExpression
labeled alternative in .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
Enter a parse tree produced by .
The parse tree.
Exit a parse tree produced by .
The parse tree.
This interface defines a complete generic visitor for a parse tree produced
by .
The return type of the visit operation.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by the lineCondition
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the lineOnceCondition
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expParens
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expMultDivMod
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expComparison
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expNegative
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expAndOrXor
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expAddSub
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expNot
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expValue
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the expEquality
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueNumber
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueTrue
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueFalse
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueVar
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueString
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueFunc
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the valueTypeMemberReference
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by the jumpToNodeName
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the jumpToExpression
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the detourToNodeName
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by the detourToExpression
labeled alternative in .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Visit a parse tree produced by .
The parse tree.
The visitor result.
Creates a new instruction, and appends it to the current node in the
.
Called by instances of while walking the parse tree.
The instruction to add.
The first token in the expression or
statement that was responsible for emitting this
instruction.
The last token in the expression or
statement that was responsible for emitting this
instruction.
Adds instructions to the current node in the .
Called by instances of while
walking the parse tree.
The instructions to add.
The first token in the expression or
statement that was responsible for emitting this
instruction.
The last token in the expression or
statement that was responsible for emitting this
instruction.
Creates a new instruction, and appends it to the current node in the
.
Differs from the other Emit call by not requiring a start token.
This enables its use in pure synthesised elements of the Yarn.
Called by instances of while walking the parse tree.
The instruction to add.
A Lexer subclass that detects newlines and generates indent and
dedent tokens accordingly.
Returns a value indicating whether the lexer is currently lexing an
expression that's part of a 'when' clause.
This value is set by .
Sets a value indicating whether the lexer is currently lexing an
expression that's part of a 'when' clause.
The value to set.
This value can be accessed by calling .
The collection of tokens that we have seen, but have not yet
returned. This is needed when NextToken encounters a newline,
which means we need to buffer indents or dedents. NextToken
only returns a single at a time, which
means we use this list to buffer it.
The collection of objects we've
generated.
A stack keeping track of the levels of indentations we have
seen so far that are relevant to shortcuts.
Keeps track of the last indentation encounterd.
This is used to see if depth has changed between lines.
A flag to say the last line observed was a shortcut or not.
Used to determine if tracking indents needs to occur.
Holds the last observed token from the stream.
Used to see if a line is blank or not.
Holds the line number of the last seen indent-tracking content. Lets
us work out if the blank line needs to end the option.
Initializes a new instance of the class.
The incoming character stream.
The to send
output to.
The to send
errors to.
Initializes a new instance of the class.
The incoming character stream.
Looks ahead 1 character in the input stream and returns a value
indicating whether the character is whitespace (as determined by
) or the > character.
Gets the collection of warnings determined during lexing.
Inserts a new token with the given text and type, as though it
had appeared in the input stream.
The text to use for the token.
The type of the token.
The token will have a zero length.
A warning emitted during lexing.
The token associated with the warning.
The message associated with the warning.
Initializes a new instance of the NodeGroupCompiler class.
The name of the node group to
compile.
The collection of existing
variable declarations found during compilation.
The collection of node group parser
contexts that all belong to this node group.
The collection of existing compiled
nodes in the compilation.
The collection of node names for whom
tracking information should be added.
contains metadata about a node extracted during compilation for use by language server features
this is different from nodedebuginfo which is for instruction level debugging
the title of the node
the original title as written in source (before any rewriting by NodeGroupVisitor)
the rewritten unique title (e.g. "Meeting.happy" or "Meeting.checksum"), set by NodeGroupVisitor
the node group name (equals sourceTitle when when: headers exist, null otherwise)
the subtitle of the node (optional)
the file uri where this node is defined
all jump and detour destinations referenced from this node
all function names called within this node
all command names called within this node (excludes flow control like if/else/endif)
all variable names referenced within this node
complexity score for node groups or negative one if not part of a group
calculated by the compiler based on when clauses
character names found in dialogue lines within this node
extracted from lines matching the pattern charactername: dialogue
tags from the node tags header
preview text from the first few lines of dialogue in the node
used for quick previews in ui
number of shortcut options in this node
detailed information about each shortcut option in this node
includes text, conditions, and grouping for visual display
zero based line number where the node header starts (first three dashes)
zero based line number where the title declaration is (title: nodename)
zero based line number where the node body starts (after second three dashes)
zero based line number where the node body ends (at or before three equals signs)
information about a jump or detour from one node to another
The URI of the file in which this jump occurs.
the title of the destination node
whether this is a jump or a detour
the source location of this jump statement in the file
used for precise error reporting (YS0002)
type of jump between nodes
a standard jump to another node
a detour to another node that will return
information about a shortcut option within a node
the display text of the option (before any pipe separator)
zero based line number where this option appears
group identifier - consecutive options that are presented together get the same group id
used for visual grouping in the editor to show which options appear at the same time
increments each time options are separated by dialogue or commands
Yarn Projects represent instructions on where to find Yarn scripts and
associated assets, and how they should be compiled.
A placeholder string that represents the location of the workspace
root in paths.
The current version of .yarnproject file format.
A version number representing project version 2 (released with Yarn Spinner 2.0)
A version number representing project version 3 (released with Yarn Spinner 3.0).
A version number representing project version 4 (released with Yarn Spinner 3.2.0).
Initializes a new instance of the class.
Initializes a new instance of the class.
The value to use for the new instance's property.
The path to the root of the current
workspace, or .
Gets or sets the file version of the project.
This value is required to be equal to .
Gets the path that the was loaded from.
This value is not stored when the file is saved, but is instead
determined when the file is loaded by , or provided when the is constructed.
Gets or sets the collection of file search patterns used to locate
Yarn files that form this project.
Gets or sets the collection of file search patterns that should be
excluded from this project.
If a file is matched by a pattern in , and is also matched by a pattern in
, then it is not included in the
value returned by .
Gets or sets the collection of
objects that store information about where localized data for this
project is found.
Gets or sets the base language of the project, as an IETF BCP-47
language tag.
The base language is the language that the Yarn scripts is written
in.
Gets or sets the patterns for matching paths to JSON files that
contain command and function definitions that this project
references.
Definitions files are used by editing tools to provide type
information and other externally-defined data used by the Yarn
scripts.
Gets a value indicating whether this Project is an 'implicit'
project (that is, it does not currently represent a file that exists
on disk.)
An implicit project is created by tools like the Yarn Spinner
Language Server when opening a folder that contains Yarn files but
no Yarn Project file.
Gets or sets a dictionary containing instructions that control how
the Yarn Spinner compiler should compile a project.
Gets a value indicating whether is a valid
Yarn Spinner version number.
Gets or sets a value indicating whether compiler features that are
not intended for production use are allowed.
Gets the collection of Yarn files that should be used to compile the
project.
This collection uses a to find all files
specified by , excluding those that
are specified by .
Gets the path to the Definitions file, relative to this project's
location.
Gets the absolute paths to the project's Definitions files.
Contains any data parsed from the source file that was not matched
to a property on this type.
Gets the path of the directory from which to start searching for
.yarn files. This value is if the directory
does not exist on disk.
Gets a value indicating whether is a path
that is included in this project.
The path to check.
if is a path
that is included in this project;
otherwise.
Gets a neutral that
represents the current culture.
The location of the root of the workspace in which this project is
located.
Loads and parses a from a file on disk.
The path to the file to load.
The path of the root of the workspace in
which is located.
The loaded .
Thrown when the contents of the
file cannot be loaded.
Saves a as JSON-formatted text to a file on
disk.
The path of the file to write to.
Gets a string containing JSON-formatted text that represents this
.
The , serialized to JSON.
Stores the locations of where localized assets and a localized
string table for a Yarn Project may be found.
Gets or sets the location at which localized assets may be
found.
Gets or sets the location at which the localized string table
may be found.
Compiles a Declaration describing a smart variable, and produces a
and a .
The Declaration to generate an implementation
node for.
A that contains the
generated node for this smart variable and its debugger
information.
Information about a string. Stored inside a string table, which is
produced from the Compiler.
You do not create instances of this class yourself. They are
generated by the .
The original text of the string.
This field is if
is not null.
The name of the node that this string was found in.
The line number at which this string was found in the file.
The name of the file this string was found in.
Indicates whether this string's line ID was implicitly
generated.
Implicitly generated line IDs are not guaranteed to remain the
same across multiple compilations. To ensure that a line ID
remains the same, you must define it by adding a line tag to the
line.
The metadata (i.e. hashtags) associated with this string.
This array will contain any hashtags associated with this
string besides the #line: hashtag.
The ID of the line that this line is shadowing, or null if this line
is not shadowing another line.
Initializes a new instance of the struct.
The text of the string.
The file name.
The node name.
The line number.
If true, this string info is
stored with an implicit line ID.
The string's metadata.
The ID of the line that this entry is
shadowing, or null.
Registers a new string in the string table.
The text of the string to register.
The name of the yarn file that this line is contained within
The name of the node that this string
was found in.
The line ID to use for this entry in the
string table.
The line number that this string was
found in.
The tags to associate with this string in
the string table.
The line ID that this line is shadowing.
The string ID for the newly registered
string.
If is , a line ID will be generated from , , and the number
of elements in .
Checks to see if this string table already contains a line with
the line ID .
The line ID to check for.
if the string table already
contains a line with this ID,
otherwise.
Contains methods for parsing structured commands.
Represents the result of a parse operation containing both the
parsed context and diagnostics.
The parsed structured command context.
A collection of diagnostics produced during parsing.
Gets a value indicating whether the parse result is valid (that
is, it contains no parse errors.)
Parses the given source string into a structured command.
The string containing the possible structured
command text to be parsed.
A object encapsulating the parsed
context and any diagnostics.
Validates syntax patterns that the parser accepts but are semantically incorrect.
This includes:
- Stray command end markers without matching start markers
- Command keywords outside of command blocks
- Line content on the same line as non-flow-control commands
creates type constraints (subclasses
of ) for expressions and values found in a
parse tree, as well as type declarations that it encounters. These
constraints can then be resolved by a to determine
the types of expressions and values in the source code (or to determine
if there was a type error.)
Stores the total number of type variables that have been produced.
This variable is used to ensure that names for new type variables
are always unique.
The token stream used to produce the current file.
This variable is used to get documentation comments via calls to
.
The name of the source file that we are currently walking.
This variable is used to help produce error messages.
The list of all known objects.
This list is passed to the constructor, and added to while walking
the parse tree when new explicit or implicit variable declarations
need to be added.
Contains the list of all named type declarations found so far, from
both built-in types (string, number, etc) and user-defined types
(enums). This doesn't include function types.
The current type solution produced by running this listener on a
parse tree.
The name of the node that we are currently walking.
This variable is used to help produce error messages.
The current incremental type solution.
Gets the list of diagnostics produced during type checking.
Gets the list of type equations that have been generated by this
listener.
Gets the collection of file-level hashtags that were found as a
result of using this to visit a
.
Maps the names of types as they appear in the language
(string, bool, number) to actual type objects.
Initializes a new instance of the
class.
The name of the source file being
walked.
The token stream produced from the source
file.
The list of all known variable and
function declarations. This list will be added to while walking the
parse tree.
The list of all known types. This list will
be added to while walking the parse tree.
An existing type solution to build
upon.
A collection of objects. During type checking, this
collection will be added to if a type constraint fails to resolve by
the end of a file.
A token used to indicate that type
checking should be cancelled.
Gets a declaration for the identifier named ,
or .
The name of the identifier to get a declaration
for.
A object for , or if none was
found.
Adds a file hashtag to the parse result.
The file hashtag parse node.
Given a collection of Declaration objects that have fully-resolved
types, determines the appropriate value to use as this declaration's
initial value.
The list of declarations to
update.
The list of diagnostics to add to.
Provides methods for walking a parse tree.
Walks a parse tree, starting at , and
calls for each it encounters.
The parser rule context to begin walking
from.
The delegate to call for each parser rule
context encountered.
Walks a parse tree, starting at , and
calls for each it encounters.
The type of parser rule context to call
for.
The parser rule context to begin walking
from.
The delegate to call for each parser rule
context encountered.
Contains properties common to all parse nodes that have a type
associated with them.
Gets or sets the type of this parse node.
An upgrade job.
The collection of files to upgrade.
The type of the upgrade to perform.
Initialises a new instances of the UpgradeJob struct.
The type of the upgrade.
The files to upgrade.
The result of an upgrade.
The files produced as part of the upgrade.
Gets a collection containing all
objects across all of the files in .
A file generated as part of an upgrade.
The path of the file.
The list of replacements needed to be made in order to go from
to .
The original text of the file, prior to upgrades.
The upgraded text of the file.
The diagnostics produced for this file as a result of the
upgrade process.
Indicates whether this represents
a new file to be created. If this is , will be the
empty string, and will be empty.
Merges two objects, producing a
merged result.
The first file.
The second file.
The merged result.
Contains information describing a replacement to make in a string.
The position in the original string where the substitution
should be made.
The line in the original string where the substitution should
be made.
The string to expect at in the original
string.
The string to replace with at .
A descriptive comment explaining why the substitution is
necessary.
Gets the length of .
Gets the length of .
Contains methods for upgrading the syntax of Yarn scripts.
Upgrades a Yarn script from one version of the language to
another, producing both the fully upgraded text as well as a
collection of replacements.
The upgrade job to perform.
Thrown if the
is unsupported.
An object containing the
results of the upgrade operation.
Applies a collection of string replacements to a string.
The string to modify.
A collection of s to make in the .
The modified string.
Thrown when a
replacement refers to an invalid position in originalText, or
its original text does not match what exists in the
text.
Specifies what kind of language upgrading should be applied.
Indicates an upgrade from Yarn Spinner 1.0 syntax to Yarn
Spinner 2.0 syntax.
Utility methods for working with line tags.
Generates a Yarn script that contains a node that declares
variables.
This method is intended to be called by tools that let the
user manage variable declarations. Such tools can read the existing
variable declarations in from a script (by compiling the script with
the value set to ), allow the user to
make changes, and then write the changes to disk by calling this
method and saving the results.
The collection of objects to include in the output.
The title of the node that should be
generated.
The collection of tags that should be generated
for the node. If this is , no tags will be
generated.
The collection of additional headers that
should be generated for the node. If this is ,
no additional headers will be generated.
A string containing a Yarn script that declares the
specified variables.
Thrown when any of the
objects in
is not a variable declaration, or if the of any of the declarations is an
invalid value.
Given Yarn source code, adds line tags to the ends of all lines
that need one and do not already have one.
This method ensures that it does not generate line
tags that are already present in the file, or present in the
collection.
Line tags are added to any line of source code that contains
user-visible text: lines, options, and shortcut options.
The source code to add line tags
to.
The collection of line tags
already exist elsewhere in the source code; the newly added
line tags will not be duplicates of any in this
collection.
The modified source code, with line tags
added.
Given Yarn source code, adds line tags to the ends of all lines that
need one and do not already have one.
This method ensures that it does not generate line tags that are
already present in the file, or present in the collection.
Line tags are added to any line of source code that contains
user-visible text: lines, options, and shortcut options.
The source code to add line tags to.
The collection of line tags already
exist elsewhere in the source code; the newly added line tags will
not be duplicates of any in this collection.
Tuple of the modified source code, with line tags added and
an updated list of line IDs.
Parses a string of Yarn source code, and produces a FileParseResult
and (if there were any problems) a collection of diagnostics.
The source code to parse.
A tuple containing a that
stores the parse tree and tokens, and a collection of objects that describe problems in the source
code.
Parses a string of Yarn source code, and produces a .
The source code to parse.
The name of the source.
A representing the result of
parsing the source.
Generates a new unique line tag that is not present in
existingKeys.
The collection of keys that should be
considered when generating a new, unique line tag.
A unique line tag that is not already present in .
Gets the range covered by a in the
source code.
The context to get a range for.
The covered by this context.
An that produces line tags.
Initializes a new instance of the class.
A collection of line IDs that
should not be used. This list will be added to as this instance
works.
The token stream used to generate the
this instance is operating on.
Gets the index of the first token to the left of the token at
that's on .
If there are no tokens that match, return -1.
The token stream to search
within.
The index of the token to start searching
from.
The channel to find tokens on.
The index of the first token before the token at
that is on the channel . If none is found, returns -1. If is beyond the size of , returns the index of the last token in the
stream.
Gets the collection of contiguous runs of lines in the provided
nodes. Each run of lines is guaranteed to run to completion once
entered.
The nodes to get string blocks for.
An object containing debugging
information for the project.
A collection of runs of lines.
Finds and collates every jump in every node.
The collection of yarn file content to parse and walk
A list of lists of GraphingNode each containing a node, its jumps, and any positional info.
Gets a string containing a representation of the compiled bytecode
for a .
Returns an representation of the provided
value.
The value to get a Yarn representation
of.
An representation of .
Gets the title for a node as defined in the source code, along with
its unique title (which may be different to the source title.)
The name of the file in which the node
is defined, or if not available.
The parsed node's context.
On return, contains the title of the node,
as it appears in the source code.
On return, contains the unique title of
the node, as stored in the output program.
The sub-title of the node, if present. This
value is always if the node is not in a node
group.
The name of the node group the node is a
member of, if any.
if the and could be
determined; otherwise.
A node for representation in a visual graph.
The name of the node.
The list of nodes that this node jumps to.
if this 's field contains valid information.
The position of this . Only valid when
is .
Generates code that evaluates any conditions present on the line and
places the result on the stack.
The line statement containing
potential condition information.
An output parameter to store the name of
the relevant 'once' variable for this statement if present, or if not.
Emits code that calls a method appropriate for the operator
on the type , given the
operands .
The operation to perform on .
The first token in the statement that is
responsible for this operation.
The type of the expression.
The operands to perform the operation
on.
Thrown when there is no
matching instructions for the
The content does not have a condition.
The content has a 'once' condition (possibly with an additional expression).
The content has a regular condition with an expression.
Gets the collection of objects
generated by this object.
A visitor that visits any valid literal (i.e. numbers, bools, strings),
and returns a .
Initializes a new instance of the class.
The parser context for this value.
The name of the file that is being
visited by this instance.
The list of diagnostics to add to.
Extracts node metadata during compilation for language server features.
This visitor walks the parse tree and gathers information about nodes including
jumps, function calls, commands, variables, character names, and structural information.
Extracts metadata from a parse tree.
A Visitor that walks an expression parse tree and generates string
table entries, which are provided to a . This string table can then be provided
to future compilation passes, or stored for later use. Call the
method to begin generating string table
entries.
Gets the collection of objects
generated by this object.
A conjunction constraint is a logical 'and' that resolves if all of its
child constraints resolve.
A disjunction constraint is a logical 'or' that resolves if at least one
of its child constraints resolves.
Contains extension methods for working with
types.
Gets the Cartesian product of 2 or more sequences.
The type of the values in the sequences.
The sequences to combine.
The Cartesian product of the sequences.
Returns an enumerator containing all items of that are not null.
The type of item in .
The sequence.
A sequence containing non-null elements of .
A constraint that always fails to resolve.
This type of constraint is useful for representing error
messages, and for simplifying larger but known-to-be-unresolvable
constraint systems.
A that is always resolvable under any circumstance.
Stores information that a Solver can use to solve a system of type
equations.
Simplifies this constraint, producing either a or a , or .
If this method returns , it represents that
the constraint has determined that it is a tautology (e.g. 'T0 ==
T0'), and does not need further evaluation.
A that the constraint
can use to help decide how to simplify.
The collection of all currently known types.
A or a that represents a simplified version
of this constraint, or null.
Gets or sets the range of text that contained the expression that
produced this constraint.
Gets or sets the name of the file that contained the expression that
produced this constraint.
Gets the collection of all variables involved in this constraint.
Gets a value indicating whether this constraint is self-evident.
A self-evident constraint will always evaluate to 'true' on its own;
for example, 'String == String' or 'nameof(String) == "String"').
Tautological constraints are removed from the type problem, because
they don't provide any additional information to the type solution.
Initializes a new instance of the class.
The type to constraint to one that is convertible
to
The type that should be constrained to be convertible to.
Gets or sets the type that is being constrained to one that is
convertible to .
Gets or sets the type that can be converted
to.
Contains methods for solving systems of type equations.
This class contains the central algorithms used for solving the system
of type equations produced by .
Incrementally solves a collection of type constraints, and produces
a substitution.
The collection of type constraints to
solve.
The list of types known to the
solver.
The list of diagnostics. If this method
returns false, the list will be added to.
The Substitution containing a partial
solution to the overall type problem. If this method returns true,
is updated with the solution;
otherwise, is unmodified.
if the type constraints could be
solved; otherwise.
Thrown when
contains a type of constraint
that could not be handled.
Attempts to unify with ,
updating .
This method modifies in place.
If unifying with fails,
subst is returned unmodified.
The first term to unify.
The second term to unify.
The to use and
update.
True if the unification worked; false otherwise.
Unifies a variable with a term, by creating a substitution from the
variable to the value represented by the term, taking into account
the existing subsitution.
The variable to unify.
The term to unify.
The current substitution.
The updated substitution.
Recursively determines if exists as a
sub-term in , taking into account any
existing substitutions in .
This function is used to prevent the creation of cyclical
substitutions (i.e. X: Y, Y: X).
The variable to test for use inside .
The term to test to see if
is used inside it.
The current substitution.
if exists in
,
otherwise.
Converts a constraint into disjunctive normal form (that is, an 'OR
of ANDs'.)
Converting a conjunction containing disjunctions produces an
exponential number of new constraints, which can result in extremely
large memory and time cost. Accordingly,
should be kept as simple as possible.
A substitution is a mapping between type variables and types (or other
type variables). It is produced during the process of type resolution by
the class.
Returns a duplicate of this .
The cloned .
Contains extension methods for working with types in the context of the
type solver.
Attempts to provide a substituted version of this term, given a
substitution to draw from.
You can use to build a Substitution from
a system of objects. Once you have a
, you can use this method to convert an
into the solution's result for that type.
(That
is: 'substitution' is how you go from a type variable to a type
literal, given a type solution.)
The term to substitute.
A to use.
A substituted term, or .
Returns a new collection of type constraints containing all items
from that are not tautologies (that
is, that are not equalities of the form X == X).
Tautologies are not useful when solving a system of type
constraints, because they always evaluate to true and do not provide
any useful new information. It's often useful to remove them, to
save time processing them.
A collection of type constraints.
A new collection of constraints that does not include
tautologies.
Applies a substitution to a type constraint, returning an updated
version of that constraint.
The type constraint to apply the substitution to.
The substitution to apply.
An updated constraint.
A type variable represents a type that is not yet known.
Gets or sets the name of this type variable.
Gets the parser context associated with this type (that is, the
expression or other parse context whose type is represented by this
type variable.)
Gets the collection of members belonging to this type.
This collection is always empty, because a type variable represents
an unknown type.
Initialises a new .
The name of the type variable.
The parser context that this type variable
represents the type of.