GrammarBuilder

Description

sealed class Tinman.Core.Parsing.GrammarBuilder

Derived from

Disposable abstract

Helper class for building Grammar objects.

Public / Methods

Build


[OwnerReturn] [OwnerThis]
public method Build → (1)

dependencyGraph opt : Graph<IGrammarRule> = null

Optional graph that will receive links that describe the grammar rule dependencies (source depends on target).

returns → Grammar

The Grammar object.

Builds the Grammar object and validates it.

ValidatingException

If one or more validation errors have occurred.

DefaultRule


[OwnerReturn] [OwnerThis]
public method DefaultRule → (1)

ruleName in : string

The default rule or null for none.

returns → GrammarBuilder

this

Specifies the default rule of the Grammar.

If no default rule is specified, the first grammar rule will become the default one.

ExternalRule


[OwnerReturn] [OwnerThis]
public method ExternalRule → (1)

rule in : IGrammarRule

[not-null]
The external rule.

returns → GrammarBuilder

this

Specifies an external rule for the Grammar.

Psi


[OwnerReturn] [OwnerThis]
public method Psi → (2)

tokenType in : string

[not-null]
The AST token type.

psi in : PsiDelegate

[not-null]
The PSI handler method.

returns → GrammarBuilder

this

Specifies a handler method for creating a program structure information (PSI) node for the given abstract syntax tree (AST) node type.