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.

Is​Left​Recursive


public attribute IsLeftRecursive → (get)

value : bool

true if this rule if left-recursive,
false if it is not.

Is this grammar rule left-recursive?

Rule


public attribute Rule → (get)

value : IRule

The body rule.

The body of this grammar rule.

Rule​Name


public attribute RuleName → (get)

value : string

[not-null]
The rule name.

The name of this rule.

Extensions

Is​Redundant


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

3 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.


public static method Parse3 → (1)

input in : ParserContext

[not-null]
The parser context that has been prepared via ParserContext.Reset.

returns → ParseResult

The parser result object.

Parses the given input data with this rule.

Parse​Ast

3 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).


public static method ParseAst3 → (1)

input in : ParserContext

[not-null]
The parser context that has been prepared via ParserContext.Reset.

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).

Parse​Psi

3 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 root node of the PSI model.

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

If the returned object is an instance of IPsiNode, this method will have called the IPsiNode.Resolve method once.

ValidatingException

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


public static method ParsePsi3 → (1)

input in : ParserContext

[not-null]
The parser context that has been prepared via ParserContext.Reset.

returns → object

The resulting root node of the PSI model.

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

If the returned object is an instance of IPsiNode, this method will have called the IPsiNode.Resolve method once.

ValidatingException

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