BlockParser Class

Base class for a parser of a Block

Inheritance
ParserBase<BlockProcessor> BlockParser
Implements

Constructors

NameDescription
BlockParser()

BlockParser()

protected BlockParser()

No documentation is available.

Methods

NameDescription
CanInterrupt(BlockProcessor, Block)Determines whether this instance can interrupt the specified block being processed.
Close(BlockProcessor, Block)Called when a block matched by this parser is being closed (to allow final computation on the block).
HasOpeningCharacter(char)Determines whether the specified char is an opening character.
TryContinue(BlockProcessor, Block)Tries to continue matching a block already opened.
TryOpen(BlockProcessor)Tries to match a block opening.

CanInterrupt(BlockProcessor, Block)

BlockParser.cs

Determines whether this instance can interrupt the specified block being processed.

public virtual bool CanInterrupt(BlockProcessor processor, Block block)

Parameters

processor BlockProcessor
The parser processor.
block Block
The block being processed.

Returns

bool true if this parser can interrupt the specified block being processed.

Close(BlockProcessor, Block)

BlockParser.cs

Called when a block matched by this parser is being closed (to allow final computation on the block).

public virtual bool Close(BlockProcessor processor, Block block)

Parameters

processor BlockProcessor
The parser processor.
block Block
The block being closed.

Returns

bool true to keep the block; false to remove it. True by default.

HasOpeningCharacter(char)

BlockParser.cs

Determines whether the specified char is an opening character.

public bool HasOpeningCharacter(char c)

Parameters

c char
The character.

Returns

bool true if the specified char is an opening character.

TryContinue(BlockProcessor, Block)

BlockParser.cs

Tries to continue matching a block already opened.

public virtual BlockState TryContinue(BlockProcessor processor, Block block)

Parameters

processor BlockProcessor
The parser processor.
block Block
The block already opened.

Returns

BlockState The result of the match. By default, don't expect any newline

TryOpen(BlockProcessor)

Tries to match a block opening.

public abstract BlockState TryOpen(BlockProcessor processor)

Parameters

processor BlockProcessor
The parser processor.

Returns

BlockState The result of the match

Events

NameDescription
ClosedOccurs when a block opened by this parser is closed. The block is complete and can be post-processed.

Closed

Occurs when a block opened by this parser is closed. The block is complete and can be post-processed.

public event ProcessBlockDelegate? Closed