Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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 |
---|---|
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.
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 .
Method in CompilationJob
Creates a new CompilationJob using the contents of a string.
A new CompilationJob .
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Field in
Struct in
Name | Description |
---|
Enumeration Member in
Method in
Name | Description |
---|
A tuple containing a that stores the parse tree and tokens, and a collection of objects that describe problems in the source code.
Property in
Property in
If this was not found in a Yarn source file, this will be -1.
Enumeration Member in
Constructor in
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.
System.Collections.Generic.IEnumerable<string>
paths
The paths to the files.
Yarn.Library library
The Library containing functions to use for this compilation.
string
fileName
The name to assign to the compiled file.
string
source
The text to compile.
Yarn.Library library
| The source code to parse. |
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.
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.
Field in Declaration
The string used for SourceFileName if the Declaration was found outside of a Yarn source 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 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.
The name of the file. |
The source code of this file. |
|
|
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 Antlr4.Runtime.Lexer
A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.
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.
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.
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.
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
.
Class in Yarn.Compiler
Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener
Compiles Yarn 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.
The modified source code, with line tags added.
severity
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Class in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Property in
Gets the default value of this , if no value has been specified in code or is available from a 's .
Method 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 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.
Initializes a new instance of the IndentAwareLexer class.
Gets the collection of warnings determined during lexing.
A warning emitted during lexing.
string[]
paths
The paths to the files.
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.
Yarn.Compiler.CompilationJob compilationJob
The compilation job to perform.
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.
Antlr4.Runtime.Tree.IParseTree
node
The root node to begin work from.
string
name
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
.
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.
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.
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. |
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.
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 .
Name | Description |
---|---|
Name | Description |
---|---|
Property in
Gets a string describing the purpose of this .
Property in
If this was not found in a Yarn source file, this will be .
Property in
Class in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Property in
If this was not found in a Yarn source file, this will be null
.
Property in
Field in
Field in
Field in
Field in
Field in
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
object
obj
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 |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Constructor in
Initializes a new instance of the struct.
Name | Description |
---|
Method in
Name | Description |
---|
Property in
Struct in
Name | Description |
---|
Name | Description |
---|
Name | Description |
---|
Property in
Property in
Constructor in
Initializes a new instance of the class.
Name | Description |
---|
Method in
Field in
Method in
object
obj
string
fileName
int
line
int
column
string
message
string
fileName
Antlr4.Runtime.ParserRuleContext
context
string
message
string
message
| The name of the file. |
| The parse tree extracted from the file. |
| 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.
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.
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.
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 .
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.
Class in Yarn.Compiler
Inherits from System.Object
Utility methods for working with line tags.
Initializes a new instance of the struct.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
The message associated with the warning.
The token associated with the warning.
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.
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.
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.