Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
package Synopsis::Parser::C++
class FunctionHeuristic
Files: Synopsis/Parser/C++/syn/lookup.cc

Public Member functions Summary:
 constructorFunctionHeuristic(const v_Type& v)
Constructor - takes arguments to match functions against [Source]
 intoperator()(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::iteratorvi_Type [Source]
std::vector<AST::Parameter*>v_Param [Source]
v_Param::iteratorvi_Param [Source]

Private Member functions Summary:
 boolhasEllipsis(v_Param* params)
Find an ellipsis as the last arg [Source]
 intcountDefault(v_Param* params)
Returns the number of parameters with default values. [Source]
 voidcalcCost(Types::Type* arg_t, Types::Type* param_t)
Calculate the cost of converting 'arg' into 'param'. [Source]

Private Data members Summary:
v_Typem_args [Source]
intcost [Source]

Private Member function Details:
 int countDefault(v_Param* params)

Returns the number of parameters with default values. Counts from the back and stops when it finds one without a default.


 void calcCost(Types::Type* arg_t, Types::Type* param_t)

Calculate the cost of converting 'arg' into 'param'. The cost is accumulated on the 'cost' member variable.