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...
Name | Description |
---|
Name | Description |
---|
| The paths to the files. |
Enumeration Member in Type
The compiler will derive only the variable and function declarations, and file tags, found in the script.
The type of compilation that the compiler will do. |
The type of compilation to perform. |
The declarations for variables. |
Represents the contents of a file to compile. |
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. |
| The paths to the files. |
library | The containing functions to use for this compilation. |
Enum in CompilationJob
Inherits from System.Enum
The type of compilation that the compiler will do.
Name | Description |
---|---|
Struct in CompilationJob
Inherits from System.ValueType
Represents the contents of a file to compile.
Name | Description |
---|---|
Method in CompilationJob
Creates a new CompilationJob using the contents of a string.
Name | Description |
---|---|
A new CompilationJob .
Property in
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.
Property in
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.
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 |
---|
An System.Collections.Generic.IEnumerable`1
that contains a flattened version of the hierarchy rooted at node
.
The structs that represent the content to parse..
The that contains declarations for functions.
Creates a new using the contents of a collection of files.
Creates a new using the contents of a collection of files.
Creates a new using the contents of a string.
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 of the file.
The source code of this file.
string
fileName
The name to assign to the compiled file.
string
source
The text to compile.
Yarn.Library library
| The root node to begin work from. |
Field in Declaration
The string used for SourceFileName if the Declaration was found outside of a Yarn source file.
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
Get or sets a value indicating whether this Declaration was implicitly inferred from usage.
Gets a value indicating whether the compiler had to create line IDs for lines in the source code that lacked |
Gets the collection of objects that describe problems in the source code. |
Gets the compiled Yarn program that the produced. |
Gets a dictionary mapping line IDs to StringInfo objects. |
compilationJob | The compilation job to perform. |
Compiles Yarn code, as specified by a compilation job. |
Flattens a tree of |
Gets the text of the documentation comments that either immediately precede |
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.
Name | Description |
---|---|
A new instance of the Declaration class.
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.
Name | Description |
---|---|
The text of the documentation comments.
Class in Yarn.Compiler
Inherits from System.Object
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|
string
name
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
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.
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
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 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 .
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 line number at which this Declaration was found in the node indicated by SourceNodeName .
Gets the name of the node in which this Declaration was found.
object
obj
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.
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 |
---|---|
Constructor in FileParseResult
Initializes a new instance of the FileParseResult struct.
Name | Description |
---|---|
Name | Description |
---|---|
string
fileName
string
message
string
fileName
Antlr4.Runtime.ParserRuleContext
context
string
message
string
message
string
fileName
int
line
int
column
string
message
object
obj
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.
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.
| The incoming character stream. |
| The |
| The |
|
Field in StringInfo
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.
Gets the collection of warnings determined during lexing. |
A warning emitted during lexing. |
The message associated with the warning. |
The token associated with the warning. |
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 |
---|---|
Class in Yarn.Compiler
Inherits from System.Object
Utility methods for working with line tags.
Name | Description |
---|---|
Method in Utility
Parses a string of Yarn source code, and produces a FileParseResult and (if there were any problems) a collection of diagnostics.
Name | Description |
---|---|
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.
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.
Name | Description |
---|---|
The modified source code, with line tags added.
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.
Name | Description |
---|---|
A string containing a Yarn script that declares the specified variables.
Initializes a new instance of the class.
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.
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.
string
source
The source code to parse.
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.
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.