Esempio n. 1
0
 void init_kernel(Context& context,Interpreter& interpreter){
   //Operators
   interpreter.add_operator("=","operator=",opBinary,15);
   interpreter.add_operator("<","operator<",opBinary,8);
   interpreter.add_operator(">","operator>",opBinary,8);
   interpreter.add_operator("<=","operator<=",opBinary,8);
   interpreter.add_operator(">=","operator>=",opBinary,8);
   interpreter.add_operator("==","operator==",opBinary,8);
   interpreter.add_operator("===","operator===",opBinary,8);
   interpreter.add_operator("!=","operator!=",opBinary,8);
   interpreter.add_operator("+","operator+",opBinary,4);
   interpreter.add_operator("-","operator-",opBinary,4);
   interpreter.add_operator("*","operator*",opBinary,5);
   interpreter.add_operator("/","operator/",opBinary,5);
   interpreter.add_operator("%","operator%",opBinary,5);
   interpreter.add_operator("::","operator::",opBinary,1);
   interpreter.add_operator("!","factorial",opPostUnitary,2);
   context.add_contextual_function("Void","load",{"String"},(void*)load_module);
   context.add_contextual_function("Void","unload",{"Module"},(void*)unload);
   context.add_contextual_function("Void","reload",{"Module"},(void*)reload);
 }