Package eu.bandm.tools.ramus.runtime2
Class Parser.Proxy<D,T>
java.lang.Object
eu.bandm.tools.ramus.runtime2.Parser<D,T>
eu.bandm.tools.ramus.runtime2.Parser.Proxy<D,T>
- All Implemented Interfaces:
Action.Continuation<Parser.Input<D,
,T>, Parser.Output<D, T>, SimpleMessage<D>, Parser.Input<D, T>> Function<Parser.Input<D,
T>, Action<Parser.Output<D, T>, SimpleMessage<D>, Parser.Input<D, T>>>
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.ramus.runtime2.Parser
Parser.Compile, Parser.Input<D,
T>, Parser.Output<D, T>, Parser.Pragma, Parser.Proxy<D, T>, Parser.Test, Parser.Token<D, T> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Parser.Input<D, T> in, Success<?, SimpleMessage<D>, Parser.Input<D, T>> recyclable) Applies this continuation, possibly using a recyclable leaf node.Returns the finite set of token types that this parser may consume first, if available.boolean
Checks whether this parser may succeed without consuming any token.Methods inherited from class eu.bandm.tools.ramus.runtime2.Parser
andThen, andThenCombining, append, assigning, choice, choice, collecting, compile, compileApply, compose, constant, diagnose, diagnose, diagnoseUnexpectedToken, dummy, endInterval, fail, fix, guard, id, ifThenElse, ignoringResult, keyword, lift, locate, lookbehind, lookbehind, lookbehind, lookup, lookup, main, map, negate, optional, optionalTagged, optionalTagged, orElse, plus, plusSequence, plusSequence, postprocess, postprocess, postprocess, process, sequence, sequence, star, starSequence, starSequence, startCollection, startInterval, succeed, succeed, terminal, terminal, terminal, terminal, test, TRACE, withScope, withScope, withScope, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.ramus.runtime2.Action.Continuation
apply
-
Field Details
-
body
-
-
Constructor Details
-
Proxy
-
-
Method Details
-
apply
public Action<Parser.Output<D,T>, applySimpleMessage<D>, Parser.Input<D, T>> (Parser.Input<D, T> in, Success<?, SimpleMessage<D>, Parser.Input<D, T>> recyclable) Description copied from class:Parser
Applies this continuation, possibly using a recyclable leaf node. Operational method.- Specified by:
apply
in interfaceAction.Continuation<Parser.Input<D,
T>, Parser.Output<D, T>, SimpleMessage<D>, Parser.Input<D, T>> - Specified by:
apply
in classParser<D,
T> - Parameters:
in
- the input parsing resultrecyclable
- a recyclable leaf node, ornull
if not available- Returns:
- a leaf node with a newly computed parsing result;
either
recyclable
if available ornew
. - See Also:
-
getFirstSet
Description copied from class:Parser
Returns the finite set of token types that this parser may consume first, if available.The default implementation returns
Optional.empty()
, which is always safe. Subclasses may override this method to return an actual set, if those parsers are known to never succeed with consuming a first token of another type, to enable optimizations.- Overrides:
getFirstSet
in classParser<D,
T> - Returns:
- an actual finite set if, whenever this parser succeeds consuming at
least one token, the type of the first consumed token must be contained in
the set;
Optional.empty()
if such a set is either unknown or infinite. - See Also:
-
mayBeEpsilon
public boolean mayBeEpsilon()Description copied from class:Parser
Checks whether this parser may succeed without consuming any token.The default implementation returns
true
, which is always safe. Subclasses may override this method to returnfalse
, if those parsers are known to never succeed without consuming any token, to enable optimizations.- Overrides:
mayBeEpsilon
in classParser<D,
T> - Returns:
true
iff it is possible (certain or unknown) that this parser accepts zero tokens.- See Also:
-