All pages
Powered by GitBook
Couldn't generate the PDF for 167 pages, generation stopped at 100.
Extend with 50 more pages.
1 of 100

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...

FirstInstructionIndex

Property in BasicBlock

Summary

Gets the index of the first instruction of the node that this block is in.

public int FirstInstructionIndex { get; set; }

NodeName

Property in Destination

Summary

The name of the node that this destination refers to.

public string NodeName { get; set; }

Remarks

This value is only valid when Type is Node .

AddDestination(string,Condition)

Method in BasicBlock

Summary

Adds a new destination to this block, that points to a node.

public void AddDestination(string nodeName, Condition condition)

Parameters

Name
Description

string nodeName

The name of the destination node.

CommandElement

Class in

Inherits from

A command that will be executed.

Name
Description

Node

Enumeration Member in

LineID

Field in

The string table ID of the line that will be shown to the player.

Options

Field in

The collection of options that will be delivered to the player.

Block

Enumeration Member in

DirectJump

Enumeration Member in

The Destination is reached beacuse of an explicit instruction to go to this block.

Descendants

Property in

Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.

Cycles are detected and avoided.

LabelName

Property in

Gets the name of the label that this block begins at, or null if this basic block does not begin at a labelled instruction.

LineElement

Class in

Inherits from

A line of dialogue that should be shown to the player.

Name
Description

DescendantsWithPlayerVisibleContent

Property in

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.

CommandText

Field in

The text of the command.

Block

Property in

The block that this destination refers to.

This value is only valid when is .

Name

Property in

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] .

Fallthrough

Enumeration Member in

The Destination is reached because the preceding BasicBlock reached the end of its execution, and the Destination's target is the block immediately following.

NodeName

Property in

Gets the name of the node that this block is in.

PlayerVisibleContent

Property in

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:

Instructions

Property in

Gets the Instructions that form this block.

Type

Property in

Gets the Destination's type - whether the destination is a block, or a node.

Option

Enumeration Member in

The Destination is reached because the player made an in-game choice to go to it.

Option

Struct in

Inherits from System.ValueType

Represents a single option that may be presented to the player.

Name
Description

WithSourceNodeName(string)

Method in

Sets the of the .

Name
Description

Condition

Property in

The condition that causes this destination to be reached.

Yarn.Compiler.BasicBlock.Condition condition

The condition under which descendant will be run.

public class CommandElement : PlayerVisibleContentElement

CommandText

Summary

Fields

BasicBlock
PlayerVisibleContentElement

The text of the command.

Node

Summary

DestinationType
public string LineID;

Summary

LineElement
public IEnumerable<Option> Options;

Summary

OptionsElement
Block

Summary

DestinationType
DirectJump

Summary

Condition
public IEnumerable<BasicBlock> Descendants
{
            get; }

Summary

Remarks

BasicBlock
public string LabelName { get; set; }

Summary

BasicBlock
public class LineElement : PlayerVisibleContentElement

LineID

Summary

Fields

BasicBlock
PlayerVisibleContentElement

The string table ID of the line that will be shown to the player.

public IEnumerable<BasicBlock> DescendantsWithPlayerVisibleContent
{
            get; }

Summary

Remarks

BasicBlock
public string CommandText;

Summary

CommandElement
public BasicBlock Block { get; set; }

Summary

Remarks

Destination
Type
Block
public string Name
{
            get; }

Summary

Remarks

BasicBlock
Fallthrough

Summary

Condition
public string NodeName { get; set; }

Summary

BasicBlock
public IEnumerable<PlayerVisibleContentElement> PlayerVisibleContent
{
            get; }

Summary

Remarks

BasicBlock
public IEnumerable<Instruction> Instructions { get; set; };

Summary

BasicBlock
public DestinationType Type { get; set; }

Summary

Destination
Option

Summary

Condition
The DeclarationBuilder instance that received this method call.

string sourceNodeName

The source node name to apply to the Declaration.

Summary

Parameters

Returns

DeclarationBuilder
SourceNodeName
Declaration
public Condition Condition { get; set; }

Summary

Destination

PlayerVisibleContentElement

Class in BasicBlock

Inherits from System.Object

Summary

An abstract class that represents some content that is shown to the player.

public abstract class PlayerVisibleContentElement

Remarks

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.

CompilationType

Field in CompilationJob

Summary

The type of compilation to perform.

public Type CompilationType;

Files

Field in CompilationJob

Summary

The File structs that represent the content to parse..

public IEnumerable<File> Files;

VariableDeclarations

Field in CompilationJob

Summary

The declarations for variables.

public IEnumerable<Declaration> VariableDeclarations;

Library

Field in CompilationJob

Summary

The Library that contains declarations for functions.

public Library Library;

Source

Field in File

Summary

The source code of this file.

public string Source;

DeclarationsOnly

Enumeration Member in Type

Summary

The compiler will derive only the variable and function declarations, and file tags, found in the script.

DeclarationsOnly

FullCompilation

Enumeration Member in Type

Summary

The compiler will do a full compilation, and generate a Program , function declaration set, and string table.

FullCompilation

StringsOnly

Enumeration Member in Type

Summary

The compiler will generate a string table only.

StringsOnly

ContainsImplicitStringTags

Property in CompilationResult

Summary

Gets a value indicating whether the compiler had to create line IDs for lines in the source code that lacked #line: tags.

public bool ContainsImplicitStringTags { get; internal set; }

Remarks

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.

DebugInfo

Property in CompilationResult

Summary

Gets the collection of DebugInfo objects for each node in Program .

public IReadOnlyDictionary<string, DebugInfo> DebugInfo { get; internal set; }

FileTags

Property in CompilationResult

Summary

public Dictionary<string, IEnumerable<string>> FileTags { get; internal set; }

Program

Property in CompilationResult

Summary

Gets the compiled Yarn program that the Compiler produced.

public Program Program { get; internal set; }

Remarks

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.

GetLineIDForNodeName(string)

Method in Compiler

Summary

public static string GetLineIDForNodeName(string name)

Parameters

Name
Description

string name

CharacterNumber

Field in LineInfo

Summary

The zero-indexed character number in FileName that contains the statement or expression that this line was produced from.

public int CharacterNumber;

NodeName

Field in LineInfo

Summary

The node name of the source that this intruction was produced from.

public string NodeName;

Equals(object)

Method in Declaration

Summary

public override bool Equals(object obj)

Parameters

Name
Description

object obj

GetHashCode()

Method in Declaration

Summary

public override int GetHashCode()

ToString()

Method in Declaration

Summary

public override string ToString()

Name

Property in Declaration

Summary

Gets the name of this Declaration.

public string Name { get; internal set; }

Range

Property in Declaration

Summary

Gets the range of text at which this declaration occurs.

public Range Range { get; internal set; };

Remarks

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.

Ancestors

Property in BasicBlock

Summary

Get the ancestors of this block - that is, blocks that may run immediately before this block.

public IEnumerable<BasicBlock> Ancestors { get };

Destinations

Property in BasicBlock

Summary

Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.

public IEnumerable<Destination> Destinations { get };

See Also

  • Destination: A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .

ExpressionIsTrue

Enumeration Member in Condition

Summary

The Destination is reached because an expression evaluated to true.

ExpressionIsTrue

ExpressionIsFalse

Enumeration Member in Condition

Summary

The Destination is reached because an expression evaluated to false.

ExpressionIsFalse

LineID

Field in Option

Summary

The string table ID that will be shown to the player.

public string LineID;

Destination

Field in Option

Summary

The destination that will be run if this option is selected by the player.

public string Destination;

Remarks

This will be the name of a label, or the name of a node.

SourceFileLine

Property in Declaration

Summary

Gets the line number at which this Declaration was found in the source file.

public int SourceFileLine { get };

Remarks

If this Declaration was not found in a Yarn source file, this will be -1.

StringTable

Property in CompilationResult

Summary

Gets a dictionary mapping line IDs to StringInfo objects.

public IDictionary<string, StringInfo> StringTable { get; internal set; }

Remarks

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.

foreach (var item in block.PlayerVisibleContent) { if (item is
LineElement line) { // Do something with line } }
public DeclarationBuilder WithSourceNodeName(string sourceNodeName)

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.

public struct Option

Summary

Fields

OptionsElement

AddDestination(BasicBlock,Condition)

Method in BasicBlock

Summary

Adds a new destination to this block, that points to another block.

public void AddDestination(BasicBlock descendant, Condition condition)

Parameters

Name
Description

descendant

The new descendant node.

BasicBlock

Class in Yarn.Compiler

Inherits from System.Object

Summary

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.

public class BasicBlock

Classes

Name
Description
Name
Description
Name
Description
Name
Description
Name
Description

DestinationType

Enum in Destination

Inherits from System.Enum

Summary

The type of a Destination.

public enum DestinationType
{
    Node,
    Block
}

Members

Name
Description

CreateFromFiles(string[])

Method in CompilationJob

Summary

Creates a new CompilationJob using the contents of a collection of files.

public static CompilationJob CreateFromFiles(params string[] paths)

Parameters

Name
Description

string[] paths

The paths to the files.

Returns

A new .

LineInfo

Struct in DebugInfo

Inherits from System.ValueType

Summary

Contains positional information about an instruction.

public struct LineInfo

Fields

Name
Description

CreateVariable(string,Yarn.IType,IConvertible,string)

Method in Declaration

Summary

Creates a new instance of the Declaration class, using the given name, type and default value.

public static Declaration CreateVariable(string name, Yarn.IType type, IConvertible defaultValue, string description = null)

Parameters

Name
Description

string name

A new instance of the class.

Destination

Struct in

Inherits from System.ValueType

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.

Name
Description

CreateFromFiles(IEnumerable<string>,Library)

Method in

Creates a new using the contents of a collection of files.

Name
Description

File

Struct in

Inherits from System.ValueType

Represents the contents of a file to compile.

Name
Description

CreateFromString(string,string,Library)

Method in

Creates a new using the contents of a string.

Name
Description

Type

Enum in

Inherits from System.Enum

The type of compilation that the compiler will do.

Name
Description

Compiler

Class in

Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener

Compiles Yarn code.

Name
Description

Compile(CompilationJob)

Method in

Compiles Yarn code, as specified by a compilation job.

Name
Description

FlattenParseTree(IParseTree)

Method in

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 .

Name
Description

GetLineInfo(int)

Method in

Gets a object that describes the specified instruction at the index instructionNumber .

Name
Description

WithName(string)

Method in

Sets the of the .

Name
Description

OptionsElement

Class in

Inherits from

A collection of options that should be shown to the player.

Name
Description

Description

Property in

Gets a string describing the purpose of this .

DefaultValue

Property in

Gets the default value of this , if no value has been specified in code or is available from a 's .

FileName

Field in

The file name of the source that this intruction was produced from.

Declarations

Property in

Type

Property in

Gets the type of the variable, as represented by an object that implements .

Diagnostics

Property in

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 null . To help figure out what the error is, users should consult the contents of this property.

SourceFileName

Property in

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 .

SourceNodeName

Property in

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 null .

LineNumber

Field in

The zero-indexed line number in that contains the statement or expression that this line was produced from.

Declaration

Property in

Gets the instance constructed by this .

FileName

Field in

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.

CreateDeferredTypeDiagnostic(string,Diagnostic)

Method in

Name
Description

ExternalDeclaration

Field in

The string used for if the Declaration was found outside of a Yarn source file.

Block

Node

CharacterNumber

The zero-indexed character number in FileName that contains the statement or expression that this line was produced from.

FileName

The file name of the source that this intruction was produced from.

LineNumber

The zero-indexed line number in FileName that contains the statement or expression that this line was produced from.

NodeName

The node name of the source that this intruction was produced from.

CompilationJob

The name of the new declaration.

Yarn.IType type

The type of the declaration.

System.IConvertible defaultValue

The default value of the declaration. This must be a string, a number (integer or floating-point), or boolean value.

string description

The description of the new declaration.

Returns

Declaration
Destination
LineID

Yarn.Compiler.BasicBlock.Condition condition

The condition under which descendant will be run.

Yarn.Compiler.BasicBlock
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.

Yarn.Compiler.CompilationJob compilationJob

The compilation job to perform.

Summary

Parameters

Returns

Compiler

See Also

The root node to begin work from.

An System.Collections.Generic.IEnumerable`1 that contains a flattened version of the hierarchy rooted at node .

Summary

Parameters

Compiler

Antlr4.Runtime.Tree.IParseTree node

Returns

A LineInfo object that describes the position of the instruction.

int instructionNumber

Summary

Parameters

DebugInfo
LineInfo

The index of the instruction to retrieve information for.

Returns

The DeclarationBuilder instance that received this method call.

string name

The name to apply to the Declaration.

Summary

Parameters

Returns

DeclarationBuilder
Name
Declaration
public string Description { get; internal set; }

Summary

Declaration
Declaration
public IConvertible DefaultValue { get; internal set; }

Summary

Declaration
Declaration
Dialogue
IVariableStorage
public string FileName;

Summary

LineInfo
public IEnumerable<Declaration> Declarations { get; internal set; }

Summary

CompilationResult
public Yarn.IType Type { get; internal set; }

Summary

Declaration
IType
public IEnumerable<Diagnostic> Diagnostics { get; internal set; }

Summary

Remarks

CompilationResult
Diagnostic
CompilationResult
Program
public string SourceFileName { get; internal set; }

Summary

Remarks

Declaration
Declaration
ExternalDeclaration
public string SourceNodeName { get; internal set; }

Summary

Remarks

Declaration
Declaration
public int LineNumber;

Summary

LineInfo
FileName
public Declaration Declaration { get; };

Summary

DeclarationBuilder
Declaration
DeclarationBuilder
public string FileName;

Summary

Remarks

File
Line
public const string ExternalDeclaration = "(External)";

Summary

Declaration
SourceFileName

IsImplicit

Property in Declaration

Summary

Gets a value indicating whether get or sets a value indicating whether this Declaration was implicitly inferred from usage.

public bool IsImplicit { get; internal set; }
public static CompilationResult Compile(CompilationJob compilationJob)
public static IEnumerable<IParseTree> FlattenParseTree(IParseTree node)
public LineInfo GetLineInfo(int instructionNumber)
public DeclarationBuilder WithName(string name)

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.

CommandElement

A command that will be executed.

LineElement

A line of dialogue that should be shown to the player.

OptionsElement

A collection of options that should be shown to the player.

PlayerVisibleContentElement

An abstract class that represents some content that is shown to the player.

Condition

The conditions under which a Destination may be reached at the end of a BasicBlock.

AddDestination(string,Condition)

Adds a new destination to this block, that points to a node.

AddDestination(BasicBlock,Condition)

Adds a new destination to this block, that points to another block.

Ancestors

Get the ancestors of this block - that is, blocks that may run immediately before this block.

Descendants

Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.

Destination

A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .

Enums

Methods

Properties

Structs

The type of a Destination.

Name
Description

The block that this destination refers to.

The condition that causes this destination to be reached.

public struct Destination

Summary

Remarks

Enums

BasicBlock
BasicBlock
BasicBlock

Properties

library

The containing functions to use for this compilation.

A new CompilationJob .

public static CompilationJob CreateFromFiles(IEnumerable<string> paths, Library library = null)

System.Collections.Generic.IEnumerable<string> paths

The paths to the files.

Summary

Parameters

CompilationJob
CompilationJob

Returns

The name of the file.

The source code of this file.

public struct File

Summary

Fields

CompilationJob

string source

The text to compile.

library

Library of function definitions to use during compilation.

A new CompilationJob .

public static CompilationJob CreateFromString(string fileName, string source, Library library = null)

string fileName

The name to assign to the compiled file.

Summary

Parameters

CompilationJob
CompilationJob

Returns

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 , function declaration set, and string table.

The compiler will generate a string table only.

public enum Type
{
    FullCompilation,
    DeclarationsOnly,
    StringsOnly
}

Summary

Members

CompilationJob

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 .

public class Compiler : YarnSpinnerParserBaseListener

Summary

Methods

Yarn.Compiler

Name
Description

Represents a single option that may be presented to the player.

public class OptionsElement : PlayerVisibleContentElement

Options

Summary

Fields

BasicBlock
PlayerVisibleContentElement

The collection of options that will be delivered to the player.

Structs

public static DeferredTypeDiagnostic CreateDeferredTypeDiagnostic(string name, Diagnostic diagnostic)

string name

Summary

Parameters

DeferredTypeDiagnostic

diagnostic

CompilationResult

Struct in Yarn.Compiler

Inherits from System.ValueType

Summary

The result of a compilation.

public struct CompilationResult

Remarks

Instances of this struct are produced as a result of supplying a CompilationJob to Compile(CompilationJob) .

Properties

Name
Description

Condition

Enum in BasicBlock

Inherits from System.Enum

Summary

The conditions under which a Destination may be reached at the end of a BasicBlock.

public enum Condition
{
    Fallthrough,
    DirectJump,
    ExpressionIsTrue,
    ExpressionIsFalse,
    Option
}

Members

Name
Description

Yarn.Compiler Namespace

Summary

Contains classes for compiling Yarn code.

Classes

Name
Description

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.

Name
Description
Name
Description

WithImplicit(bool)

Method in DeclarationBuilder

Summary

Sets the IsImplicit of the Declaration .

public DeclarationBuilder WithImplicit(bool isImplicit)

Parameters

Name
Description

bool isImplicit

The is-implicit value to apply to the Declaration.

Returns

The instance that received this method call.

GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)

Method in Compiler

Summary

Gets the text of the documentation comments that either immediately precede context , or are on the same line as context .

public static string GetDocumentComments(CommonTokenStream tokens, ParserRuleContext context, bool allowCommentsAfter = true)

Remarks

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.

Parameters

Name
Description

The text of the documentation comments.

DebugInfo

Class in Yarn.Compiler

Inherits from System.Object

Summary

Contains debug information for a node in a Yarn file.

public class DebugInfo

Methods

Name
Description
Name
Description

WithRange(Yarn.Compiler.Range)

Method in DeclarationBuilder

Summary

Sets the Range of the Declaration .

public DeclarationBuilder WithRange(Yarn.Compiler.Range range)

Parameters

Name
Description

range

The range to apply to the Declaration.

Returns

The instance that received this method call.

DeferredTypeDiagnostic

Class in Yarn.Compiler

Inherits from System.Object

Summary

public class DeferredTypeDiagnostic

Methods

Name
Description

Name
Description

WithType(IType)

Method in DeclarationBuilder

Summary

Sets the Type of the Declaration .

public DeclarationBuilder WithType(IType type)

Parameters

Name
Description

type

The type to apply to the Declaration.

Returns

The instance that received this method call.

WithDefaultValue(System.IConvertible)

Method in DeclarationBuilder

Summary

Sets the DefaultValue of the Declaration .

public DeclarationBuilder WithDefaultValue(System.IConvertible defaultValue)

Parameters

Name
Description

System.IConvertible defaultValue

The default value to apply to the Declaration.

Returns

The instance that received this method call.

WithSourceFileName(string)

Method in DeclarationBuilder

Summary

Sets the SourceFileName of the Declaration .

public DeclarationBuilder WithSourceFileName(string sourceFileName)

Parameters

Name
Description

string sourceFileName

The source file name to apply to the Declaration.

Returns

The instance that received this method call.

WithDescription(string)

Method in DeclarationBuilder

Summary

Sets the Description of the Declaration .

public DeclarationBuilder WithDescription(string description)

Parameters

Name
Description

string description

The description to apply to the Declaration.

Returns

The instance that received this method call.

DirectJump

The Destination is reached beacuse of an explicit instruction to go to this block.

ExpressionIsFalse

The Destination is reached because an expression evaluated to false.

ExpressionIsTrue

The Destination is reached because an expression evaluated to true.

Fallthrough

The Destination is reached because the preceding BasicBlock reached the end of its execution, and the Destination's target is the block immediately following.

Option

The Destination is reached because the player made an in-game choice to go to it.

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.

Returns

GetLineInfo(int)

Gets a LineInfo object that describes the specified instruction at the index instructionNumber .

LineInfo

Contains positional information about an instruction.

Structs

DeclarationBuilder
DeclarationBuilder
DeclarationBuilder
DeclarationBuilder
DescendantsWithPlayerVisibleContent
Destinations
FirstInstructionIndex
Instructions
LabelName
Name
NodeName
PlayerVisibleContent

NodeName

The name of the node that this destination refers to.

Type

Gets the Destination's type - whether the destination is a block, or a node.

DestinationType
Block
Condition
Yarn.Library
Library
FileName
Source
Yarn.Library
DeclarationsOnly
FullCompilation
Program
StringsOnly
Compile(CompilationJob)
FlattenParseTree(IParseTree)
GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)
GetLineIDForNodeName(string)
Option
Yarn.Compiler.Diagnostic
DeclarationBuilder
Yarn.Compiler.Range

diagnostic

Name

Properties

CreateDeferredTypeDiagnostic(string,Diagnostic)
DeclarationBuilder
Yarn.IType

Gets the compiled Yarn program that the produced.

Gets a dictionary mapping line IDs to StringInfo objects.

ContainsImplicitStringTags

Gets a value indicating whether the compiler had to create line IDs for lines in the source code that lacked #line: tags.

DebugInfo

Gets the collection of DebugInfo objects for each node in Program .

Declarations

Diagnostics

Gets the collection of Diagnostic objects that describe problems in the source code.

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.

Compiler

Compiles Yarn code.

DebugInfo

Contains debug information for a node in a Yarn file.

Declaration

DeclarationBuilder

Provides methods for constructing Declaration objects.

DeferredTypeDiagnostic

Diagnostic

A diagnostic message that describes an error, warning or informational message that the user can take action on.

FunctionTypeBuilder

Provides methods for constructing FunctionType objects.

IndentAwareLexer

A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.

InstructionCollectionExtensions

Contains extension methods for producing BasicBlock objects from a Node.

Position

Represents a position in a multi-line string.

Range

Represents a range of text in a multi-line string.

Utility

Utility methods for working with line tags.

Yarn.Compiler.Upgrader

Contains classes for upgrading Yarn code to more recent versions of the language.

CompilationJob

An object that contains Yarn source code to compile, and instructions on how to compile it.

CompilationResult

The result of a compilation.

Namespaces

Structs

BasicBlock

CompilationJob

Struct in Yarn.Compiler

Inherits from System.ValueType

Summary

An object that contains Yarn source code to compile, and instructions on how to compile it.

public struct CompilationJob

Remarks

Instances of this struct are used with Compile(CompilationJob) to produce CompilationResult objects.

Enums

Name
Description
Name
Description
Name
Description
Name
Description

DeclarationBuilder

Class in

Inherits from System.Object

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 .

Declaration

Class in

Inherits from System.Object

Name
Description
FileTags
Program
Compiler
StringTable
FileParseResult
StringInfo

The that contains declarations for functions.

The declarations for variables.

Creates a new using the contents of a string.

Type

The type of compilation that the compiler will do.

CompilationType

The type of compilation to perform.

Files

The File structs that represent the content to parse..

CreateFromFiles(IEnumerable,Library)

Creates a new CompilationJob using the contents of a collection of files.

CreateFromFiles(string[])

Creates a new CompilationJob using the contents of a collection of files.

File

Represents the contents of a file to compile.

Fields

Methods

Structs

Name
Description

Sets the of the .

Sets the of the .

Sets the of the .

Sets the of the .

Name
Description

Gets the instance constructed by this .

public class DeclarationBuilder

Summary

Remarks

Methods

Yarn.Compiler
Declaration
Declaration
Declaration

Properties

Name
Description

Creates a new instance of the class, using the given name, type and default value.

Name
Description

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 .

public class Declaration

ExternalDeclaration

The string used for SourceFileName if the Declaration was found outside of a Yarn source file.

Summary

Fields

Yarn.Compiler

Methods

Properties

Library
Library
VariableDeclarations
CreateFromString(string,string,Library)
CompilationJob

Sets the of the .

Sets the of the .

Sets the of the .

Sets the of the .

WithDefaultValue(System.IConvertible)
DefaultValue
Declaration
WithDescription(string)
Description
Declaration
WithImplicit(bool)
IsImplicit
Declaration
WithName(string)
Name
Declaration
Declaration
Declaration
DeclarationBuilder

Gets a value indicating whether get or sets a value indicating whether this Declaration was implicitly inferred from usage.

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 .

CreateVariable(string,Yarn.IType,IConvertible,string)
Declaration
Equals(object)
DefaultValue
Declaration
Dialogue
IVariableStorage
Description
Declaration
WithRange(Yarn.Compiler.Range)
Range
Declaration
WithSourceFileName(string)
SourceFileName
Declaration
WithSourceNodeName(string)
SourceNodeName
Declaration
WithType(IType)
Type
Declaration
GetHashCode()
ToString()
IsImplicit
Name
Range
SourceFileLine
SourceFileName
SourceNodeName
Type
IType