#ifndef __5D_BUILTINS_H #define __5D_BUILTINS_H #include #include #include "AST/AST" #include "AST/Symbols" #include "AST/Keyword" #include "Numbers/Small" #include "Numbers/Integer" #include "Numbers/Real" #include "AST/Keyword" #include "AST/Symbol" #include "Evaluators/Evaluators" #include "Evaluators/Operation" namespace Evaluators { AST::NodeT operator/(const Numbers::Integer& a, const Numbers::Integer& b); AST::NodeT operator/(const Numbers::Int& a, const Numbers::Int& b); AST::NodeT internNative(bool value); AST::NodeT internNative(const char* value); void resetWorld(void); /* TODO factorize str here so it returns "(2.3⋅10**4)" or whatever: */ AST::NodeT provide_dynamic_builtins(AST::NodeT body); extern AST::NodeT aFalse; extern AST::NodeT aTrue; DECLARE_BINARY_OPERATION(Conser) DECLARE_BINARY_OPERATION(Pairer) DECLARE_SIMPLE_OPERATION(ConsP) DECLARE_SIMPLE_OPERATION(PairP) DECLARE_SIMPLE_OPERATION(NilP) DECLARE_SIMPLE_OPERATION(HeadGetter) DECLARE_SIMPLE_OPERATION(TailGetter) DECLARE_SIMPLE_OPERATION(FstGetter) DECLARE_SIMPLE_OPERATION(SndGetter) DECLARE_BINARY_OPERATION(Adder) DECLARE_BINARY_OPERATION(Subtractor) DECLARE_BINARY_OPERATION(Multiplicator) DECLARE_BINARY_OPERATION(Divider) DECLARE_BINARY_OPERATION(QModulator2) DECLARE_BINARY_OPERATION(LEComparer) DECLARE_BINARY_OPERATION(StrP) DECLARE_BINARY_OPERATION(SymbolP) DECLARE_BINARY_OPERATION(AddrLEComparer) DECLARE_BINARY_OPERATION(SymbolEqualityChecker) DECLARE_BINARY_OPERATION(KeywordP) DECLARE_BINARY_OPERATION(SymbolFromStrGetter) DECLARE_BINARY_OPERATION(KeywordFromStrGetter) DECLARE_BINARY_OPERATION(KeywordStr) DECLARE_SIMPLE_OPERATION(ApplicationMaker) DECLARE_SIMPLE_OPERATION(ApplicationP) DECLARE_SIMPLE_OPERATION(ApplicationOperatorGetter) DECLARE_SIMPLE_OPERATION(ApplicationOperandGetter) DECLARE_SIMPLE_OPERATION(AbstractionMaker) DECLARE_SIMPLE_OPERATION(AbstractionP) DECLARE_SIMPLE_OPERATION(AbstractionParameterGetter) DECLARE_SIMPLE_OPERATION(AbstractionBodyGetter) DECLARE_SIMPLE_OPERATION(RFileMathParser) DECLARE_SIMPLE_OPERATION(RStrMathParser) DECLARE_SIMPLE_OPERATION(InfinityChecker) DECLARE_SIMPLE_OPERATION(NanChecker) typedef std::list, gc_allocator > > CXXArguments; CXXArguments CXXfromArguments(AST::NodeT options, AST::NodeT argument); /* non-keyword arguments will be at the FRONT */ CXXArguments CXXfromArgumentsU(AST::NodeT options, AST::NodeT argument, int backwardsIndexOfArgumentNotToReduce); /* non-keyword arguments will be at the FRONT */ AST::NodeT CXXgetKeywordArgumentValue(const CXXArguments& list, AST::Keyword* key); AST::NodeT divideA(AST::NodeT a, AST::NodeT b, AST::NodeT fallback); AST::NodeT divmod0A(AST::NodeT a, AST::NodeT b, AST::NodeT fallback); }; #endif /* ndef __5D_BUILTINS_H */