Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Property in BasicBlock
Get the ancestors of this block - that is, blocks that may run immediately before this block.
Name | Description |
---|---|
string
nodeName
The name of the destination node.
Yarn.Compiler.BasicBlock.Condition condition
The condition under which descendant
will be run.
Property in BasicBlock
Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.
Cycles are detected and avoided.
Property in BasicBlock
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.
Property in BasicBlock
Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.
Destination: A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .
Property in BasicBlock
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]
.
Property in BasicBlock
Gets the index of the first instruction of the node that this block is in.
Method in BasicBlock
Adds a new destination to this block, that points to another block.
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 is
operator to check the type of each item:
Name | Description |
---|---|
Property in
Yarn.Compiler.BasicBlock descendant
The new descendant node.
Yarn.Compiler.BasicBlock.Condition condition
The condition under which descendant
will be run.
Enumeration Member in Condition
The Destination is reached beacuse of an explicit instruction to go to this block.
Enum in BasicBlock
Inherits from System.Enum
The conditions under which a Destination may be reached at the end of a BasicBlock.
Name | Description |
---|---|
Enumeration Member in
The Destination is reached beacuse of an explicit instruction to go to this block.
The Destination is reached because an expression evaluated to false.
The Destination is reached because an expression evaluated to true.
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 because the player made an in-game choice to go to it.
Enumeration Member in Condition
The Destination is reached because an expression evaluated to true.
Enumeration Member in Condition
The Destination is reached because the preceding BasicBlock reached the end of its execution, and the Destination's target is the block immediately following.
Enumeration Member in
Struct in BasicBlock
Inherits from System.ValueType
A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .
Destination objects represent links between blocks, or between blocks and nodes.
Name | Description |
---|---|
Name | Description |
---|---|
The type of a Destination.
The block that this destination refers to.
The condition that causes this destination to be reached.
The name of the node that this destination refers to.
Gets the Destination's type - whether the destination is a block, or a node.
Property in
Name | Description |
---|---|
Property in Destination
Gets the Destination's type - whether the destination is a block, or a node.
Class in BasicBlock
Inherits from PlayerVisibleContentElement
A collection of options that should be shown to the player.
Name | Description |
---|---|
Name | Description |
---|---|
Field in
The collection of options that will be delivered to the player.
Represents a single option that may be presented to the player.
Class in BasicBlock
Inherits from PlayerVisibleContentElement
A line of dialogue that should be shown to the player.
Name | Description |
---|---|
Field in
The string table ID of the line that will be shown to the player.
Struct in OptionsElement
Inherits from System.ValueType
Represents a single option that may be presented to the player.
Name | Description |
---|---|
The destination that will be run if this option is selected by the player.
The string table ID that will be shown to the player.
Struct in Yarn.Compiler
Inherits from System.ValueType
An object that contains Yarn source code to compile, and instructions on how to compile it.
Instances of this struct are used with Compile(CompilationJob) to produce CompilationResult objects.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
The type of compilation that the compiler will do.
The type of compilation to perform.
The File structs that represent the content to parse..
The Library that contains declarations for functions.
The declarations for variables.
Creates a new CompilationJob using the contents of a collection of files.
Creates a new CompilationJob using the contents of a collection of files.
Creates a new CompilationJob using the contents of a string.
Represents the contents of a file to compile.
Method in CompilationJob
Creates a new CompilationJob using the contents of a collection of files.
A new CompilationJob .
Name | Description |
---|---|
System.Collections.Generic.IEnumerable<string>
paths
The paths to the files.
Yarn.Library library
The Library containing functions to use for this compilation.
Struct in CompilationJob
Inherits from System.ValueType
Represents the contents of a file to compile.
Name | Description |
---|---|
The name of the file.
The source code of this file.
Method in CompilationJob
Creates a new CompilationJob using the contents of a collection of files.
A new CompilationJob .
Name | Description |
---|---|
string[]
paths
The paths to the files.
Enum in CompilationJob
Inherits from System.Enum
The type of compilation that the compiler will do.
Name | Description |
---|---|
Method in
Creates a new using the contents of a string.
Name | Description |
---|
A new .
The compiler will derive only the variable and function declarations, and file tags, found in the script.
The compiler will do a full compilation, and generate a Program , function declaration set, and string table.
The compiler will generate a string table only.
| The name to assign to the compiled file. |
| The text to compile. |
Library of function definitions to use during compilation. |
library
Field in
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.
Property in CompilationResult
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 AddTagsToLines(string,ICollection<string>) method.
Struct in Yarn.Compiler
Inherits from System.ValueType
The result of a compilation.
Instances of this struct are produced as a result of supplying a CompilationJob to Compile(CompilationJob) .
Name | Description |
---|---|
Property in
Gets the collection of objects for each node in .
Enumeration Member in
Gets a value indicating whether the compiler had to create line IDs for lines in the source code that lacked #line:
tags.
Gets the collection of variable declarations that were found during compilation.
Gets the collection of Diagnostic objects that describe problems in the source code.
Gets the collection of file-level tags found in the source code.
Gets the compiled Yarn program that the Compiler produced.
Gets a dictionary mapping line IDs to StringInfo objects.
Property in CompilationResult
Gets the collection of variable declarations that were found during compilation.
This value will be null
if the CompilationJob object's CompilationType value was not DeclarationsOnly or FullCompilation .
Enumeration Member in
The compiler will do a full compilation, and generate a , function declaration set, and string table.
Property in
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.
Property in CompilationResult
Gets the collection of Diagnostic objects that describe problems in the source code.
If the compiler encounters errors while compiling source code, the CompilationResult it produces will have a Program value of null
. To help figure out what the error is, users should consult the contents of this property.
Property in CompilationResult
Gets the compiled Yarn program that the Compiler produced.
This value will be null
if there were errors in the compilation. If this is the case, Diagnostics will contain information describing the errors.
It will also be null
if the CompilationJob object's CompilationType value was not FullCompilation.
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.
Property in
Class in Yarn.Compiler
Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener
Compiles Yarn code.
Name | Description |
---|---|
Compiles Yarn code, as specified by a compilation job.
Flattens a tree of Antlr4.Runtime.Tree.IParseTree
objects by recursively visiting their children, and converting them into a flat System.Collections.Generic.IEnumerable`1
.
Gets the text of the documentation comments that either immediately precede context
, or are on the same line as context
.
Generates a line id for a raw text node
Method in Compiler
Compiles Yarn code, as specified by a compilation job.
The results of the compilation.
CompilationJob: An object that contains Yarn source code to compile, and instructions on how to compile it.
CompilationResult: The result of a compilation.
Name | Description |
---|---|
Yarn.Compiler.CompilationJob compilationJob
The compilation job to perform.
Method in Compiler
Flattens a tree of Antlr4.Runtime.Tree.IParseTree
objects by recursively visiting their children, and converting them into a flat System.Collections.Generic.IEnumerable`1
.
An System.Collections.Generic.IEnumerable`1
that contains a flattened version of the hierarchy rooted at node
.
Name | Description |
---|---|
Method in
Name | Description |
---|
Antlr4.Runtime.Tree.IParseTree
node
The root node to begin work from.
| The name of the node |
Class in Yarn.Compiler
Inherits from System.Object
Contains debug information for a node in a Yarn file.
Method in Compiler
Gets the text of the documentation comments that either immediately precede context
, or are on the same line as context
.
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 text of the documentation comments.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Gets a LineInfo object that describes the specified instruction at the index instructionNumber
.
Contains positional information about an instruction.
Antlr4.Runtime.CommonTokenStream
tokens
The token stream to search.
Antlr4.Runtime.ParserRuleContext
context
The parser rule context to get documentation comments for.
bool
allowCommentsAfter
If true, this method will search for documentation comments that come after context
's last token and are on the same line.
Method in
Gets a object that describes the specified instruction at the index instructionNumber
.
Name | Description |
---|
A object that describes the position of the instruction.
| The index of the instruction to retrieve information for. |
Struct in
Name | Description |
---|
The file name of the source that this intruction was produced from. |
The node name of the source that this intruction was produced from. |
Class in Yarn.Compiler
Inherits from System.Object
Represents a variable declaration
The zero-indexed character number in that contains the statement or expression that this line was produced from.
The zero-indexed line number in that contains the statement or expression that this line was produced from.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
The string used for SourceFileName if the Declaration was found outside of a Yarn source file.
Creates a new instance of the Declaration class, using the given name, type and default value.
Gets the default value of this Declaration , if no value has been specified in code or is available from a Dialogue 's IVariableStorage .
Gets a string describing the purpose of this Declaration .
Gets a value indicating whether get or sets a value indicating whether this Declaration was implicitly inferred from usage.
Gets a value indicating whether this Declaration represents a variable.
Gets the name of this Declaration.
Gets the range of text at which this declaration occurs.
Gets the line number at which this Declaration was found in the source file.
Gets the name of the file in which this Declaration was found.
Gets the name of the node in which this Declaration was found.
Gets the type of the variable, as represented by an object that implements IType .
Field in Declaration
The string used for SourceFileName if the Declaration was found outside of a Yarn source file.
Name | Description |
---|---|
Method in
Method in
Creates a new instance of the class, using the given name, type and default value.
Name | Description |
---|
A new instance of the class.
object
obj
| 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. |
type
Property in Declaration
Gets the default value of this Declaration , if no value has been specified in code or is available from a Dialogue 's IVariableStorage .
Property in Declaration
Gets a value indicating whether get or sets a value indicating whether this Declaration was implicitly inferred from usage.
Property in Declaration
Gets a value indicating whether this Declaration represents a variable.
Property in Declaration
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.
Property in Declaration
Gets the name of the node in which this Declaration was found.
If this Declaration was not found in a Yarn source file, this will be null
.
Property in Declaration
Gets the type of the variable, as represented by an object that implements IType .
Property in
If this was not found in a Yarn source file, this will be -1.
Property in Declaration
Gets the name of the file in which this Declaration was found.
If this Declaration was not found in a Yarn source file, this will be ExternalDeclaration .
Class in Yarn.Compiler
Inherits from System.Object
Provides methods for constructing Declaration 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 Declaration property to get the final, constructed Declaration .
Name | Description |
---|---|
Name | Description |
---|---|
Sets the DefaultValue of the Declaration .
Sets the Description of the Declaration .
Sets the IsImplicit of the Declaration .
Sets the Name of the Declaration .
Sets the Range of the Declaration .
Sets the SourceFileName of the Declaration .
Sets the SourceNodeName of the Declaration .
Sets the Type of the Declaration .
Gets the Declaration instance constructed by this DeclarationBuilder .
Method in DeclarationBuilder
Sets the DefaultValue of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
System.IConvertible
defaultValue
The default value to apply to the Declaration.
Method in DeclarationBuilder
Sets the IsImplicit of the Declaration .
The DeclarationBuilder instance that received this method call.
Method in DeclarationBuilder
Sets the Description of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
Name | Description |
---|---|
bool
isImplicit
The is-implicit value to apply to the Declaration.
string
description
The description to apply to the Declaration.
Method in DeclarationBuilder
Sets the Range of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
Yarn.Compiler.Range range
The range to apply to the Declaration.
Method in
Sets the of the .
Name | Description |
---|
The instance that received this method call.
| The name to apply to the Declaration. |
Method in DeclarationBuilder
Sets the SourceFileName of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
string
sourceFileName
The source file name to apply to the Declaration.
Method in DeclarationBuilder
Sets the SourceNodeName of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
string
sourceNodeName
The source node name to apply to the Declaration.
Method in DeclarationBuilder
Sets the Type of the Declaration .
The DeclarationBuilder instance that received this method call.
Name | Description |
---|---|
Yarn.IType type
The type to apply to the Declaration.
Property in DeclarationBuilder
Gets the Declaration instance constructed by this DeclarationBuilder .
Inherits from System.Object
Represents a potential type error diagnostic message.
Because a variable can be declared in a scope different from the current yarn file, or even externally, when we first hit upon any variables of which we don't know the type of we create a deferred diagnostic. The idea being that we are hoping another file or step will give the information needed to resolved the type. Later once the compiler has finished parsing every file we can see if any of these weren't resolved. If they were not they will be promoted into a full diagnostic and presented to the user.
Class in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Convenience method for constructing new deferred type diagnostics |
The name of the variable who's type error is being deferred |
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. |
Compiles Yarn code. |
Contains debug information for a node in a Yarn file. |
Represents a variable declaration |
Represents a potential type error diagnostic message. |
A diagnostic message that describes an error, warning or informational message that the user can take action on. |
A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly. |
Represents a position in a multi-line string. |
Yarn Projects represent instructions on where to find Yarn scripts and associated assets, and how they should be compiled. |
Represents a range of text in a multi-line string. |
Utility methods for working with line tags. |
Contains classes for upgrading Yarn code to more recent versions of the language. |
An object that contains Yarn source code to compile, and instructions on how to compile it. |
The result of a compilation. |
Contains the result of parsing a single file of source code. |
Information about a string. Stored inside a string table, which is produced from the Compiler. |
Class in Yarn.Compiler
Inherits from System.Object
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.
The that has been deferred.
Provides methods for constructing objects.
Provides methods for constructing objects.
Contains extension methods for producing objects from a Node.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
A command that will be executed.
A line of dialogue that should be shown to the player.
A collection of options that should be shown to the player.
An abstract class that represents some content that is shown to the player.
The conditions under which a Destination may be reached at the end of a BasicBlock.
Adds a new destination to this block, that points to a node.
Adds a new destination to this block, that points to another block.
Get the ancestors of this block - that is, blocks that may run immediately before this block.
Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.
Gets all descendants (that is, destinations, and destinations of those destinations, and so on) that have any player-visible content, recursively.
Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.
Gets the index of the first instruction of the node that this block is in.
Gets the Instructions that form this 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 a descriptive name for the block.
Gets the name of the node that this block is in.
Gets the collection of player-visible content that will be delivered when this block is run.
A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .
Inherits from System.Object
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.
Class in
Class in BasicBlock
Inherits from PlayerVisibleContentElement
A command that will be executed.
Name | Description |
---|---|
The text of the command.
Property in BasicBlock
Gets the name of the label that this block begins at, or null if this basic block does not begin at a labelled instruction.