Class FunctionMatcher


  • public class FunctionMatcher
    extends Object
    Utility class for function matching.
    Since:
    6.0
    Author:
    O. Kerpershoek, F. van der Meer
    • Constructor Detail

      • FunctionMatcher

        public FunctionMatcher​(ITypeEnvironment environment)
        constructs a function matcher for the specified environment. For type checking it will use the type environment.
        Parameters:
        environment - The mandatory type environment class.
    • Method Detail

      • matchFunction

        public IFunction matchFunction​(Identifier identifier,
                                       Type[] arguments,
                                       IFunction... matches)
        This function matches the 'best' function given a set of function. In such a way that the least conversions have to be made.
        Parameters:
        identifier - The name of the function.
        arguments - The argument set.
        matches - The functions for which the matchFunction should work.
        Returns:
        The best matching function or null when not found.