Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Method in
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.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
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.
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
.
Field in
The that contains declarations for functions.
Method in
Name | Description |
---|
| The root node to begin work from. |
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.
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 |
---|---|
Name | Description |
---|---|
Field in
The structs that represent the content to parse..
Method in
Creates a new using the contents of a string.
Name | Description |
---|
A new .
Field in
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.
string[]
paths
The paths to the files.
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 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.
Enumeration Member in Type
The compiler will derive only the variable and function declarations, and file tags, found in the script.
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.
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.
| The name to assign to the compiled file. |
| The text to compile. |
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.
Struct in CompilationJob
Inherits from System.ValueType
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 .
Enum in CompilationJob
Inherits from System.Enum
The type of compilation that the compiler will do.
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) .
Class in Yarn.Compiler
Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener
Compiles Yarn code.
library
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Constructor in
Name | Description |
---|
Field in
The string used for if the Declaration was found outside of a Yarn source file.
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.
The name of the file.
The source code of this file.
System.Collections.Generic.IEnumerable<string>
paths
The paths to the files.
Yarn.Library library
The Library containing functions to use for this compilation.
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.
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.
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
.
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.
|
|
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.
severity
Name | Description |
---|---|
Method in
Name | Description |
---|
Method in
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.
Name | Description |
---|
A new instance of the class.
string
name
| 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 |
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 .
| The name of the new 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. |
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.
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 .
type
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Property in
If this was not found in a Yarn source file, this will be null
.
Method in
Property in
Gets the line number at which this Declaration was found in the node indicated by .
If this was not found in a Yarn source file, this will be -1.
Property in
If this was not found in a Yarn source file, this will be .
Property in
Yarn.Compiler.CompilationJob compilationJob
The compilation job to perform.
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.
object
obj
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Class in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Constructor in
Name | Description |
---|
Constructor in
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
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.
|
|
|
|
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.
severity
severity
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Enumeration Member in
Enumeration Member in
Method in
Method in
Property in
Property in
Method in
Name | Description |
---|
Struct in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Constructor in
Initializes a new instance of the struct.
Name | Description |
---|
string
fileName
int
line
int
column
string
message
object
obj
|
| The name of the file. |
| The parse tree extracted from the file. |
| The tokens extracted from the file. |
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.
The name of the file. |
The tokens extracted from the file. |
The parse tree extracted from the file. |
Struct in IndentAwareLexer
Inherits from System.ValueType
A warning emitted during lexing.
Constructor in IndentAwareLexer
Initializes a new instance of the IndentAwareLexer class.
Class in Yarn.Compiler
Inherits from Antlr4.Runtime.Lexer
A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.
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.
Class in Yarn.Compiler
Inherits from System.Object
Utility methods for working with line tags.
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.
Initializes a new instance of the struct.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Field in
The message associated with the warning.
The token associated with the warning.
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.
Initializes a new instance of the IndentAwareLexer class.
Gets the collection of warnings determined during lexing.
A warning emitted during lexing.
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.
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.