58 |
stackitem *head; /* Head of the stack */ |
stackitem *head; /* Head of the stack */ |
59 |
hashtbl symbols; /* Hash table of all variable bindings */ |
hashtbl symbols; /* Hash table of all variable bindings */ |
60 |
int err; /* Error flag */ |
int err; /* Error flag */ |
|
int non_eval_flag; |
|
61 |
char *in_string; /* Input pending to be read */ |
char *in_string; /* Input pending to be read */ |
62 |
char *free_string; /* Free this string when all input is |
char *free_string; /* Free this string when all input is |
63 |
read from in_string */ |
read from in_string */ |
74 |
|
|
75 |
env->in_string= NULL; |
env->in_string= NULL; |
76 |
env->err= 0; |
env->err= 0; |
|
env->non_eval_flag= 0; |
|
77 |
for(i= 0; i<HASHTBLSIZE; i++) |
for(i= 0; i<HASHTBLSIZE; i++) |
78 |
env->symbols[i]= NULL; |
env->symbols[i]= NULL; |
79 |
} |
} |
100 |
free(item); /* free the stackitem */ |
free(item); /* free the stackitem */ |
101 |
item=temp; /* go to next stackitem */ |
item=temp; /* go to next stackitem */ |
102 |
} |
} |
|
free(val); /* Free the actual list value */ |
|
103 |
break; |
break; |
104 |
case integer: |
case integer: |
105 |
case func: |
case func: |
106 |
case symb: |
case symb: |
107 |
break; |
break; |
108 |
} |
} |
109 |
|
if(val->id!=NULL) |
110 |
|
free(val->id); |
111 |
|
free(val); /* Free the actual list value */ |
112 |
} |
} |
113 |
} |
} |
114 |
|
|
174 |
|
|
175 |
new_value->content.val= in_val; |
new_value->content.val= in_val; |
176 |
new_value->type= integer; |
new_value->type= integer; |
177 |
new_value->refcount=1; |
new_value->refcount= 1; |
178 |
|
new_value->id= NULL; |
179 |
|
|
180 |
push_val(env, new_value); |
push_val(env, new_value); |
181 |
} |
} |
188 |
new_value->content.ptr= malloc(strlen(in_string)+1); |
new_value->content.ptr= malloc(strlen(in_string)+1); |
189 |
strcpy(new_value->content.ptr, in_string); |
strcpy(new_value->content.ptr, in_string); |
190 |
new_value->type= string; |
new_value->type= string; |
191 |
new_value->refcount=1; |
new_value->refcount= 1; |
192 |
|
new_value->id= NULL; |
193 |
|
|
194 |
push_val(env, new_value); |
push_val(env, new_value); |
195 |
} |
} |
215 |
} |
} |
216 |
|
|
217 |
extern void mangle(environment *env){ |
extern void mangle(environment *env){ |
|
value *new_value; |
|
218 |
char *new_string; |
char *new_string; |
219 |
|
|
220 |
if((env->head)==NULL) { |
if((env->head)==NULL) { |
234 |
toss(env); |
toss(env); |
235 |
if(env->err) return; |
if(env->err) return; |
236 |
|
|
237 |
new_value= malloc(sizeof(value)); |
push_cstring(env, new_string); |
|
new_value->content.ptr= new_string; |
|
|
new_value->type= string; |
|
|
new_value->refcount=1; |
|
|
|
|
|
push_val(env, new_value); |
|
238 |
} |
} |
239 |
|
|
240 |
/* Push a symbol onto the stack. */ |
/* Push a symbol onto the stack. */ |