#include "global.h"#include <math.h>#include "interpret.h"#include "svalue.h"#include "multiset.h"#include "mapping.h"#include "array.h"#include "stralloc.h"#include "opcodes.h"#include "operators.h"#include "pike_memory.h"#include "pike_error.h"#include "docode.h"#include "constants.h"#include "peep.h"#include "lex.h"#include "program.h"#include "object.h"#include "pike_types.h"#include "module_support.h"#include "pike_macros.h"#include "bignum.h"#include "builtin_functions.h"#include "cyclic.h"#include "pike_security.h"Defines | |
| #define | sp Pike_sp |
| #define | OP_DIVISION_BY_ZERO_ERROR(FUNC) math_error(FUNC, sp-2, 2, 0, "Division by zero.\n") |
| #define | OP_MODULO_BY_ZERO_ERROR(FUNC) math_error(FUNC, sp-2, 2, 0, "Modulo by zero.\n") |
| #define | COMPARISON(ID, NAME, FUN) |
| #define | CALL_OPERATOR(OP, args) |
| #define | ADD_WITH_UNDEFINED(TYPE, T_TYPEID, ADD_FUNC, PUSH_FUNC) |
| #define | ADD(TYPE, ADD_FUNC, PUSH_FUNC) |
| #define | TMP_OPT(X, Y) |
| #define | STRING_BITOP(OP, STROP) |
| #define | TWO_TYPES(X, Y) (((X)<<8)|(Y)) |
| #define | CALC_BOUND_TYPES(bound_types) |
| #define | THIS ((struct string_assignment_storage *)(CURRENT_STORAGE)) |
| #define | CMP_TYPE "!function(!(object|mixed)...:mixed)&function(mixed...:int(0..1))|function(int|float...:int(0..1))|function(string...:int(0..1))|function(type|program,type|program,type|program...:int(0..1))" |
| #define | F_AND_TYPE(Z) |
| #define | LOG_TYPE |
| #define | SHIFT_TYPE |
Functions | |
| void | index_no_free (struct svalue *to, struct svalue *what, struct svalue *ind) |
| void | o_index (void) |
| void | o_cast_to_int (void) |
| void | o_cast_to_string (void) |
| void | o_cast (struct pike_type *type, INT32 run_time_type) |
| PMOD_EXPORT void | f_cast (void) |
| PMOD_EXPORT void | f_ne (INT32 args) |
| PMOD_EXPORT void | f_add (INT32 args) |
| mapping * | merge_mapping_array_ordered (struct mapping *a, struct array *b, INT32 op) |
| mapping * | merge_mapping_array_unordered (struct mapping *a, struct array *b, INT32 op) |
| PMOD_EXPORT void | o_subtract (void) |
| PMOD_EXPORT void | f_minus (INT32 args) |
| PMOD_EXPORT void | o_and (void) |
| PMOD_EXPORT void | f_and (INT32 args) |
| PMOD_EXPORT void | o_or (void) |
| PMOD_EXPORT void | f_or (INT32 args) |
| PMOD_EXPORT void | o_xor (void) |
| PMOD_EXPORT void | f_xor (INT32 args) |
| PMOD_EXPORT void | o_lsh (void) |
| PMOD_EXPORT void | f_lsh (INT32 args) |
| PMOD_EXPORT void | o_rsh (void) |
| PMOD_EXPORT void | f_rsh (INT32 args) |
| PMOD_EXPORT void | o_multiply (void) |
| PMOD_EXPORT void | f_multiply (INT32 args) |
| PMOD_EXPORT void | o_divide (void) |
| PMOD_EXPORT void | f_divide (INT32 args) |
| PMOD_EXPORT void | o_mod (void) |
| PMOD_EXPORT void | f_mod (INT32 args) |
| PMOD_EXPORT void | o_not (void) |
| PMOD_EXPORT void | f_not (INT32 args) |
| PMOD_EXPORT void | o_compl (void) |
| PMOD_EXPORT void | f_compl (INT32 args) |
| PMOD_EXPORT void | o_negate (void) |
| PMOD_EXPORT void | o_range2 (int bound_types) |
| PMOD_EXPORT void | f_range (INT32 args) |
| PMOD_EXPORT void | f_index (INT32 args) |
| PMOD_EXPORT void | f_arrow (INT32 args) |
| PMOD_EXPORT void | f_index_assign (INT32 args) |
| PMOD_EXPORT void | f_arrow_assign (INT32 args) |
| PMOD_EXPORT void | f_sizeof (INT32 args) |
| int | generate_call_function (node *n) |
| void | init_operators (void) |
| void | exit_operators (void) |
| void | o_breakpoint (void) |
Variables | |
| program * | string_assignment_program |
|
|
Value: do { \ struct TYPE *x = ADD_FUNC (sp - args, args); \ pop_n_elems (args); \ PUSH_FUNC (x); \ return; \ } while (0) |
|
|
Value: do { \ int e; \ if (sp[-args].type == T_INT) { \ if(IS_UNDEFINED(sp-args)) \ { \ struct TYPE *x; \ \ for(e=1;e<args;e++) \ if(sp[e-args].type != T_TYPEID) \ SIMPLE_ARG_TYPE_ERROR("`+", e+1, #TYPE); \ \ x = ADD_FUNC(sp-args+1,args-1); \ pop_n_elems(args); \ PUSH_FUNC(x); \ return; \ } \ \ for(e=1;e<args;e++) \ if (sp[e-args].type != T_INT) \ SIMPLE_ARG_TYPE_ERROR("`+", e+1, "int"); \ } \ \ else { \ for(e=1;e<args;e++) \ if (sp[e-args].type != T_TYPEID) \ SIMPLE_ARG_TYPE_ERROR("`+", e+1, #TYPE); \ } \ \ DO_IF_DEBUG (Pike_fatal ("Shouldn't be reached.\n")); \ } while (0) |
|
|
Value: do { \ if (ind[2].type != T_INT) \ SIMPLE_ARG_TYPE_ERROR ("predef::`[..]", 3, "int"); \ switch (ind[2].u.integer) { \ case INDEX_FROM_BEG: bound_types = RANGE_LOW_FROM_BEG; break; \ case INDEX_FROM_END: bound_types = RANGE_LOW_FROM_END; break; \ case OPEN_BOUND: bound_types = RANGE_LOW_OPEN; break; \ default: \ SIMPLE_ARG_ERROR ("predef::`[..]", 3, "Unrecognized bound type."); \ } \ \ if (ind[4].type != T_INT) \ SIMPLE_ARG_TYPE_ERROR ("predef::`[..]", 5, "int"); \ switch (ind[4].u.integer) { \ case INDEX_FROM_BEG: bound_types |= RANGE_HIGH_FROM_BEG; break; \ case INDEX_FROM_END: bound_types |= RANGE_HIGH_FROM_END; break; \ case OPEN_BOUND: bound_types |= RANGE_HIGH_OPEN; break; \ default: \ SIMPLE_ARG_ERROR ("predef::`[..]", 5, "Unrecognized bound type."); \ } \ } while (0) |
|
|
Value: do { \ struct object *o_ = sp[-args].u.object; \ int i; \ if(!o_->prog) \ bad_arg_error(lfun_names[OP], sp-args, args, 1, "object", sp-args, \ "Called in destructed object.\n"); \ if((i = FIND_LFUN(o_->prog->inherits[sp[-args].subtype].prog, \ OP)) == -1) \ bad_arg_error(lfun_names[OP], sp-args, args, 1, "object", sp-args, \ "Operator not in object.\n"); \ apply_low(o_, i, args-1); \ stack_pop_keep_top(); \ } while (0) |
|
|
|
|
|
Value: PMOD_EXPORT void ID(INT32 args) \ { \ int i; \ switch(args) \ { \ case 0: case 1: \ SIMPLE_TOO_FEW_ARGS_ERROR(NAME, 2); \ case 2: \ i=FUN (sp-2,sp-1); \ pop_n_elems(2); \ push_int(i); \ break; \ default: \ for(i=1;i<args;i++) \ if(! ( FUN (sp-args+i-1, sp-args+i))) \ break; \ pop_n_elems(args); \ push_int(i==args); \ } \ } |
|
|
Value: |
|
|
Value: tOr7(tOr(tFuncV(tMix tObj,tMix,tMix), \ tFuncV(tObj,tMix,tMix)), \ tFuncV(tInt,tInt,tInt), \ tFuncV(tSetvar(1,tMapping),tSetvar(2,tMapping),tOr(tVar(1),tVar(2))), \ tFuncV(tSetvar(3,tMultiset),tSetvar(4,tMultiset),tOr(tVar(3),tVar(4))), \ tFuncV(tSetvar(5,tArray),tSetvar(6,tArray),tOr(tVar(5),tVar(6))), \ tFuncV(tString,tString,tString), \ tFuncV(tOr(tType(tMix),tPrg(tObj)),tOr(tType(tMix),tPrg(tObj)),tType(tMix))) |
|
|
|
|
|
|
|
|
Value: |
|
|
|
|
|
Value: case T_STRING: \ { \ struct pike_string *s; \ ptrdiff_t len, i; \ \ len = sp[-2].u.string->len; \ if (len != sp[-1].u.string->len) \ PIKE_ERROR("`" #OP, "Bitwise "STROP \ " on strings of different lengths.\n", sp, 2); \ if(!sp[-2].u.string->size_shift && !sp[-1].u.string->size_shift) \ { \ s = begin_shared_string(len); \ for (i=0; i<len; i++) \ s->str[i] = sp[-2].u.string->str[i] OP sp[-1].u.string->str[i]; \ }else{ \ s = begin_wide_shared_string(len, \ MAXIMUM(sp[-2].u.string->size_shift, \ sp[-1].u.string->size_shift)); \ for (i=0; i<len; i++) \ low_set_index(s,i,index_shared_string(sp[-2].u.string,i) OP \ index_shared_string(sp[-1].u.string,i)); \ } \ pop_n_elems(2); \ push_string(end_shared_string(s)); \ return; \ } |
|
|
|
|
|
Value: do { \ if((more_args=is_call_to(*first_arg, X))) \ { \ node *tmp=*more_args; \ if(count_args(*more_args) > 2) return 0; \ ADD_NODE_REF(*more_args); \ return mkopernode(Y,tmp,0); \ } } while(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1