pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1:
/*\ ||| This file a part of Pike, and is copyright by Fredrik Hubinette ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/ /**/ #include "global.h"
-
RCSID("$Id: docode.c,v 1.
53
1999/11/
05
23
:
21
:
26
grubba Exp $");
+
RCSID("$Id: docode.c,v 1.
54
1999/11/
11
13
:
55
:
58
grubba Exp $");
#include "las.h" #include "program.h" #include "language.h" #include "pike_types.h" #include "stralloc.h" #include "interpret.h" #include "constants.h" #include "array.h" #include "pike_macros.h" #include "error.h"
pike.git/src/docode.c:71:
} #define DO_CODE_BLOCK(X) do_pop(do_docode((X),DO_NOT_COPY | DO_POP)); int do_docode(node *n,INT16 flags) { int i; int save_current_line=lex.current_line; if(!n) return 0; lex.current_line=n->line_number;
-
i=do_docode2(n, flags);
+
i=do_docode2(
check_node_hash(
n
)
, flags);
lex.current_line=save_current_line; return i; } static int is_efun(node *n, c_fun fun) { return n && n->token == F_CONSTANT && n->u.sval.subtype == FUNCTION_BUILTIN && n->u.sval.u.efun->function == fun; } static void code_expression(node *n, int flags, char *err) {
-
switch(do_docode(n, flags & ~ DO_POP))
+
switch(do_docode(
check_node_hash(
n
)
, flags & ~ DO_POP))
{ case 0: my_yyerror("Void expression for %s",err); case 1: return; case 2: fatal("Internal compiler error (%s), line %ld, file %s\n", err, (long)lex.current_line, lex.current_file?lex.current_file->str:"Unknown"); } }
pike.git/src/docode.c:432:
yyerror("Illegal to use local variable here."); if(CDR(n)->u.integer.b) goto normal_assign; code_expression(CAR(n), 0, "RHS"); emit(flags & DO_POP ? F_ASSIGN_LOCAL_AND_POP:F_ASSIGN_LOCAL, CDR(n)->u.integer.a ); break; case F_IDENTIFIER:
-
if(!IDENTIFIER_IS_VARIABLE( ID_FROM_INT(new_program, CDR(n)->u.number)->identifier_flags))
+
if(!IDENTIFIER_IS_VARIABLE( ID_FROM_INT(new_program, CDR(n)->u.
id.
number)->identifier_flags))
{ yyerror("Cannot assign functions or constants.\n"); }else{ code_expression(CAR(n), 0, "RHS"); emit(flags & DO_POP ? F_ASSIGN_GLOBAL_AND_POP:F_ASSIGN_GLOBAL,
-
CDR(n)->u.number);
+
CDR(n)->u.
id.
number);
} break; default: normal_assign: tmp1=do_docode(CDR(n),DO_LVALUE); if(do_docode(CAR(n),0)!=1) yyerror("RHS is void!"); emit2(flags & DO_POP ? F_ASSIGN_AND_POP:F_ASSIGN); break; }
pike.git/src/docode.c:568:
INT32 continue_save = current_continue; current_switch_jumptable=0; current_break=alloc_label(); current_continue=alloc_label(); arr=CAR(n); if(arr->token==F_RANGE) {
-
node **a1=my_get_arg(&CDR(n),0);
-
node **a2=my_get_arg(&CDR(n),1);
+
node **a1=my_get_arg(&
_
CDR(n),0);
+
node **a2=my_get_arg(&
_
CDR(n),1);
if(a1 && a2 && a2[0]->token==F_CONSTANT && a2[0]->u.sval.type==T_INT && a2[0]->u.sval.type==0x7fffffff && a1[0]->type == int_type_string) { tmp2=do_docode(CAR(arr),DO_NOT_COPY); do_docode(*a1,DO_NOT_COPY); goto foreach_arg_pushed; } }
pike.git/src/docode.c:734:
emit2(F_MARK); do_docode(CDR(n),0); tmp1=store_constant(& CAR(n)->u.sval, !(CAR(n)->tree_info & OPT_EXTERNAL_DEPEND), CAR(n)->name); emit(F_APPLY,tmp1); return 1; } else if(CAR(n)->token == F_IDENTIFIER &&
-
IDENTIFIER_IS_FUNCTION(ID_FROM_INT(new_program, CAR(n)->u.number)->identifier_flags))
+
IDENTIFIER_IS_FUNCTION(ID_FROM_INT(new_program, CAR(n)->u.
id.
number)->identifier_flags))
{ emit2(F_MARK); do_docode(CDR(n),0);
-
emit(F_CALL_LFUN, CAR(n)->u.number);
+
emit(F_CALL_LFUN, CAR(n)->u.
id.
number);
return 1; } else { struct pike_string *tmp; struct efun *fun; node *foo; emit2(F_MARK); do_docode(CAR(n),0);
pike.git/src/docode.c:1168:
case F_LOCAL: if(n->u.integer.a >= find_local_frame(n->u.integer.b)->max_number_of_locals) yyerror("Illegal to use local variable here."); if(n->u.integer.b) { emit(F_LDA,n->u.integer.b); if(flags & WANT_LVALUE) {
-
emit(F_LEXICAL_LOCAL_LVALUE,n->u.number);
+
emit(F_LEXICAL_LOCAL_LVALUE,n->u.
id.
number);
return 2; }else{
-
emit(F_LEXICAL_LOCAL,n->u.number);
+
emit(F_LEXICAL_LOCAL,n->u.
id.
number);
return 1; } }else{ if(flags & WANT_LVALUE) {
-
emit(F_LOCAL_LVALUE,n->u.number);
+
emit(F_LOCAL_LVALUE,n->u.
id.
number);
return 2; }else{
-
emit(F_LOCAL,n->u.number);
+
emit(F_LOCAL,n->u.
id.
number);
return 1; } } case F_TRAMPOLINE:
-
emit(F_TRAMPOLINE,n->u.number);
+
emit(F_TRAMPOLINE,n->u.
id.
number);
return 1; case F_IDENTIFIER:
-
if(IDENTIFIER_IS_FUNCTION(ID_FROM_INT(new_program, n->u.number)->identifier_flags))
+
if(IDENTIFIER_IS_FUNCTION(ID_FROM_INT(new_program, n->u.
id.
number)->identifier_flags))
{ if(flags & WANT_LVALUE) { yyerror("Cannot assign functions.\n"); }else{
-
emit(F_LFUN,n->u.number);
+
emit(F_LFUN,n->u.
id.
number);
} }else{ if(flags & WANT_LVALUE) {
-
emit(F_GLOBAL_LVALUE,n->u.number);
+
emit(F_GLOBAL_LVALUE,n->u.
id.
number);
return 2; }else{
-
emit(F_GLOBAL,n->u.number);
+
emit(F_GLOBAL,n->u.
id.
number);
} } return 1; case F_VAL_LVAL: return do_docode(CAR(n),flags)+do_docode(CDR(n),flags | DO_LVALUE); default: fatal("Infernal compiler error (unknown parse-tree-token).\n"); return 0; /* make gcc happy */