public interface Parser
Parser
s must not maintain any state or persistence from one parse operation to another. They should be
immutable objects.
Important: for implementations-- parsing sub-units that may contain a Refinable
, then querying for the results,
may require that you use Broadcaster.chain(Broadcaster)
or Broadcaster.chainBroadcast(Broadcastable,
Broadcaster, Broadcaster...)
in order to find units broadcasted by Refine
subscription methods. See how other
parsers use those methods for examples.
Modifier and Type | Method and Description |
---|---|
boolean |
parse(Source source,
Grammar grammar,
Broadcaster broadcaster)
Parse from the current position of the given source, notifying the given
Broadcaster of any applicable events and
data. |
default boolean |
parse(Source source,
Grammar grammar,
Broadcaster broadcaster,
boolean parentIsConditional)
Parse from the current position of the given source, notifying the given
Broadcaster of any applicable events and
data. |
boolean parse(Source source, Grammar grammar, Broadcaster broadcaster)
Broadcaster
of any applicable events and
data.
Necessary grammar tokens and other parsers should be retrieved from the provided Grammar
instance.
source
- The source to parse.grammar
- The grammar.broadcaster
- The broadcaster.#parse(Source, Grammar, Broadcaster, Boolean)
default boolean parse(Source source, Grammar grammar, Broadcaster broadcaster, boolean parentIsConditional)
Broadcaster
of any applicable events and
data.
Necessary grammar tokens and other parsers should be retrieved from the provided Grammar
instance.
source
- The source to parse.grammar
- The grammar.broadcaster
- The broadcaster.parentIsConditional
- Indicates that the parent rule is a conditional rule.parse(Source, Grammar, Broadcaster)
Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.