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.Child, Parser.Compile, Parser.Input<D,T>, Parser.Interpreter, Parser.InterpreterTactics, Parser.Offspring, Parser.OffspringMap, Parser.Output<D, T>, Parser.Pragma, Parser.Proxy<D, T>, Parser.Reading<R, D>, Parser.Test -
Field Summary
Fields -
Constructor Summary
Constructors -
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.booleanChecks 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, getCallerLocation, getChildren, getDescription, getParameters, 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, setCaptureCallerLocations, setWatcher, sideEffect, sideEffect, star, starSequence, starSequence, startCollection, startInterval, succeed, succeed, terminal, terminal, terminal, terminal, test, TRACE, withOtherTokenSource, withScope, withScope, withScope, withSideEffects, withSideEffects, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ParserApplies this continuation, possibly using a recyclable leaf node. Operational method.- Specified by:
applyin interfaceAction.Continuation<Parser.Input<D,T>, Parser.Output<D, T>, SimpleMessage<D>, Parser.Input<D, T>> - Specified by:
applyin classParser<D,T> - Parameters:
in- the input parsing resultrecyclable- a recyclable leaf node, ornullif not available- Returns:
- a leaf node with a newly computed parsing result;
either
recyclableif available ornew. - See Also:
-
getFirstSet
Description copied from class:ParserReturns 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:
getFirstSetin 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:ParserChecks 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:
mayBeEpsilonin classParser<D,T> - Returns:
trueiff it is possible (certain or unknown) that this parser accepts zero tokens.- See Also:
-