Table of Contents

Class LarkGenerator

Namespace
Hegel
Assembly
Hegel.dll

Draws strings from a grammar in Lark syntax.

public sealed class LarkGenerator : ValueGenerator<string>
Inheritance
LarkGenerator
Inherited Members

Properties

Label

The span label the engine files this generator's draws under. Defaults to a label derived from the class's full name.

public override ulong Label { get; }

Property Value

ulong

Methods

Alphabet(TextGenerator)

Draw the characters a wildcard matches from characters.

public LarkGenerator Alphabet(TextGenerator characters)

Parameters

characters TextGenerator

Returns

LarkGenerator

DoDraw(TestCase)

Draw one value. Called inside a span labelled Label: draw from another generator through DrawSilent<T>(Generator<T>), which opens its span, rather than by calling its hook.

protected override string DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

string

Explicit(string, Generator<string>)

Draw the terminal name, which the grammar declares but does not define, from generator.

public LarkGenerator Explicit(string name, Generator<string> generator)

Parameters

name string
generator Generator<string>

Returns

LarkGenerator

ImportPath(string)

Resolve the grammar's %imports against directory.

public LarkGenerator ImportPath(string directory)

Parameters

directory string

Returns

LarkGenerator

MaxDepth(int)

Nest rules at most maxDepth deep.

public LarkGenerator MaxDepth(int maxDepth)

Parameters

maxDepth int

Returns

LarkGenerator

MaxSize(int)

Aim for at most maxSize terminals.

public LarkGenerator MaxSize(int maxSize)

Parameters

maxSize int

Returns

LarkGenerator

Start(string)

Start from rule instead of the grammar's first rule.

public LarkGenerator Start(string rule)

Parameters

rule string

Returns

LarkGenerator