public interface BlockParser
Implementations should subclass AbstractBlockParser instead of implementing this directly.
| Modifier and Type | Method and Description |
|---|---|
void |
addLine(SourceLine line) |
void |
addSourceSpan(SourceSpan sourceSpan)
Add a source span of the currently parsed block.
|
boolean |
canContain(Block childBlock) |
boolean |
canHaveLazyContinuationLines()
Return true if the block can have lazy continuation lines.
|
void |
closeBlock() |
Block |
getBlock() |
boolean |
isContainer()
Return true if the block that is parsed is a container (contains other blocks), or false if it's a leaf.
|
void |
parseInlines(InlineParser inlineParser) |
BlockContinue |
tryContinue(ParserState parserState) |
boolean isContainer()
boolean canHaveLazyContinuationLines()
Lazy continuation lines are lines that were rejected by this tryContinue(ParserState) but didn't match
any other block parsers either.
If true is returned here, those lines will get added via addLine(SourceLine). For false, the block is
closed instead.
boolean canContain(Block childBlock)
Block getBlock()
BlockContinue tryContinue(ParserState parserState)
void addLine(SourceLine line)
void addSourceSpan(SourceSpan sourceSpan)
AbstractBlockParser adds
it to the block. Unless you have some complicated parsing where you need to check source positions, you don't
need to override this.void closeBlock()
void parseInlines(InlineParser inlineParser)
Copyright © 2021. All rights reserved.