All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.tinyexpression.parser.MethodsParser Maven / Gradle / Ivy

There is a newer version: 1.4.4
Show newest version
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*/> extractMethods(/*Typed*/Token/**/ thisParserParsed) {
    
    Parser.checkTokenParsedBySpecifiedParser(thisParserParsed , MethodsParser.class);
    
    List*/> methods = thisParserParsed.flatten().stream()
        .filter(TokenPredicators.parserImplements(MethodParser.class))
//        .map(token->token.typed(MethodParser.class))
        .collect(Collectors.toList());
    return methods;
  }
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy