public class Parser extends Object
Meepo template parser, thead safe. When syntax errors are found in the directive, `lax` mode to log as warn and treat as plain text, `strict` mode to throw exceptions
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Parser.Ctx
Naming convention: 0 - start point, include; 1 - end point, exclude;
|
protected static class |
Parser.G |
| Modifier and Type | Field and Description |
|---|---|
protected static Exon |
DealText |
protected static org.slf4j.Logger |
logger |
protected static int |
RegxFlag |
protected static Exon |
SkipThis |
| Constructor and Description |
|---|
Parser() |
| Modifier and Type | Method and Description |
|---|---|
protected static Exon |
dealDnaBkb(Parser.Ctx ctx)
handle `DNA:BKB`
|
protected static Exon |
dealDnaEnd(Parser.Ctx ctx)
handle `DNA:END`
|
protected static @NotNull Exon |
dealDnaGroup(Parser.Ctx ctx)
deal DNA group
|
protected static Exon |
dealDnaRaw(Parser.Ctx ctx)
handle `DNA:RAW`
|
protected static Exon |
dealDnaSet(Parser.Ctx ctx)
handle `DNA:SET`
|
protected static Exon |
dealDnaSon(Parser.Ctx ctx)
handle `DNA:SON`
|
protected static Exon |
dealRnaDone(Parser.Ctx ctx)
handle `DNA:DONE`
|
protected static Exon |
dealRnaEach(Parser.Ctx ctx)
handle `DNA:EACH`
|
protected static Exon |
dealRnaElse(Parser.Ctx ctx)
handle `DNA:ELSE`
|
protected static @NotNull Exon |
dealRnaGroup(Parser.Ctx ctx)
deal RNA group
|
protected static Exon |
dealRnaPut(Parser.Ctx ctx)
handle `DNA:PUT`
|
protected static Exon |
dealRnaRun(Parser.Ctx ctx)
handle `DNA:RUN`
|
protected static Exon |
dealRnaUse(Parser.Ctx ctx)
handle `DNA:USE`
|
protected static Exon |
dealRnaWhen(Parser.Ctx ctx)
handle `DNA:WHEN`
|
protected static void |
dealTxtPlain(Parser.Ctx ctx,
int edge0,
Exon exon)
handle plain text
|
protected static boolean |
findXnaGrp(Parser.Ctx ctx,
String token)
find `DNA:` or `RNA:`
|
protected static boolean |
markHiMeepo(Parser.Ctx ctx)
find and handle Meepo, and decide whether to stop follow-up processing
|
protected static void |
parse(Parser.Ctx ctx) |
static Gene |
parse(String txt)
Parse template, strict mode.
|
static Gene |
parse(String txt,
boolean lax)
Parse template.
|
static Gene |
parse(String txt,
String pwd)
Parse template, strict mode.
|
static Gene |
parse(String txt,
String pwd,
boolean lax)
Parse template, strict mode.
|
protected static final org.slf4j.Logger logger
protected static final Exon SkipThis
protected static final Exon DealText
protected static final int RegxFlag
@Contract(value="null->null;!null->!null") public static Gene parse(String txt)
txt - text to parse@Contract(value="null,_->null;!null,_->!null") public static Gene parse(String txt, boolean lax)
lax - lax mode (not strict)txt - text to parse@Contract(value="null, _->null;!null, _->!null") public static Gene parse(String txt, String pwd)
txt - text to parsepwd - template path@Contract(value="null,_,_->null;!null,_,_->!null") public static Gene parse(String txt, String pwd, boolean lax)
txt - text to parsepwd - template pathlax - lax mode (not strict)protected static void parse(Parser.Ctx ctx)
@NotNull protected static @NotNull Exon dealDnaGroup(Parser.Ctx ctx)
ctx - the context@NotNull protected static @NotNull Exon dealRnaGroup(Parser.Ctx ctx)
ctx - the contextprotected static boolean markHiMeepo(Parser.Ctx ctx)
ctx - the contextprotected static void dealTxtPlain(Parser.Ctx ctx, int edge0, Exon exon)
ctx - the contextedge0 - the left edgeexon - exonprotected static boolean findXnaGrp(Parser.Ctx ctx, String token)
ctx - the contexttoken - tokenprotected static Exon dealDnaRaw(Parser.Ctx ctx)
protected static Exon dealDnaSon(Parser.Ctx ctx)
protected static Exon dealDnaBkb(Parser.Ctx ctx)
protected static Exon dealDnaEnd(Parser.Ctx ctx)
protected static Exon dealDnaSet(Parser.Ctx ctx)
protected static Exon dealRnaRun(Parser.Ctx ctx)
protected static Exon dealRnaUse(Parser.Ctx ctx)
protected static Exon dealRnaPut(Parser.Ctx ctx)
protected static Exon dealRnaWhen(Parser.Ctx ctx)
protected static Exon dealRnaEach(Parser.Ctx ctx)
protected static Exon dealRnaElse(Parser.Ctx ctx)
protected static Exon dealRnaDone(Parser.Ctx ctx)
Copyright © 2024. All rights reserved.