Package net.vleo.timel.function
Class FunctionRegistry
- java.lang.Object
-
- net.vleo.timel.function.FunctionRegistry
-
-
Constructor Summary
Constructors Constructor Description FunctionRegistry()
-
Method Summary
Modifier and Type Method Description void
add(Function<?> function)
Add a function to the registry.void
addAll(Collection<Function<?>> functions)
Add all the functions to the registry.net.vleo.timel.impl.intermediate.tree.FunctionCall
lookup(net.vleo.timel.impl.parser.tree.AbstractParseTree reference, String function, List<net.vleo.timel.impl.intermediate.tree.AbstractSyntaxTree> arguments)
Lookup a function for the given arguments.
-
-
-
Method Detail
-
add
public void add(Function<?> function)
Add a function to the registry.- Parameters:
function
- Function to register
-
addAll
public void addAll(Collection<Function<?>> functions)
Add all the functions to the registry.- Parameters:
functions
- Collections of functions to be registered
-
lookup
public net.vleo.timel.impl.intermediate.tree.FunctionCall lookup(net.vleo.timel.impl.parser.tree.AbstractParseTree reference, String function, List<net.vleo.timel.impl.intermediate.tree.AbstractSyntaxTree> arguments) throws ParseException
Lookup a function for the given arguments.- Parameters:
reference
- Source reference nodefunction
- Function to lookuparguments
- Call arguments- Returns:
- A
FunctionCall
applying the given function to the passed arguments (casting them when needed). - Throws:
ParseException
- When the lookup failed
-
-