Package | Description |
---|---|
eu.bandm.tools.ramus.runtime2 |
Modifier and Type | Method and Description |
---|---|
Parser<D,T> |
Parser.andThen(Parser<D,T> other)
Follows the behavior of this parser sequentially with another.
|
Parser<D,T> |
Parser.andThenCombining(Parser<D,T> other,
Action.BiContinuation<Data,Data,Data,SimpleMessage<D>,State> combiner)
Follows the behavior of this parser sequentially with another, combining
the result values.
|
Parser<D,T> |
Parser.assigning(Object key)
Adds the assignment of the result value to a semantic variable to the
behavior of this parser.
|
static <D,T> Parser<D,T> |
Parser.choice(Parser<D,T>... alts)
Alternates the behavior of several parsers in nondeterministic choice.
|
Parser<D,T> |
Parser.collecting()
Adds the collecting of the result value in a sequence to the
behavior of this parser.
|
Parser<D,T> |
Parser.compile() |
static <D,T> Parser<D,T> |
Parser.constant(Data value)
Returns a parser that succeeds and sets the result to the given value,
consuming no tokens.
|
Parser<D,T> |
Parser.diagnose(Function<? super Parser.Input<D,T>,? extends SimpleMessage<D>>... msgs) |
Parser<D,T> |
Parser.diagnose(SimpleMessage<D>... msgs)
Add diagnostic messages to the behavior of this parser.
|
static <D,T> Parser<D,T> |
Parser.endInterval()
Returns a parser that sets the result value to the token location before
the current input state.
|
static <D,T> Parser<D,T> |
Parser.fail()
Returns a parser that fails immediately.
|
static <D,T> Parser<D,T> |
Parser.fix(UnaryOperator<Parser<D,T>> loop)
Computes the fixpoint of a recursive parser definition.
|
Parser<D,T> |
AbstractExpression.getSyntax() |
Parser<D,T> |
Parser.guard(Predicate<State> condition,
Function<State,List<SimpleMessage<D>>> error) |
static <D,T> Parser<D,T> |
Parser.id()
Returns a parser that succeeds with no effect, consuming no tokens.
|
static <D,T> Parser<D,T> |
Parser.ifThenElse(Predicate<Parser.Token<D,T>> condition,
Parser<D,T> thenBranch,
Parser<D,T> elseBranch)
Alternates the behavior of two parsers in deterministic choice, depending
on the next input token.
|
Parser<D,T> |
Parser.ignoringResult()
Removes the setting of the result value from the semantic effect of this
parser.
|
static <D,T> Parser<D,T> |
Parser.lookbehind(Predicate<Parser.Token<D,T>> match) |
static <D,T> Parser<D,T> |
Parser.lookbehind(Set<T> types) |
static <D,T> Parser<D,T> |
Parser.lookbehind(T... types) |
static <D,T> Parser<D,T> |
Parser.lookup(Map<T,Parser<D,T>> alts)
Alternates the behavior of several parsers in deterministic choice, depending
on the next input token.
|
static <D,T> Parser<D,T> |
Parser.lookup(Map<T,Parser<D,T>> alts,
Parser<D,T> otherwise)
Alternates the behavior of several parsers in deterministic choice, depending
on the next input token.
|
Parser<D,T> |
Parser.map(Function<Data,Data> transform)
Adds a final transformation of the result value to the behavior of this
parser.
|
Parser<D,T> |
Parser.negate()
Returns a parser that succeeds if this parser fails, and vice versa.
|
Parser<D,T> |
Parser.optional(Parser.Pragma... pragmas)
Returns a parser that behaves like this parser, or alternatively does
nothing.
|
Parser<D,T> |
Parser.optionalTagged(Parser.Pragma... pragmas)
Returns a parser that behaves like this parser, or alternatively does
nothing, setting a corresponding result value.
|
Parser<D,T> |
Parser.optionalTagged(Parser<D,T> defaultBranch,
Parser.Pragma... pragmas) |
Parser<D,T> |
Parser.orElse(Parser<D,T> other)
Alternates the behavior of this parser with another in nondeterministic
choice.
|
default <T> Parser<D,T> |
Reducer.Constructor6.parse(AbstractExpression<D,T,? extends A1> arg1,
AbstractExpression<D,T,? extends A2> arg2,
AbstractExpression<D,T,? extends A3> arg3,
AbstractExpression<D,T,? extends A4> arg4,
AbstractExpression<D,T,? extends A5> arg5,
AbstractExpression<D,T,? extends A6> arg6) |
default <T> Parser<D,T> |
Reducer.Constructor7.parse(AbstractExpression<D,T,? extends A1> arg1,
AbstractExpression<D,T,? extends A2> arg2,
AbstractExpression<D,T,? extends A3> arg3,
AbstractExpression<D,T,? extends A4> arg4,
AbstractExpression<D,T,? extends A5> arg5,
AbstractExpression<D,T,? extends A6> arg6,
AbstractExpression<D,T,? extends A7> arg7) |
default <T> Parser<D,T> |
Reducer.Constructor1.parse(Fragment<D,T,? extends A1> arg1) |
default <T> Parser<D,T> |
Reducer.Constructor2.parse(Fragment<D,T,? extends A1> arg1,
Fragment<D,T,? extends A2> arg2) |
default <T> Parser<D,T> |
Reducer.Constructor3.parse(Fragment<D,T,? extends A1> arg1,
Fragment<D,T,? extends A2> arg2,
Fragment<D,T,? extends A3> arg3) |
default <T> Parser<D,T> |
Reducer.Constructor4.parse(Fragment<D,T,? extends A1> arg1,
Fragment<D,T,? extends A2> arg2,
Fragment<D,T,? extends A3> arg3,
Fragment<D,T,? extends A4> arg4) |
default <T> Parser<D,T> |
Reducer.Constructor5.parse(Fragment<D,T,? extends A1> arg1,
Fragment<D,T,? extends A2> arg2,
Fragment<D,T,? extends A3> arg3,
Fragment<D,T,? extends A4> arg4,
Fragment<D,T,? extends A5> arg5) |
Parser<D,T> |
Parser.plus(Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
one or more times.
|
Parser<D,T> |
Parser.plusSequence(Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
one or more times, and collects the result values in a sequence.
|
Parser<D,T> |
Parser.plusSequence(Parser<D,T> separator,
Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
one or more times, interspersed with a separator parser, and collects the
result values in a sequence.
|
Parser<D,T> |
Parser.postprocess(Action.Continuation<State,State,SimpleMessage<D>,State> cont)
Appends an ad-hoc continuation to the semantic effect of this parser.
|
Parser<D,T> |
Parser.postprocess(Action.Continuation<State,State,SimpleMessage<D>,State> cont,
int complexity)
Appends an ad-hoc continuation to the semantic effect of this parser.
|
Parser<D,T> |
Parser.postprocess(Update<SimpleMessage<D>> effect)
Appends to the semantic effect of this parser.
|
static <D,T> Parser<D,T> |
Parser.sequence(Parser<D,T>... elems)
Combines the behavior of several parsers sequentially.
|
Parser<D,T> |
Parser.star(Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
zero or more times.
|
Parser<D,T> |
Parser.starSequence(Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
zero or more times, and collects the result values in a sequence.
|
Parser<D,T> |
Parser.starSequence(Parser<D,T> separator,
Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
zero or more times, interspersed with a separator parser, and collects the
result values in a sequence.
|
static <D,T> Parser<D,T> |
Parser.startCollection()
Returns a parser that succeeds and sets the result to the empty sequence,
consuming no tokens.
|
static <D,T> Parser<D,T> |
Parser.startInterval()
Returns a parser that sets the result value to the token location at
the current input state.
|
static <D,T> Parser<D,T> |
Parser.succeed(Function<? super Parser.Input<D,T>,? extends Update<SimpleMessage<D>>> effect)
Returns a parser that succeeds with the given state-dependent effect,
consuming no tokens.
|
static <D,T> Parser<D,T> |
Parser.succeed(Update<SimpleMessage<D>> effect)
Returns a parser that succeeds with the given effect, consuming no tokens.
|
static <D,T> Parser<D,T> |
Parser.terminal(Predicate<Parser.Token<D,T>> match)
Returns a parser that consumes a single token matching a given predicate.
|
static <D,T> Parser<D,T> |
Parser.terminal(Predicate<Parser.Token<D,T>> match,
Optional<Set<T>> firstSet,
@Opt String description)
Returns a parser that consumes a single token matching a given predicate.
|
static <D,T> Parser<D,T> |
Parser.terminal(T type)
Returns a parser that consumes a single token of a given type.
|
static <D,T> Parser<D,T> |
Parser.terminal(T type,
Predicate<? super String> text)
Returns a parser that consumes a single token of a given type and text.
|
static <D,T> Parser<D,T> |
Parser.TRACE(String msg) |
Parser<D,T> |
Parser.withScope(Fragment... fragments)
Wraps the behavior of this parser in a local scope for a set of semantic
variables bound by grammar fragments.
|
Parser<D,T> |
Parser.withScope(Map<Object,? extends Data> initializers)
Wraps the behavior of this parser in a local scope for a set of semantic
variables.
|
Parser<D,T> |
Parser.withScope(Object key,
Data initializer)
Wraps the behavior of this parser in a local scope for a semantic
variable.
|
Modifier and Type | Method and Description |
---|---|
Parser<D,T> |
Parser.andThen(Parser<D,T> other)
Follows the behavior of this parser sequentially with another.
|
Parser<D,T> |
Parser.andThenCombining(Parser<D,T> other,
Action.BiContinuation<Data,Data,Data,SimpleMessage<D>,State> combiner)
Follows the behavior of this parser sequentially with another, combining
the result values.
|
Expression<D,T,A> |
Expression.append(Parser<D,T> suffix) |
static <D,T> Parser<D,T> |
Parser.choice(Parser<D,T>... alts)
Alternates the behavior of several parsers in nondeterministic choice.
|
protected <D,T> void |
ParserCompilationContext.compile(Parser<D,T> parser) |
static <D,T,A> Expression<D,T,A> |
Expression.constant(Parser<D,T> syntax,
A value) |
static <D,T> Expression<D,T,Content<D,T>> |
Expression.content(Parser<D,T> syntax) |
static <D,T> Parser<D,T> |
Parser.ifThenElse(Predicate<Parser.Token<D,T>> condition,
Parser<D,T> thenBranch,
Parser<D,T> elseBranch)
Alternates the behavior of two parsers in deterministic choice, depending
on the next input token.
|
static <D,T> Parser<D,T> |
Parser.ifThenElse(Predicate<Parser.Token<D,T>> condition,
Parser<D,T> thenBranch,
Parser<D,T> elseBranch)
Alternates the behavior of two parsers in deterministic choice, depending
on the next input token.
|
static <D,T> Parser<D,T> |
Parser.lookup(Map<T,Parser<D,T>> alts,
Parser<D,T> otherwise)
Alternates the behavior of several parsers in deterministic choice, depending
on the next input token.
|
Parser<D,T> |
Parser.optionalTagged(Parser<D,T> defaultBranch,
Parser.Pragma... pragmas) |
Parser<D,T> |
Parser.orElse(Parser<D,T> other)
Alternates the behavior of this parser with another in nondeterministic
choice.
|
Expression<D,T,List<A>> |
Expression.plus(Parser<D,T> sep,
Parser.Pragma... pragmas) |
Parser<D,T> |
Parser.plusSequence(Parser<D,T> separator,
Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
one or more times, interspersed with a separator parser, and collects the
result values in a sequence.
|
Expression<D,T,A> |
Expression.prepend(Parser<D,T> prefix) |
static <D,T> Parser<D,T> |
Parser.sequence(Parser<D,T>... elems)
Combines the behavior of several parsers sequentially.
|
Expression<D,T,List<A>> |
Expression.star(Parser<D,T> sep,
Parser.Pragma... pragmas) |
Parser<D,T> |
Parser.starSequence(Parser<D,T> separator,
Parser.Pragma... pragmas)
Returns a parser that behaves as the sequential iteration of this parser,
zero or more times, interspersed with a separator parser, and collects the
result values in a sequence.
|
static <D,T> Expression<D,T,Void> |
Expression.unit(Parser<D,T> syntax) |
Expression<D,T,A> |
Expression.wrap(Parser<D,T> prefix,
Parser<D,T> suffix) |
Expression<D,T,A> |
Expression.wrap(Parser<D,T> prefix,
Parser<D,T> suffix) |
Modifier and Type | Method and Description |
---|---|
static <D,T> Parser<D,T> |
Parser.fix(UnaryOperator<Parser<D,T>> loop)
Computes the fixpoint of a recursive parser definition.
|
static <D,T> Parser<D,T> |
Parser.lookup(Map<T,Parser<D,T>> alts)
Alternates the behavior of several parsers in deterministic choice, depending
on the next input token.
|
static <D,T> Parser<D,T> |
Parser.lookup(Map<T,Parser<D,T>> alts,
Parser<D,T> otherwise)
Alternates the behavior of several parsers in deterministic choice, depending
on the next input token.
|
Expression<D,T,A> |
Expression.mapSyntax(Function<? super Parser<D,T>,? extends Parser<D,T>> fun) |
Expression<D,T,A> |
Expression.mapSyntax(Function<? super Parser<D,T>,? extends Parser<D,T>> fun) |
Constructor and Description |
---|
AbstractExpression(Parser<D,T> syntax,
Data.View<A> semantics,
State.Projection projection) |
Expression(Parser<D,T> syntax,
Data.View<A> semantics) |
Fragment(Object key,
Data initialValue,
Parser<D,T> syntax,
Data.View<A> semantics) |
Fragment(Object key,
Parser<D,T> syntax,
Data.View<A> semantics) |
see also the complete user documentation .