Package com.vladsch.flexmark.parser
Class LightInlineParserImpl
- java.lang.Object
-
- com.vladsch.flexmark.parser.LightInlineParserImpl
-
- All Implemented Interfaces:
LightInlineParser
- Direct Known Subclasses:
InlineParserImpl
public class LightInlineParserImpl extends java.lang.Object implements LightInlineParser
-
-
Field Summary
Fields Modifier and Type Field Description protected Node
block
protected java.util.ArrayList<BasedSequence>
currentText
protected Document
document
protected int
index
protected BasedSequence
input
protected Parsing
myParsing
protected InlineParserOptions
options
-
Constructor Summary
Constructors Constructor Description LightInlineParserImpl(DataHolder dataOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendNode(Node node)
Text
appendSeparateText(BasedSequence text)
void
appendText(BasedSequence text)
void
appendText(BasedSequence text, int beginIndex, int endIndex)
boolean
flushTextNode()
Node
getBlock()
java.util.ArrayList<BasedSequence>
getCurrentText()
Document
getDocument()
int
getIndex()
BasedSequence
getInput()
InlineParserOptions
getOptions()
Parsing
getParsing()
BasedSequence
match(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.java.util.regex.Matcher
matcher(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.BasedSequence[]
matchWithGroups(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.void
moveNodes(Node fromNode, Node toNode)
boolean
nonIndentSp()
Parse zero or more non-indent spaceschar
peek()
char
peek(int ahead)
void
setBlock(Node block)
void
setDocument(Document document)
void
setIndex(int index)
void
setInput(BasedSequence input)
boolean
sp()
Parse zero or more spacesboolean
spnl()
Parse zero or more space characters, including at most one newline and zero or more spaces.boolean
spnlUrl()
Parse zero or more space characters, including at one newline.BasedSequence
toEOL()
Parse to end of line, including EOL
-
-
-
Field Detail
-
options
protected final InlineParserOptions options
-
myParsing
protected final Parsing myParsing
-
block
protected Node block
-
input
protected BasedSequence input
-
index
protected int index
-
currentText
protected java.util.ArrayList<BasedSequence> currentText
-
document
protected Document document
-
-
Constructor Detail
-
LightInlineParserImpl
public LightInlineParserImpl(DataHolder dataOptions)
-
-
Method Detail
-
getCurrentText
@NotNull public java.util.ArrayList<BasedSequence> getCurrentText()
- Specified by:
getCurrentText
in interfaceLightInlineParser
-
getInput
@NotNull public BasedSequence getInput()
- Specified by:
getInput
in interfaceLightInlineParser
-
setInput
public void setInput(BasedSequence input)
- Specified by:
setInput
in interfaceLightInlineParser
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceLightInlineParser
-
setIndex
public void setIndex(int index)
- Specified by:
setIndex
in interfaceLightInlineParser
-
getDocument
@NotNull public Document getDocument()
- Specified by:
getDocument
in interfaceLightInlineParser
-
setDocument
public void setDocument(@NotNull Document document)
- Specified by:
setDocument
in interfaceLightInlineParser
-
getOptions
@NotNull public InlineParserOptions getOptions()
- Specified by:
getOptions
in interfaceLightInlineParser
-
getParsing
@NotNull public Parsing getParsing()
- Specified by:
getParsing
in interfaceLightInlineParser
-
getBlock
@NotNull public Node getBlock()
- Specified by:
getBlock
in interfaceLightInlineParser
-
setBlock
public void setBlock(@NotNull Node block)
- Specified by:
setBlock
in interfaceLightInlineParser
-
moveNodes
public void moveNodes(@NotNull Node fromNode, @NotNull Node toNode)
- Specified by:
moveNodes
in interfaceLightInlineParser
-
appendText
public void appendText(@NotNull BasedSequence text)
- Specified by:
appendText
in interfaceLightInlineParser
-
appendText
public void appendText(@NotNull BasedSequence text, int beginIndex, int endIndex)
- Specified by:
appendText
in interfaceLightInlineParser
-
appendNode
public void appendNode(@NotNull Node node)
- Specified by:
appendNode
in interfaceLightInlineParser
-
appendSeparateText
@NotNull public Text appendSeparateText(@NotNull BasedSequence text)
- Specified by:
appendSeparateText
in interfaceLightInlineParser
-
flushTextNode
public boolean flushTextNode()
- Specified by:
flushTextNode
in interfaceLightInlineParser
-
match
public BasedSequence match(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
match
in interfaceLightInlineParser
- Parameters:
re
- pattern to match- Returns:
- sequence matched or null
-
matchWithGroups
public BasedSequence[] matchWithGroups(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
matchWithGroups
in interfaceLightInlineParser
- Parameters:
re
- pattern to match- Returns:
- sequence matched or null
-
matcher
public java.util.regex.Matcher matcher(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
matcher
in interfaceLightInlineParser
- Parameters:
re
- pattern to match- Returns:
- matched matcher or null
-
peek
public char peek()
- Specified by:
peek
in interfaceLightInlineParser
- Returns:
- the char at the current input index, or
'\0'
in case there are no more characters.
-
peek
public char peek(int ahead)
- Specified by:
peek
in interfaceLightInlineParser
-
spnl
public boolean spnl()
Parse zero or more space characters, including at most one newline and zero or more spaces.- Specified by:
spnl
in interfaceLightInlineParser
- Returns:
- true
-
nonIndentSp
public boolean nonIndentSp()
Parse zero or more non-indent spaces- Specified by:
nonIndentSp
in interfaceLightInlineParser
- Returns:
- true
-
sp
public boolean sp()
Parse zero or more spaces- Specified by:
sp
in interfaceLightInlineParser
- Returns:
- true
-
spnlUrl
public boolean spnlUrl()
Parse zero or more space characters, including at one newline.- Specified by:
spnlUrl
in interfaceLightInlineParser
- Returns:
- true
-
toEOL
@Nullable public BasedSequence toEOL()
Parse to end of line, including EOL- Specified by:
toEOL
in interfaceLightInlineParser
- Returns:
- characters parsed or null if no end of line
-
-