Top Description Methods
com.vladsch.flexmark.parser.block

public Interface ParserState

extends BlockTracker, BlockParserTracker
Known Direct Implementers
com.vladsch.flexmark.parser.internal.DocumentParser
Imports
com.vladsch.flexmark.ast.util.Parsing, com.vladsch.flexmark.parser.InlineParser, com.vladsch.flexmark.util.ast.Block, .BlockTracker, .Node, com.vladsch.flexmark.util.data.MutableDataHolder, com.vladsch.flexmark.util.sequence.BasedSequence, java.util.List

State of the parser that is used in block parsers.

This interface is not intended to be implemented by clients.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the block ends in a blank line
endsWithBlankLine
(Node
block to be tested
block
)

Test the block to see if it ends in a blank line.

public BlockParser

Returns:

the deepest open block parser
getActiveBlockParser
()

public BlockParser

Returns:

an active block parser for the node or null if not found or the block is already closed.
getActiveBlockParser
(Block
block node for which to get the active block parser
node
)

public List<BlockParser>

Returns:

the current list of active block parsers, deepest is last
getActiveBlockParsers
()

public int

Returns:

the current column within the line (0-based)
getColumn
()

The column is the position within the line after tab characters have been processed as 4-space tab stops.

public int

Returns:

the indentation in columns (either by spaces or tab stop of 4), starting from getColumn()
getIndent
()

public int

Returns:

the current index within the line (0-based)
getIndex
()

public InlineParser

Returns:

inline parser instance for the parser state
getInlineParser
()

public BasedSequence

Returns:

the current line
getLine
()

public int

Returns:

the end of line offset into the input stream corresponding to current index into the line, including the EOL
getLineEndIndex
()

public int

Returns:

the EOL offset into the input stream corresponding to current index into the line
getLineEolLength
()

public int

Returns:

The 0 based current line number within the input
getLineNumber
()

public List<BasedSequence>

Returns:

list of line sequences (including EOLs)
getLineSegments
()

Returns a list of document lines encountered this far in the parsing process

public int

Returns:

the start of line offset into the input stream corresponding to current index into the line
getLineStart
()

public BasedSequence

Returns:

the current line with EOL
getLineWithEOL
()

public int

Returns:

the index of the next non-space character starting from getIndex() (may be the same) (0-based)
getNextNonSpaceIndex
()

public ParserPhase

Returns:

the current parser phase ParserPhase
getParserPhase
()

Get the current parser phase

public Parsing

Returns:

strings and patterns class adjusted for options Parsing
getParsing
()

public MutableDataHolder

Returns:

document properties of the document being parsed
getProperties
()

public boolean

Returns:

true if the current line is blank starting from the index
isBlank
()

public boolean

Returns:

true if the current line is blank starting from the index
isBlankLine
()

public boolean

Returns:

true if the block's last line is blank
isLastLineBlank
(Node
block instance to test
node
)

Test a block to see if the last line of the block is blank.

Inherited from com.vladsch.flexmark.parser.block.BlockParserTracker:
blockParserAddedblockParserRemoved
Inherited from com.vladsch.flexmark.util.ast.BlockTracker:
blockAddedblockAddedWithChildrenblockAddedWithDescendantsblockRemovedblockRemovedWithChildrenblockRemovedWithDescendants

Method Detail

endsWithBlankLineback to summary
public boolean endsWithBlankLine(Node block)

Test the block to see if it ends in a blank line. The blank line can be in the block or its last child.

Parameters
block:Node

block to be tested

Returns:boolean

true if the block ends in a blank line

getActiveBlockParserback to summary
public BlockParser getActiveBlockParser()
Returns:BlockParser

the deepest open block parser

getActiveBlockParserback to summary
public BlockParser getActiveBlockParser(Block node)
Parameters
node:Block

block node for which to get the active block parser

Returns:BlockParser

an active block parser for the node or null if not found or the block is already closed.

getActiveBlockParsersback to summary
public List<BlockParser> getActiveBlockParsers()
Returns:List<BlockParser>

the current list of active block parsers, deepest is last

getColumnback to summary
public int getColumn()

The column is the position within the line after tab characters have been processed as 4-space tab stops. If the line doesn't contain any tabs, it's the same as the getIndex(). If the line starts with a tab, followed by text, then the column for the first character of the text is 4 (the index is 1).

Returns:int

the current column within the line (0-based)

getIndentback to summary
public int getIndent()
Returns:int

the indentation in columns (either by spaces or tab stop of 4), starting from getColumn()

getIndexback to summary
public int getIndex()
Returns:int

the current index within the line (0-based)

getInlineParserback to summary
public InlineParser getInlineParser()
Returns:InlineParser

inline parser instance for the parser state

getLineback to summary
public BasedSequence getLine()
Returns:BasedSequence

the current line

getLineEndIndexback to summary
public int getLineEndIndex()
Returns:int

the end of line offset into the input stream corresponding to current index into the line, including the EOL

getLineEolLengthback to summary
public int getLineEolLength()
Returns:int

the EOL offset into the input stream corresponding to current index into the line

getLineNumberback to summary
public int getLineNumber()
Returns:int

The 0 based current line number within the input

getLineSegmentsback to summary
public List<BasedSequence> getLineSegments()

Returns a list of document lines encountered this far in the parsing process

Returns:List<BasedSequence>

list of line sequences (including EOLs)

getLineStartback to summary
public int getLineStart()
Returns:int

the start of line offset into the input stream corresponding to current index into the line

getLineWithEOLback to summary
public BasedSequence getLineWithEOL()
Returns:BasedSequence

the current line with EOL

getNextNonSpaceIndexback to summary
public int getNextNonSpaceIndex()
Returns:int

the index of the next non-space character starting from getIndex() (may be the same) (0-based)

getParserPhaseback to summary
public ParserPhase getParserPhase()

Get the current parser phase

Returns:ParserPhase

the current parser phase ParserPhase

getParsingback to summary
public Parsing getParsing()
Returns:Parsing

strings and patterns class adjusted for options Parsing

getPropertiesback to summary
public MutableDataHolder getProperties()
Returns:MutableDataHolder

document properties of the document being parsed

isBlankback to summary
public boolean isBlank()
Returns:boolean

true if the current line is blank starting from the index

isBlankLineback to summary
public boolean isBlankLine()
Returns:boolean

true if the current line is blank starting from the index

isLastLineBlankback to summary
public boolean isLastLineBlank(Node node)

Test a block to see if the last line of the block is blank. Children not tested.

Parameters
node:Node

block instance to test

Returns:boolean

true if the block's last line is blank