use of de.prob.parserbase.JoinedParserBase in project probparsers by bendisposto.
the class LtlConsoleParser method getExtensionParser.
public static ProBParserBase getExtensionParser(final String pattern) {
final ProBParserBase result;
if (pattern == null) {
result = UNPARSED_PARSER_BASE;
} else {
final String[] langs = pattern.split(",");
final ProBParserBase[] sublangs = new ProBParserBase[langs.length];
for (int i = 0; i < langs.length; i++) {
final String lang = langs[i];
final ProBParserBase sub;
if ("none".equals(lang)) {
sub = UNPARSED_PARSER_BASE;
} else if ("B".equals(lang)) {
sub = new ClassicalBParser();
} else
throw new IllegalArgumentException("Unknown language " + lang);
sublangs[i] = sub;
}
if (sublangs.length == 1) {
result = sublangs[0];
} else {
result = new JoinedParserBase(sublangs);
}
}
return result;
}
Aggregations