Inherits xtended.
Public Member Functions | |
FloorPrim () | |
virtual unsigned int | arity () |
virtual bool | needCache () |
virtual Type | infereSigType (const vector< Type > &args) |
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 7 of file floorprim.cpp.
FloorPrim::FloorPrim | ( | ) | [inline] |
Definition at line 12 of file floorprim.cpp.
00012 : xtended("floor") {}
virtual unsigned int FloorPrim::arity | ( | ) | [inline, virtual] |
Implements xtended.
Definition at line 14 of file floorprim.cpp.
Referenced by computeSigOutput(), generateCode(), generateLateq(), infereSigOrder(), and infereSigType().
Implements xtended.
Definition at line 32 of file floorprim.cpp.
References arity(), isNum(), xtended::symbol(), and tree().
00032 { 00033 num n; 00034 assert (args.size() == arity()); 00035 if (isNum(args[0],n)) { 00036 return tree(floor(double(n))); 00037 } else { 00038 return tree(symbol(), args[0]); 00039 } 00040 }
virtual string FloorPrim::generateCode | ( | Klass * | klass, | |
const vector< string > & | args, | |||
const vector< Type > & | types | |||
) | [inline, virtual] |
Implements xtended.
Definition at line 42 of file floorprim.cpp.
References arity(), isuffix(), and subst().
00043 { 00044 assert (args.size() == arity()); 00045 assert (types.size() == arity()); 00046 00047 return subst("floor$1($0)", args[0], isuffix()); 00048 }
virtual string FloorPrim::generateLateq | ( | Lateq * | lateq, | |
const vector< string > & | args, | |||
const vector< Type > & | types | |||
) | [inline, virtual] |
Implements xtended.
Definition at line 50 of file floorprim.cpp.
References arity(), and subst().
00051 { 00052 assert (args.size() == arity()); 00053 assert (types.size() == arity()); 00054 00055 return subst("\\left\\lfloor {$0} \\right\\rfloor", args[0]); 00056 }
virtual int FloorPrim::infereSigOrder | ( | const vector< int > & | args | ) | [inline, virtual] |
Implements xtended.
Definition at line 26 of file floorprim.cpp.
References arity().
00026 { 00027 assert (args.size() == arity()); 00028 return args[0]; 00029 }
Implements xtended.
Definition at line 18 of file floorprim.cpp.
References arity(), and floatCast().
virtual bool FloorPrim::needCache | ( | ) | [inline, virtual] |
virtual void FloorPrim::sigVisit | ( | Tree | sig, | |
sigvisitor * | visitor | |||
) | [inline, virtual] |
Definition at line 24 of file floorprim.cpp.