Public Member functions Summary: | |
constructor | FunctionHeuristic(const v_Type& v) Constructor - takes arguments to match functions against [Source] |
int | operator()(AST::Function* func) Heuristic operator, returns 'cost' of given function - higher is worse, 1000 means no match [Source] |
Private Typedefs Summary: | |
std::vector<Types::Type*> | v_Type [Source] |
v_Type::iterator | vi_Type [Source] |
std::vector<AST::Parameter*> | v_Param [Source] |
v_Param::iterator | vi_Param [Source] |
Private Member functions Summary: | |
bool | hasEllipsis(v_Param* params) Find an ellipsis as the last arg [Source] |
int | countDefault(v_Param* params) Returns the number of parameters with default values. [Source] |
void | calcCost(Types::Type* arg_t, Types::Type* param_t) Calculate the cost of converting 'arg' into 'param'. [Source] |
Private Data members Summary: | |
v_Type | m_args [Source] |
int | cost [Source] |
Private Member function Details: |
Returns the number of parameters with default values. Counts from the back and stops when it finds one without a default.
Calculate the cost of converting 'arg' into 'param'. The cost is accumulated on the 'cost' member variable.