public class LexerBlockResolverWrapper extends Object implements LexerBlockResolver
Constructor and Description |
---|
LexerBlockResolverWrapper(LexerBlock b,
LexerBlockResolver w) |
LexerBlockResolverWrapper(LexerBlockResolver w) |
Modifier and Type | Method and Description |
---|---|
void |
consume(LexerParser parser)
Indicates that this parser has been consumed.
|
LexerBlock |
getBlock() |
LexerBlockResolver |
getWrapped() |
LexerParser |
identify(LexerParser parentParser)
Should Calls
LexerBlockResolver.identify(LexerParser, boolean)
with safe mode computed from unicity, mandatory flag min/max occur and already consumed parsers. |
LexerParser |
identify(LexerParser parentParser,
boolean safeMode)
Identifies the lexer to use between candidates identified by
LexerBlockResolver.resolveLexers(Grammar) to handle the following source part. |
LexerParser |
identifyAndConsume(LexerParser parentParser)
Short cut to call both identity and consume
|
LexerParser |
identifyAndConsume(LexerParser parentParser,
boolean safeMode)
Short cut to call both identity and consume
|
void |
inject(Object target,
LexerParser value)
Method used to inject result.
|
boolean |
isExcluded(Matcher matcher) |
boolean |
isHasBeenConsumed() |
boolean |
isMaxConsommationReached() |
boolean |
isMinConsommationReached() |
List<Lexer> |
resolveLexers(Grammar grammar)
Resolves the lexer(s) described by this block's configuration that can still be candidate in this parsing operation.
|
public LexerBlockResolverWrapper(LexerBlockResolver w)
public LexerBlockResolverWrapper(LexerBlock b, LexerBlockResolver w)
public LexerBlockResolver getWrapped()
public List<Lexer> resolveLexers(Grammar grammar) throws DslException
LexerBlockResolver
resolveLexers
in interface LexerBlockResolver
DslException
public LexerParser identify(LexerParser parentParser) throws IOException, DslException
LexerBlockResolver
LexerBlockResolver.identify(LexerParser, boolean)
with safe mode computed from unicity, mandatory flag min/max occur and already consumed parsers.identify
in interface LexerBlockResolver
IOException
DslException
public LexerParser identify(LexerParser parentParser, boolean safeMode) throws IOException, DslException
LexerBlockResolver
LexerBlockResolver.resolveLexers(Grammar)
to handle the following source part.identify
in interface LexerBlockResolver
parentParser
- Parent parsersafeMode
- If false, an exception will be thrown if no lexer is identifiedIOException
DslException
public void consume(LexerParser parser) throws DslException
LexerBlockResolver
consume
in interface LexerBlockResolver
DslException
public LexerParser identifyAndConsume(LexerParser parentParser) throws IOException, DslException
LexerBlockResolver
identifyAndConsume
in interface LexerBlockResolver
IOException
DslException
public LexerParser identifyAndConsume(LexerParser parentParser, boolean safeMode) throws IOException, DslException
LexerBlockResolver
identifyAndConsume
in interface LexerBlockResolver
IOException
DslException
public boolean isHasBeenConsumed()
isHasBeenConsumed
in interface LexerBlockResolver
public boolean isMinConsommationReached()
isMinConsommationReached
in interface LexerBlockResolver
public boolean isMaxConsommationReached()
isMaxConsommationReached
in interface LexerBlockResolver
public void inject(Object target, LexerParser value) throws UtilsException
LexerBlockResolver
inject
in interface LexerBlockResolver
UtilsException
public boolean isExcluded(Matcher matcher) throws DslException
isExcluded
in interface LexerBlockResolver
DslException
public LexerBlock getBlock()
getBlock
in interface LexerBlockResolver