Table of Contents

Class PrecompilerOutputAttribute

Namespace
Farkle.Builder
Assembly
Farkle.dll

Enables accessing the outputs of a precompiled grammar defined with PrecompilerInputAttribute. Methods with this attribute applied are called precompiler output methods, or just output methods.

[AttributeUsage(AttributeTargets.Method)]
public sealed class PrecompilerOutputAttribute : Attribute
Inheritance
PrecompilerOutputAttribute
Inherited Members

Remarks

This attribute must be applied on non-generic, static, parameterless methods that return a Grammar or a CharParser<T>. At build time, the precompiler will update the method's body to retrieve the precompiled grammar and construct the requested object.

The following return types are supported:

Properties

Key

A string value that is used for disambiguation if multiple methods with PrecompilerInputAttribute exist on the same type.

public string? Key { get; set; }

Property Value

string
See Also

SyntaxCheck

Whether to emit a syntax-checking parser.

public bool SyntaxCheck { get; set; }

Property Value

bool

Remarks

Setting this property is required when the precompiler input method's type implements IGrammarBuilder<T>. Otherwise, a syntax-checking parser is always emitted.

See Also