ParserList<T, TState> Class

Base class for a list of parsers.

public abstract class ParserList<T, TState> : OrderedList<T> where T : notnull, ParserBase<TState>

Type parameters

T
Type of the parser
TState
The type of the parser state.

See also

Inheritance
OrderedList<T> ParserList<T, TState>

Constructors

NameDescription
ParserList(IEnumerable<T>)Performs the parser list operation.

ParserList(IEnumerable<T>)

ParserList.cs

Performs the parser list operation.

protected ParserList(IEnumerable<T> parsersArg)

Parameters

parsersArg IEnumerable<T>

Properties

NameDescription
GlobalParsersGets the list of global parsers (that don't have any opening characters defined)
OpeningCharactersGets all the opening characters defined.

GlobalParsers

ParserList.cs

Gets the list of global parsers (that don't have any opening characters defined)

public T[]? GlobalParsers { get; }

Property value

T[]?

OpeningCharacters

ParserList.cs

Gets all the opening characters defined.

public char[] OpeningCharacters { get; }

Property value

char[]

Methods

NameDescription
GetParsersForOpeningCharacter(uint)Gets the list of parsers valid for the specified opening character.
IndexOfOpeningCharacter(string, int, int)Searches for an opening character from a registered parser in the specified string.

GetParsersForOpeningCharacter(uint)

ParserList.cs

Gets the list of parsers valid for the specified opening character.

public T[]? GetParsersForOpeningCharacter(uint openingChar)

Parameters

openingChar uint
The opening character.

Returns

T[]? A list of parsers valid for the specified opening character or null if no parsers registered.

IndexOfOpeningCharacter(string, int, int)

ParserList.cs

Searches for an opening character from a registered parser in the specified string.

public int IndexOfOpeningCharacter(string text, int start, int end)

Parameters

text string
The text.
start int
The start.
end int
The end.

Returns

int Index position within the string of the first opening character found in the specified text; if not found, returns -1