void
Stokhos::QuadOrthogPolyExpansion<ordinal_type, value_type>::
atanh(Stokhos::OrthogPolyApprox<ordinal_type, value_type>& c, 
      const Stokhos::OrthogPolyApprox<ordinal_type, value_type>& a)
{
  unary_op(atanh_quad_func(), c, a);
}
Ejemplo n.º 2
0
void
Stokhos::PseudoSpectralOrthogPolyExpansion<ordinal_type, value_type, point_compare_type, node_type>::
atanh(Stokhos::OrthogPolyApprox<ordinal_type, value_type, node_type>& c, 
      const Stokhos::OrthogPolyApprox<ordinal_type, value_type, node_type>& a)
{
  unary_op(atanh_quad_func(), c, a);
}
void
Stokhos::QuadOrthogPolyExpansion<ordinal_type, value_type>::
sin(Stokhos::OrthogPolyApprox<ordinal_type, value_type>& s, 
    const Stokhos::OrthogPolyApprox<ordinal_type, value_type>& a)
{
  unary_op(sin_quad_func(), s, a);
}
void
Stokhos::QuadOrthogPolyExpansion<ordinal_type, value_type>::
tan(Stokhos::OrthogPolyApprox<ordinal_type, value_type>& t, 
    const Stokhos::OrthogPolyApprox<ordinal_type, value_type>& a)
{
  unary_op(tan_quad_func(), t, a);
}
Ejemplo n.º 5
0
void attention_layer<dType>::scale_gradients() {

	scale_functor unary_op(minibatch_size);
	thrust::for_each(thrust_d_W_a_grad,thrust_d_W_a_grad + LSTM_size*LSTM_size,unary_op);
	thrust::for_each(thrust_d_W_p_grad,thrust_d_W_p_grad + LSTM_size*LSTM_size,unary_op);
	thrust::for_each(thrust_d_v_p_grad,thrust_d_v_p_grad + LSTM_size*1,unary_op);
	thrust::for_each(thrust_d_output_bias_grad,thrust_d_output_bias_grad + LSTM_size*1,unary_op);
	thrust::for_each(thrust_d_W_c_p1_grad,thrust_d_W_c_p1_grad + LSTM_size*LSTM_size,unary_op);
	thrust::for_each(thrust_d_W_c_p2_grad,thrust_d_W_c_p2_grad + LSTM_size*LSTM_size,unary_op);

}
Ejemplo n.º 6
0
void factor(){
	if (lookahead == UNARY_OP || (lookahead == LOW_BIN_OP && lexval.ival == '-')) {
		unary_op();
		factor();
	}
	else if (lookahead == '('){
		match('(');
		expr();
		match(')');
	}
	else if (lookahead == ID){
		match(ID);
	}
	else { //(lookahead == INT_CONST || lookahead == STR_CONST || lookahead == BOOL_CONST || lookahead == '{')
		constant();
	}
}
Ejemplo n.º 7
0
bool run(struct context *context,
         struct byte_array *program,
         struct map *env,
         bool in_context)
{
    null_check(context);
    null_check(program);
    program = byte_array_copy(program);
    program->current = program->data;
    struct program_state *state = NULL;
    enum Opcode inst = VM_NIL;
    if (context->runtime) {
        if (in_context) {
            if (!state)
                state = (struct program_state*)stack_peek(context->program_stack, 0);
            env = state->named_variables; // use the caller's variable set in the new state
        }
        else
            state = program_state_new(context, env);
    }

    while (program->current < program->data + program->length) {
        inst = (enum Opcode)*program->current;
        bool really = inst & VM_RLY;
        inst &= ~VM_RLY;
#ifdef DEBUG
        display_program_counter(context, program);
#endif
        program->current++; // increment past the instruction
        int32_t pc_offset = 0;

        switch (inst) {
            case VM_COM:
            case VM_ITR:    if (iterate(context, inst, state, program)) goto done;  break;
            case VM_RET:    if (ret(context, program))                  goto done;  break;
            case VM_TRO:    if (tro(context))                           goto done;  break;
            case VM_TRY:    if (vm_trycatch(context, program))          goto done;  break;
            case VM_EQU:
            case VM_MUL:
            case VM_DIV:
            case VM_ADD:
            case VM_SUB:
            case VM_NEQ:
            case VM_GTN:
            case VM_LTN:
            case VM_GRQ:
            case VM_LEQ:
            case VM_BND:
            case VM_BOR:
            case VM_MOD:
            case VM_XOR:
            case VM_INV:
            case VM_RSF:
            case VM_LSF:    binary_op(context, inst);                       break;
            case VM_ORR:
            case VM_AND:    pc_offset = boolean_op(context, program, inst); break;
            case VM_NEG:
            case VM_NOT:    unary_op(context, inst);                        break;
            case VM_SRC:    src(context, inst, program);                    break;
            case VM_DST:    dst(context, really);                           break;
            case VM_STX:
            case VM_SET:    set(context, inst, state, program);             break;
            case VM_JMP:    pc_offset = jump(context, program);             break;
            case VM_IFF:    pc_offset = iff(context, program);              break;
            case VM_CAL:    func_call(context, inst, program, NULL);        break;
            case VM_LST:    push_list(context, program);                    break;
            case VM_MAP:    push_map(context, program);                     break;
            case VM_NIL:    push_nil(context);                              break;
            case VM_INT:    push_int(context, program);                     break;
            case VM_FLT:    push_float(context, program);                   break;
            case VM_BUL:    push_bool(context, program);                    break;
            case VM_STR:    push_str(context, program);                     break;
            case VM_VAR:    push_var(context, program);                     break;
            case VM_FNC:    push_fnc(context, program);                     break;
            case VM_GET:    list_get(context, really);                      break;
            case VM_PTX:
            case VM_PUT:    list_put(context, inst, really);                break;
            case VM_MET:    method(context, program, really);               break;
            default:
                vm_exit_message(context, ERROR_OPCODE);
                return false;
        }
        program->current += pc_offset;
    }

    if (!context->runtime)
        return false;
done:
    if (!in_context)
        stack_pop(context->program_stack);
    return inst == VM_RET;
}
Ejemplo n.º 8
0
Link interpret(Link codeblock_link ,  Link This, Link Arg){
    
    CallEnv env = callenv_new_root( codeblock_link, This, Arg);
    LinkStack stack = env->stack;
    
    
    Link b          = NULL;
    Link link       = NULL;
    Link parent     = NULL;
    Link child_key  = NULL;
    
    Link pusher     = NULL; // Anything in this variable gets pushed onto the stack
    Link trapped    = NULL; // This is the last critical caught by the trap operator
    
    int    delta = 0; // jump delta

    /* Main interpreter loop */
    while(1){

        switch( *(env->current++) ){

            case INTRO:
                env->current+=4;
                break;

            case ALLOC_MODULE:
                delta = read_offset(env);
                env->module->global_vars = linkarray_new(delta);
                break;
            
            case ALLOC_LOCAL:
                delta = read_offset(env);
                env->local = linkarray_new(delta);
                break;
                                
            case NO_OP:
                break;
            
            case RETURN: // if there is something on the env->stack stack pop it off and return it, if not return null link
                if (   stack_length(stack) - env->stack_offset ){
                    pusher = stack_pop(stack);
                }else{
                    pusher = object_create(Global->null_type);
                }
                goto done;

            case RAISE: // if there is something on the stack stack pop it off and return it, if not return null link
            
                if (  stack_length(stack) - env->stack_offset ){
                    pusher = create_critical(stack_pop(stack));
                }else{
                    pusher = create_critical(object_create(Global->null_type));
                }
                goto done;

            case PUSH_LEX:
                delta = read_offset(env);
                //fprintf(stderr , "push lex [%i]    %p\n", delta,env->function->value.codeblock->lexicals);
                pusher = link_dup(env->function->value.codeblock->lexicals->vars[delta]);
                break;
                
            case STORE_LEX:
                delta = read_offset(env);
                //fprintf(stderr , "storing lex [%i]    %p\n", delta,env->function->value.codeblock->lexicals);
                b = env->function->value.codeblock->lexicals->vars[delta];
            
                if (b){
                    if  ( (b->type == Global->function_type) && 
                          (b->value.codeblock->lexicals == env->function->value.codeblock->lexicals)
                        )  b->value.codeblock->lexical_cycles--;
                    link_free(b);
                }
                
                b = link_dup(stack_peek(stack));
                if  ( (b->type == Global->function_type) && 
                      (b->value.codeblock->lexicals == env->function->value.codeblock->lexicals)
                    )  b->value.codeblock->lexical_cycles++;
                
                env->function->value.codeblock->lexicals->vars[delta] = b;
                
                break;
            
            case DEF:
                if (env->Def) link_free(env->Def);
                env->Def = stack_pop(env->stack);
                pusher = link_dup(env->Def);
                break;
            
            case PUSH_DEF:
                if ( ! env->Def){
                    pusher = exception("NoDefObject",NULL, NULL);
                }
                pusher = link_dup(env->Def);
                break;
                
                
                
            case ALLOC_LEXICAL:
                delta = read_offset(env);
                lexicals_alloc( env->function, delta);
                //env->lexical_root = 1;
                break;
                
            case STORE_ARG:
                delta = read_offset(env);
                
                if (env->Arg->value.array->length  > delta){
                    retry_store_arg:
                    env->Arg->value.array->links[delta] =  link_dup( stack_peek(stack) );
                }else{
                    array_push(env->Arg, NULL);
                    goto retry_store_arg;
                } 
                break;
                
            case PUSH_ARG:
                delta = read_offset(env);
                if (env->Arg->value.array->length  > delta){
                    pusher = link_dup(  env->Arg->value.array->links[delta]);
                }else{
                    pusher = exception("ArgsIndexOutOfBounds", NULL, NULL);
                }
            
                break;
                
            case STORE_GVAR:
                delta = read_offset(env);
                if (env->module->global_vars->links[delta]){
                    link_free(env->module->global_vars->links[delta]);
                }
                env->module->global_vars->links[delta] = link_dup( stack_peek(stack) );
                break;

            case STORE_VAR:
                delta = read_offset(env);

                if (env->local->links[delta]){
                    link_free(env->local->links[delta]);
                }
            
                env->local->links[delta] = link_dup( stack_peek(stack) );
                break;

            case STORE_CHILD:
                link        = stack_pop(stack); // value
                child_key   = stack_pop(stack); // key to find the child
                parent      = stack_pop(stack); // parent to look in
                pusher = object_addChild(parent, link, child_key);
                goto STORE_COMMON;

            case STORE_ATTR:
                link           = stack_pop(stack); // value
                child_key      = stack_pop(stack); // key to find the child
                parent         = stack_pop(stack); // parent to look in
                pusher = addAttr(parent, link,child_key);
                goto STORE_COMMON;
                
            STORE_COMMON:
                if (! pusher){
                    pusher = exception("AssignError", NULL, NULL);
                    link_free(link);
                }
            
                link_free(child_key);
                link_free(parent);
                break;

            case LT:
                delta = compare(env);
                pusher = create_numberi( (delta < 0)  ? 1 : 0 );
                break;

            case GT:
                delta = compare(env);
                pusher = create_numberi( (delta > 0)  ? 1 : 0 );
                break;

            case EQ:
                delta = compare(env);
                pusher = create_numberi( (delta == 0)  ? 1 : 0 );
                break;

            case NE:
                delta = compare(env);
                pusher = create_numberi( (delta == 0)  ? 0 : 1 );
                break;

            case LE:
                delta = compare(env);
                pusher = create_numberi( (delta <= 0)  ? 1 : 0 );
                break;

            case GE:
                delta = compare(env);
                pusher = create_numberi( (delta >= 0)  ? 1 : 0 );
                break;
        
            case CMP:
                delta = compare(env);
                pusher = create_numberi( delta );
                break;
            
            case OR:
            case AND:
                break;

            case SUB:
                b = stack_pop(env->stack);
                link = stack_pop(env->stack);
            
                if ( (link->type == Global->number_type) && (link->type == b->type)){
                    pusher = create_number(link->value.number - b->value.number);
                    link_free(link);
                    link_free(b);
                    break;
                }            
            
                pusher = object_op_minus(link,b);
                link_free(link);
                link_free(b);
            
                break;
            
            case ADD:
                b = stack_pop(env->stack);
                link = stack_pop(env->stack);
            
                if ( (link->type == Global->number_type) && (link->type == b->type)){
                    pusher = create_number(link->value.number + b->value.number);
                    link_free(link);
                    link_free(b);
                    break;
                }            
            
                pusher = object_op_plus(link,b);
                link_free(link);
                link_free(b);
                
                break;
                        
            case DIV:
                binary_op(env , object_op_divide);
                break;
            
            case MULT:
                binary_op(env , object_op_multiply);
                break;
            
            case MOD:
                binary_op(env , object_op_modulus);
                break;
            
            case POW:
                binary_op(env , object_op_power);
                break;
            
            case NEG:
                unary_op(env, object_op_neg);
                break;
            
            case NOT:
                link = stack_pop(stack);
                pusher = create_numberi(  (object_is_true(link))  ?  0 : 1 );
                link_free(link);
                break;

            case TEST:
            case ELSE:
                break;

            case DO:
                delta = read_offset(env);
                link  = codeblock_literal2( env->function->value.codeblock->parent, delta  );
                if (env->function->value.codeblock->lexicals) {
                    lexicals_attach( env->function->value.codeblock->lexicals, link);
                }
                env = callenv_new_doblock(env,link);
                break;
            
            case PUSH_ARRAY:
                delta = read_offset(env);
                pusher =  array_new_subarray( stack , delta);
                break;
                
            case CALL:
                link   = stack_pop(stack);     // the arguments in an array
                b      = stack_pop(stack);     // the function that gets called
                parent = link_dup(env->This);  // caller
                goto CALL_COMMON;

            
            case CALL_ATTR:            
                link       = stack_pop(stack);    // arguments
                child_key  = stack_pop(stack);    // name of the function
                parent     = stack_pop(stack);    // caller
                b = getAttr(parent,child_key); // the function that gets called           
                link_free(child_key); // no longer need the attributes key
            
                if (! b) {
                    pusher = exception("AttrNotFound", NULL, NULL);
                    break;
                }
                goto CALL_COMMON;
                
            case CALL_CHILD:
                link       = stack_pop(stack);     // ARG
                child_key  = stack_pop(stack);
                parent     = stack_pop(stack);     // THIS
                b = object_getChild(parent,child_key);
                link_free(child_key);
                goto CALL_COMMON;

            CALL_COMMON:
                /* function type so we can call it inline */
                if (b->type == Global->function_type){
                    env = callenv_new_function(env, b, parent, link); // ce , func,this, arg

                /* Not a CodeBlock so we have to use its virtual call function */
                }else{
                    pusher = object_call(b,  parent, link);// function, caller, args
                    link_free(link);
                    if (parent) link_free(parent);
                    link_free(b);
                    if (! pusher) pusher = object_create(Global->null_type);
                }
                break;

            case DEL_CHILD:
                child_key      = stack_pop(stack); // key to find the child
                parent         = stack_pop(stack); // parent to look in

                /* delete child from container */
                pusher = object_delChild(parent,child_key);
                if (! pusher) pusher = exception("ChildNotFound", object_getString(child_key), NULL);
                        
                link_free(child_key);
                link_free(parent);
                break;                
                
            case DEL_ATTR:
                child_key      = stack_pop(stack); // key to find the child
                parent         = stack_pop(stack); // parent to look in

                /* delete attr from container */
                pusher = delAttr(parent,child_key);
                if (! pusher) pusher = exception("AttrNotFound", object_getString(child_key), NULL);

                link_free(child_key);
                link_free(parent);
                break;                
                
            case GET_CHILD:
                child_key      = stack_pop(stack); // key to find the child
                parent         = stack_pop(stack); // parent to look in

                pusher = object_getChild(parent, child_key);            
                if (! pusher) pusher = exception("ChildNotFound", object_getString(child_key), NULL);

                link_free(parent);
                link_free(child_key);
                break;

            case GET_ATTR:
                child_key      = stack_pop(stack); // key to find the child
                parent         = stack_pop(stack); // parent to look in

                pusher = getAttr(parent, child_key);
                if (! pusher) pusher = exception("AttrNotFound", object_getString(child_key), NULL);

                link_free(parent);
                link_free(child_key);
                break;

            case TRAP:
                break;

            case CLEAR:
                for ( delta = stack_length( stack ) ; delta > env->stack_offset ; delta--){
                    link_free( stack_pop(stack) );    
                }    
                break;
            
            case STOP:
                break;

            done:
            case END:
                for ( delta = stack_length( stack ) ; delta > env->stack_offset ; delta--){
                    link_free( stack_pop(stack) );    
                }    
                addBacktrace(pusher, env->function, env->linenum);
                env = callenv_free(env);

                if (! env) goto end;
                
                if (! pusher) pusher = object_create(Global->null_type);
                break;

            /* JUMPS */
            case JIT:  /* Jump if true */
                delta = read_offset(env);
                link = stack_peek(stack);
                if ( link->type->is_true(link) )  env->current = env->start+delta;
                break;

            case JIF:  /* Jump if false */
                delta = read_offset(env);
                link = stack_peek(stack);
                if ( ! link->type->is_true(link) )  env->current = env->start+delta;
                break;
                

            case JIF_POP:  /* Pop value then jump if value is false,  */
                delta = read_offset(env);
                link = stack_pop(stack);
                if ( ! link->type->is_true(link) )  env->current = env->start+delta;
                link_free(link);
                break;
                
            case JUMP:  /* Absolute jump */
                delta = read_offset(env);
                env->current = env->start + delta;
                break;

            case JINC: /* Jump If Not Critical */
                delta = read_offset(env);
                env->current = env->start+delta;
                break;
                
              jinc_critical:
                delta = read_offset(env);
            
                if (trapped) link_free(trapped);
                trapped = pusher->value.link;
                pusher->value.link = NULL;
                link_free(pusher);
                pusher = NULL;
                break;

            case PUSH_NULL:
                pusher = create_null();
                break;

            case PUSH_NUM:
                pusher = create_number( *((number_t *)env->current) );
                env->current+= sizeof(number_t);
                break;
            
            case PUSH_STR:
                delta = read_offset(env);
                pusher = create_string_literal( env->start + delta  );
                break;

            case PUSH_GVAR:
                delta = read_offset(env);
                pusher = link_dup(env->module->global_vars->links[delta]);
            
                if (! pusher){
                    pusher = exception("GlobalVariableUsedBeforeSet",NULL,NULL);
                }
                break;
            
            case PUSH_VAR:
                delta = read_offset(env);
             
                pusher = link_dup(env->local->links[delta]);
                
                if (! pusher){
                    pusher = exception("VariableUsedBeforeSet",NULL,NULL);;
                }
                break;
            
            case PUSH_BLOCK:
                delta = read_offset(env);
                pusher  = codeblock_literal2( env->function->value.codeblock->parent, delta  );
                if (env->function->value.codeblock->lexicals) {
                    lexicals_attach( env->function->value.codeblock->lexicals, pusher);
                }
                break;

            case PUSH_SYS:
                pusher = link_dup(Global->SYS_MODULE);
                break;
            
            case PUSH_MODULE:
                pusher = link_dup( env->function->value.codeblock->parent);
                break;
            
            case TYPEOF:
                link = stack_pop(stack);
                pusher = link_dup( link->type->type_link);
                link_free(link);
                break;
            
            case PUSH_THIS:
                pusher = link_dup(env->This);
                break;

            case PUSH_SELF:
                pusher = link_dup(env->Self);
                break;
            
            case PUSH_ARGS:
                pusher = link_dup(env->Arg);
                break;

            case PUSH_TRAPPED:
                pusher = trapped ? link_dup(trapped) : object_create(Global->null_type);
                break;
            
            case POP:
                link_free( stack_pop(stack) );
                break;

            case LINE:
                env->linenum = read_offset(env);
                break;

            default:
                fprintf(stderr," UNRECOGNIZED OPCODE ERROR %i\n", *(env->current));
                fprintf(stderr,"     near line %i\n", (int)(env->linenum));
                exit(1);
                break;
        }
                
        if (pusher) {
            
            if ( is_critical( pusher ) ){
                if ( *(env->current) == JINC)  goto jinc_critical;
                goto done;
            }
            
            stack_push(stack , pusher);
            pusher = NULL;
        }
        
    }

    end:

    if (trapped) link_free(trapped);
    return pusher;
}
Ejemplo n.º 9
0
void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
	int i = 0;
	zend_op *opline = op_array->opcodes;
	zend_op *end = opline + op_array->last;
	zend_bool collect_constants = (op_array == &ctx->script->main_op_array);

	while (opline < end) {
		switch (opline->opcode) {
		case ZEND_ADD:
		case ZEND_SUB:
		case ZEND_MUL:
		case ZEND_DIV:
		case ZEND_MOD:
		case ZEND_POW:
		case ZEND_SL:
		case ZEND_SR:
		case ZEND_CONCAT:
		case ZEND_FAST_CONCAT:
		case ZEND_IS_EQUAL:
		case ZEND_IS_NOT_EQUAL:
		case ZEND_IS_SMALLER:
		case ZEND_IS_SMALLER_OR_EQUAL:
		case ZEND_IS_IDENTICAL:
		case ZEND_IS_NOT_IDENTICAL:
		case ZEND_BW_OR:
		case ZEND_BW_AND:
		case ZEND_BW_XOR:
		case ZEND_BOOL_XOR:
			if (ZEND_OP1_TYPE(opline) == IS_CONST &&
				ZEND_OP2_TYPE(opline) == IS_CONST) {
				/* binary operation with constant operands */
				binary_op_type binary_op = get_binary_op(opline->opcode);
				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */
				zval result;
				int er;

				if (opline->opcode == ZEND_DIV &&
					Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_LONG &&
					Z_LVAL(ZEND_OP2_LITERAL(opline)) == 0) {
					/* div by 0 */
					break;
				}
				er = EG(error_reporting);
				EG(error_reporting) = 0;
				/* evaluate constant expression */
				if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline)) != SUCCESS) {
					EG(error_reporting) = er;
					break;
				}
				EG(error_reporting) = er;

				if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result)) {
					literal_dtor(&ZEND_OP1_LITERAL(opline));
					literal_dtor(&ZEND_OP2_LITERAL(opline));
					MAKE_NOP(opline);
				}
			}
			break;

		case ZEND_CAST:
			if (ZEND_OP1_TYPE(opline) == IS_CONST &&
				opline->extended_value != IS_ARRAY &&
				opline->extended_value != IS_OBJECT &&
				opline->extended_value != IS_RESOURCE) {
				/* cast of constant operand */
				zend_uchar type = opline->result_type;
				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */
				zval res;
				res = ZEND_OP1_LITERAL(opline);
				zval_copy_ctor(&res);
				switch (opline->extended_value) {
					case IS_NULL:
						convert_to_null(&res);
						break;
					case _IS_BOOL:
						convert_to_boolean(&res);
						break;
					case IS_LONG:
						convert_to_long(&res);
						break;
					case IS_DOUBLE:
						convert_to_double(&res);
						break;
					case IS_STRING:
						convert_to_string(&res);
						break;
				}

				if (zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res)) {
					literal_dtor(&ZEND_OP1_LITERAL(opline));
					MAKE_NOP(opline);
				}
			} else if (opline->extended_value == _IS_BOOL) {
				/* T = CAST(X, IS_BOOL) => T = BOOL(X) */
				opline->opcode = ZEND_BOOL;
				opline->extended_value = 0;
			}
			break;

		case ZEND_BW_NOT:
		case ZEND_BOOL_NOT:
			if (ZEND_OP1_TYPE(opline) == IS_CONST) {
				/* unary operation on constant operand */
				unary_op_type unary_op = get_unary_op(opline->opcode);
				zval result;
				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */
				int er;

				er = EG(error_reporting);
				EG(error_reporting) = 0;
				if (unary_op(&result, &ZEND_OP1_LITERAL(opline)) != SUCCESS) {
					EG(error_reporting) = er;
					break;
				}
				EG(error_reporting) = er;

				if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result)) {
					literal_dtor(&ZEND_OP1_LITERAL(opline));
					MAKE_NOP(opline);
				}
			}
			break;

#if 0
		case ZEND_ADD_STRING:
		case ZEND_ADD_CHAR:
			{
				zend_op *next_op = opline + 1;
				int requires_conversion = (opline->opcode == ZEND_ADD_CHAR? 1 : 0);
				size_t final_length = 0;
				zend_string *str;
				char *ptr;
				zend_op *last_op;

				/* There is always a ZEND_RETURN at the end
				if (next_op>=end) {
					break;
				}
				*/
				while (next_op->opcode == ZEND_ADD_STRING || next_op->opcode == ZEND_ADD_CHAR) {
					if (ZEND_RESULT(opline).var != ZEND_RESULT(next_op).var) {
						break;
					}
					if (next_op->opcode == ZEND_ADD_CHAR) {
						final_length += 1;
					} else { /* ZEND_ADD_STRING */
						final_length += Z_STRLEN(ZEND_OP2_LITERAL(next_op));
					}
					next_op++;
				}
				if (final_length == 0) {
					break;
				}
				last_op = next_op;
				final_length += (requires_conversion? 1 : Z_STRLEN(ZEND_OP2_LITERAL(opline)));
				str = zend_string_alloc(final_length, 0);
				str->len = final_length;
				ptr = str->val;
				ptr[final_length] = '\0';
				if (requires_conversion) { /* ZEND_ADD_CHAR */
					char chval = (char)Z_LVAL(ZEND_OP2_LITERAL(opline));

					ZVAL_NEW_STR(&ZEND_OP2_LITERAL(opline), str);
					ptr[0] = chval;
					opline->opcode = ZEND_ADD_STRING;
					ptr++;
				} else { /* ZEND_ADD_STRING */
					memcpy(ptr, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)));
					ptr += Z_STRLEN(ZEND_OP2_LITERAL(opline));
					zend_string_release(Z_STR(ZEND_OP2_LITERAL(opline)));
					ZVAL_NEW_STR(&ZEND_OP2_LITERAL(opline), str);
				}
				next_op = opline + 1;
				while (next_op < last_op) {
					if (next_op->opcode == ZEND_ADD_STRING) {
						memcpy(ptr, Z_STRVAL(ZEND_OP2_LITERAL(next_op)), Z_STRLEN(ZEND_OP2_LITERAL(next_op)));
						ptr += Z_STRLEN(ZEND_OP2_LITERAL(next_op));
						literal_dtor(&ZEND_OP2_LITERAL(next_op));
					} else { /* ZEND_ADD_CHAR */
						*ptr = (char)Z_LVAL(ZEND_OP2_LITERAL(next_op));
						ptr++;
					}
					MAKE_NOP(next_op);
					next_op++;
				}
				if (!((ZEND_OPTIMIZER_PASS_5|ZEND_OPTIMIZER_PASS_10) & OPTIMIZATION_LEVEL)) {
					/* NOP removal is disabled => insert JMP over NOPs */
					if (last_op-opline >= 3) { /* If we have more than 2 NOPS then JMP over them */
						(opline + 1)->opcode = ZEND_JMP;
						ZEND_OP1(opline + 1).opline_num = last_op - op_array->opcodes; /* that's OK even for ZE2, since opline_num's are resolved in pass 2 later */
					}
				}
			}
			break;
#endif

		case ZEND_FETCH_CONSTANT:
			if (ZEND_OP1_TYPE(opline) == IS_UNUSED &&
				ZEND_OP2_TYPE(opline) == IS_CONST &&
				Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING &&
				Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("__COMPILER_HALT_OFFSET__") - 1 &&
				memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1) == 0) {
				/* substitute __COMPILER_HALT_OFFSET__ constant */
				zend_execute_data *orig_execute_data = EG(current_execute_data);
				zend_execute_data fake_execute_data;
				zval *offset;

				memset(&fake_execute_data, 0, sizeof(zend_execute_data));
				fake_execute_data.func = (zend_function*)op_array;
				EG(current_execute_data) = &fake_execute_data;
				if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
					uint32_t tv = ZEND_RESULT(opline).var;

					if (zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset)) {
						literal_dtor(&ZEND_OP2_LITERAL(opline));
						MAKE_NOP(opline);
					}
				}
				EG(current_execute_data) = orig_execute_data;
				break;
			}

			if (ZEND_OP1_TYPE(opline) == IS_UNUSED &&
				ZEND_OP2_TYPE(opline) == IS_CONST &&
				Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
				/* substitute persistent constants */
				uint32_t tv = ZEND_RESULT(opline).var;
				zval c;

				if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1)) {
					if (!ctx->constants || !zend_optimizer_get_collected_constant(ctx->constants, &ZEND_OP2_LITERAL(opline), &c)) {
						break;
					}
				}
				if (Z_TYPE(c) == IS_CONSTANT_AST) {
					break;
				}
				if (zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c)) {
					literal_dtor(&ZEND_OP2_LITERAL(opline));
					MAKE_NOP(opline);
				}
			}

			/* class constant */
			if (ZEND_OP1_TYPE(opline) != IS_UNUSED &&
			    ZEND_OP2_TYPE(opline) == IS_CONST &&
				Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {

				zend_class_entry *ce = NULL;

				if (ZEND_OP1_TYPE(opline) == IS_CONST &&
			        Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
					/* for A::B */
					if (op_array->scope &&
						!strncasecmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)),
						op_array->scope->name->val, Z_STRLEN(ZEND_OP1_LITERAL(opline)) + 1)) {
						ce = op_array->scope;
					} else {
						if ((ce = zend_hash_find_ptr(EG(class_table),
								Z_STR(op_array->literals[opline->op1.constant + 1]))) == NULL ||
								(ce->type == ZEND_INTERNAL_CLASS &&
								 ce->info.internal.module->type != MODULE_PERSISTENT) ||
								(ce->type == ZEND_USER_CLASS &&
								 ZEND_CE_FILENAME(ce) != op_array->filename)) {
							break;
						}
					}
				} else if (op_array->scope &&
					ZEND_OP1_TYPE(opline) == IS_VAR &&
					(opline - 1)->opcode == ZEND_FETCH_CLASS &&
					(ZEND_OP1_TYPE(opline - 1) == IS_UNUSED &&
					((opline - 1)->extended_value & ~ZEND_FETCH_CLASS_NO_AUTOLOAD) == ZEND_FETCH_CLASS_SELF) &&
					ZEND_RESULT((opline - 1)).var == ZEND_OP1(opline).var) {
					/* for self::B */
					ce = op_array->scope;
				}

				if (ce) {
					uint32_t tv = ZEND_RESULT(opline).var;
					zval *c, t;

					if ((c = zend_hash_find(&ce->constants_table,
							Z_STR(ZEND_OP2_LITERAL(opline)))) != NULL) {
						ZVAL_DEREF(c);
						if (Z_TYPE_P(c) == IS_CONSTANT_AST) {
							break;
						}
						if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_P(c))) {
							if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1) ||
							    ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {
								break;
							}
						} else {
							ZVAL_COPY_VALUE(&t, c);
							zval_copy_ctor(&t);
						}

						if (ZEND_OP1_TYPE(opline) == IS_CONST) {
							literal_dtor(&ZEND_OP1_LITERAL(opline));
						} else {
							MAKE_NOP((opline - 1));
						}
						if (zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t)) {
							literal_dtor(&ZEND_OP2_LITERAL(opline));
							MAKE_NOP(opline);
						}
					}
				}
			}
			break;

		case ZEND_DO_ICALL: {
			zend_op *send1_opline = opline - 1;
			zend_op *send2_opline = NULL;
			zend_op *init_opline = NULL;

			while (send1_opline->opcode == ZEND_NOP) {
				send1_opline--;
			}
			if (send1_opline->opcode != ZEND_SEND_VAL ||
			    ZEND_OP1_TYPE(send1_opline) != IS_CONST) {
				/* don't colllect constants after unknown function call */
				collect_constants = 0;
				break;
			}
			if (send1_opline->op2.num == 2) {
				send2_opline = send1_opline;
				send1_opline--;
				while (send1_opline->opcode == ZEND_NOP) {
					send1_opline--;
				}
				if (send1_opline->opcode != ZEND_SEND_VAL ||
				    ZEND_OP1_TYPE(send1_opline) != IS_CONST) {
					/* don't colllect constants after unknown function call */
					collect_constants = 0;
					break;
				}
			}
			init_opline = send1_opline - 1;
			while (init_opline->opcode == ZEND_NOP) {
				init_opline--;
			}
			if (init_opline->opcode != ZEND_INIT_FCALL ||
			    ZEND_OP2_TYPE(init_opline) != IS_CONST ||
			    Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) {
				/* don't colllect constants after unknown function call */
				collect_constants = 0;
				break;
			}

			/* define("name", scalar); */
			if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("define")-1 &&
			    zend_binary_strcasecmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), Z_STRLEN(ZEND_OP2_LITERAL(init_opline)), "define", sizeof("define")-1) == 0) {

				if (Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING &&
				    send2_opline &&
				    Z_TYPE(ZEND_OP1_LITERAL(send2_opline)) <= IS_STRING) {

					if (collect_constants) {
						zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(send1_opline), &ZEND_OP1_LITERAL(send2_opline));
					}

					if (RESULT_UNUSED(opline) &&
					    !zend_memnstr(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), "::", sizeof("::") - 1, Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)) + Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) {

						opline->opcode = ZEND_DECLARE_CONST;
						opline->op1_type = IS_CONST;
						opline->op2_type = IS_CONST;
						opline->result_type = IS_UNUSED;
						opline->op1.constant = send1_opline->op1.constant;
						opline->op2.constant = send2_opline->op1.constant;
						opline->result.num = 0;

						literal_dtor(&ZEND_OP2_LITERAL(init_opline));
						MAKE_NOP(init_opline);
						MAKE_NOP(send1_opline);
						MAKE_NOP(send2_opline);
					}
					break;
				}
			}

			/* pre-evaluate constant functions:
			   defined(x)
			   constant(x)
			   function_exists(x)
			   is_callable(x)
			   extension_loaded(x)
			*/
			if (!send2_opline &&
			    Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING) {
				if ((Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("function_exists")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"function_exists", sizeof("function_exists")-1)) ||
					(Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("is_callable")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"is_callable", sizeof("is_callable")))) {
					zend_internal_function *func;
					zend_string *lc_name = zend_string_tolower(
							Z_STR(ZEND_OP1_LITERAL(send1_opline)));

					if ((func = zend_hash_find_ptr(EG(function_table), lc_name)) != NULL &&
							func->type == ZEND_INTERNAL_FUNCTION &&
							func->module->type == MODULE_PERSISTENT) {
						zval t;
						if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("is_callable") - 1 ||
								func->handler != ZEND_FN(display_disabled_function)) {
							ZVAL_TRUE(&t);
						} else {
							ZVAL_FALSE(&t);
						}
						if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
							literal_dtor(&ZEND_OP2_LITERAL(init_opline));
							MAKE_NOP(init_opline);
							literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
							MAKE_NOP(send1_opline);
							MAKE_NOP(opline);
							zend_string_release(lc_name);
							break;
						}
					}
					zend_string_release(lc_name);
				} else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("extension_loaded")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"extension_loaded", sizeof("extension_loaded")-1)) {
					zval t;
					zend_string *lc_name = zend_string_tolower(
							Z_STR(ZEND_OP1_LITERAL(send1_opline)));
					zend_module_entry *m = zend_hash_find_ptr(&module_registry,
							lc_name);

					zend_string_release(lc_name);
					if (!m) {
						if (!PG(enable_dl)) {
							break;
						} else {
							ZVAL_FALSE(&t);
						}
					} else {
						if (m->type == MODULE_PERSISTENT) {
							ZVAL_TRUE(&t);
						} else {
							break;
						}
					}

					if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
						literal_dtor(&ZEND_OP2_LITERAL(init_opline));
						MAKE_NOP(init_opline);
						literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
						MAKE_NOP(send1_opline);
						MAKE_NOP(opline);
						break;
					}
				} else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("defined")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"defined", sizeof("defined")-1)) {
					zval t;

					if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0)) {

						ZVAL_TRUE(&t);
						if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
							literal_dtor(&ZEND_OP2_LITERAL(init_opline));
							MAKE_NOP(init_opline);
							literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
							MAKE_NOP(send1_opline);
							MAKE_NOP(opline);
							break;
						}
					}
				} else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("constant")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"constant", sizeof("constant")-1)) {
					zval t;

					if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1)) {
						if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
							literal_dtor(&ZEND_OP2_LITERAL(init_opline));
							MAKE_NOP(init_opline);
							literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
							MAKE_NOP(send1_opline);
							MAKE_NOP(opline);
							break;
						}
					}
				} else if ((CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN) == 0 &&
					Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("strlen") - 1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "strlen", sizeof("strlen") - 1)) {
					zval t;

					ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
					if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
						literal_dtor(&ZEND_OP2_LITERAL(init_opline));
						MAKE_NOP(init_opline);
						literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
						MAKE_NOP(send1_opline);
						MAKE_NOP(opline);
						break;
					}
				/* dirname(IS_CONST/IS_STRING) -> IS_CONST/IS_STRING */
				} else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("dirname")-1 &&
					!memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
						"dirname", sizeof("dirname")-1) &&
					IS_ABSOLUTE_PATH(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) {
					zend_string *dirname = zend_string_init(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)), 0);
					dirname->len = zend_dirname(dirname->val, dirname->len);
					if (IS_ABSOLUTE_PATH(dirname->val, dirname->len)) {
						zval t;

						ZVAL_STR(&t, dirname);
						if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
							literal_dtor(&ZEND_OP2_LITERAL(init_opline));
							MAKE_NOP(init_opline);
							literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
							MAKE_NOP(send1_opline);
							MAKE_NOP(opline);
							break;
						}
					} else {
						zend_string_release(dirname);
					}
				}
			}
			/* don't colllect constants after any other function call */
			collect_constants = 0;
			break;
		}
		case ZEND_STRLEN:
			if (ZEND_OP1_TYPE(opline) == IS_CONST &&
			    Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
				zval t;

				ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline)));
				if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t)) {
					literal_dtor(&ZEND_OP1_LITERAL(opline));
					MAKE_NOP(opline);
				}
			}
			break;
		case ZEND_DEFINED:
			{
				zval c;
				uint32_t tv = ZEND_RESULT(opline).var;
				if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0)) {
					break;
				}
				ZVAL_TRUE(&c);
				if (zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c)) {
					literal_dtor(&ZEND_OP1_LITERAL(opline));
					MAKE_NOP(opline);
				}
			}
			break;
		case ZEND_DECLARE_CONST:
			if (collect_constants &&
			    Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING &&
			    Z_TYPE(ZEND_OP2_LITERAL(opline)) <= IS_STRING) {
				zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline));
			}
			break;

		case ZEND_RETURN:
		case ZEND_RETURN_BY_REF:
		case ZEND_GENERATOR_RETURN:
		case ZEND_EXIT:
		case ZEND_THROW:
		case ZEND_CATCH:
		case ZEND_BRK:
		case ZEND_CONT:
		case ZEND_GOTO:
		case ZEND_FAST_CALL:
		case ZEND_FAST_RET:
		case ZEND_JMP:
		case ZEND_JMPZNZ:
		case ZEND_JMPZ:
		case ZEND_JMPNZ:
		case ZEND_JMPZ_EX:
		case ZEND_JMPNZ_EX:
		case ZEND_FE_RESET_R:
		case ZEND_FE_RESET_RW:
		case ZEND_FE_FETCH_R:
		case ZEND_FE_FETCH_RW:
		case ZEND_NEW:
		case ZEND_JMP_SET:
		case ZEND_COALESCE:
		case ZEND_ASSERT_CHECK:
			collect_constants = 0;
			break;
		case ZEND_FETCH_R:
		case ZEND_FETCH_W:
		case ZEND_FETCH_RW:
		case ZEND_FETCH_FUNC_ARG:
		case ZEND_FETCH_IS:
		case ZEND_FETCH_UNSET:
			if (opline != op_array->opcodes &&
			    (opline-1)->opcode == ZEND_BEGIN_SILENCE &&
			    (opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_LOCAL &&
				opline->op1_type == IS_CONST &&
			    opline->op2_type == IS_UNUSED &&
			    Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING &&
			    (Z_STRLEN(ZEND_OP1_LITERAL(opline)) != sizeof("this")-1 ||
			     memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), "this", sizeof("this") - 1) != 0)) {

			    int var = opline->result.var;
			    int level = 0;
				zend_op *op = opline + 1;
				zend_op *use = NULL;

				while (op < end) {
					if (op->opcode == ZEND_BEGIN_SILENCE) {
						level++;
					} else if (op->opcode == ZEND_END_SILENCE) {
						if (level == 0) {
							break;
						} else {
							level--;
						}
					}
					if (op->op1_type == IS_VAR && op->op1.var == var) {
						if (use) {
							/* used more than once */
							use = NULL;
							break;
						}
						use = op;
					} else if (op->op2_type == IS_VAR && op->op2.var == var) {
						if (use) {
							/* used more than once */
							use = NULL;
							break;
						}
						use = op;
					}
					op++;
				}
				if (use) {
					if (use->op1_type == IS_VAR && use->op1.var == var) {
						use->op1_type = IS_CV;
						use->op1.var = zend_optimizer_lookup_cv(op_array,
							Z_STR(ZEND_OP1_LITERAL(opline)));
						MAKE_NOP(opline);
					} else if (use->op2_type == IS_VAR && use->op2.var == var) {
						use->op2_type = IS_CV;
						use->op2.var = zend_optimizer_lookup_cv(op_array,
							Z_STR(ZEND_OP1_LITERAL(opline)));
						MAKE_NOP(opline);
					}
				}
			}
			break;
		}
		opline++;
		i++;
	}
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
/* Initialize the main stuff. Will be cleaned up later. */
{
    int _735;
    int _0, _1, _2;

    Argc = argc;
    Argv = argv;
    stack_base = (char *)&_0;
    eu_startup(_00, (int)CLOCKS_PER_SEC, (int)sysconf(_SC_CLK_TCK));
    init_literal(); /* Sets up all the stuff in init-.c */
    shift_args(argc, argv);
    _4ELINUX = (3 == 3);
    _4EWINDOWS = (3 == 2);
    _4EDOS = (3 == 1);

#ifdef ELINUX
    _4PATH_SEPARATOR = 58; /* : */
    _4SLASH = 47; /* / */
    _4SLASH_CHARS = _274;
    /* Special chars allowed in path. */
#else
    _4PATH_SEPARATOR = 59; /* ; */
    _4SLASH = 92; /* \ */
    _4SLASH_CHARS = _277; /* \ and / and : */
#endif

    _4NOVALUE = _321;
    /* For showing that the item has no value. Always on, except for constants. */

    _4SymTab = _39;
    /* The Symbol Table where almost everything is stored. */

    _4file_name = _39;
    _4file_name_entered = _39;
    _4current_file_no = 1;
    _4slist = _39;

    _6warning_list = _39;
    /* Error list. */

    _10buckets = Repeat(0, 2003);
    /* For calculating hashes. */

    _10literal_init = 0;

    RefDS(_39);
    _10lastintval = _39;
    /* Integers : The values of the integers sent. */

    RefDS(_39);
    _10lastintsym = _39;
    /* Integers : Holds the position of the value. */

    /* When integers are made, lastinval and lastintsym are checked to see if we already
       have a symbol with that value. If so, we point to it instead of making a new one. */

    _10last_sym = 0;

    _10SEARCH_LIMIT = 20;
    /* How long to search for a double before stopping. */

    _10temps_allocated = 0;
    /* A counter of how many temps were allocated. Used to allocate the stack for tasks. */

    _11start_include = 0;
    _11LastLineNumber = -1;

    RefDS(_39);
    _11all_source = _39; /* Storage spot for trace. */

    _11current_source_next = 10000; /* For Scanner.c : Helps allocate for trace. */
    _14previous_op = -1; /* For emit.c : Holds the last op we emitted. */

    RefDS(_39);
    _14current_sequence = _39; /* The current sequence we are working with. */

    _14lhs_ptr = 0;
    _14assignable = 0; /* For emit.c : Is this routine/op assignable to? */

    _15sample_size = 0;
    /* For profiling. */

    _15max_stack_per_call = 1;
    /* Not necessary, since it's always 1. However, backend references it, so i'll
       remove it when I get to backend.c */

    RefDS(_39);
    DeRef(_15branch_list);
    _15branch_list = _39;

    _15short_circuit = 0;
    _15short_circuit_B = 0; /* circuit expression? given short_circuit_B is 1 (TRUE) */
    _15factors = 0;
    _15lhs_subs_level = -1;
    _15left_sym = 0;

    RefDS(_3832);
    DeRef(_15mix_msg);
    _15mix_msg = _3832;

    /* For compressing objects in backend. */
    _16MIN2B = - 32768;
    _16MAX2B = 32767;
    _16MIN3B = - 8388608;
    _16MAX3B = 8388607;
    _735 = power(2, 31);
    _16MIN4B = unary_op(UMINUS, _735);
    DeRef(_735);

    int ptr_;
    s1_ptr ptr;
    object_ptr Base;

    /* Fields for keylist... */
    _1 = NewS1(98);
    _2 = (int)((s1_ptr)_1)->base;
    Base = ((s1_ptr)_1)->base;

    /* Set the elements of the keylist. This will be used later to make SymTab. */

    e_arg1 = NewString("if");
    e_arg2 = 8; e_arg3 = 20; e_arg4 = 0; e_arg5 = 0;
    Base[1] = new_key_entry();
    /* "if", SC_KEYWORD, IF, 0, 0 */

    e_arg1 = NewString("end");
    e_arg3 = 402;
    Base[2] = new_key_entry();
    /* "end", SC_KEYWORD, END, 0, 0 */

    e_arg1 = NewString("then");
    e_arg3 = 409;
    Base[3] = new_key_entry();
    /* "then", SC_KEYWORD, THEN, 0, 0 */

    e_arg1 = NewString("procedure");
    e_arg3 = 405;
    Base[4] = new_key_entry();
    /* "procedure", SC_KEYWORD, PROCEDURE, 0, 0 */

    e_arg1 = NewString("else");
    e_arg3 = 23;
    Base[5] = new_key_entry();
    /* "else", SC_KEYWORD, ELSE, 0, 0 */

    e_arg1 = NewString("for");
    e_arg3 = 21;
    Base[6] = new_key_entry();
    /* "for", SC_KEYWORD, FOR, 0, O */

    e_arg1 = NewString("return");
    e_arg3 = 412;
    Base[7] = new_key_entry();
    /* "return", SC_KEYWORD, RETURN, 0, 0 */

    e_arg1 = NewString("do");
    e_arg3 = 410;
    Base[8] = new_key_entry();
    /* "do", SC_KEYWORD, DO, 0, 0 */

    e_arg1 = NewString("elsif");
    e_arg3 = 413;
    Base[9] = new_key_entry();
    /* "elsif", SC_KEYWORD, ELSIF, 0, 0 */

    e_arg1 = NewString("while");
    e_arg3 = 47;
    Base[10] = new_key_entry();
    /* "while", SC_KEYWORD, WHILE, 0, 0 */

    e_arg1 = NewString("type");
    e_arg3 = 415;
    Base[11] = new_key_entry();
    /* "type", SC_KEYWORD, TYPE_DECL, 0, 0 */

    e_arg1 = NewString("constant");
    e_arg3 = 416;
    Base[12] = new_key_entry();
    /* "constant", SC_KEYWORD, CONSTANT, 0, 0 */

    e_arg1 = NewString("to");
    e_arg3 = 403;
    Base[13] = new_key_entry();
    /* "to", SC_KEYWORD, TO, 0, 0 */

    e_arg1 = NewString("and");
    e_arg3 = 8;
    Base[14] = new_key_entry();
    /* "and", SC_KEYWORD, AND, 0, 0 */

    e_arg1 = NewString("or");
    e_arg3 = 9;
    Base[15] = new_key_entry();
    /* "or", SC_KEYWORD, OR, 0, 0 */

    e_arg1 = NewString("exit");
    e_arg3 = 61;
    Base[16] = new_key_entry();
    /* "exit", SC_KEYWORD, EXIT, 0, 0 */

    e_arg1 = NewString("function");
    e_arg3 = 406;
    Base[17] = new_key_entry();
    /* "function", SC_KEYWORD, FUNCTION, 0, 0 */

    e_arg1 = NewString("global");
    e_arg3 = 411;
    Base[18] = new_key_entry();
    /* "global", SC_KEYWORD, GLOBAL, 0, 0 */

    e_arg1 = NewString("by");
    e_arg3 = 404;
    Base[19] = new_key_entry();
    /* "by", SC_KEYWORD, BY, 0, 0 */

    e_arg1 = NewString("not");
    e_arg3 = 7;
    Base[20] = new_key_entry();
    /* "not", SC_KEYWORD, NOT, 0, 0 */

    e_arg1 = NewString("include");
    e_arg3 = 417;
    Base[21] = new_key_entry();
    /* "include", SC_KEYWORD, INCLUDE, 0, 0 */

    e_arg1 = NewString("with");
    e_arg3 = 419;
    Base[22] = new_key_entry();
    /* "with", SC_KEYWORD, WITH, 0, 0 */

    e_arg1 = NewString("without");
    e_arg3 = 420;
    Base[23] = new_key_entry();
    /* "without", SC_KEYWORD, WITHOUT, 0, 0 */

    e_arg1 = NewString("xor");
    e_arg3 = 154;
    Base[24] = new_key_entry();
    /* "xor", SC_KEYWORD, XOR, 0, 0 */

    /* Now the ops... */

    e_arg1 = NewString("length");
    e_arg2 = 7; e_arg3 = 501; e_arg4 = 42; e_arg5 = 1;
    Base[25] = new_key_entry();
    /* "length", SC_PREDEF, FUNC, LENGTH, 1 */

    e_arg1 = NewString("puts");
    e_arg3 = 27; e_arg4 = 44; e_arg5 = 2;
    Base[26] = new_key_entry();
    /* "puts", SC_PREDEF, PROC, PUTS, 2 */

    e_arg1 = NewString("integer");
    e_arg3 = 504; e_arg4 = 94; e_arg5 = 1;
    Base[27] = new_key_entry();
    /* "integer", SC_PREDEF, TYPE, IS_AN_INTEGER, 1 */

    e_arg1 = NewString("sequence");
    e_arg4 = 68;
    Base[28] = new_key_entry();
    /* "sequence", SC_PREDEF, TYPE, IS_A_SEQUENCE, 1 */

    e_arg1 = NewString("position");
    e_arg3 = 27; e_arg4 = 60; e_arg5 = 2;
    Base[29] = new_key_entry();
    /* "position", SC_PREDEF, PROC, POSITION, 2 */

    e_arg1 = NewString("object");
    e_arg3 = 504; e_arg4 = 40; e_arg5 = 1;
    Base[30] = new_key_entry();
    /* "object", SC_PREDEF, FUNC, IS_AN_OBJECT, 1 */

    e_arg1 = NewString("append");
    e_arg3 = 501; e_arg4 = 35; e_arg5 = 2;
    Base[31] = new_key_entry();
    /* "append", SC_PREDEF, FUNC, APPEND, 2 */

    e_arg1 = NewString("prepend");
    e_arg4 = 57;
    Base[32] = new_key_entry();
    /* "prepend", SC_PREDEF, FUNC, PREPEND, 2 */

    e_arg1 = NewString("print");
    e_arg3 = 27; e_arg4 = 19;
    Base[33] = new_key_entry();
    /* "print", SC_PREDEF, PROC, PRINT, 2 */

    e_arg1 = NewString("printf");
    e_arg4 = 38; e_arg5 = 3;
    Base[34] = new_key_entry();
    /* "printf", SC_PREDEF, PROC, PRINTF, 3 */

    e_arg1 = NewString("clear_screen");
    e_arg4 = 59; e_arg5 = 0;
    Base[35] = new_key_entry();
    /* "clear_screen", SC_PREDEF, PROC, CLEAR_SCREEN, 0 */

    e_arg1 = NewString("floor");
    e_arg3 = 501; e_arg4 = 83; e_arg5 = 1;
    Base[36] = new_key_entry();
    /* "floor", SC_PREDEF, FUNC, FLOOR, 1 */

    e_arg1 = NewString("getc");
    e_arg4 = 33;
    Base[37] = new_key_entry();
    /* "getc", SC_PREDEF, FUNC, GETC, 1 */

    e_arg1 = NewString("gets");
    e_arg3 = 501; e_arg4 = 17; e_arg5 = 1;
    Base[38] = new_key_entry();
    /* "gets", SC_PREDEF, FUNC, GETS, 1 */

    e_arg1 = NewString("get_key");
    e_arg4 = 79; e_arg5 = 0;
    Base[39] = new_key_entry();
    /* "get_key", SC_PREDEF, FUNC, GET_KEY, 0 */

    e_arg1 = NewString("rand");
    e_arg4 = 62; e_arg5 = 1;
    Base[40] = new_key_entry();
    /* "rand", SC_PREDEF, FUNC, RAND, 1 */

    e_arg1 = NewString("repeat");
    e_arg4 = 32; e_arg5 = 2;
    Base[41] = new_key_entry();
    /* "repeat", SC_PREDEF, FUNC, REPEAT, 2 */

    e_arg1 = NewString("atom");
    e_arg3 = 504; e_arg4 = 67; e_arg5 = 1;
    Base[42] = new_key_entry();
    /* "atom", SC_PREDEF, TYPE, IS_AN_ATOM, 1 */

    e_arg1 = NewString("compare");
    e_arg3 = 501; e_arg4 = 76; e_arg5 = 2;
    Base[43] = new_key_entry();
    /* "compare", SC_PREDEF, FUNC, COMPARE, 2 */

    e_arg1 = NewString("find");
    e_arg4 = 77;
    Base[44] = new_key_entry();
    /* "find", SC_PREDEF, FUNC, FIND, 2 */

    e_arg1 = NewString("match");
    e_arg4 = 78;
    Base[45] = new_key_entry();
    /* "match", SC_PREDEF, FUNC, MATCH, 2 */

    e_arg1 = NewString("time");
    e_arg4 = 70; e_arg5 = 0;
    Base[46] = new_key_entry();
    /* "time", SC_PREDEF, FUNC, TIME, 0 */

    e_arg1 = NewString("command_line");
    e_arg4 = 100;
    Base[47] = new_key_entry();
    /* "command_line", SC_PREDEF, FUNC, COMMAND_LINE, 0 */

    e_arg1 = NewString("open");
    e_arg4 = 37; e_arg5 = 2;
    Base[48] = new_key_entry();
    /* "open", SC_PREDEF, FUNC, OPEN, 2 */

    e_arg1 = NewString("close");
    e_arg3 = 27; e_arg4 = 86; e_arg5 = 1;
    Base[49] = new_key_entry();
    /* "close", SC_PREDEF, PROC, CLOSE, 1 */

    e_arg1 = NewString("trace");
    e_arg4 = 64; e_arg5 = 1;
    Base[50] = new_key_entry();
    /* "trace", SC_PREDEF, PROC, TRACE, 1 */

    e_arg1 = NewString("getenv");
    e_arg3 = 501; e_arg4 = 91;
    Base[51] = new_key_entry();
    /* "getenv", SC_PREDEF, FUNC, GETENV, 1 */

    e_arg1 = NewString("sqrt");
    e_arg4 = 41;
    Base[52] = new_key_entry();
    /* "sqrt", SC_PREDEF, FUNC, SQRT, 1 */

    e_arg1 = NewString("sin");
    e_arg4 = 80;
    Base[53] = new_key_entry();
    /* "sin", SC_PREDEF, FUNC, SIN, 1 */

    e_arg1 = NewString("cos");
    e_arg4 = 81;
    Base[54] = new_key_entry();
    /* "cos", SC_PREDEF, FUNC, COS, 1 */

    e_arg1 = NewString("tan");
    e_arg4 = 82;
    Base[55] = new_key_entry();
    /* "tan", SC_PREDEF, FUNC, TAN, 1 */

    e_arg1 = NewString("log");
    e_arg4 = 74;
    Base[56] = new_key_entry();
    /* "log", SC_PREDEF, FUNC, LOG, 1 */

    e_arg1 = NewString("system");
    e_arg3 = 27; e_arg4 = 99; e_arg5 = 2;
    Base[57] = new_key_entry();
    /* "system", SC_PREDEF, PROC, SYSTEM, 2 */

    e_arg1 = NewString("date");
    e_arg3 = 501; e_arg4 = 69; e_arg5 = 0;
    Base[58] = new_key_entry();
    /* "date", SC_PREDEF, FUNC, DATE, 0 */

    e_arg1 = NewString("remainder");
    e_arg4 = 71; e_arg5 = 2;
    Base[59] = new_key_entry();
    /* "remainder", SC_PREDEF, FUNC, REMAINDER, 2 */

    e_arg1 = NewString("power");
    e_arg4 = 72;
    Base[60] = new_key_entry();
    /* "power", SC_PREDEF, FUNC, POWER, 2 */

    e_arg1 = NewString("machine_func");
    e_arg4 = 111;
    Base[61] = new_key_entry();
    /* "machine_func", SC_PREDEF, FUNC, MACHINE_FUNC, 2 */

    e_arg1 = NewString("machine_proc");
    e_arg3 = 27; e_arg4 = 112;
    Base[62] = new_key_entry();
    /* "machine_proc", SC_PREDEF, PROC, MACHINE_PROC, 2 */

    e_arg1 = NewString("abort");
    e_arg4 = 126; e_arg5 = 1;
    Base[63] = new_key_entry();
    /* "abort", SC_PREDEF, PROC, ABORT, 1 */

    e_arg1 = NewString("peek");
    e_arg3 = 501; e_arg4 = 127;
    Base[64] = new_key_entry();
    /* "peek", SC_PREDEF, FUNC, PEEK, 1 */

    e_arg1 = NewString("poke");
    e_arg3 = 27; e_arg4 = 128; e_arg5 = 2;
    Base[65] = new_key_entry();
    /* "poke", SC_PREDEF, PROC, POKE, 2 */

    e_arg1 = NewString("call");
    e_arg3 = 27; e_arg4 = 129; e_arg5 = 1;
    Base[66] = new_key_entry();
    /* "call", SC_PREDEF, PROC, CALL, 1 */

    e_arg1 = NewString("sprintf");
    e_arg3 = 501; e_arg4 = 53; e_arg5 = 2;
    Base[67] = new_key_entry();
    /* "sprintf", SC_PREDEF, FUNC, SPRINTF, 2 */

    e_arg1 = NewString("arctan");
    e_arg4 = 73; e_arg5 = 1;
    Base[68] = new_key_entry();
    /* "arctan", SC_PREDEF, FUNC, ARCTAN, 1 */

    e_arg1 = NewString("and_bits");
    e_arg4 = 56; e_arg5 = 2;
    Base[69] = new_key_entry();
    /* "and_bits", SC_PREDEF, FUNC, AND_BITS, 2 */

    e_arg1 = NewString("or_bits");
    e_arg4 = 24; e_arg5 = 2;
    Base[70] = new_key_entry();
    /* "or_bits", SC_PREDEF, FUNC, OR_BITS, 2 */

    e_arg1 = NewString("xor_bits");
    e_arg4 = 26;
    Base[71] = new_key_entry();
    /* "xor_bits", SC_PREDEF, FUNC, XOR_BITS, 2 */

    e_arg1 = NewString("not_bits");
    e_arg4 = 51; e_arg5 = 1;
    Base[72] = new_key_entry();
    /* "not_bits", SC_PREDEF, FUNC, NOT_BITS, 1 */

    e_arg1 = NewString("pixel");
    e_arg3 = 27; e_arg4 = 130; e_arg5 = 2;
    Base[73] = new_key_entry();
    /* "pixel", SC_PREDEF, PROC, PIXEL, 2 */

    e_arg1 = NewString("get_pixel");
    e_arg3 = 501; e_arg4 = 131; e_arg5 = 1;
    Base[74] = new_key_entry();
    /* "get_pixel", SC_PREDEF, FUNC, GET_PIXEL, 1 */

    e_arg1 = NewString("mem_copy");
    e_arg3 = 27; e_arg4 = 132; e_arg5 = 3;
    Base[75] = new_key_entry();
    /* "mem_copy", SC_PREDEF, PROC, MEM_COPY, 3 */

    e_arg1 = NewString("mem_set");
    e_arg4 = 133; e_arg5 = 3;
    Base[76] = new_key_entry();
    /* "mem_set", SC_PREDEF, PROC, MEM_SET, 3 */

    e_arg1 = NewString("c_proc");
    e_arg4 = 134; e_arg5 = 2;
    Base[77] = new_key_entry();
    /* "c_proc", SC_PREDEF, PROC, C_PROC, 2 */

    e_arg1 = NewString("c_func");
    e_arg3 = 501; e_arg4 = 135;
    Base[78] = new_key_entry();
    /* "c_func", SC_PREDEF, FUNC, C_FUNC, 2 */

    e_arg1 = NewString("routine_id");
    e_arg4 = 136; e_arg5 = 1;
    Base[79] = new_key_entry();
    /* "routine_id", SC_PREDEF, FUNC, ROUTINE_ID, 1 */

    e_arg1 = NewString("call_proc");
    e_arg3 = 27; e_arg4 = 138; e_arg5 = 2;
    Base[80] = new_key_entry();
    /* "call_proc", SC_PREDEF, PROC, CALL_PROC, 2 */

    e_arg1 = NewString("call_func");
    e_arg3 = 501; e_arg4 = 139;
    Base[81] = new_key_entry();
    /* "call_func", SC_PREDEF, FUNC, CALL_FUNC, 2 */

    e_arg1 = NewString("poke4");
    e_arg3 = 27; e_arg4 = 140;
    Base[82] = new_key_entry();
    /* "poke4", SC_PREDEF, PROC, POKE4, 2 */

    e_arg1 = NewString("peek4s");
    e_arg3 = 501; e_arg4 = 141; e_arg5 = 1;
    Base[83] = new_key_entry();
    /* "peek4s", SC_PREDEF, FUNC, PEEK4S, 1 */

    e_arg1 = NewString("peek4u");
    e_arg4 = 142;
    Base[84] = new_key_entry();
    /* "peek4u", SC_PREDEF, FUNC, PEEK4U, 1 */

    e_arg1 = NewString("profile");
    e_arg3 = 27; e_arg4 = 153;
    Base[85] = new_key_entry();
    /* "profile", SC_PREDEF, PROC, PROFILE, 1 */

    e_arg1 = NewString("equal");
    e_arg3 = 501; e_arg4 = 155; e_arg5 = 2;
    Base[86] = new_key_entry();
    /* "equal", SC_PREDEF, FUNC, EQUAL, 2 */

    e_arg1 = NewString("system_exec");
    e_arg4 = 156;
    Base[87] = new_key_entry();
    /* "system_exec", SC_PREDEF, FUNC, SYSTEM_EXEC, 2 */

    e_arg1 = NewString("platform");
    e_arg4 = 157; e_arg5 = 0;
    Base[88] = new_key_entry();
    /* "platform", SC_PREDEF, FUNC, PLATFORM, 0 */

    e_arg1 = NewString("task_create");
    e_arg4 = 169; e_arg5 = 2;
    Base[89] = new_key_entry();
    /* "task_create", SC_PREDEF, FUNC, TASK_CREATE, 2 */

    e_arg1 = NewString("task_schedule");
    e_arg3 = 27; e_arg4 = 170;
    Base[90] = new_key_entry();
    /* "task_schedule", SC_PREDEF, PROC, TASK_SCHEDULE, 2 */

    e_arg1 = NewString("task_yield");
    e_arg4 = 171; e_arg5 = 0;
    Base[91] = new_key_entry();
    /* "task_yield", SC_PREDEF, PROC, TASK_YIELD, 0 */

    e_arg1 = NewString("task_self");
    e_arg3 = 501; e_arg4 = 172;
    Base[92] = new_key_entry();
    /* "task_self", SC_PREDEF, FUNC, TASK_SELF, 0 */

    e_arg1 = NewString("task_suspend");
    e_arg3 = 27; e_arg4 = 173; e_arg5 = 1;
    Base[93] = new_key_entry();
    /* "task_suspend", SC_PREDEF, PROC, TASK_SUSPEND, 1 */

    e_arg1 = NewString("task_list");
    e_arg3 = 501; e_arg4 = 174; e_arg5 = 0;
    Base[94] = new_key_entry();
    /* "task_list", SC_PREDEF, FUNC, TASK_LIST, 0 */

    e_arg1 = NewString("task_status");
    e_arg4 = 157; e_arg5 = 1;
    Base[95] = new_key_entry();
    /* "task_status", SC_PREDEF, FUNC, TASK_STATUS, 1 */

    e_arg1 = NewString("task_clock_stop");
    e_arg3 = 27; e_arg4 = 176; e_arg5 = 0;
    Base[96] = new_key_entry();
    /* "task_clock_stop", SC_PREDEF, PROC, TASK_CLOCK_STOP, 0 */

    e_arg1 = NewString("task_clock_start");
    e_arg4 = 177;
    Base[97] = new_key_entry();
    /* "task_clock_start", SC_PREDEF, PROC, TASK_CLOCK_START, 0 */

    e_arg1 = NewString("_toplevel_");
    e_arg4 = 0;
    Base[98] = new_key_entry();
    /* "_toplevel_", SC_PREDEF, PROC, 0, 0 */

    /* _toplevel_ is an extremely important part of SymTab. When we pass off
       SymTab through the backend, this is then executed as if it were a proc.
       This contains all code not in functions or procedures. A user cannot call
       this directly because _ isn't allowed to start routines, I think. */

    _8keylist = MAKE_SEQ(_1);

    /* Generating fields for token_name now. token_name is used by LexName to get
       a correct message from a token. This way, instead of sending strings to be matched,
       we send numbers from scanner. If the number we send doesn't match scanner's, then
       we search through this list to find a name for the token to tell the user what was
       expected and what we got. If we're unable to find the token, we return '...'.
       In the future, this may only be used to output "expected %s", which would mean less
       tokens to hold. Also, less redundancy by telling the user what they sent with the line
       holding the stuff they sent too! */

    _1 = NewS1(59);
    _2 = (int)((s1_ptr)_1)->base;
    Base = ((s1_ptr)_1)->base;
    Base[1] = new_lex_entry(8, NewString("and"));
    Base[2] = new_lex_entry(502, NewString("a number"));
    Base[3] = new_lex_entry(-1, NewString("!"));
    Base[4] = new_lex_entry(404, NewString("by"));
    Base[5] = new_lex_entry(-23, NewString(":"));
    Base[6] = new_lex_entry(-30, NewString(","));
    Base[7] = new_lex_entry(15, NewString("&"));
    Base[8] = new_lex_entry(416, NewString("constant"));
    Base[9] = new_lex_entry(14, NewString("/"));
    Base[10] = new_lex_entry(410, NewString("do"));
    Base[11] = new_lex_entry(23, NewString("else"));
    Base[12] = new_lex_entry(413, NewString("elsif"));
    Base[13] = new_lex_entry(402, NewString("end"));
    Base[14] = new_lex_entry(-21, NewString("the end of file."));
    Base[15] = new_lex_entry(155, NewString("="));
    Base[16] = new_lex_entry(61, NewString("exit"));
    Base[17] = new_lex_entry(21, NewString("for"));
    Base[18] = new_lex_entry(501, NewString("a function"));
    Base[19] = new_lex_entry(406, NewString("function"));
    Base[20] = new_lex_entry(411, NewString("global"));
    Base[21] = new_lex_entry(6, NewString(">"));
    Base[22] = new_lex_entry(2, NewString(">="));
    Base[23] = new_lex_entry(20, NewString("if"));
    Base[24] = new_lex_entry(-20, NewString("an illegal character"));
    Base[25] = new_lex_entry(417, NewString("include"));
    Base[26] = new_lex_entry(-24, NewString("{"));
    Base[27] = new_lex_entry(-26, NewString("("));
    Base[28] = new_lex_entry(-28, NewString("["));
    Base[29] = new_lex_entry(1, NewString("<"));
    Base[30] = new_lex_entry(5, NewString("<="));
    Base[31] = new_lex_entry(10, NewString("-"));
    Base[32] = new_lex_entry(13, NewString("*"));
    Base[33] = new_lex_entry(523, NewString("a namespace qualifier"));
    Base[34] = new_lex_entry(-6, NewString("end-of-line"));
    Base[35] = new_lex_entry(7, NewString("not"));
    Base[36] = new_lex_entry(4, NewString("!="));
    Base[37] = new_lex_entry(9, NewString("or"));
    Base[38] = new_lex_entry(11, NewString("+"));
    Base[39] = new_lex_entry(27, NewString("a procedure"));
    Base[40] = new_lex_entry(405, NewString("procedure"));
    Base[41] = new_lex_entry(515, NewString("a variable"));
    Base[42] = new_lex_entry(524, NewString("a function"));
    Base[43] = new_lex_entry(525, NewString("a procedure"));
    Base[44] = new_lex_entry(526, NewString("a type"));
    Base[45] = new_lex_entry(-25, NewString("}"));
    Base[46] = new_lex_entry(-27, NewString(")"));
    Base[47] = new_lex_entry(-29, NewString("]"));
    Base[48] = new_lex_entry(412, NewString("return"));
    Base[49] = new_lex_entry(516, NewString("a slice"));
    Base[50] = new_lex_entry(503, NewString("a character string"));
    Base[51] = new_lex_entry(403, NewString("to"));
    Base[52] = new_lex_entry(409, NewString("then"));
    Base[53] = new_lex_entry(504, NewString("a type"));
    Base[54] = new_lex_entry(415, NewString("type"));
    Base[55] = new_lex_entry(-100, NewString("a variable"));
    Base[56] = new_lex_entry(419, NewString("with"));
    Base[57] = new_lex_entry(420, NewString("without"));
    Base[58] = new_lex_entry(47, NewString("while"));
    Base[59] = new_lex_entry(63, NewString("?"));

    _14token_name = MAKE_SEQ(_1);

    /* op_result = repeat(T_UNKNOWN, MAX_OPCODE) */
    _14op_result = Repeat(5, 177);

    ptr = SEQ_PTR(_14op_result);
    Base = ptr->base;

    /* op_result[RIGHT_BRACE_N] = T_SEQUENCE */
    Base[31] = 3;

    /* op_result[RIGHT_BRACE_2] = T_SEQUENCE */
    Base[85] = 3;

    /* op_result[REPEAT] = T_SEQUENCE */
    Base[32] = 3;

    /* op_result[APPEND] = T_SEQUENCE */
    Base[35] = 3;

    /* op_result[RHS_SLICE] = T_SEQUENCE */
    Base[46] = 3;

    /* op_result[CONCAT] = T_SEQUENCE */
    Base[15] = 3;

    /* op_result[CONCAT_N] = T_SEQUENCE */
    Base[159] = 3;

    /* op_result[PREPEND] = T_SEQUENCE */
    Base[57] = 3;

    /* op_result[COMMAND_LINE] = T_SEQUENCE */
    Base[100] = 3;

    /* op_result[SPRINTF] = T_SEQUENCE */
    Base[53] = 3;

    /* op_result[ROUTINE_ID] = T_INTEGER */
    Base[136] = 1;

    /* op_result[GETC] = T_INTEGER */
    Base[33] = 1;

    /* op_result[OPEN] = T_INTEGER */
    Base[37] = 1;

    /* op_result[LENGTH] = T_INTEGER   -- assume less than a billion */
    Base[42] = 1;

    /* op_result[PLENGTH] = T_INTEGER  -- "" */
    Base[162] = 1;

    /* op_result[IS_AN_OBJECT] = T_INTEGER */
    Base[40] = 1;

    /* op_result[IS_AN_ATOM] = T_INTEGER */
    Base[67] = 1;

    /* op_result[IS_A_SEQUENCE] = T_INTEGER */
    Base[68] = 1;

    /* op_result[COMPARE] = T_INTEGER */
    Base[76] = 1;

    /* op_result[EQUAL] = T_INTEGER */
    Base[155] = 1;

    /* op_result[FIND] = T_INTEGER */
    Base[77] = 1;

    /* op_result[MATCH]  = T_INTEGER */
    Base[78] = 1;

    /* op_result[GET_KEY] = T_INTEGER */
    Base[79] = 1;

    /* op_result[IS_AN_INTEGER] = T_INTEGER */
    Base[94] = 1;

    /* op_result[ASSIGN_I] = T_INTEGER */
    Base[113] = 1;

    /* op_result[RHS_SUBS_I] = T_INTEGER */
    Base[114] = 1;

    /* op_result[PLUS_I] = T_INTEGER */
    Base[115] = 1;

    /* op_result[MINUS_I] = T_INTEGER */
    Base[116] = 1;

    /* op_result[PLUS1_I] = T_INTEGER */
    Base[117] = 1;

    /* op_result[SYSTEM_EXEC] = T_INTEGER */
    Base[156] = 1;

    /* op_result[TIME] = T_ATOM */
    Base[70] = 4;

    /* op_result[TASK_STATUS] = T_INTEGER */
    Base[175] = 1;

    /* op_result[TASK_SELF] = T_ATOM */
    Base[172] = 4;

    /* op_result[TASK_CREATE] = T_ATOM */
    Base[169] = 4;

    /* op_result[TASK_LIST] = T_SEQUENCE */
    Base[174] = 3;

    /* op_result[PLATFORM] = T_INTEGER */
    Base[157] = 1;

    /* Initialize the error stack. */
    ebegin();

    _18main();
    Cleanup(0);
}