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