3 namespace std __attribute__ ((__visibility__ ("default")))
5 typedef __SIZE_TYPE__ size_t;
6 template<typename _Alloc> class allocator;
7 template<class _CharT> struct char_traits;
8 template<typename _CharT, typename _Traits = char_traits<_CharT>,
9 typename _Alloc = allocator<_CharT> >
11 typedef basic_string<char> string;
12 template<class _T1, class _T2> struct pair { };
13 template<typename _Tp> class allocator { };
14 template<typename _Arg1, typename _Arg2, typename _Result>
15 struct binary_function {
16 typedef _Arg1 first_argument_type;
17 typedef _Arg2 second_argument_type;
18 typedef _Result result_type;
20 template<typename _CharT, typename _Traits, typename _Alloc>
23 basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
27 const char* name() const;
29 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__))
30 void * memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
32 return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
34 template <typename _Key, typename _Tp >
36 typedef _Key key_type;
37 typedef _Tp mapped_type;
39 mapped_type& operator[](const key_type& __k);
45 class basicForEachType;
46 typedef const basicForEachType * aType;
47 extern map<const string,basicForEachType *> map_type;
48 class AnyTypeWithOutCheck { };
49 typedef AnyTypeWithOutCheck AnyType;
50 template<typename T> AnyTypeWithOutCheck inline SetAny(const T & x)
52 AnyTypeWithOutCheck any;
53 memcpy(&any,&x,sizeof(x));
55 template<typename T> const T& GetAny(const AnyTypeWithOutCheck & x);
59 typedef E_F0 * Expression;
61 extern Polymorphic * TheOperators, * TheRightOperators;
62 class basicForEachType : public CodeAlloc {
64 virtual C_F0 CastTo(const C_F0 & e) const ;
66 class E_F0 :public CodeAlloc {
68 virtual AnyType operator()(Stack) const =0;
70 class E_F0mps : public E_F0 {
72 class ArrayOfaType : public CodeAlloc{
76 class OneOperator : public ArrayOfaType {
78 OneOperator(aType rr,aType a,aType b);
79 virtual E_F0 * code(const basicAC_F0 &) const =0;
81 class Polymorphic: public E_F0mps {
83 void Add(const char * op,OneOperator * p0 ,OneOperator * p1=0) const;
87 operator E_F0 * () const;
91 const C_F0 & operator [] (int i) const;
93 struct OneBinaryOperatorMI { };
95 template<typename C,class MI=OneBinaryOperatorMI,class MIx=evalE_F2 >
96 class OneBinaryOperator : public OneOperator
98 typedef typename C::result_type R;
99 typedef typename C::first_argument_type A;
100 typedef typename C::second_argument_type B;
102 class Op : public E_F0 {
105 AnyType operator()(Stack s) const {
106 return SetAny<R>(static_cast<R>(C::f( GetAny<A>((*a)(s)),
107 GetAny<B>((*b)(s)))));
109 Op(Expression aa,Expression bb) : a(aa),b(bb) { }
112 E_F0 * code(const basicAC_F0 & args) const {
113 return new Op(t0->CastTo(args[0]),t1->CastTo(args[1]));
116 : OneOperator(map_type[typeid(R).name()],
117 map_type[typeid(A).name()],
118 map_type[typeid(B).name()]), t0(t[0]), t1(t[1]) { }
120 struct NothingType { };
121 class ShapeOfArray{ };
122 template<class R> class KN_: public ShapeOfArray { };
123 template <class T> struct affectation: binary_function<T, T, T> { };
124 template<class K,class L,class OP> struct set_A_BI
125 : public binary_function<KN_<K>,pair<KN_<K>, KN_<L> > *,KN_<K> >
127 static KN_<K> f(const KN_<K> & a, pair<KN_<K>, KN_<L> > * const & b);
129 template<class K,class L,class OP> struct set_AI_B
130 : public binary_function<pair<KN_<K>, KN_<L> > * ,KN_<K>, NothingType >
132 static NothingType f( pair<KN_<K>, KN_<L> > * const & b,const KN_<K> & a);
134 template<class K,class Z> void ArrayOperator()
136 TheOperators->Add("=", new OneBinaryOperator<set_A_BI< K,Z,affectation<K> > >,
137 new OneBinaryOperator<set_AI_B< K,Z,affectation<K> > >);
139 void initArrayOperatorlong() {
140 ArrayOperator<long,long>();