org.parsky.sequence.infix.InfixExpressionSequenceMatcher Maven / Gradle / Ivy
package org.parsky.sequence.infix;
import org.parsky.sequence.SequenceMatchers;
import org.parsky.sequence.TransformSequenceMatcher;
import org.parsky.sequence.TypedSequenceMatcher;
import org.parsky.sequence.infix.configuration.CombinedExpressionFactory;
import org.parsky.sequence.infix.transform.CombinedExpressionTransformation;
import org.parsky.sequence.transform.Transformations;
public class InfixExpressionSequenceMatcher extends TransformSequenceMatcher {
public InfixExpressionSequenceMatcher(CombinedExpressionFactory combinedExpressionFactory, TypedSequenceMatcher expressionSequenceMatcher, TypedSequenceMatcher infixExpressionSequenceMatcher) {
super(SequenceMatchers.flatten(
SequenceMatchers.sequence(
expressionSequenceMatcher,
SequenceMatchers.flatten(
SequenceMatchers.zeroOrMore(
SequenceMatchers.sequence(
infixExpressionSequenceMatcher,
expressionSequenceMatcher
)
)
)
)
), Transformations.fromContentList(new CombinedExpressionTransformation<>(combinedExpressionFactory)));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy