Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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 |
---|---|
Method in CompilationJob
Creates a new CompilationJob using the contents of a string.
Name | Description |
---|---|
A new CompilationJob .
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.
string
fileName
The name to assign to the compiled file.
string
source
The text to compile.
Yarn.Library library
| The paths to the files. |
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) .
Name | Description |
---|---|
Enum in CompilationJob
Inherits from System.Enum
The type of compilation that the compiler will do.
Name | Description |
---|---|
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.
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.
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.
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.
Class in Yarn.Compiler
Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener
Compiles Yarn code.
Name | Description |
---|---|
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
.
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
.
|
| The root node to begin work from. |
compilationJob | The compilation job to perform. |
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.
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.
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.
object
obj
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
Class in Yarn.Compiler
Inherits from System.Object
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
|
|
|
|
severity |
Struct in
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 |
---|
string
fileName
Antlr4.Runtime.ParserRuleContext
context
string
message
object
obj
string
message
string
fileName
string
message
The name of the file. |
The tokens extracted from the file. |
The parse tree extracted from the file. |
Constructor in FileParseResult
Initializes a new instance of the FileParseResult struct.
Name | Description |
---|---|
Initializes a new instance of the struct.
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.
object
obj
Gets the collection of warnings determined during lexing. |
A warning emitted during lexing. |
Struct in IndentAwareLexer
Inherits from System.ValueType
A warning emitted during lexing.
Name | Description |
---|---|
Initializes a new instance of the class.
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 |
---|---|
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.
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 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
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 that stores the parse tree and tokens, and a collection of objects that describe problems in the source code.
Method in
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 value set to ), 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.
Name | Description |
---|
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.
| The incoming character stream. |
| The |
| The |
| The source code to parse. |
|
| The title of the node that should be generated. |
| The collection of tags that should be generated for the node. If this is |
| The collection of additional headers that should be generated for the node. If this is |
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. |
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. |
| The paths to the files. |
library | The containing functions to use for this compilation. |
The collection of objects to include in the output.
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 .