IGrammarRule

Description

[ShutdownSurvive]
interface Tinman.Core.Parsing.IGrammarRule

Derived from

IRule

Extended by

IGrammarRuleProxy

Base interface for grammar rule.

Public / Attributes

Flags


public attribute Flags → (get)

value : GrammarRuleFlags

The rule flags.

The grammar rule flags.

Grammar


public attribute Grammar → (get)

value : Grammar

[not-null]
The grammar.

The Grammar object that has defined this rule.

Rule


public attribute Rule → (get)

value : IRule

The body rule.

The body of this grammar rule.

RuleName


public attribute RuleName → (get)

value : string

[not-null]
The rule name.

The name of this rule.

Extensions

IsRedundant


public static method IsRedundant → ()

returns → bool

true if this grammar rule is redundant,
false if it is not.

Is this grammar rule redundant, i.e. it only refers to another grammar rule or a terminal token?

Parse

2 overloads


public static method Parse1 → (1)

input in : string

[not-null]
The input data.

returns → ParseResult

The parser result object.

Parses the given input data with this rule.


public static method Parse2 → (1)

input in : ICodeInput

[not-null]
The input data.

returns → ParseResult

The parser result object.

Parses the given input data with this rule.

ParseAst

2 overloads


public static method ParseAst1 → (1)

input in : string

[not-null]
The input data.

returns → AstNode

The parsed AST node.

Parses the given input data with this rule and returns the resulting abstract syntax tree.

ValidatingException

If one or more parsing errors have occurred (see ValidateMessageType.Error).


public static method ParseAst2 → (1)

input in : ICodeInput

[not-null]
The input data.

returns → AstNode

The parsed AST node.

Parses the given input data with this rule and returns the resulting abstract syntax tree.

ValidatingException

If one or more parsing errors have occurred (see ValidateMessageType.Error).

ParsePsi

2 overloads


public static method ParsePsi1 → (1)

input in : string

[not-null]
The source code to parse.

returns → object

The resulting AST.

Parses the given input data with this rule and returns the resulting PSI model.

ValidatingException

If one or more parsing errors have occurred (see ValidateMessageType.Error).


public static method ParsePsi2 → (1)

input in : ICodeInput

[not-null]
The source code to parse.

returns → object

The resulting AST.

Parses the given input data with this rule and returns the resulting PSI model.

ValidatingException

If one or more parsing errors have occurred (see ValidateMessageType.Error).