![JAR search and dependency download from the Maven repository](/logo.png)
org.unlaxer.tinyexpression.parser.MethodsParser Maven / Gradle / Ivy
package org.unlaxer.tinyexpression.parser;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.unlaxer.Token;
import org.unlaxer.TokenPredicators;
import org.unlaxer.parser.Parser;
import org.unlaxer.tinyexpression.parser.javalang.JavaStyleDelimitedLazyZeroOrMore;
import org.unlaxer.util.annotation.TokenExtractor;
import org.unlaxer.util.annotation.TokenExtractor.Timing;
public class MethodsParser extends JavaStyleDelimitedLazyZeroOrMore{
@Override
public Supplier targetParser() {
return MethodChoiceParser::new;
}
@TokenExtractor(timings = Timing.CreateOperatorOperandTree)
public static List*Typed*/Token/**/> extractMethods(/*Typed*/Token/**/ thisParserParsed) {
Parser.checkTokenParsedBySpecifiedParser(thisParserParsed , MethodsParser.class);
List*Typed*/Token/**/> methods = thisParserParsed.flatten().stream()
.filter(TokenPredicators.parserImplements(MethodParser.class))
// .map(token->token.typed(MethodParser.class))
.collect(Collectors.toList());
return methods;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy