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...
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 |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
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.
Compiles Yarn code.
A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.
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.
Method in CompilationJob
Creates a new CompilationJob using the contents of a collection of files.
A new CompilationJob .
Method in CompilationJob
Creates a new CompilationJob using the contents of a string.
A new CompilationJob .
Struct in CompilationJob
Inherits from System.ValueType
Represents the contents of a file to compile.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
string[]
paths
The paths to the files.
string
fileName
The name to assign to the compiled file.
string
source
The text to compile.
Yarn.Library library
The name of the file.
The source code of this file.
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.
Enum in CompilationJob
Inherits from System.Enum
The type of compilation that the compiler will do.
Name | Description |
---|---|
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.
Enumeration Member in Type
The compiler will derive only the variable and function declarations, and file tags, found in the script.
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 |
---|---|
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 Diagnostic objects that describe problems 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 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.
Property in CompilationResult
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.
Name | Description |
---|---|
string
name
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
.
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 |
---|---|
Antlr4.Runtime.Tree.IParseTree
node
The root node to begin work from.
Name | Description |
---|---|
object
obj
Field in Declaration
The string used for SourceFileName if the Declaration was found outside of a Yarn source file.
Method in Declaration
Creates a new instance of the Declaration class, using the given name
and default value. The ReturnType
of the new instance will be configured based on the type of defaultValue
, and the DeclarationType
will be Type.Variable
. All other properties will be their default values.
A new instance of the Declaration class.
Name | Description |
---|---|
string
name
The name of the new 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.
Yarn.IType 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 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
Get or sets a value indicating whether this Declaration was implicitly inferred from usage.
Property in Declaration
The line number at which this Declaration was found in the source file.
If this Declaration 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 .
Property in Declaration
Gets the line number at which this Declaration was found in the node indicated by SourceNodeName .
If this Declaration was not found in a Yarn source file, this will be -1.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Field in
Field in
Name | Description |
---|---|
Field in
string
fileName
Antlr4.Runtime.ParserRuleContext
context
string
message
Name | Description |
---|---|
Method in
string
fileName
int
line
int
column
string
message
Name | Description |
---|---|
string
message
Name | Description |
---|---|
Struct in Yarn.Compiler
Inherits from System.ValueType
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.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Initializes a new instance of the FileParseResult struct.
The name of the file.
The tokens extracted from the file.
The parse tree extracted from the file.
Name | Description |
---|---|
object
obj
Constructor in FileParseResult
Initializes a new instance of the FileParseResult struct.
Name | Description |
---|---|
string
name
The name of the file.
Antlr4.Runtime.Tree.IParseTree
tree
The parse tree extracted from the file.
Antlr4.Runtime.CommonTokenStream
tokens
The tokens extracted from the file.
Class in Yarn.Compiler
Inherits from Antlr4.Runtime.Lexer
A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Initializes a new instance of the IndentAwareLexer class.
Gets the collection of warnings determined during lexing.
A warning emitted during lexing.
Constructor in IndentAwareLexer
Initializes a new instance of the IndentAwareLexer class.
Name | Description |
---|---|
Antlr4.Runtime.ICharStream
input
The incoming character stream.
System.IO.TextWriter
output
The System.IO.TextWriter
to send output to.
System.IO.TextWriter
errorOutput
The System.IO.TextWriter
to send errors to.
Struct in IndentAwareLexer
Inherits from System.ValueType
A warning emitted during lexing.
Name | Description |
---|---|
The message associated with the warning.
The token associated with the warning.
Field in
Field in StringInfo
The metadata (i.e. hashtags) associated with this string.
This array will contain any hashtags associated with this string besides the #line:
hashtag.
Field in
Struct in Yarn.Compiler
Inherits from System.ValueType
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 Compiler .
Name | Description |
---|---|
Name | Description |
---|---|
The name of the file this string was found in.
Indicates whether this string's line ID was implicitly generated.
The line number at which this string was found in the file.
The metadata (i.e. hashtags) associated with this string.
The name of the node that this string was found in.
The original text of the string.
Class in Yarn.Compiler
Inherits from System.Object
Utility methods for working with line tags.
Name | Description |
---|---|
Given Yarn source code, adds line tags to the ends of all lines that need one and do not already have one.
Generates a Yarn script that contains a node that declares variables.
Parses a string of Yarn source code, and produces a FileParseResult and (if there were any problems) a collection of diagnostics.
Method in Utility
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 existingLineTags
collection.
Line tags are added to any line of source code that contains user-visible text: lines, options, and shortcut options.
The modified source code, with line tags added.
Name | Description |
---|---|
Field in
string
contents
The source code to add line tags to.
System.Collections.Generic.ICollection<string>
existingLineTags
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.
Method in Utility
Parses a string of Yarn source code, and produces a FileParseResult and (if there were any problems) a collection of diagnostics.
A tuple containing a FileParseResult that stores the parse tree and tokens, and a collection of Diagnostic objects that describe problems in the source code.
Name | Description |
---|---|
string
source
The source code to parse.
Method in Utility
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 CompilationType value set to DeclarationsOnly ), allow the user to make changes, and then write the changes to disk by calling this method and saving the results.
A string containing a Yarn script that declares the specified variables.
Name | Description |
---|---|
System.Collections.Generic.IEnumerable<Yarn.Compiler.Declaration>
declarations
The collection of Declaration objects to include in the output.
string
title
The title of the node that should be generated.
System.Collections.Generic.IEnumerable<string>
tags
The collection of tags that should be generated for the node. If this is null
, no tags will be generated.
System.Collections.Generic.IDictionary<string, string>
headers
The collection of additional headers that should be generated for the node. If this is null
, no additional headers will be generated.
Name | Description |
---|---|
Class in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
string
fileName
string
message
Get or sets a value indicating whether this Declaration was implicitly inferred from usage. |
Gets the name of this Declaration. |
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. |
The string used for if the Declaration was found outside of a Yarn source file.
Creates a new instance of the class, using the given name
and default value. The ReturnType
of the new instance will be configured based on the type of defaultValue
, and the DeclarationType
will be Type.Variable
. All other properties will be their default values.
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 line number at which this Declaration was found in the node indicated by .
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.
Method in
Name | Description |
---|
| 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 |
Name | Description |
---|---|
object
obj
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.