org.unlaxer.tinyexpression.parser.AbstractStringTermParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tinyExpression Show documentation
Show all versions of tinyExpression Show documentation
TinyExpression implemented with Unlaxer
package org.unlaxer.tinyexpression.parser;
import org.unlaxer.parser.Parser;
import org.unlaxer.parser.Parsers;
import org.unlaxer.parser.combinator.ZeroOrMore;
import org.unlaxer.tinyexpression.parser.javalang.JavaStyleDelimitedLazyChain;
public abstract class AbstractStringTermParser extends JavaStyleDelimitedLazyChain implements StringExpression , VariableTypeSelectable{
private static final long serialVersionUID = 1742165276514464092L;
public AbstractStringTermParser() {
super();
}
@Override
public org.unlaxer.parser.Parsers getLazyParsers(boolean withNakedVariable) {
return
withNakedVariable ?
new Parsers(
Parser.get(StringFactorParser.class),
new ZeroOrMore(
Parser.get(SliceParser.class)
)
):
new Parsers(
Parser.get(StrictTypedStringFactorParser.class),
new ZeroOrMore(
Parser.get(SliceParser.class)
)
);
}
}