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
Methods
Alphabet(TextGenerator)
Draw the characters a wildcard matches from characters.
public LarkGenerator Alphabet(TextGenerator characters)
Parameters
charactersTextGenerator
Returns
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
tcTestCase
Returns
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
Returns
ImportPath(string)
Resolve the grammar's %imports against directory.
public LarkGenerator ImportPath(string directory)
Parameters
directorystring
Returns
MaxDepth(int)
Nest rules at most maxDepth deep.
public LarkGenerator MaxDepth(int maxDepth)
Parameters
maxDepthint
Returns
MaxSize(int)
Aim for at most maxSize terminals.
public LarkGenerator MaxSize(int maxSize)
Parameters
maxSizeint
Returns
Start(string)
Start from rule instead of the grammar's first rule.
public LarkGenerator Start(string rule)
Parameters
rulestring