org.eclipse.xtend.backend.common
Interface FunctionDefContext

All Known Subinterfaces:
FunctionDefContextInternal
All Known Implementing Classes:
FunctionDefContextImpl

public interface FunctionDefContext

A FunctionDefContext is roughly the backend representation of a compilation unit - it stands for all functions that are visible from a given point in the code, and every function knows the FunctionDefContext that is valid within its body.

Author:
Arno Haase (http://www.haase-consulting.com), André Arnold

Method Summary
 java.util.Collection<NamedFunction> getAllFunctions()
           
 java.util.Collection<NamedFunction> getByFirstParameterType(BackendType firstParameterType)
          for reflection.
 Function getMatch(ExecutionContext ctx, QualifiedName name, java.util.List<BackendType> params)
          for reflection.
 java.util.Collection<NamedFunction> getPublicFunctions()
           
 boolean hasMatch(ExecutionContext ctx, QualifiedName functionName, java.util.List<? extends java.lang.Object> params)
          for dynamic matching, e.g.
 java.lang.Object invoke(ExecutionContext ctx, QualifiedName functionName, java.util.List<? extends java.lang.Object> params)
           
 java.lang.Object invoke(ExecutionContext ctx, QualifiedName functionName, java.util.List<? extends java.lang.Object> params, boolean firstParamIsThis)
           
 

Method Detail

invoke

java.lang.Object invoke(ExecutionContext ctx,
                        QualifiedName functionName,
                        java.util.List<? extends java.lang.Object> params)

invoke

java.lang.Object invoke(ExecutionContext ctx,
                        QualifiedName functionName,
                        java.util.List<? extends java.lang.Object> params,
                        boolean firstParamIsThis)

getByFirstParameterType

java.util.Collection<NamedFunction> getByFirstParameterType(BackendType firstParameterType)
for reflection. This method returns all functions, both those separately registered and those "built into" the type.


getMatch

Function getMatch(ExecutionContext ctx,
                  QualifiedName name,
                  java.util.List<BackendType> params)
for reflection. This method returns all functions, both those built-into the types and those registered separately.


hasMatch

boolean hasMatch(ExecutionContext ctx,
                 QualifiedName functionName,
                 java.util.List<? extends java.lang.Object> params)
for dynamic matching, e.g. to determine if a function should be called on a collection itself or on all of its members. This method matches against all functions, both those built into the types and those registered separately.


getPublicFunctions

java.util.Collection<NamedFunction> getPublicFunctions()

getAllFunctions

java.util.Collection<NamedFunction> getAllFunctions()