Inherits xtended.
Public Member Functions | |
AbsPrim () | |
virtual unsigned int | arity () |
virtual bool | needCache () |
virtual Type | infereSigType (const vector< Type > &types) |
virtual void | sigVisit (Tree sig, sigvisitor *visitor) |
virtual int | infereSigOrder (const vector< int > &args) |
virtual Tree | computeSigOutput (const vector< Tree > &args) |
virtual string | generateCode (Klass *klass, const vector< string > &args, const vector< Type > &types) |
virtual string | generateLateq (Lateq *lateq, const vector< string > &args, const vector< Type > &types) |
Definition at line 8 of file absprim.cpp.
AbsPrim::AbsPrim | ( | ) | [inline] |
Definition at line 6 of file absprim.cpp.
00008 : public xtended
virtual unsigned int AbsPrim::arity | ( | ) | [inline, virtual] |
Implements xtended.
Definition at line 8 of file absprim.cpp.
Referenced by computeSigOutput(), and sigVisit().
00008 : public xtended
Implements xtended.
Definition at line 29 of file absprim.cpp.
References arity().
00030 { 00031 assert (args.size() == arity()); 00032 return args[0]; 00033 } 00034 00035 00036 virtual Tree computeSigOutput (const vector<Tree>& args) 00037 { 00038 double f; int i; 00039 00040 assert (args.size() == arity()); 00041 00042 if (isDouble(args[0]->node(),&f)) { 00043 return tree(fabs(f)); 00044
virtual string AbsPrim::generateCode | ( | Klass * | klass, | |
const vector< string > & | args, | |||
const vector< Type > & | types | |||
) | [inline, virtual] |
Implements xtended.
Definition at line 46 of file absprim.cpp.
virtual string AbsPrim::generateLateq | ( | Lateq * | lateq, | |
const vector< string > & | args, | |||
const vector< Type > & | types | |||
) | [inline, virtual] |
Implements xtended.
Definition at line 59 of file absprim.cpp.
References isuffix(), and subst().
00059 { 00060 return subst("fabs$1($0)", args[0], isuffix()); 00061 } else { 00062 return subst("abs($0)", args[0]); 00063 } 00064 } 00065 00066 virtual string generateLateq (Lateq* lateq, const vector<string>& args, const vector<Type>& types)
virtual int AbsPrim::infereSigOrder | ( | const vector< int > & | args | ) | [inline, virtual] |
virtual bool AbsPrim::needCache | ( | ) | [inline, virtual] |
virtual void AbsPrim::sigVisit | ( | Tree | sig, | |
sigvisitor * | visitor | |||
) | [inline, virtual] |
Definition at line 20 of file absprim.cpp.
References arity().