All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

FlattenParseTree(IParseTree)

Method in Compiler

Summary

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 .

public static IEnumerable<IParseTree> FlattenParseTree(IParseTree node)

Parameters

Name
Description

Returns

An System.Collections.Generic.IEnumerable`1 that contains a flattened version of the hierarchy rooted at node .

Antlr4.Runtime.Tree.IParseTree node

The root node to begin work from.

Compiler

Class in Yarn.Compiler

Inherits from Yarn.Compiler.YarnSpinnerParserBaseListener

Summary

Compiles Yarn code.

public class Compiler : YarnSpinnerParserBaseListener

Methods

Name
Description

Compile(CompilationJob)

Compiles Yarn code, as specified by a compilation job.

FlattenParseTree(IParseTree)

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 .

GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)

Gets the text of the documentation comments that either immediately precede context , or are on the same line as context .

GetLineIDForNodeName(string)

Compile(CompilationJob)

Method in Compiler

Summary

Compiles Yarn code, as specified by a compilation job.

public static CompilationResult Compile(CompilationJob compilationJob)

Parameters

Name
Description

Returns

The results of the compilation.

See Also

  • : An object that contains Yarn source code to compile, and instructions on how to compile it.

  • : The result of a compilation.

Yarn.Compiler.CompilationJob compilationJob

The compilation job to perform.

CompilationJob
CompilationResult

GetLineIDForNodeName(string)

Method in Compiler

Summary

public static string GetLineIDForNodeName(string name)

Parameters

Name
Description

GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)

Method in

Summary

Gets the text of the documentation comments that either immediately precede context , or are on the same line as context .

string name

Remarks

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.

Parameters

Name
Description

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.

Returns

The text of the documentation comments.

Compiler
public static string GetDocumentComments(CommonTokenStream tokens, ParserRuleContext context, bool allowCommentsAfter = true)