/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
   Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
   especially those whose name start with YY_ or yy_.  They are
   private implementation details that can be changed or removed.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output, and Bison version.  */
#define YYBISON 30802

/* Bison version string.  */
#define YYBISON_VERSION "3.8.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 1 "lang.y"

#line 3 "prelang.y"

/* The first line is to give proper line number references. Please mail me
 * if your compiler complains about it.
 */

/*
 * This is the grammar definition of LPC. The token table is built
 * automatically by make_func. The lang.y is constructed from this file,
 * the generated token list and post_lang.y. The reason of this is that there
 * is no #include-statment that yacc recognizes.
 */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <memory.h>
#include <sys/types.h>
#include <sys/stat.h>

#include "config.h"
#include "lint.h"
#include "interface.h"
#include "object.h"
#include "instrs.h"
#include "incralloc.h"
#include "mstring.h"
#include "simulate.h"
#include "backend.h"
#include "lex.h"
#include "efun_table.h"

/* This is to see to it that we always go through xalloc() in main.c
   even from within the yacc-parser
*/
#ifdef malloc
#undef malloc
#endif
#define malloc xalloc

#define YYMAXDEPTH	600

#define BREAK_ON_STACK		0x40000
#define BREAK_FROM_CASE		0x80000

/* make shure that this struct has a size that is a power of two */
struct case_heap_entry { long long key; short addr; short line; };
#define CASE_HEAP_ENTRY_ALIGN(offset) offset &= -sizeof(struct case_heap_entry)

static struct mem_block mem_block[NUMAREAS];

static int has_inherited;

/*
 * Some good macros to have.
 */

#define BASIC_TYPE(e,t) ((e) == TYPE_ANY ||\
			 (e) == (t) ||\
			 (t) == TYPE_ANY)

#define TYPE(e,t) (BASIC_TYPE((e) & TYPE_MASK, (t) & TYPE_MASK) ||\
		   (((e) & TYPE_MOD_POINTER) && ((t) & TYPE_MOD_POINTER) &&\
		    BASIC_TYPE((e) & (TYPE_MASK & ~TYPE_MOD_POINTER),\
			       (t) & (TYPE_MASK & ~TYPE_MOD_POINTER))))

#define FUNCTION(n) ((struct function *)mem_block[A_FUNCTIONS].block + (n))
#define VARIABLE(n) ((struct variable *)mem_block[A_VARIABLES].block + (n))
#define INHERIT(n)  ((struct inherit *)mem_block[A_INHERITS].block + (n))

#define align(x) ( ((x) + (sizeof(double)-1) )  &  ~(sizeof(double)-1) )

/*
 * If the type of the function is given, then strict types are
 * checked and required.
 */
static int exact_types;
extern int pragma_strict_types;	/* Maintained by lex.c */
extern int pragma_save_binary;	/* Save this in the binary shadow dir */
extern int pragma_no_inherit;
extern int pragma_no_shadow;
extern int pragma_no_clone;
extern struct object *auto_ob;

static int true_varargs;

extern int total_num_prog_blocks, total_prog_block_size;

extern int num_parse_error;
extern int d_flag;

static int current_break_address;
static int current_continue_address;
static int current_case_address;
static int current_case_number_heap;
static int current_case_string_heap;
static int try_level, break_try_level, continue_try_level;
#define SOME_NUMERIC_CASE_LABELS 0x40000
#define NO_STRING_CASE_LABELS    0x80000
static int zero_case_label;
static int current_type;

static char *get_type_name(int);

/*
 * There is always function starting at address 0, which will execute
 * the initialization code. This code is spread all over the program,
 * with jumps to next initializer. The next variable keeps track of
 * the previous jump. After the last initializer, the jump will be changed
 * into a return(0) statement instead.
 *
 * A function named '.CTOR' will be defined, which will contain the
 * initialization code. If there was no initialization code, then the
 * function will not be defined. That is the usage of the
 * first_last_initializer_end variable.
 *
 * When inheriting from another object, a call will automatically be made
 * to call .CTOR in that code from the current .CTOR.
 */
static int last_initializer_end;
static int first_last_initializer_end;

void epilog (void);
static int check_declared (char *str);
static void prolog (void);
static void push_address (void);
static int pop_address (void);
static int make_label (void);
static void transfer_init_control (void);
static char *get_two_types (int, int);
static int verify_declared (char *);
static int handle_function_id (char *);
static void copy_inherits (struct program *, int, char *);
static int check_inherits(struct program *);
static int search_for_ext_function(char *, struct program *);

static struct program NULL_program; /* marion - clean neat empty struct */

void init_lineno_info(void);
void end_lineno_info(void);
static void push_init_arg_address (int);
static void clear_init_arg_stack (void);
void free_all_local_names (void);
int lookup_local_name(char *);
int add_local_name (char *, int);
void smart_log (char *, int, char *);
extern int yylex (void);
void type_error (char *, int);
char *inner_get_srccode_position(int code, struct lineno *lineno, int lineno_count,
    char *inc_files, char *name);
int search_for_function(char *name, struct program *prog);
int handle_include(char *name, int ignore_errors);

INLINE static unsigned mem_block_size(int, int);

extern int current_line;
/*
 * 'inherit_file' is used as a flag. If it is set to a string
 * after yyparse(), this string should be loaded as an object,
 * and the original object must be loaded again.
 */
extern char *current_file, *inherit_file;

/*
 * The names and types of arguments and auto variables.
 */
static unsigned short type_of_locals[MAX_LOCAL];
static int local_blockdepth[MAX_LOCAL];
static char *local_names[MAX_LOCAL];
static int current_number_of_locals = 0;
static int max_number_of_locals = 0;

/*
 * The types of arguments when calling functions must be saved,
 * to be used afterwards for checking. And because function calls
 * can be done as an argument to a function calls,
 * a stack of argument types is needed. This stack does not need to
 * be freed between compilations, but will be reused.
 */
struct mem_block type_of_arguments;

struct program *prog;	/* Is returned to the caller of yyparse */

/*
 * Compare two types, and return true if they are compatible.
 */
static int 
compatible_types(int t1, int t2)
{
    if (t1 == TYPE_UNKNOWN || t2 == TYPE_UNKNOWN)
	return 0;
    if (t1 == t2)
	return 1;
    if ((t1|TYPE_MOD_NO_MASK|TYPE_MOD_STATIC|TYPE_MOD_PRIVATE|TYPE_MOD_PUBLIC)
	== (t2|TYPE_MOD_NO_MASK|TYPE_MOD_STATIC|TYPE_MOD_PRIVATE|TYPE_MOD_PUBLIC))
	return 1;
    if (t1 == TYPE_ANY || t2 == TYPE_ANY)
	return 1;
    if ((t1 & TYPE_MOD_POINTER) && (t2 & TYPE_MOD_POINTER)) {
	if ((t1 & TYPE_MASK) == (TYPE_ANY|TYPE_MOD_POINTER) ||
	    (t2 & TYPE_MASK) == (TYPE_ANY|TYPE_MOD_POINTER))
	    return 1;
    }
    if (t1 == TYPE_MAPPING)
        return 1;
    return 0;
}

/*
 * Add another argument type to the argument type stack
 */
INLINE
static void 
add_arg_type(unsigned short type)
{
    struct mem_block *mbp = &type_of_arguments;
    while (mbp->current_size + sizeof type > mbp->max_size) {
	mbp->max_size <<= 1;
	mbp->block = realloc(mbp->block, (size_t)mbp->max_size);
    }
    (void)memcpy(mbp->block + mbp->current_size, &type, sizeof type);
    mbp->current_size += sizeof type;
}

/*
 * Pop the argument type stack 'n' elements.
 */
INLINE
static void 
pop_arg_stack(int n)
{
    type_of_arguments.current_size -= sizeof (unsigned short) * n;
}

/* Get a pointer to first argument when there are 'n' arguments in total. */
INLINE
static unsigned short*
get_argument_ptr(int n)
{
  return &((unsigned short *)
	   (type_of_arguments.block + type_of_arguments.current_size))[-n];
}
/*
 * Get type of argument number 'arg', where there are
 * 'n' arguments in total in this function call. Argument
 * 0 is the first argument.
 */
INLINE
int 
get_argument_type(int arg, int n)
{
    return
	((unsigned short *)
	 (type_of_arguments.block + type_of_arguments.current_size))[arg - n];
}

INLINE
static void 
add_to_mem_block(int n, char *data, int size)
{
    struct mem_block *mbp = &mem_block[n];
    while (mbp->current_size + size > mbp->max_size) {
	mbp->max_size <<= 1;
	mbp->block = realloc(mbp->block, (size_t)mbp->max_size);
    }
    (void)memcpy(mbp->block + mbp->current_size, data, (size_t)size);
    mbp->current_size += size;
}

INLINE static unsigned
mem_block_size(n, size)
    int n;
    int size;
{
    return mem_block[n].current_size / size;
}

INLINE static void 
ins_byte(char b)
{
    add_to_mem_block(A_PROGRAM, &b, 1);
}

static INLINE void 
upd_byte(int offset, char l)
{
    mem_block[A_PROGRAM].block[offset] = l;
}

static INLINE char
read_byte(int offset)
{
    return mem_block[A_PROGRAM].block[offset];
}

/*
 * Store a 2 byte number. It is stored in such a way as to be sure
 * that correct byte order is used, regardless of machine architecture.
 * Also beware that some machines can't write a word to odd addresses.
 */
static INLINE void 
ins_short(short l)
{
    add_to_mem_block(A_PROGRAM, (char *)&l + 0, 1);
    add_to_mem_block(A_PROGRAM, (char *)&l + 1, 1);
}

static INLINE void 
upd_short(int offset, short l)
{
    mem_block[A_PROGRAM].block[offset + 0] = ((char *)&l)[0];
    mem_block[A_PROGRAM].block[offset + 1] = ((char *)&l)[1];
}

static INLINE short 
read_short(int offset)
{
    short l;

    ((char *)&l)[0] = mem_block[A_PROGRAM].block[offset + 0];
    ((char *)&l)[1] = mem_block[A_PROGRAM].block[offset + 1];
    return l;
}

static INLINE void
ins_mem(void *data, size_t n)
{
   add_to_mem_block(A_PROGRAM, data, n);
}

/*
 * Store a 4 byte number. It is stored in such a way as to be sure
 * that correct byte order is used, regardless of machine architecture.
 */
static INLINE void 
ins_long(int l)
{
    add_to_mem_block(A_PROGRAM, (char *)&l+0, 1);
    add_to_mem_block(A_PROGRAM, (char *)&l+1, 1);
    add_to_mem_block(A_PROGRAM, (char *)&l+2, 1);
    add_to_mem_block(A_PROGRAM, (char *)&l+3, 1);
}

static INLINE void
ins_long_long(long long ll)
{
    ins_mem(&ll, sizeof(ll));
}

/*
 * Return 1 on success, 0 on failure.
 */
static int 
defined_function(char *s)
{
    int offset;
    int inh;
    struct function *funp;
    char *super_name = 0;
    char *sub_name;
    char *real_name;
    char *search;

    real_name = strrchr(s, ':') + 1;
    sub_name = strchr(s, ':') + 2;
    
    real_name = (find_sstring((real_name == (char *)1) ? s : real_name));
    if(!real_name) {
        return 0;
    }
    if (sub_name == (char *)2)
	for (offset = 0; offset < mem_block[A_FUNCTIONS].current_size;
	     offset += sizeof (struct function)) 
	    {
		funp = (struct function *)&mem_block[A_FUNCTIONS].block[offset];
		/* Only index, prog, and type will be defined. */
		if (real_name == funp->name) 
		    {
			function_index_found = offset / sizeof (struct function);
			function_prog_found = 0;
			function_type_mod_found = funp->type_flags & TYPE_MOD_MASK;
			function_inherit_found =
			    mem_block[A_INHERITS].current_size / 
				sizeof(struct inherit);
			return 1;
		    }
	    }
    else
	if (sub_name - s > 2)
	{
	    super_name = xalloc((size_t)(sub_name - s - 1));
	    (void)memcpy(super_name, s, (size_t)(sub_name - s - 2));
	    super_name[sub_name - s - 2] = 0;
	    if (strcmp(super_name, "this") == 0)
		return defined_function(sub_name);
	}
	else
	    s = sub_name;
    
    /* Look for the function in the inherited programs
	*/

    for (inh = mem_block[A_INHERITS].current_size / sizeof (struct inherit) - 1;
          inh >= 0; inh -= ((struct inherit *)(mem_block[A_INHERITS].block))[inh].prog->
	 num_inherited)
    {
	if (super_name &&
	    strcmp(super_name, ((struct inherit *)(mem_block[A_INHERITS].block))[inh].name) == 0)
	    search = sub_name;
	else
	    search = s;
        if (search_for_ext_function (search,
	    ((struct inherit *)(mem_block[A_INHERITS].block))[inh].prog))
	{
	    /* Adjust for inherit-type */
	    int type = ((struct inherit *)mem_block[A_INHERITS].block)[inh].type;
	    
	    if (function_type_mod_found & TYPE_MOD_PRIVATE)
		type &= ~TYPE_MOD_PUBLIC;
	    if (function_type_mod_found & TYPE_MOD_PUBLIC)
		type &= ~TYPE_MOD_PRIVATE;
            function_type_mod_found |= type & TYPE_MOD_MASK;

	    function_inherit_found += inh -
		(((struct inherit *)(mem_block[A_INHERITS].block))[inh].prog->
		 num_inherited - 1);
	    
	    return 1;
	}
    }
    return 0;
}

/*
 * A mechanism to remember addresses on a stack. The size of the stack is
 * defined in config.h.
 */
static int comp_stackp;
static int comp_stack[COMPILER_STACK_SIZE];

static INLINE void 
push_address()
{
    if (comp_stackp >= COMPILER_STACK_SIZE) {
	yyerror("Compiler stack overflow");
	comp_stackp++;
	return;
    }
    comp_stack[comp_stackp++] = mem_block[A_PROGRAM].current_size;
}

static INLINE int
get_address(void)
{
    return mem_block[A_PROGRAM].current_size;
}

static INLINE void 
push_explicit(int address)
{
    if (comp_stackp >= COMPILER_STACK_SIZE) {
	yyerror("Compiler stack overflow");
	comp_stackp++;
	return;
    }
    comp_stack[comp_stackp++] = address;
}

static INLINE int 
pop_address()
{
    if (comp_stackp == 0)
	fatal("Compiler stack underflow.\n");
    if (comp_stackp > COMPILER_STACK_SIZE) {
	--comp_stackp;
	return 0;
    }
    return comp_stack[--comp_stackp];
}

static INLINE void
add_jump(void)
{
    int offset;

    offset = mem_block[A_PROGRAM].current_size;
    add_to_mem_block(A_JUMPS, (char *)&offset, sizeof (offset));
}

static void 
define_new_function(char *name, char num_arg, unsigned char num_local,
		    int offset, int type_flags, char first_default)
{
    struct function fun;
    struct function *funp;
    unsigned short argument_start_index;
 
    if (defined_function (name)) 
    {
        /* The function is already defined.
         *   If it was defined by inheritance, make a new definition,
         *   unless nomask applies.
         *   If it was defined in the current program, use that definition.
         */
         /* Point to the function definition found 
	  */
        if (function_prog_found)
	{
	    funp = &function_prog_found->functions[function_index_found];
	}
	else
	    funp = FUNCTION(function_index_found);
  
	/* If it was declared in the current program, and not a prototype,
	 * it is a double definition. 
	 */
	if (!(funp->type_flags & NAME_PROTOTYPE) &&
	    !function_prog_found) 
	{
	    char buff[500];

	    (void)snprintf(buff, sizeof(buff), "Redeclaration of function %s", name);
	    yyerror (buff);
	    return;
	}

	/* If neither the new nor the old definition is a prototype,
	 * it must be a redefinition of an inherited function.
	 * Check for nomask. 
	 */
	if ((funp->type_flags & TYPE_MOD_NO_MASK) &&
	    !(funp->type_flags & NAME_PROTOTYPE))
	{
	    char buff[500];

	    (void)snprintf(buff, sizeof(buff), "Illegal to redefine nomask function %s", name);
	    yyerror (buff);
	    return;
	}

	/* Check types 
	 */
	if (exact_types && 
	    ((funp->type_flags & TYPE_MASK) != TYPE_UNKNOWN))
	{
	    if (funp->num_arg != num_arg && 
		!(funp->type_flags & TYPE_MOD_VARARGS)) 
	    {
	        yyerror("Incorrect number of arguments");
		return;
	    }
/*
 * This is just a nuisance! /JnA

	    else if (!(funp->type_flags & NAME_STRICT_TYPES)) 
	    {
	        yyerror("Function called not compiled with type testing");
		return;
	    }
*/

#if 0
            else 
	    {
	        int i;
		/* Now check argument types
		 */
		for (i=0; i < num_arg; i++) 
		{
		}
	    }
#endif
	}
	/* If it is a prototype for a function that has already been defined,
	 * we don't need it. 
	 */
	if ((type_flags & NAME_PROTOTYPE) && !function_prog_found)
	    return;

	/* If the function was defined in an inherited program, we need to
	 * make a new definition here. 
	 */
	if (function_prog_found) {
	    funp = &fun;
	}
    }
    else { /* Function was not defined before, we need a new definition */
        funp = &fun;
    }

#ifdef PROFILE_LPC
    funp->num_calls = 0;
    funp->time_spent = 0;
    funp->tot_time_spent = 0;
    funp->avg_calls = 0;
    funp->avg_time = 0;
    funp->avg_tot_time = 0;
    funp->last_call_update = 0;
#endif
    funp->offset = offset;
    funp->type_flags = type_flags;
    funp->num_arg = num_arg;
    funp->num_local = num_local;
    funp->first_default = first_default;
    funp->hash_idx = -1;
    if (exact_types)
        funp->type_flags |= NAME_STRICT_TYPES;

    if (!exact_types || num_arg == 0)
	argument_start_index = INDEX_START_NONE;
    else 
    {
	int i;
	/*
	 * Save the start of argument types.
	 */
	argument_start_index =
	    mem_block[A_ARGUMENT_TYPES].current_size /
		sizeof (unsigned short);
	for (i=0; i < num_arg; i++)
	    add_to_mem_block(A_ARGUMENT_TYPES, (char *)&type_of_locals[i],
			     sizeof type_of_locals[i]);
    }
    if (funp == &fun) 
    {
	funp->name = make_sstring(name);
        add_to_mem_block (A_FUNCTIONS, (char *)&fun, sizeof fun);
	add_to_mem_block(A_ARGUMENT_INDEX, (char *)&argument_start_index,
                    sizeof argument_start_index);
    }
    else
    {
	(void)memcpy(&mem_block[A_ARGUMENT_INDEX].
		     block[function_index_found * sizeof(argument_start_index)],
		     (char *)&argument_start_index, sizeof(argument_start_index));
    }
    return;
}
 
static INLINE int 
is_simul_efun (char *name)
{

    if (simul_efun_ob != 0 && search_for_function (name, simul_efun_ob->prog) &&
	!(function_type_mod_found & (TYPE_MOD_PRIVATE | TYPE_MOD_STATIC)))
        return 1;
    return 0;
}  

static void 
define_variable(char *name, int type)
{
    struct variable dummy;
    int n;

    n = check_declared(name);
    if (n != -1 && (n & TYPE_MOD_NO_MASK))
    {
	char *p = (char *)alloca(80 + strlen(name));
	(void)sprintf(p, "Illegal to redefine 'nomask' variable \"%s\"", name);
	yyerror(p);
    }

    dummy.name = make_sstring(name);
    dummy.type = type;
    variable_index_found = mem_block_size(A_VARIABLES,sizeof(struct variable));
    variable_inherit_found = 255;
    add_to_mem_block(A_VARIABLES, (char *)&dummy, sizeof dummy);
}

unsigned short
store_prog_string(char *str)
{
    unsigned short addr;
    int i;

    for (i = mem_block[A_STRTAB].current_size - sizeof(short);
	 i >= 0; i -= sizeof(short))
    {
	char *str2;
	unsigned short offset;
	((char *)&offset)[0] = mem_block[A_STRTAB].block[i];
	((char *)&offset)[1] = mem_block[A_STRTAB].block[i + 1];
	str2 = mem_block[A_RODATA].block + offset;
	if (strcmp(str, str2) == 0)
	    return offset;
    }
    if (mem_block[A_RODATA].current_size >= 0x10000)
    {
	yyerror("Too large rodata segment!\n");
	mem_block[A_RODATA].current_size = 0;
    }
    addr = mem_block[A_RODATA].current_size;

    add_to_mem_block(A_STRTAB, (char *)&addr, sizeof(addr));
    add_to_mem_block(A_RODATA, str, (int)strlen(str) + 1);
    return addr;
}

struct label
{
    unsigned short address;
    unsigned short link;
};

static int
make_label()
{
    static struct label lbl = { (unsigned short)-1, (unsigned short)-1};
    int ret;

    ret = mem_block[A_LABELS].current_size / sizeof(struct label);
    add_to_mem_block(A_LABELS, (char *)&lbl, sizeof(lbl));
    return ret;
}

static void
ins_label(int lbl)
{
    struct label *l;
    unsigned short here;

    here = mem_block[A_PROGRAM].current_size;
    l = &((struct label *)mem_block[A_LABELS].block)[lbl];
    if (l->address != (unsigned short)-1)
	ins_short(l->address);
    else
    {
	ins_short(l->link);
	l->link = here;
    }
}

static void
set_label(int lbl, unsigned short addr)
{
    struct label *l;
    unsigned short link1, next;
    /*char *pgm = mem_block[A_PROGRAM].block;*/

    l = ((struct label *)mem_block[A_LABELS].block) + lbl;
    l->address = addr;
    for (link1 = l->link; link1 != (unsigned short)-1; link1 = next)
    {
	next = read_short(link1);
	upd_short(link1, addr);
    }
    l->link = (unsigned short)-1;
}


static INLINE long long cmp_case_keys(struct case_heap_entry *entry1,
				struct case_heap_entry *entry2, int is_str)
{
    if (is_str)
	return strcmp(mem_block[A_RODATA].block + (unsigned short)entry1->key,
		      mem_block[A_RODATA].block + (unsigned short)entry2->key);
    else
	return entry1->key - entry2->key;
}

void 
add_to_case_heap(int block_index, struct case_heap_entry *entry,
		 struct case_heap_entry *entry2)
{
    int current_heap;
    struct case_heap_entry *heap_top, *heap_entry;
    int is_str;
    int from, to, size;


    if (block_index == A_CASE_NUMBERS )
    {
        current_heap = current_case_number_heap;
	is_str = 0;
    }
    else
    {
	current_heap = current_case_string_heap;
	is_str = 1;
    }

    if (entry2 && cmp_case_keys(entry, entry2, is_str) > 0)
	return;

    heap_top = (struct case_heap_entry *)
	(mem_block[block_index].block +
	 mem_block[block_index].current_size);

    heap_entry = (struct case_heap_entry *)
	(mem_block[block_index].block +
	 current_heap);
    
    for (; heap_entry < heap_top; heap_entry++)
    {
	if (cmp_case_keys(heap_entry, entry, is_str) > 0)
	    break;
	if (heap_entry->addr == -1)
	{
	    if (cmp_case_keys(++heap_entry, entry, is_str) >= 0)
	    {
		/* Duplicate case label! */
		char buff[100];

		(void)sprintf(buff, "Duplicate case label (line %d)",
			heap_entry->line);
		yyerror(buff);
		break;
	    }
	}
    }
    
    if (heap_entry < heap_top &&
	(!cmp_case_keys(heap_entry, entry, is_str) ||
	 (entry2 && (cmp_case_keys(entry2, heap_entry, is_str) >= 0))))
    {
	/* Duplicate case label! */
	char buff[100];

	(void)sprintf(buff, "Duplicate case label (line %d)",
		heap_entry->line);
	yyerror(buff);
    }
    
	
    to = ((char *)(heap_entry + 1 + (entry2 != NULL))) -
	mem_block[block_index].block;
    from = ((char *)heap_entry) - mem_block[block_index].block;
    size = (heap_top - heap_entry) * sizeof(*entry);

    add_to_mem_block(block_index, (char *)entry, sizeof(*entry));
    if (entry2)
	add_to_mem_block(block_index, (char *)entry2, sizeof(*entry2));
    
    if (heap_entry != heap_top)
    {
	(void)memmove(mem_block[block_index].block + to,
		      mem_block[block_index].block + from, (size_t)size);
	(void)memcpy(mem_block[block_index].block + from, entry, sizeof(*entry));
	if (entry2)
	    (void)memcpy(mem_block[block_index].block + from + sizeof(*entry),
			 entry2, sizeof(*entry));
    }
}

/*
 * Arrange a jump to the current position for the initialization code
 * to continue.
 */
static void
transfer_init_control() 
{
    if (mem_block[A_PROGRAM].current_size - 2 == last_initializer_end)
	mem_block[A_PROGRAM].current_size -= 3;
    else 
    {
	/*
	 * Change the address of the last jump after the last
	 * initializer to this point.
	 */
	upd_short(last_initializer_end,
		  (short)mem_block[A_PROGRAM].current_size);
    }
}

#define DEREFSIZE 256
static int deref_stack[DEREFSIZE];
static int deref_index;

void add_new_init_jump(void);
static int init_arg_stack[256];
static int init_arg_stack_index;

static void INLINE
clear_init_arg_stack()
{
    init_arg_stack_index = 0;
}

static void INLINE
push_init_arg_address(int address)
{
    init_arg_stack[init_arg_stack_index++] = address;
}

static void ins_f_byte(unsigned int);

/* ARGSUSED1 */
void
dump_init_arg_table(int arg)
{
    int i;
#if defined(DEBUG)
    if (num_parse_error == 0 && init_arg_stack_index != arg)
	fatal("Not correct number of init addresses!\n");
#endif
    for (i = 0; i < init_arg_stack_index; i++)
	ins_short((short)init_arg_stack[i]);
}

#line 1098 "lang.y"

#line 3 "postlang.y"

/*
 * These are token values that needn't have an associated code for the
 * compiled file
 */


#line 983 "lang.c"

# ifndef YY_CAST
#  ifdef __cplusplus
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
#  else
#   define YY_CAST(Type, Val) ((Type) (Val))
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
#  endif
# endif
# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

#include "lang.h"
/* Symbol kind.  */
enum yysymbol_kind_t
{
  YYSYMBOL_YYEMPTY = -2,
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
  YYSYMBOL_YYerror = 1,                    /* error  */
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
  YYSYMBOL_F_EXT = 3,                      /* F_EXT  */
  YYSYMBOL_F_JUMP = 4,                     /* F_JUMP  */
  YYSYMBOL_F_JUMP_WHEN_ZERO = 5,           /* F_JUMP_WHEN_ZERO  */
  YYSYMBOL_F_JUMP_WHEN_NON_ZERO = 6,       /* F_JUMP_WHEN_NON_ZERO  */
  YYSYMBOL_F_SKIP_NZ = 7,                  /* F_SKIP_NZ  */
  YYSYMBOL_F_POP_VALUE = 8,                /* F_POP_VALUE  */
  YYSYMBOL_F_DUP = 9,                      /* F_DUP  */
  YYSYMBOL_F_CALL_NON_VIRT = 10,           /* F_CALL_NON_VIRT  */
  YYSYMBOL_F_CALL_VIRT = 11,               /* F_CALL_VIRT  */
  YYSYMBOL_F_PUSH_IDENTIFIER_LVALUE = 12,  /* F_PUSH_IDENTIFIER_LVALUE  */
  YYSYMBOL_F_PUSH_LOCAL_VARIABLE_LVALUE = 13, /* F_PUSH_LOCAL_VARIABLE_LVALUE  */
  YYSYMBOL_F_PUSH_INDEXED_LVALUE = 14,     /* F_PUSH_INDEXED_LVALUE  */
  YYSYMBOL_F_INDIRECT = 15,                /* F_INDIRECT  */
  YYSYMBOL_F_INDEX = 16,                   /* F_INDEX  */
  YYSYMBOL_F_CONST0 = 17,                  /* F_CONST0  */
  YYSYMBOL_F_CONST1 = 18,                  /* F_CONST1  */
  YYSYMBOL_F_CALL_VAR = 19,                /* F_CALL_VAR  */
  YYSYMBOL_F_BUILD_CLOSURE = 20,           /* F_BUILD_CLOSURE  */
  YYSYMBOL_F_PAPPLY = 21,                  /* F_PAPPLY  */
  YYSYMBOL_F_IDENTIFIER = 22,              /* F_IDENTIFIER  */
  YYSYMBOL_F_RETURN = 23,                  /* F_RETURN  */
  YYSYMBOL_F_STRING = 24,                  /* F_STRING  */
  YYSYMBOL_F_FLOATC = 25,                  /* F_FLOATC  */
  YYSYMBOL_F_INC = 26,                     /* F_INC  */
  YYSYMBOL_F_DEC = 27,                     /* F_DEC  */
  YYSYMBOL_F_POST_INC = 28,                /* F_POST_INC  */
  YYSYMBOL_F_POST_DEC = 29,                /* F_POST_DEC  */
  YYSYMBOL_F_NUMBER = 30,                  /* F_NUMBER  */
  YYSYMBOL_F_ASSIGN = 31,                  /* F_ASSIGN  */
  YYSYMBOL_F_ADD = 32,                     /* F_ADD  */
  YYSYMBOL_F_SUBTRACT = 33,                /* F_SUBTRACT  */
  YYSYMBOL_F_MULTIPLY = 34,                /* F_MULTIPLY  */
  YYSYMBOL_F_DIVIDE = 35,                  /* F_DIVIDE  */
  YYSYMBOL_F_LT = 36,                      /* F_LT  */
  YYSYMBOL_F_GT = 37,                      /* F_GT  */
  YYSYMBOL_F_EQ = 38,                      /* F_EQ  */
  YYSYMBOL_F_GE = 39,                      /* F_GE  */
  YYSYMBOL_F_LE = 40,                      /* F_LE  */
  YYSYMBOL_F_NE = 41,                      /* F_NE  */
  YYSYMBOL_F_ADD_EQ = 42,                  /* F_ADD_EQ  */
  YYSYMBOL_F_SUB_EQ = 43,                  /* F_SUB_EQ  */
  YYSYMBOL_F_DIV_EQ = 44,                  /* F_DIV_EQ  */
  YYSYMBOL_F_MULT_EQ = 45,                 /* F_MULT_EQ  */
  YYSYMBOL_F_NEGATE = 46,                  /* F_NEGATE  */
  YYSYMBOL_F_SWITCH = 47,                  /* F_SWITCH  */
  YYSYMBOL_F_SSCANF = 48,                  /* F_SSCANF  */
  YYSYMBOL_F_PARSE_COMMAND = 49,           /* F_PARSE_COMMAND  */
  YYSYMBOL_F_STRING_DECL = 50,             /* F_STRING_DECL  */
  YYSYMBOL_F_LOCAL_NAME = 51,              /* F_LOCAL_NAME  */
  YYSYMBOL_F_MOD = 52,                     /* F_MOD  */
  YYSYMBOL_F_MOD_EQ = 53,                  /* F_MOD_EQ  */
  YYSYMBOL_F_STATIC = 54,                  /* F_STATIC  */
  YYSYMBOL_F_ARROW = 55,                   /* F_ARROW  */
  YYSYMBOL_F_AGGREGATE = 56,               /* F_AGGREGATE  */
  YYSYMBOL_F_M_AGGREGATE = 57,             /* F_M_AGGREGATE  */
  YYSYMBOL_F_COMPL = 58,                   /* F_COMPL  */
  YYSYMBOL_F_AND = 59,                     /* F_AND  */
  YYSYMBOL_F_AND_EQ = 60,                  /* F_AND_EQ  */
  YYSYMBOL_F_OR = 61,                      /* F_OR  */
  YYSYMBOL_F_OR_EQ = 62,                   /* F_OR_EQ  */
  YYSYMBOL_F_XOR = 63,                     /* F_XOR  */
  YYSYMBOL_F_XOR_EQ = 64,                  /* F_XOR_EQ  */
  YYSYMBOL_F_LSH = 65,                     /* F_LSH  */
  YYSYMBOL_F_LSH_EQ = 66,                  /* F_LSH_EQ  */
  YYSYMBOL_F_RSH = 67,                     /* F_RSH  */
  YYSYMBOL_F_RSH_EQ = 68,                  /* F_RSH_EQ  */
  YYSYMBOL_F_NOT = 69,                     /* F_NOT  */
  YYSYMBOL_F_TRY = 70,                     /* F_TRY  */
  YYSYMBOL_F_END_TRY = 71,                 /* F_END_TRY  */
  YYSYMBOL_F_FOREACH = 72,                 /* F_FOREACH  */
  YYSYMBOL_F_FOREACH_M = 73,               /* F_FOREACH_M  */
  YYSYMBOL_F_CATCH = 74,                   /* F_CATCH  */
  YYSYMBOL_F_END_CATCH = 75,               /* F_END_CATCH  */
  YYSYMBOL_F_CALL_C = 76,                  /* F_CALL_C  */
  YYSYMBOL_F_CALL_SIMUL = 77,              /* F_CALL_SIMUL  */
  YYSYMBOL_F_RANGE = 78,                   /* F_RANGE  */
  YYSYMBOL_F_THROW = 79,                   /* F_THROW  */
  YYSYMBOL_F_ABS = 80,                     /* F_ABS  */
  YYSYMBOL_F_ACOS = 81,                    /* F_ACOS  */
  YYSYMBOL_F_ACOSH = 82,                   /* F_ACOSH  */
  YYSYMBOL_F_ADD_ACTION = 83,              /* F_ADD_ACTION  */
  YYSYMBOL_F_ALL_INVENTORY = 84,           /* F_ALL_INVENTORY  */
  YYSYMBOL_F_ALLOCATE = 85,                /* F_ALLOCATE  */
  YYSYMBOL_F_ASIN = 86,                    /* F_ASIN  */
  YYSYMBOL_F_ASINH = 87,                   /* F_ASINH  */
  YYSYMBOL_F_ATAN = 88,                    /* F_ATAN  */
  YYSYMBOL_F_ATAN2 = 89,                   /* F_ATAN2  */
  YYSYMBOL_F_ATANH = 90,                   /* F_ATANH  */
  YYSYMBOL_F_BREAK_STRING = 91,            /* F_BREAK_STRING  */
  YYSYMBOL_F_CALL_OTHER = 92,              /* F_CALL_OTHER  */
  YYSYMBOL_F_CALL_OTHERV = 93,             /* F_CALL_OTHERV  */
  YYSYMBOL_F_CALL_SELF = 94,               /* F_CALL_SELF  */
  YYSYMBOL_F_CALL_SELFV = 95,              /* F_CALL_SELFV  */
  YYSYMBOL_F_CALLING_FUNCTION = 96,        /* F_CALLING_FUNCTION  */
  YYSYMBOL_F_CALLING_OBJECT = 97,          /* F_CALLING_OBJECT  */
  YYSYMBOL_F_CALLING_PROGRAM = 98,         /* F_CALLING_PROGRAM  */
  YYSYMBOL_F_CAPITALIZE = 99,              /* F_CAPITALIZE  */
  YYSYMBOL_F_CLEAR_BIT = 100,              /* F_CLEAR_BIT  */
  YYSYMBOL_F_CLONE_OBJECT = 101,           /* F_CLONE_OBJECT  */
  YYSYMBOL_F_COMMAND = 102,                /* F_COMMAND  */
  YYSYMBOL_F_COMMANDS = 103,               /* F_COMMANDS  */
  YYSYMBOL_F_COS = 104,                    /* F_COS  */
  YYSYMBOL_F_COSH = 105,                   /* F_COSH  */
  YYSYMBOL_F_CRYPT = 106,                  /* F_CRYPT  */
  YYSYMBOL_F_CTIME = 107,                  /* F_CTIME  */
  YYSYMBOL_F_DEBUG = 108,                  /* F_DEBUG  */
  YYSYMBOL_F_DEEP_INVENTORY = 109,         /* F_DEEP_INVENTORY  */
  YYSYMBOL_F_DESTRUCT = 110,               /* F_DESTRUCT  */
  YYSYMBOL_F_DISABLE_COMMANDS = 111,       /* F_DISABLE_COMMANDS  */
  YYSYMBOL_F_ED = 112,                     /* F_ED  */
  YYSYMBOL_F_ENABLE_COMMANDS = 113,        /* F_ENABLE_COMMANDS  */
  YYSYMBOL_F_ENVIRONMENT = 114,            /* F_ENVIRONMENT  */
  YYSYMBOL_F_EXEC = 115,                   /* F_EXEC  */
  YYSYMBOL_F_EXP = 116,                    /* F_EXP  */
  YYSYMBOL_F_EXPLODE = 117,                /* F_EXPLODE  */
  YYSYMBOL_F_EXTRACT = 118,                /* F_EXTRACT  */
  YYSYMBOL_F_FACT = 119,                   /* F_FACT  */
  YYSYMBOL_F_FILE_NAME = 120,              /* F_FILE_NAME  */
  YYSYMBOL_F_FILE_SIZE = 121,              /* F_FILE_SIZE  */
  YYSYMBOL_F_FILE_TIME = 122,              /* F_FILE_TIME  */
  YYSYMBOL_F_FILTER = 123,                 /* F_FILTER  */
  YYSYMBOL_F_FIND_LIVING = 124,            /* F_FIND_LIVING  */
  YYSYMBOL_F_FIND_OBJECT = 125,            /* F_FIND_OBJECT  */
  YYSYMBOL_F_FIND_PLAYER = 126,            /* F_FIND_PLAYER  */
  YYSYMBOL_F_FLOATP = 127,                 /* F_FLOATP  */
  YYSYMBOL_F_FTOA = 128,                   /* F_FTOA  */
  YYSYMBOL_F_FTOI = 129,                   /* F_FTOI  */
  YYSYMBOL_F_FUNCTION_EXISTS = 130,        /* F_FUNCTION_EXISTS  */
  YYSYMBOL_F_FUNCTION_NAME = 131,          /* F_FUNCTION_NAME  */
  YYSYMBOL_F_FUNCTION_OBJECT = 132,        /* F_FUNCTION_OBJECT  */
  YYSYMBOL_F_FUNCTIONP = 133,              /* F_FUNCTIONP  */
  YYSYMBOL_F_GET_ALARM = 134,              /* F_GET_ALARM  */
  YYSYMBOL_F_GET_ALL_ALARMS = 135,         /* F_GET_ALL_ALARMS  */
  YYSYMBOL_F_GET_DIR = 136,                /* F_GET_DIR  */
  YYSYMBOL_F_GETTIMEOFDAY = 137,           /* F_GETTIMEOFDAY  */
  YYSYMBOL_F_IMPLODE = 138,                /* F_IMPLODE  */
  YYSYMBOL_F_INPUT_TO = 139,               /* F_INPUT_TO  */
  YYSYMBOL_F_INTP = 140,                   /* F_INTP  */
  YYSYMBOL_F_ITOF = 141,                   /* F_ITOF  */
  YYSYMBOL_F_LAST_REFERENCE_TIME = 142,    /* F_LAST_REFERENCE_TIME  */
  YYSYMBOL_F_LIVING = 143,                 /* F_LIVING  */
  YYSYMBOL_F_LOG = 144,                    /* F_LOG  */
  YYSYMBOL_F_LOWER_CASE = 145,             /* F_LOWER_CASE  */
  YYSYMBOL_F_M_DELETE = 146,               /* F_M_DELETE  */
  YYSYMBOL_F_M_DELKEY = 147,               /* F_M_DELKEY  */
  YYSYMBOL_F_M_INDEXES = 148,              /* F_M_INDEXES  */
  YYSYMBOL_F_M_RESTORE_OBJECT = 149,       /* F_M_RESTORE_OBJECT  */
  YYSYMBOL_F_M_SAVE_OBJECT = 150,          /* F_M_SAVE_OBJECT  */
  YYSYMBOL_F_M_SIZEOF = 151,               /* F_M_SIZEOF  */
  YYSYMBOL_F_M_VALUES = 152,               /* F_M_VALUES  */
  YYSYMBOL_F_MAP = 153,                    /* F_MAP  */
  YYSYMBOL_F_MAPPINGP = 154,               /* F_MAPPINGP  */
  YYSYMBOL_F_MATCH_PATH = 155,             /* F_MATCH_PATH  */
  YYSYMBOL_F_MAX = 156,                    /* F_MAX  */
  YYSYMBOL_F_MEMBER_ARRAY = 157,           /* F_MEMBER_ARRAY  */
  YYSYMBOL_F_MIN = 158,                    /* F_MIN  */
  YYSYMBOL_F_MKDIR = 159,                  /* F_MKDIR  */
  YYSYMBOL_F_MKFUNCTION = 160,             /* F_MKFUNCTION  */
  YYSYMBOL_F_MKMAPPING = 161,              /* F_MKMAPPING  */
  YYSYMBOL_F_MOVE_OBJECT = 162,            /* F_MOVE_OBJECT  */
  YYSYMBOL_F_NOTIFY_FAIL = 163,            /* F_NOTIFY_FAIL  */
  YYSYMBOL_F_NRND = 164,                   /* F_NRND  */
  YYSYMBOL_F_OBJECT_CLONES = 165,          /* F_OBJECT_CLONES  */
  YYSYMBOL_F_OBJECT_TIME = 166,            /* F_OBJECT_TIME  */
  YYSYMBOL_F_OBJECTP = 167,                /* F_OBJECTP  */
  YYSYMBOL_F_OBSOLETE = 168,               /* F_OBSOLETE  */
  YYSYMBOL_F_PAPPLYV = 169,                /* F_PAPPLYV  */
  YYSYMBOL_F_POINTERP = 170,               /* F_POINTERP  */
  YYSYMBOL_F_POW = 171,                    /* F_POW  */
  YYSYMBOL_F_PRESENT = 172,                /* F_PRESENT  */
  YYSYMBOL_F_PREVIOUS_OBJECT = 173,        /* F_PREVIOUS_OBJECT  */
  YYSYMBOL_F_PROCESS_STRING = 174,         /* F_PROCESS_STRING  */
  YYSYMBOL_F_PROCESS_VALUE = 175,          /* F_PROCESS_VALUE  */
  YYSYMBOL_F_QUERY_AUTH = 176,             /* F_QUERY_AUTH  */
  YYSYMBOL_F_QUERY_HOST_NAME = 177,        /* F_QUERY_HOST_NAME  */
  YYSYMBOL_F_QUERY_IDLE = 178,             /* F_QUERY_IDLE  */
  YYSYMBOL_F_QUERY_INTERACTIVE = 179,      /* F_QUERY_INTERACTIVE  */
  YYSYMBOL_F_QUERY_IP_IDENT = 180,         /* F_QUERY_IP_IDENT  */
  YYSYMBOL_F_QUERY_IP_NAME = 181,          /* F_QUERY_IP_NAME  */
  YYSYMBOL_F_QUERY_IP_NUMBER = 182,        /* F_QUERY_IP_NUMBER  */
  YYSYMBOL_F_QUERY_LIVING_NAME = 183,      /* F_QUERY_LIVING_NAME  */
  YYSYMBOL_F_QUERY_SCREEN_WIDTH = 184,     /* F_QUERY_SCREEN_WIDTH  */
  YYSYMBOL_F_QUERY_SNOOP = 185,            /* F_QUERY_SNOOP  */
  YYSYMBOL_F_QUERY_TRIGVERB = 186,         /* F_QUERY_TRIGVERB  */
  YYSYMBOL_F_QUERY_VERB = 187,             /* F_QUERY_VERB  */
  YYSYMBOL_F_RANDOM = 188,                 /* F_RANDOM  */
  YYSYMBOL_F_READ_BYTES = 189,             /* F_READ_BYTES  */
  YYSYMBOL_F_READ_FILE = 190,              /* F_READ_FILE  */
  YYSYMBOL_F_READABLE_STRING = 191,        /* F_READABLE_STRING  */
  YYSYMBOL_F_REDUCE = 192,                 /* F_REDUCE  */
  YYSYMBOL_F_REGEXP = 193,                 /* F_REGEXP  */
  YYSYMBOL_F_REMOVE_ALARM = 194,           /* F_REMOVE_ALARM  */
  YYSYMBOL_F_RENAME = 195,                 /* F_RENAME  */
  YYSYMBOL_F_RESTORE_MAP = 196,            /* F_RESTORE_MAP  */
  YYSYMBOL_F_RESTORE_OBJECT = 197,         /* F_RESTORE_OBJECT  */
  YYSYMBOL_F_RM = 198,                     /* F_RM  */
  YYSYMBOL_F_RMDIR = 199,                  /* F_RMDIR  */
  YYSYMBOL_F_RND = 200,                    /* F_RND  */
  YYSYMBOL_F_SAVE_MAP = 201,               /* F_SAVE_MAP  */
  YYSYMBOL_F_SAVE_OBJECT = 202,            /* F_SAVE_OBJECT  */
  YYSYMBOL_F_SET_ALARM = 203,              /* F_SET_ALARM  */
  YYSYMBOL_F_SET_ALARMV = 204,             /* F_SET_ALARMV  */
  YYSYMBOL_F_SET_AUTH = 205,               /* F_SET_AUTH  */
  YYSYMBOL_F_SET_BIT = 206,                /* F_SET_BIT  */
  YYSYMBOL_F_SET_LIVING_NAME = 207,        /* F_SET_LIVING_NAME  */
  YYSYMBOL_F_SET_SCREEN_WIDTH = 208,       /* F_SET_SCREEN_WIDTH  */
  YYSYMBOL_F_SET_THIS_PLAYER = 209,        /* F_SET_THIS_PLAYER  */
  YYSYMBOL_F_SHADOW = 210,                 /* F_SHADOW  */
  YYSYMBOL_F_SIN = 211,                    /* F_SIN  */
  YYSYMBOL_F_SINH = 212,                   /* F_SINH  */
  YYSYMBOL_F_SIZEOF = 213,                 /* F_SIZEOF  */
  YYSYMBOL_F_SNOOP = 214,                  /* F_SNOOP  */
  YYSYMBOL_F_SPRINTF = 215,                /* F_SPRINTF  */
  YYSYMBOL_F_SQRT = 216,                   /* F_SQRT  */
  YYSYMBOL_F_STR2VAL = 217,                /* F_STR2VAL  */
  YYSYMBOL_F_STRINGP = 218,                /* F_STRINGP  */
  YYSYMBOL_F_STRLEN = 219,                 /* F_STRLEN  */
  YYSYMBOL_F_TAIL = 220,                   /* F_TAIL  */
  YYSYMBOL_F_TAN = 221,                    /* F_TAN  */
  YYSYMBOL_F_TANH = 222,                   /* F_TANH  */
  YYSYMBOL_F_TEST_BIT = 223,               /* F_TEST_BIT  */
  YYSYMBOL_F_THIS_INTERACTIVE = 224,       /* F_THIS_INTERACTIVE  */
  YYSYMBOL_F_THIS_OBJECT = 225,            /* F_THIS_OBJECT  */
  YYSYMBOL_F_THIS_PLAYER = 226,            /* F_THIS_PLAYER  */
  YYSYMBOL_F_TIME = 227,                   /* F_TIME  */
  YYSYMBOL_F_TYPEOF = 228,                 /* F_TYPEOF  */
  YYSYMBOL_F_UNIQUE_ARRAY = 229,           /* F_UNIQUE_ARRAY  */
  YYSYMBOL_F_UPDATE_ACTIONS = 230,         /* F_UPDATE_ACTIONS  */
  YYSYMBOL_F_UPPER_CASE = 231,             /* F_UPPER_CASE  */
  YYSYMBOL_F_USERS = 232,                  /* F_USERS  */
  YYSYMBOL_F_VAL2JSON = 233,               /* F_VAL2JSON  */
  YYSYMBOL_F_VAL2STR = 234,                /* F_VAL2STR  */
  YYSYMBOL_F_WILDMATCH = 235,              /* F_WILDMATCH  */
  YYSYMBOL_F_WRITE_BYTES = 236,            /* F_WRITE_BYTES  */
  YYSYMBOL_F_WRITE_FILE = 237,             /* F_WRITE_FILE  */
  YYSYMBOL_F_WRITE_SOCKET = 238,           /* F_WRITE_SOCKET  */
  YYSYMBOL_F_WRITE_SOCKET_GMCP = 239,      /* F_WRITE_SOCKET_GMCP  */
  YYSYMBOL_F_ELSE = 240,                   /* F_ELSE  */
  YYSYMBOL_F_WHILE = 241,                  /* F_WHILE  */
  YYSYMBOL_F_DO = 242,                     /* F_DO  */
  YYSYMBOL_F_FOR = 243,                    /* F_FOR  */
  YYSYMBOL_F_STORE = 244,                  /* F_STORE  */
  YYSYMBOL_F_LAND = 245,                   /* F_LAND  */
  YYSYMBOL_F_LOR = 246,                    /* F_LOR  */
  YYSYMBOL_F_STATUS = 247,                 /* F_STATUS  */
  YYSYMBOL_F_IF = 248,                     /* F_IF  */
  YYSYMBOL_F_COMMA = 249,                  /* F_COMMA  */
  YYSYMBOL_F_INT = 250,                    /* F_INT  */
  YYSYMBOL_F_CONTINUE = 251,               /* F_CONTINUE  */
  YYSYMBOL_F_INHERIT = 252,                /* F_INHERIT  */
  YYSYMBOL_F_COLON_COLON = 253,            /* F_COLON_COLON  */
  YYSYMBOL_F_VARARGS = 254,                /* F_VARARGS  */
  YYSYMBOL_F_VARARG = 255,                 /* F_VARARG  */
  YYSYMBOL_F_SUBSCRIPT = 256,              /* F_SUBSCRIPT  */
  YYSYMBOL_F_BREAK = 257,                  /* F_BREAK  */
  YYSYMBOL_F_OBJECT = 258,                 /* F_OBJECT  */
  YYSYMBOL_F_VOID = 259,                   /* F_VOID  */
  YYSYMBOL_F_MIXED = 260,                  /* F_MIXED  */
  YYSYMBOL_F_PRIVATE = 261,                /* F_PRIVATE  */
  YYSYMBOL_F_NO_MASK = 262,                /* F_NO_MASK  */
  YYSYMBOL_F_MAPPING = 263,                /* F_MAPPING  */
  YYSYMBOL_F_FLOAT = 264,                  /* F_FLOAT  */
  YYSYMBOL_F_PUBLIC = 265,                 /* F_PUBLIC  */
  YYSYMBOL_F_FUNCTION = 266,               /* F_FUNCTION  */
  YYSYMBOL_F_OPERATOR = 267,               /* F_OPERATOR  */
  YYSYMBOL_F_CASE = 268,                   /* F_CASE  */
  YYSYMBOL_F_DEFAULT = 269,                /* F_DEFAULT  */
  YYSYMBOL_270_ = 270,                     /* ';'  */
  YYSYMBOL_271_ = 271,                     /* '*'  */
  YYSYMBOL_272_ = 272,                     /* '='  */
  YYSYMBOL_273_ = 273,                     /* '('  */
  YYSYMBOL_274_ = 274,                     /* ')'  */
  YYSYMBOL_275_ = 275,                     /* ','  */
  YYSYMBOL_276_ = 276,                     /* '{'  */
  YYSYMBOL_277_ = 277,                     /* '}'  */
  YYSYMBOL_278_ = 278,                     /* ':'  */
  YYSYMBOL_279_ = 279,                     /* '|'  */
  YYSYMBOL_280_ = 280,                     /* '^'  */
  YYSYMBOL_281_ = 281,                     /* '&'  */
  YYSYMBOL_282_ = 282,                     /* '>'  */
  YYSYMBOL_283_ = 283,                     /* '<'  */
  YYSYMBOL_284_ = 284,                     /* '+'  */
  YYSYMBOL_285_ = 285,                     /* '-'  */
  YYSYMBOL_286_ = 286,                     /* '/'  */
  YYSYMBOL_287_ = 287,                     /* '~'  */
  YYSYMBOL_288_ = 288,                     /* '?'  */
  YYSYMBOL_289_ = 289,                     /* '@'  */
  YYSYMBOL_290_ = 290,                     /* '['  */
  YYSYMBOL_291_ = 291,                     /* ']'  */
  YYSYMBOL_YYACCEPT = 292,                 /* $accept  */
  YYSYMBOL_all = 293,                      /* all  */
  YYSYMBOL_294_1 = 294,                    /* $@1  */
  YYSYMBOL_program = 295,                  /* program  */
  YYSYMBOL_possible_semi_colon = 296,      /* possible_semi_colon  */
  YYSYMBOL_inheritance = 297,              /* inheritance  */
  YYSYMBOL_opt_inherit_name = 298,         /* opt_inherit_name  */
  YYSYMBOL_number = 299,                   /* number  */
  YYSYMBOL_optional_star = 300,            /* optional_star  */
  YYSYMBOL_block_or_semi = 301,            /* block_or_semi  */
  YYSYMBOL_def = 302,                      /* def  */
  YYSYMBOL_303_2 = 303,                    /* $@2  */
  YYSYMBOL_304_3 = 304,                    /* $@3  */
  YYSYMBOL_new_arg_name = 305,             /* new_arg_name  */
  YYSYMBOL_306_4 = 306,                    /* $@4  */
  YYSYMBOL_fun_args = 307,                 /* fun_args  */
  YYSYMBOL_argument = 308,                 /* argument  */
  YYSYMBOL_argument_list = 309,            /* argument_list  */
  YYSYMBOL_type_modifier = 310,            /* type_modifier  */
  YYSYMBOL_type_modifier_list = 311,       /* type_modifier_list  */
  YYSYMBOL_type = 312,                     /* type  */
  YYSYMBOL_cast = 313,                     /* cast  */
  YYSYMBOL_opt_basic_type = 314,           /* opt_basic_type  */
  YYSYMBOL_basic_type = 315,               /* basic_type  */
  YYSYMBOL_name_list = 316,                /* name_list  */
  YYSYMBOL_new_name = 317,                 /* new_name  */
  YYSYMBOL_318_5 = 318,                    /* $@5  */
  YYSYMBOL_block = 319,                    /* block  */
  YYSYMBOL_320_6 = 320,                    /* $@6  */
  YYSYMBOL_local_declaration = 321,        /* local_declaration  */
  YYSYMBOL_new_local_name2 = 322,          /* new_local_name2  */
  YYSYMBOL_new_local_name = 323,           /* new_local_name  */
  YYSYMBOL_324_7 = 324,                    /* $@7  */
  YYSYMBOL_local_name_list = 325,          /* local_name_list  */
  YYSYMBOL_statements = 326,               /* statements  */
  YYSYMBOL_statement = 327,                /* statement  */
  YYSYMBOL_try = 328,                      /* try  */
  YYSYMBOL_329_8 = 329,                    /* $@8  */
  YYSYMBOL_330_9 = 330,                    /* $@9  */
  YYSYMBOL_331_10 = 331,                   /* $@10  */
  YYSYMBOL_while = 332,                    /* while  */
  YYSYMBOL_333_11 = 333,                   /* $@11  */
  YYSYMBOL_334_12 = 334,                   /* $@12  */
  YYSYMBOL_do = 335,                       /* do  */
  YYSYMBOL_336_13 = 336,                   /* $@13  */
  YYSYMBOL_337_14 = 337,                   /* $@14  */
  YYSYMBOL_start_block = 338,              /* start_block  */
  YYSYMBOL_foreach_var = 339,              /* foreach_var  */
  YYSYMBOL_foreach_m = 340,                /* foreach_m  */
  YYSYMBOL_341_15 = 341,                   /* $@15  */
  YYSYMBOL_foreach = 342,                  /* foreach  */
  YYSYMBOL_343_16 = 343,                   /* $@16  */
  YYSYMBOL_for_init_expr = 344,            /* for_init_expr  */
  YYSYMBOL_for = 345,                      /* for  */
  YYSYMBOL_346_17 = 346,                   /* $@17  */
  YYSYMBOL_347_18 = 347,                   /* $@18  */
  YYSYMBOL_348_19 = 348,                   /* $@19  */
  YYSYMBOL_349_20 = 349,                   /* $@20  */
  YYSYMBOL_for_guard = 350,                /* for_guard  */
  YYSYMBOL_for_expr = 351,                 /* for_expr  */
  YYSYMBOL_switch = 352,                   /* switch  */
  YYSYMBOL_353_21 = 353,                   /* $@21  */
  YYSYMBOL_case = 354,                     /* case  */
  YYSYMBOL_case_label = 355,               /* case_label  */
  YYSYMBOL_constant = 356,                 /* constant  */
  YYSYMBOL_const1 = 357,                   /* const1  */
  YYSYMBOL_const2 = 358,                   /* const2  */
  YYSYMBOL_const3 = 359,                   /* const3  */
  YYSYMBOL_const4 = 360,                   /* const4  */
  YYSYMBOL_const5 = 361,                   /* const5  */
  YYSYMBOL_const6 = 362,                   /* const6  */
  YYSYMBOL_const7 = 363,                   /* const7  */
  YYSYMBOL_const8 = 364,                   /* const8  */
  YYSYMBOL_const9 = 365,                   /* const9  */
  YYSYMBOL_default = 366,                  /* default  */
  YYSYMBOL_comma_expr = 367,               /* comma_expr  */
  YYSYMBOL_c_expr = 368,                   /* c_expr  */
  YYSYMBOL_369_22 = 369,                   /* $@22  */
  YYSYMBOL_expr0 = 370,                    /* expr0  */
  YYSYMBOL_opt_expr01 = 371,               /* opt_expr01  */
  YYSYMBOL_expr01 = 372,                   /* expr01  */
  YYSYMBOL_373_23 = 373,                   /* $@23  */
  YYSYMBOL_374_24 = 374,                   /* $@24  */
  YYSYMBOL_assign = 375,                   /* assign  */
  YYSYMBOL_return = 376,                   /* return  */
  YYSYMBOL_expr_list = 377,                /* expr_list  */
  YYSYMBOL_expr_list2 = 378,               /* expr_list2  */
  YYSYMBOL_m_expr_list = 379,              /* m_expr_list  */
  YYSYMBOL_m_expr_list2 = 380,             /* m_expr_list2  */
  YYSYMBOL_expr1 = 381,                    /* expr1  */
  YYSYMBOL_382_25 = 382,                   /* $@25  */
  YYSYMBOL_expr2 = 383,                    /* expr2  */
  YYSYMBOL_384_26 = 384,                   /* $@26  */
  YYSYMBOL_expr211 = 385,                  /* expr211  */
  YYSYMBOL_expr212 = 386,                  /* expr212  */
  YYSYMBOL_expr213 = 387,                  /* expr213  */
  YYSYMBOL_expr22 = 388,                   /* expr22  */
  YYSYMBOL_expr23 = 389,                   /* expr23  */
  YYSYMBOL_expr24 = 390,                   /* expr24  */
  YYSYMBOL_expr25 = 391,                   /* expr25  */
  YYSYMBOL_expr27 = 392,                   /* expr27  */
  YYSYMBOL_expr28 = 393,                   /* expr28  */
  YYSYMBOL_expr3 = 394,                    /* expr3  */
  YYSYMBOL_395_27 = 395,                   /* $@27  */
  YYSYMBOL_funexpr = 396,                  /* funexpr  */
  YYSYMBOL_string_or_id = 397,             /* string_or_id  */
  YYSYMBOL_oexpr_list = 398,               /* oexpr_list  */
  YYSYMBOL_oexpr_list1 = 399,              /* oexpr_list1  */
  YYSYMBOL_oexpr0 = 400,                   /* oexpr0  */
  YYSYMBOL_funident = 401,                 /* funident  */
  YYSYMBOL_funoperator = 402,              /* funoperator  */
  YYSYMBOL_funop = 403,                    /* funop  */
  YYSYMBOL_expr31 = 404,                   /* expr31  */
  YYSYMBOL_rvalue = 405,                   /* rvalue  */
  YYSYMBOL_expr4 = 406,                    /* expr4  */
  YYSYMBOL_407_28 = 407,                   /* $@28  */
  YYSYMBOL_call_other_start = 408,         /* call_other_start  */
  YYSYMBOL_catch = 409,                    /* catch  */
  YYSYMBOL_410_29 = 410,                   /* $@29  */
  YYSYMBOL_sscanf = 411,                   /* sscanf  */
  YYSYMBOL_parse_command = 412,            /* parse_command  */
  YYSYMBOL_lvalue_list = 413,              /* lvalue_list  */
  YYSYMBOL_lvaluec = 414,                  /* lvaluec  */
  YYSYMBOL_identifier = 415,               /* identifier  */
  YYSYMBOL_identifier2 = 416,              /* identifier2  */
  YYSYMBOL_fun_identifier = 417,           /* fun_identifier  */
  YYSYMBOL_lvalue = 418,                   /* lvalue  */
  YYSYMBOL_real = 419,                     /* real  */
  YYSYMBOL_string = 420,                   /* string  */
  YYSYMBOL_string_constant = 421,          /* string_constant  */
  YYSYMBOL_string_con1 = 422,              /* string_con1  */
  YYSYMBOL_cond = 423,                     /* cond  */
  YYSYMBOL_424_30 = 424,                   /* $@30  */
  YYSYMBOL_condStart = 425,                /* condStart  */
  YYSYMBOL_optional_else_part = 426        /* optional_else_part  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;


/* Second part of user prologue.  */
#line 1144 "lang.y"

/* has to be here so that F_EXT is defined */
static void store_reloc_data (char, unsigned short, char *name, int, char);
static void ins_f_byte (unsigned int);
static void start_block(void);
static void end_block(void);
static int first_default_arg, current_arg;
static int is_ctor, is_dtor;
static int block_depth;
static int return_label;
#define CTOR_FUNC ((char *)1)
#define DTOR_FUNC ((char *)2)

#line 1457 "lang.c"


#ifdef short
# undef short
#endif

/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
   <limits.h> and (if available) <stdint.h> are included
   so that the code can choose integer types of a good width.  */

#ifndef __PTRDIFF_MAX__
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
#  define YY_STDINT_H
# endif
#endif

/* Narrow types that promote to a signed type and that can represent a
   signed or unsigned integer of at least N bits.  In tables they can
   save space and decrease cache pressure.  Promoting to a signed type
   helps avoid bugs in integer arithmetic.  */

#ifdef __INT_LEAST8_MAX__
typedef __INT_LEAST8_TYPE__ yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef __INT_LEAST16_MAX__
typedef __INT_LEAST16_TYPE__ yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif

/* Work around bug in HP-UX 11.23, which defines these macros
   incorrectly for preprocessor constants.  This workaround can likely
   be removed in 2023, as HPE has promised support for HP-UX 11.23
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif

#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif

#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif

#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
# elif defined PTRDIFF_MAX
#  ifndef ptrdiff_t
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYPTRDIFF_T ptrdiff_t
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
# endif
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM                                  \
  YY_CAST (YYPTRDIFF_T,                                 \
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
            ? YYPTRDIFF_MAXIMUM                         \
            : YY_CAST (YYSIZE_T, -1)))

#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 yy_state_t;

/* State numbers in computations.  */
typedef int yy_state_fast_t;

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif


#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
#  define YY_ATTRIBUTE_PURE
# endif
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
#  define YY_ATTRIBUTE_UNUSED
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YY_USE(E) ((void) (E))
#else
# define YY_USE(E) /* empty */
#endif

/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif

#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
    _Pragma ("GCC diagnostic push")                            \
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END            \
    _Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if !defined yyoverflow

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* !defined yyoverflow */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yy_state_t yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYPTRDIFF_T yynewbytes;                                         \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYPTRDIFF_T yyi;                      \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  3
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   1450

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  292
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  135
/* YYNRULES -- Number of rules.  */
#define YYNRULES  315
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  520

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   524


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                \
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
   : YYSYMBOL_YYUNDEF)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_int16 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   281,     2,
     273,   274,   271,   284,   275,   285,     2,   286,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   278,   270,
     283,   272,   282,   288,   289,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,   290,     2,   291,   280,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   276,   279,   277,   287,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
     135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
     165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
     185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
     195,   196,   197,   198,   199,   200,   201,   202,   203,   204,
     205,   206,   207,   208,   209,   210,   211,   212,   213,   214,
     215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
     225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
     235,   236,   237,   238,   239,   240,   241,   242,   243,   244,
     245,   246,   247,   248,   249,   250,   251,   252,   253,   254,
     255,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,  1159,  1159,  1159,  1161,  1162,  1164,  1165,  1167,  1199,
    1217,  1222,  1233,  1233,  1235,  1236,  1237,  1238,  1248,  1296,
    1247,  1380,  1381,  1383,  1398,  1397,  1423,  1424,  1425,  1427,
    1428,  1442,  1457,  1458,  1460,  1461,  1462,  1463,  1464,  1466,
    1467,  1469,  1471,  1476,  1476,  1478,  1479,  1480,  1481,  1482,
    1483,  1484,  1485,  1486,  1488,  1489,  1491,  1496,  1495,  1519,
    1518,  1527,  1529,  1534,  1537,  1536,  1559,  1560,  1562,  1563,
    1564,  1566,  1572,  1572,  1572,  1572,  1572,  1572,  1572,  1572,
    1572,  1573,  1573,  1573,  1573,  1574,  1575,  1585,  1598,  1604,
    1605,  1597,  1623,  1632,  1623,  1649,  1660,  1649,  1676,  1678,
    1683,  1683,  1717,  1717,  1747,  1748,  1750,  1756,  1759,  1769,
    1750,  1789,  1793,  1800,  1801,  1804,  1803,  1908,  1924,  1950,
    1960,  1970,  1971,  1973,  1974,  1976,  1977,  1979,  1980,  1981,
    1983,  1984,  1985,  1986,  1987,  1989,  1990,  1991,  1993,  1994,
    1995,  1997,  1998,  1999,  2000,  2002,  2003,  2005,  2006,  2007,
    2008,  2010,  2024,  2025,  2027,  2028,  2028,  2032,  2033,  2047,
    2049,  2050,  2052,  2054,  2062,  2053,  2097,  2098,  2099,  2100,
    2101,  2102,  2103,  2104,  2105,  2106,  2107,  2109,  2121,  2132,
    2133,  2134,  2136,  2137,  2139,  2140,  2141,  2143,  2144,  2146,
    2148,  2147,  2165,  2167,  2166,  2184,  2185,  2207,  2208,  2218,
    2219,  2241,  2242,  2252,  2263,  2264,  2266,  2268,  2270,  2273,
    2274,  2283,  2293,  2294,  2296,  2323,  2324,  2346,  2355,  2364,
    2376,  2377,  2385,  2386,  2394,  2402,  2407,  2414,  2421,  2433,
    2432,  2457,  2458,  2470,  2474,  2495,  2498,  2499,  2500,  2502,
    2503,  2505,  2506,  2513,  2541,  2547,  2554,  2555,  2556,  2557,
    2558,  2559,  2560,  2561,  2562,  2563,  2564,  2565,  2566,  2567,
    2568,  2569,  2570,  2571,  2572,  2576,  2577,  2585,  2594,  2619,
    2620,  2624,  2645,  2645,  2664,  2687,  2687,  2688,  2689,  2690,
    2691,  2692,  2693,  2700,  2710,  2716,  2729,  2735,  3028,  3033,
    3033,  3042,  3047,  3052,  3053,  3054,  3056,  3057,  3062,  3063,
    3068,  3069,  3070,  3072,  3109,  3132,  3139,  3146,  3151,  3152,
    3158,  3165,  3163,  3177,  3185,  3186
};
#endif

/** Accessing symbol of state STATE.  */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])

#if YYDEBUG || 0
/* The user-facing name of the symbol whose (internal) number is
   YYSYMBOL.  No bounds checking.  */
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;

/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "\"end of file\"", "error", "\"invalid token\"", "F_EXT", "F_JUMP",
  "F_JUMP_WHEN_ZERO", "F_JUMP_WHEN_NON_ZERO", "F_SKIP_NZ", "F_POP_VALUE",
  "F_DUP", "F_CALL_NON_VIRT", "F_CALL_VIRT", "F_PUSH_IDENTIFIER_LVALUE",
  "F_PUSH_LOCAL_VARIABLE_LVALUE", "F_PUSH_INDEXED_LVALUE", "F_INDIRECT",
  "F_INDEX", "F_CONST0", "F_CONST1", "F_CALL_VAR", "F_BUILD_CLOSURE",
  "F_PAPPLY", "F_IDENTIFIER", "F_RETURN", "F_STRING", "F_FLOATC", "F_INC",
  "F_DEC", "F_POST_INC", "F_POST_DEC", "F_NUMBER", "F_ASSIGN", "F_ADD",
  "F_SUBTRACT", "F_MULTIPLY", "F_DIVIDE", "F_LT", "F_GT", "F_EQ", "F_GE",
  "F_LE", "F_NE", "F_ADD_EQ", "F_SUB_EQ", "F_DIV_EQ", "F_MULT_EQ",
  "F_NEGATE", "F_SWITCH", "F_SSCANF", "F_PARSE_COMMAND", "F_STRING_DECL",
  "F_LOCAL_NAME", "F_MOD", "F_MOD_EQ", "F_STATIC", "F_ARROW",
  "F_AGGREGATE", "F_M_AGGREGATE", "F_COMPL", "F_AND", "F_AND_EQ", "F_OR",
  "F_OR_EQ", "F_XOR", "F_XOR_EQ", "F_LSH", "F_LSH_EQ", "F_RSH", "F_RSH_EQ",
  "F_NOT", "F_TRY", "F_END_TRY", "F_FOREACH", "F_FOREACH_M", "F_CATCH",
  "F_END_CATCH", "F_CALL_C", "F_CALL_SIMUL", "F_RANGE", "F_THROW", "F_ABS",
  "F_ACOS", "F_ACOSH", "F_ADD_ACTION", "F_ALL_INVENTORY", "F_ALLOCATE",
  "F_ASIN", "F_ASINH", "F_ATAN", "F_ATAN2", "F_ATANH", "F_BREAK_STRING",
  "F_CALL_OTHER", "F_CALL_OTHERV", "F_CALL_SELF", "F_CALL_SELFV",
  "F_CALLING_FUNCTION", "F_CALLING_OBJECT", "F_CALLING_PROGRAM",
  "F_CAPITALIZE", "F_CLEAR_BIT", "F_CLONE_OBJECT", "F_COMMAND",
  "F_COMMANDS", "F_COS", "F_COSH", "F_CRYPT", "F_CTIME", "F_DEBUG",
  "F_DEEP_INVENTORY", "F_DESTRUCT", "F_DISABLE_COMMANDS", "F_ED",
  "F_ENABLE_COMMANDS", "F_ENVIRONMENT", "F_EXEC", "F_EXP", "F_EXPLODE",
  "F_EXTRACT", "F_FACT", "F_FILE_NAME", "F_FILE_SIZE", "F_FILE_TIME",
  "F_FILTER", "F_FIND_LIVING", "F_FIND_OBJECT", "F_FIND_PLAYER",
  "F_FLOATP", "F_FTOA", "F_FTOI", "F_FUNCTION_EXISTS", "F_FUNCTION_NAME",
  "F_FUNCTION_OBJECT", "F_FUNCTIONP", "F_GET_ALARM", "F_GET_ALL_ALARMS",
  "F_GET_DIR", "F_GETTIMEOFDAY", "F_IMPLODE", "F_INPUT_TO", "F_INTP",
  "F_ITOF", "F_LAST_REFERENCE_TIME", "F_LIVING", "F_LOG", "F_LOWER_CASE",
  "F_M_DELETE", "F_M_DELKEY", "F_M_INDEXES", "F_M_RESTORE_OBJECT",
  "F_M_SAVE_OBJECT", "F_M_SIZEOF", "F_M_VALUES", "F_MAP", "F_MAPPINGP",
  "F_MATCH_PATH", "F_MAX", "F_MEMBER_ARRAY", "F_MIN", "F_MKDIR",
  "F_MKFUNCTION", "F_MKMAPPING", "F_MOVE_OBJECT", "F_NOTIFY_FAIL",
  "F_NRND", "F_OBJECT_CLONES", "F_OBJECT_TIME", "F_OBJECTP", "F_OBSOLETE",
  "F_PAPPLYV", "F_POINTERP", "F_POW", "F_PRESENT", "F_PREVIOUS_OBJECT",
  "F_PROCESS_STRING", "F_PROCESS_VALUE", "F_QUERY_AUTH",
  "F_QUERY_HOST_NAME", "F_QUERY_IDLE", "F_QUERY_INTERACTIVE",
  "F_QUERY_IP_IDENT", "F_QUERY_IP_NAME", "F_QUERY_IP_NUMBER",
  "F_QUERY_LIVING_NAME", "F_QUERY_SCREEN_WIDTH", "F_QUERY_SNOOP",
  "F_QUERY_TRIGVERB", "F_QUERY_VERB", "F_RANDOM", "F_READ_BYTES",
  "F_READ_FILE", "F_READABLE_STRING", "F_REDUCE", "F_REGEXP",
  "F_REMOVE_ALARM", "F_RENAME", "F_RESTORE_MAP", "F_RESTORE_OBJECT",
  "F_RM", "F_RMDIR", "F_RND", "F_SAVE_MAP", "F_SAVE_OBJECT", "F_SET_ALARM",
  "F_SET_ALARMV", "F_SET_AUTH", "F_SET_BIT", "F_SET_LIVING_NAME",
  "F_SET_SCREEN_WIDTH", "F_SET_THIS_PLAYER", "F_SHADOW", "F_SIN", "F_SINH",
  "F_SIZEOF", "F_SNOOP", "F_SPRINTF", "F_SQRT", "F_STR2VAL", "F_STRINGP",
  "F_STRLEN", "F_TAIL", "F_TAN", "F_TANH", "F_TEST_BIT",
  "F_THIS_INTERACTIVE", "F_THIS_OBJECT", "F_THIS_PLAYER", "F_TIME",
  "F_TYPEOF", "F_UNIQUE_ARRAY", "F_UPDATE_ACTIONS", "F_UPPER_CASE",
  "F_USERS", "F_VAL2JSON", "F_VAL2STR", "F_WILDMATCH", "F_WRITE_BYTES",
  "F_WRITE_FILE", "F_WRITE_SOCKET", "F_WRITE_SOCKET_GMCP", "F_ELSE",
  "F_WHILE", "F_DO", "F_FOR", "F_STORE", "F_LAND", "F_LOR", "F_STATUS",
  "F_IF", "F_COMMA", "F_INT", "F_CONTINUE", "F_INHERIT", "F_COLON_COLON",
  "F_VARARGS", "F_VARARG", "F_SUBSCRIPT", "F_BREAK", "F_OBJECT", "F_VOID",
  "F_MIXED", "F_PRIVATE", "F_NO_MASK", "F_MAPPING", "F_FLOAT", "F_PUBLIC",
  "F_FUNCTION", "F_OPERATOR", "F_CASE", "F_DEFAULT", "';'", "'*'", "'='",
  "'('", "')'", "','", "'{'", "'}'", "':'", "'|'", "'^'", "'&'", "'>'",
  "'<'", "'+'", "'-'", "'/'", "'~'", "'?'", "'@'", "'['", "']'", "$accept",
  "all", "$@1", "program", "possible_semi_colon", "inheritance",
  "opt_inherit_name", "number", "optional_star", "block_or_semi", "def",
  "$@2", "$@3", "new_arg_name", "$@4", "fun_args", "argument",
  "argument_list", "type_modifier", "type_modifier_list", "type", "cast",
  "opt_basic_type", "basic_type", "name_list", "new_name", "$@5", "block",
  "$@6", "local_declaration", "new_local_name2", "new_local_name", "$@7",
  "local_name_list", "statements", "statement", "try", "$@8", "$@9",
  "$@10", "while", "$@11", "$@12", "do", "$@13", "$@14", "start_block",
  "foreach_var", "foreach_m", "$@15", "foreach", "$@16", "for_init_expr",
  "for", "$@17", "$@18", "$@19", "$@20", "for_guard", "for_expr", "switch",
  "$@21", "case", "case_label", "constant", "const1", "const2", "const3",
  "const4", "const5", "const6", "const7", "const8", "const9", "default",
  "comma_expr", "c_expr", "$@22", "expr0", "opt_expr01", "expr01", "$@23",
  "$@24", "assign", "return", "expr_list", "expr_list2", "m_expr_list",
  "m_expr_list2", "expr1", "$@25", "expr2", "$@26", "expr211", "expr212",
  "expr213", "expr22", "expr23", "expr24", "expr25", "expr27", "expr28",
  "expr3", "$@27", "funexpr", "string_or_id", "oexpr_list", "oexpr_list1",
  "oexpr0", "funident", "funoperator", "funop", "expr31", "rvalue",
  "expr4", "$@28", "call_other_start", "catch", "$@29", "sscanf",
  "parse_command", "lvalue_list", "lvaluec", "identifier", "identifier2",
  "fun_identifier", "lvalue", "real", "string", "string_constant",
  "string_con1", "cond", "$@30", "condStart", "optional_else_part", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-419)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#define YYTABLE_NINF (-301)

#define yytable_value_is_error(Yyn) \
  0

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
static const yytype_int16 yypact[] =
{
    -419,    28,  -419,  -419,    36,  -419,  -419,  -419,  -419,  -419,
    -419,  -238,   291,   280,  -230,  -419,  -419,  -419,  -419,  -419,
    -419,   -16,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,
    -419,     5,  -221,  -208,  -419,   -16,    80,  -176,  -186,  -419,
    -419,  -419,  -419,  -230,  -237,  -419,  -145,   104,  -120,  -117,
     136,  -419,  -419,  -419,  -419,  1118,   153,  -419,   -97,   420,
    -419,  -419,  -419,   317,   317,  -419,   -92,   -90,    -6,  -419,
     164,   -82,   244,    49,    -6,    -6,  -419,    -6,  -419,  -419,
     -93,   -44,  -222,   -77,   -76,  -419,  -419,   127,  -161,   -38,
    -419,  -419,  -419,  -419,  -419,   -30,   -69,  -419,  -419,  -419,
     -67,   -39,    52,  -419,  -419,  -419,   -56,  -419,  -419,   -51,
     -46,   349,  -230,  -224,  -419,  -419,  -419,  -419,  -419,  -419,
    -419,  -419,  -419,  -419,  -419,  1088,   284,   -30,   -17,   -17,
    1118,  1118,  -419,   106,   -49,   -39,  1160,  1059,  1072,   163,
    -230,   -40,   -25,  -419,   -31,   213,  1059,   -27,   200,  -419,
    -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  1088,
    1088,  1088,  1088,  1088,  1088,  1088,  1088,  1088,  1088,  1088,
    1088,  1088,    -6,    -6,    -6,    -6,   236,  1105,   660,  1105,
    1105,   237,  -419,  -419,  1118,  -419,  -419,   119,   242,  -419,
     -21,  -419,  -419,  -419,  -419,   -10,     2,  1059,  -419,  -419,
    -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,
    -419,  -419,  -419,  -419,  -419,  -419,   -15,    10,  -419,  -419,
      23,    11,    21,    -4,    29,    31,  -419,    37,  -419,    46,
     693,   304,  1088,  1088,  1088,   -77,   -76,  -419,    -9,    -9,
      -9,    -9,  -161,  -161,    -9,    -9,   -38,   -38,  -419,  -419,
    -419,  -419,  -419,    53,  -419,   -61,    55,    57,  -419,  -419,
    -419,  -419,    62,    65,  -239,   553,  1118,  1118,    64,  -419,
    -419,    66,   723,  1088,    69,   214,  -419,  1118,    63,  -419,
      71,    70,  -419,    77,  -419,  -419,  -419,  -419,  -419,  -419,
    1059,   152,  -419,  -419,  -419,    84,  -419,  -419,   334,   910,
      86,  -419,  -419,    87,    89,    97,    98,    30,    92,  -419,
    -230,  -419,  -419,    95,   553,  -419,  -419,   134,  -419,   140,
    -419,  -419,  -419,  -419,  -419,  -419,   113,   115,  -419,   594,
     114,   117,  -419,  -419,  -419,  -419,  -419,   110,  -419,   693,
    -419,   759,   112,   102,  -419,   120,  1118,  -419,  -419,  1059,
     594,   122,  -419,  1059,  -419,  -419,  -419,   367,    30,   371,
     373,   -65,   138,   126,   139,    68,   -29,    50,  -130,     9,
    -419,  -419,  -419,  -419,   399,   151,   156,   158,  -419,  -419,
     159,   594,  -419,  -419,  -419,   317,   160,  1118,  1088,   161,
    -419,  -419,    77,  1088,  -419,  -419,  -419,   166,   364,   349,
    -419,   167,  -419,  -244,  -419,  -419,    30,  -419,    34,    34,
      34,    34,    34,    34,    34,    34,    34,    34,    34,    34,
      34,    34,    34,    34,  -419,   173,  -230,  -419,  1059,  -419,
     206,   114,  -114,  -419,   114,  -419,  -419,  -419,  -419,  -419,
    -230,  -201,   627,  -419,  -419,   169,    34,   126,   139,    68,
     -29,   -29,    50,    50,    50,    50,  -130,  -130,     9,     9,
    -419,  -419,  -419,  1118,  -419,   175,   210,   594,  -419,  -419,
     178,   594,   180,  -419,   349,  1059,  -230,   185,  -419,  -419,
    -419,  -419,  -419,   183,  -419,  -419,  -419,   349,   179,   184,
    -419,  -419,   594,  1059,  -230,  1059,  -419,   993,  -419,   192,
     194,   195,   594,   189,  -419,   190,  -419,  -419,  -419,  -419,
    -419,   594,   594,  1026,  -419,  -419,   196,  -419,   594,  -419
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
static const yytype_int16 yydefact[] =
{
       2,     0,     5,     1,    39,    35,    38,    36,    34,    37,
      22,     6,    39,    44,    12,     7,     4,    40,    47,    45,
      46,     0,    48,    49,    50,    51,    52,    53,    41,    43,
      13,     0,     0,    54,   308,     0,     9,   307,    56,   301,
     302,    18,    21,    12,     0,    10,     0,     0,     0,     0,
       0,    55,   310,     8,   309,     0,    39,    19,    56,     0,
     298,   306,   305,     0,     0,    11,     0,     0,     0,   289,
       0,     0,     0,     0,     0,     0,   276,     0,    58,   157,
     162,   189,   192,   195,   197,   199,   201,   204,   209,   212,
     215,   220,   270,   222,   269,   265,   284,   279,   280,   281,
     303,   296,   268,   277,   275,    31,     0,    26,    32,     0,
      29,    44,    12,     0,   172,   173,   176,   174,   175,   167,
     168,   169,   170,   171,   166,     0,     0,     0,   223,   224,
       0,     0,   225,   268,     0,   297,     0,     0,     0,     0,
      12,     0,   152,   154,   298,     0,     0,     0,     0,   231,
     244,   234,   233,   227,   226,   221,   163,   190,   193,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   266,   267,     0,    28,    27,    39,     0,    15,
       0,    59,    20,    14,   159,     0,     0,     0,   255,   253,
     254,   256,   250,   260,   261,   263,   248,   259,   258,   257,
     251,   252,   246,   247,   249,   264,     0,     0,   153,   182,
       0,   180,     0,     0,   185,     0,   278,     0,   229,     0,
       0,     0,   160,     0,     0,   196,   198,   200,   202,   206,
     208,   203,   210,   211,   205,   207,   213,   214,   217,   216,
     218,   219,   288,     0,   272,     0,     0,     0,   299,   158,
      30,    33,    23,     0,     0,     0,     0,     0,     0,   262,
     245,     0,     0,     0,     0,     0,    42,     0,     0,   235,
     237,     0,   238,     0,   232,   164,   161,   191,   194,   285,
       0,     0,   304,   286,   287,     0,    17,    16,     0,     0,
       0,    88,    98,     0,     0,     0,     0,     0,     0,    85,
      12,    83,    84,     0,     0,    73,    74,     0,    75,     0,
      82,    81,    76,    77,    78,    79,     0,     0,    72,     0,
     293,     0,   290,   282,   183,   187,   283,     0,   156,     0,
     228,     0,     0,     0,   274,     0,     0,    70,   178,     0,
       0,     0,    98,     0,    87,    86,   147,     0,     0,     0,
       0,     0,   119,   121,   123,   125,   127,   130,   135,   138,
     141,   145,   120,   151,     0,    63,    66,     0,    60,    69,
       0,     0,    71,    80,   311,     0,     0,     0,     0,     0,
     241,   240,   239,     0,   273,   271,    25,     0,     0,     0,
     106,     0,   149,     0,   148,   150,     0,   117,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    62,     0,    12,    61,     0,    96,
     314,   293,   268,   291,   293,   188,   230,   165,   115,    89,
      12,     0,     0,   313,   146,     0,     0,   122,   124,   126,
     128,   129,   132,   134,   131,   133,   136,   137,   139,   140,
     143,   142,   144,     0,    67,     0,     0,     0,   312,   294,
       0,     0,     0,    99,     0,     0,    12,     0,   104,   114,
     118,    65,    93,     0,   315,   292,   116,     0,     0,     0,
     105,   107,     0,     0,    12,     0,   102,     0,    94,     0,
       0,     0,     0,     0,   112,     0,    90,   100,   103,   108,
      97,     0,     0,     0,    91,   101,     0,   109,     0,   110
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,    19,  -419,
    -419,  -419,  -419,   285,  -419,  -419,  -419,  -419,  -419,    22,
     467,  -419,  -419,   -13,   432,  -419,  -419,   363,  -419,  -419,
    -418,  -419,  -419,  -411,   165,   264,  -419,  -419,  -419,  -419,
    -419,  -419,  -419,  -419,  -419,  -419,   125,     4,  -419,  -419,
    -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,  -419,   -28,
    -419,  -419,  -419,    83,  -346,    75,    81,    82,  -249,  -331,
    -248,  -223,  -330,  -419,  -419,   -71,  -419,  -419,   -50,  -419,
    -121,  -419,  -419,   391,  -419,   -58,  -419,  -419,  -419,  -204,
    -419,   262,  -419,  -419,   339,   340,   345,  -419,   186,    32,
       1,  -419,   750,  -419,  -419,  -419,   170,   171,   172,  -419,
     441,  -419,  -419,  -419,   -57,  -419,  -419,  -419,  -419,  -419,
    -419,  -321,  -419,   442,   446,  -419,   -24,  -419,   445,   498,
     -33,  -419,  -419,  -419,  -419
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,     1,     2,     4,    16,    10,    46,    76,   374,   192,
      11,    49,   113,   108,   295,    57,   109,   110,    12,   111,
     112,    77,    28,   310,    32,    33,    48,   311,   265,   312,
     375,   376,   425,   377,   313,   314,   315,   350,   472,   511,
     316,   317,   492,   318,   319,   466,   351,   441,   320,   512,
     321,   502,   477,   322,   442,   497,   513,   518,   503,   478,
     323,   471,   324,   361,   362,   363,   364,   365,   366,   367,
     368,   369,   370,   371,   325,   326,   142,   227,   143,   285,
      79,   232,   342,   125,   327,   220,   221,   223,   224,    80,
     233,    81,   234,    82,    83,    84,    85,    86,    87,    88,
      89,    90,    91,   278,   147,   148,   281,   282,   283,   149,
      92,   217,    93,    94,    95,   290,    96,    97,   134,    98,
      99,   386,   431,   100,   101,    41,   102,   103,   104,   372,
      37,   328,   430,   329,   468
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
      29,   141,    44,    34,   194,    78,   127,   127,    34,   263,
     413,   414,   403,   406,   172,   464,    60,   291,    61,    62,
      63,    64,   473,   158,    65,   176,    13,    38,     3,   287,
     444,   297,    15,    31,    17,   408,    -3,    52,  -268,   128,
     129,    30,    66,    67,   133,    47,   189,    47,   190,    42,
     133,   133,   191,   133,    34,   141,   166,   159,   167,   140,
     356,   421,    50,    68,   356,   490,   218,    43,    69,   335,
      39,   144,    40,    61,   474,   229,   500,   475,   182,   183,
     195,   196,   452,   453,   454,   455,   -57,  -300,   219,   222,
       5,   460,   461,   462,   114,   115,   116,   117,    29,   357,
     403,   133,    45,   357,   145,   118,   411,   255,    47,   412,
     469,   286,   119,   470,   120,   417,   121,   418,   122,   253,
     123,   256,   257,   170,   171,    53,   268,   219,    54,   219,
     219,   188,   182,   183,   259,   133,   133,   133,   133,   133,
     133,   133,   133,   133,   133,   133,   133,   133,   133,   133,
     133,   133,    55,    59,   419,   420,    56,   264,    58,   225,
    -295,  -295,   450,   451,    59,   162,   163,   164,   165,   456,
     457,   246,   247,     5,    60,   -57,    61,    62,    63,    64,
     280,   130,    65,   131,   435,    60,    60,    61,    62,    63,
      64,   136,   166,    65,   167,   156,   458,   459,   242,   243,
      66,    67,   157,   160,   179,   161,   180,     5,   133,   133,
     133,    66,    67,   407,   181,    59,   330,   331,   185,   343,
     345,    68,   334,   186,   197,   337,    69,   338,   348,   187,
     292,   137,    68,   173,   226,   228,    60,    69,    61,    62,
      63,    64,  -243,   177,    65,    59,   230,    70,   174,   133,
    -155,   175,    35,   415,   416,   231,  -268,    35,   252,   258,
     178,    71,    66,    67,   262,   266,    60,   126,    61,    62,
      63,    64,   437,  -268,    65,    73,   269,   267,   397,    74,
     422,    75,   401,    68,   270,    59,   272,   274,    69,   280,
       6,   390,    66,    67,    18,   423,   396,     7,     8,   273,
     271,     9,    70,   358,   275,   276,    60,   446,    61,    62,
      63,    64,   277,    68,    65,   359,    71,   360,    69,   359,
     279,   360,   146,   137,   124,    44,   284,   289,   127,   293,
      18,   294,    66,    67,   -24,   296,   339,   434,   332,    60,
     333,    61,    62,   336,   340,     5,  -241,    65,   238,   239,
     240,   241,   341,    68,   244,   245,   346,   465,    69,   349,
     352,   432,   353,   137,   133,    66,    67,   354,   355,   133,
     373,   479,   378,     6,   260,   380,   114,   115,   116,   117,
       7,     8,   381,   382,     9,   383,   440,   118,   388,   385,
     393,    69,   387,   394,   119,   399,   120,   402,   121,    18,
     122,   404,   123,   405,   489,    70,   409,     6,   105,   168,
     169,   395,   106,   481,     7,     8,    70,   408,     9,    71,
     410,   424,   499,   -64,   501,    72,   504,   107,   427,   476,
      71,   426,   428,    73,   433,   436,    72,    74,   439,    75,
     438,   443,   479,   344,    73,   463,   467,   480,    74,   482,
      75,   483,   485,   487,  -184,   491,   493,   495,   496,   509,
     510,   440,   114,   115,   116,   117,   505,    70,   506,   507,
     517,    14,   261,   118,   494,    51,   193,   400,   488,   379,
     119,    71,   120,   447,   121,   516,   122,    72,   123,   445,
     448,    19,   449,   184,    20,    73,   288,    70,   235,    74,
     236,    75,    22,    23,    24,  -186,   237,    25,    26,   389,
      27,    71,   391,   392,   150,   151,   135,    72,   152,    36,
     138,     0,     0,     0,     0,    73,     0,    19,     0,    74,
      20,    75,    21,     0,   139,     0,     0,    70,    22,    23,
      24,     0,     0,    25,    26,     6,    27,     0,     0,     0,
       0,    71,     7,     8,   298,     0,     9,    72,     0,     0,
     138,     0,     0,     0,     0,    73,     0,     0,     0,    74,
      70,    75,     0,     0,   139,    60,   299,    61,    62,    63,
      64,     0,     0,    65,    71,     0,     0,     0,     0,     0,
     126,     0,     0,   384,     0,    59,    19,     0,     0,    20,
     300,    66,    67,    18,   347,     0,   124,    22,    23,    24,
       0,     0,    25,    26,   398,    27,    60,   299,    61,    62,
      63,    64,    68,   301,    65,   302,     0,    69,    59,     0,
       0,     0,   137,     0,     0,     0,     0,     0,     0,     0,
       0,   300,    66,    67,    18,   429,     0,     0,     0,    60,
       0,    61,    62,    63,    64,     0,     0,    65,     0,     0,
       0,    59,     0,    68,   301,     0,   302,     0,    69,     0,
       0,     0,     0,   137,     0,    66,    67,    18,     0,     0,
       0,     0,    60,     0,    61,    62,    63,    64,     0,     0,
      65,     0,   124,     0,    59,     0,    68,     0,     0,     0,
       0,    69,     0,     0,     0,     0,   137,     0,    66,    67,
       0,     0,     0,     0,     0,    60,     0,    61,    62,    63,
      64,     0,     0,    65,    59,     0,     0,     0,     0,    68,
       0,   484,     0,     0,    69,   486,     0,     0,   254,   137,
       0,    66,    67,     0,     0,    60,     0,    61,    62,    63,
      64,     0,     0,    65,     0,     0,   498,     0,     0,     0,
      59,     0,    68,     0,     0,     0,   508,    69,     0,     0,
       0,    66,    67,     0,     0,   514,   515,     0,     0,     0,
       0,    60,   519,    61,    62,    63,    64,     0,     0,    65,
       0,     0,    68,     0,   -92,   -95,   303,    69,     0,     0,
      19,   304,     0,    20,   305,     0,    70,    66,    67,     0,
     306,    22,    23,    24,     0,     0,    25,    26,   132,    27,
      71,   307,   308,   309,   153,   154,    72,   155,    68,   191,
     -68,     0,     0,    69,    73,   -92,   -95,   303,    74,     0,
      75,    19,   304,     0,    20,   305,     0,    70,     0,     0,
       0,   306,    22,    23,    24,     0,     0,    25,    26,     0,
      27,    71,   307,   308,   309,     0,     0,    72,     0,     0,
     191,     0,     0,     0,    19,    73,     0,    20,     0,    74,
      70,    75,     0,     0,     0,    22,    23,    24,     0,     0,
      25,    26,     0,    27,    71,     0,     0,  -113,     0,     0,
      72,     0,     0,     0,     0,     0,     0,     0,    73,     0,
       0,    59,    74,    70,    75,     0,     0,     0,     0,     0,
       0,     0,   248,   249,   250,   251,     0,    71,     0,     0,
       0,     0,    60,    72,    61,    62,    63,    64,     0,     0,
      65,    73,     0,     0,     0,    74,    70,    75,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    66,    67,
      71,     0,     0,     0,     0,     0,    72,  -236,  -242,     0,
       0,     0,     0,     0,    73,     0,    70,     0,    74,    68,
      75,     0,     0,     0,    69,     0,     0,     0,     0,   137,
      71,     0,     0,     0,    59,     0,    72,  -181,     0,     0,
    -181,     0,     0,     0,    73,     0,     0,     0,    74,     0,
      75,     0,    70,     0,     0,    60,     0,    61,    62,    63,
      64,     0,     0,    65,     0,     0,    71,    59,     0,     0,
       0,     0,    72,  -242,  -242,     0,     0,     0,     0,     0,
      73,    66,    67,     0,    74,     0,    75,     0,    60,     0,
      61,    62,    63,    64,     0,     0,    65,     0,     0,     0,
      59,     0,    68,     0,     0,     0,     0,    69,     0,     0,
       0,     0,   137,    59,    66,    67,     0,     0,     0,     0,
       0,    60,     0,    61,    62,    63,    64,     0,     0,    65,
       0,     0,     0,     0,    60,    68,    61,    62,    63,    64,
      69,     0,    65,     0,     0,   137,    59,    66,    67,     0,
      60,     0,    61,    62,    63,    64,     0,     0,    65,    59,
      66,    67,     0,     0,     0,     0,     0,    60,    68,    61,
      62,    63,    64,    69,     0,    65,    66,    67,   137,     0,
      60,    68,    61,    62,    63,    64,    69,     0,    65,     0,
       0,     0,     0,    66,    67,     0,     0,    68,     0,     0,
       0,     0,    69,    70,     0,     0,    66,    67,     0,     0,
       0,     0,     0,     0,    68,     0,     0,    71,     0,    69,
    -177,     0,     0,    72,     0,     0,     0,    68,     0,     0,
       0,    73,    69,     0,     0,    74,     0,    75,   198,   199,
     200,   201,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   202,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   203,     0,   204,     0,   205,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    70,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      71,     0,     0,  -111,     0,     0,    72,     0,     0,     0,
       0,     0,     0,     0,    73,     0,     0,     0,    74,    70,
      75,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    71,     0,     0,     0,     0,     0,    72,
    -113,     0,     0,     0,     0,     0,     0,    73,     0,     0,
       0,    74,    70,    75,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    70,    71,     0,     0,     0,
       0,     0,    72,     0,     0,     0,     0,     0,     0,    71,
      73,    70,     0,     0,    74,    72,    75,     0,     0,  -179,
       0,     0,     0,    73,     0,    71,     0,    74,    70,    75,
       0,    72,     0,     0,     0,     0,     0,     0,     0,    73,
       0,    70,    71,    74,     0,    75,     0,     0,    72,  -179,
       0,     0,     0,     0,     0,    71,    73,     0,     0,     0,
      74,    72,    75,     0,     0,     0,     0,     0,     0,    73,
       0,     0,     0,    74,     0,    75,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   206,     0,     0,     0,     0,     0,     0,     0,   207,
     208,   209,   210,   211,   212,   213,   214,   215,     0,     0,
     216
};

static const yytype_int16 yycheck[] =
{
      13,    72,    35,    24,   125,    55,    63,    64,    24,    30,
      39,    40,   358,    78,    52,   426,    22,    78,    24,    25,
      26,    27,   440,   245,    30,    55,     4,    22,     0,   233,
     274,   270,   270,    14,    12,   279,     0,   274,    55,    63,
      64,   271,    48,    49,    68,   284,   270,   284,   272,   270,
      74,    75,   276,    77,    24,   126,    65,   279,    67,    72,
      30,    52,    43,    69,    30,   476,   137,   275,    74,   273,
      65,    22,    67,    24,   275,   146,   494,   278,    26,    27,
     130,   131,   413,   414,   415,   416,   272,   273,   138,   139,
      54,   421,   422,   423,    42,    43,    44,    45,   111,    69,
     446,   125,    22,    69,    55,    53,    38,   178,   284,    41,
     431,   232,    60,   434,    62,    65,    64,    67,    66,   177,
      68,   179,   180,   284,   285,   270,   197,   177,    24,   179,
     180,   112,    26,    27,   184,   159,   160,   161,   162,   163,
     164,   165,   166,   167,   168,   169,   170,   171,   172,   173,
     174,   175,   272,     1,   284,   285,   273,   190,    22,   140,
     274,   275,   411,   412,     1,    38,    39,    40,    41,   417,
     418,   170,   171,    54,    22,   272,    24,    25,    26,    27,
     230,   273,    30,   273,   388,    22,    22,    24,    25,    26,
      27,   273,    65,    30,    67,   288,   419,   420,   166,   167,
      48,    49,   246,   280,   273,   281,   273,    54,   232,   233,
     234,    48,    49,   278,   253,     1,   266,   267,   274,   290,
     291,    69,   272,   274,   273,   275,    74,   277,   299,   275,
     291,    79,    69,   271,   274,    22,    22,    74,    24,    25,
      26,    27,   273,   273,    30,     1,   273,   253,   286,   273,
     275,   289,   273,   282,   283,    55,   273,   273,    22,    22,
     290,   267,    48,    49,    22,   275,    22,   273,    24,    25,
      26,    27,   393,   290,    30,   281,   291,   275,   349,   285,
     271,   287,   353,    69,   274,     1,   275,   291,    74,   339,
     254,   341,    48,    49,    50,   286,   346,   261,   262,   278,
     277,   265,   253,   273,   275,   274,    22,   273,    24,    25,
      26,    27,   275,    69,    30,   285,   267,   287,    74,   285,
     274,   287,   273,    79,   272,   358,    22,   274,   385,   274,
      50,   274,    48,    49,   272,   270,   273,   387,   274,    22,
     274,    24,    25,   274,   274,    54,   275,    30,   162,   163,
     164,   165,   275,    69,   168,   169,   272,   428,    74,   273,
     273,   385,   273,    79,   388,    48,    49,   270,   270,   393,
     278,   442,   277,   254,   255,   241,    42,    43,    44,    45,
     261,   262,   242,   270,   265,   270,   399,    53,   278,   275,
     278,    74,   275,   291,    60,   273,    62,    30,    64,    50,
      66,    30,    68,    30,   475,   253,   280,   254,   255,   282,
     283,   291,   259,   463,   261,   262,   253,   279,   265,   267,
     281,    22,   493,   272,   495,   273,   497,   274,   270,   442,
     267,   275,   273,   281,   274,   274,   273,   285,    74,   287,
     274,   274,   513,   291,   281,   272,   240,   278,   285,   274,
     287,   241,   274,   273,   291,   270,   273,   278,   274,   270,
     270,   474,    42,    43,    44,    45,   274,   253,   274,   274,
     274,     4,   187,    53,   487,    43,   113,   352,   474,   314,
      60,   267,    62,   408,    64,   513,    66,   273,    68,   406,
     409,   247,   410,   102,   250,   281,   234,   253,   159,   285,
     160,   287,   258,   259,   260,   291,   161,   263,   264,   339,
     266,   267,   341,   341,    73,    73,    70,   273,    73,    21,
     276,    -1,    -1,    -1,    -1,   281,    -1,   247,    -1,   285,
     250,   287,   252,    -1,   290,    -1,    -1,   253,   258,   259,
     260,    -1,    -1,   263,   264,   254,   266,    -1,    -1,    -1,
      -1,   267,   261,   262,     1,    -1,   265,   273,    -1,    -1,
     276,    -1,    -1,    -1,    -1,   281,    -1,    -1,    -1,   285,
     253,   287,    -1,    -1,   290,    22,    23,    24,    25,    26,
      27,    -1,    -1,    30,   267,    -1,    -1,    -1,    -1,    -1,
     273,    -1,    -1,   329,    -1,     1,   247,    -1,    -1,   250,
      47,    48,    49,    50,   270,    -1,   272,   258,   259,   260,
      -1,    -1,   263,   264,   350,   266,    22,    23,    24,    25,
      26,    27,    69,    70,    30,    72,    -1,    74,     1,    -1,
      -1,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    47,    48,    49,    50,   381,    -1,    -1,    -1,    22,
      -1,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
      -1,     1,    -1,    69,    70,    -1,    72,    -1,    74,    -1,
      -1,    -1,    -1,    79,    -1,    48,    49,    50,    -1,    -1,
      -1,    -1,    22,    -1,    24,    25,    26,    27,    -1,    -1,
      30,    -1,   272,    -1,     1,    -1,    69,    -1,    -1,    -1,
      -1,    74,    -1,    -1,    -1,    -1,    79,    -1,    48,    49,
      -1,    -1,    -1,    -1,    -1,    22,    -1,    24,    25,    26,
      27,    -1,    -1,    30,     1,    -1,    -1,    -1,    -1,    69,
      -1,   467,    -1,    -1,    74,   471,    -1,    -1,    78,    79,
      -1,    48,    49,    -1,    -1,    22,    -1,    24,    25,    26,
      27,    -1,    -1,    30,    -1,    -1,   492,    -1,    -1,    -1,
       1,    -1,    69,    -1,    -1,    -1,   502,    74,    -1,    -1,
      -1,    48,    49,    -1,    -1,   511,   512,    -1,    -1,    -1,
      -1,    22,   518,    24,    25,    26,    27,    -1,    -1,    30,
      -1,    -1,    69,    -1,   241,   242,   243,    74,    -1,    -1,
     247,   248,    -1,   250,   251,    -1,   253,    48,    49,    -1,
     257,   258,   259,   260,    -1,    -1,   263,   264,    68,   266,
     267,   268,   269,   270,    74,    75,   273,    77,    69,   276,
     277,    -1,    -1,    74,   281,   241,   242,   243,   285,    -1,
     287,   247,   248,    -1,   250,   251,    -1,   253,    -1,    -1,
      -1,   257,   258,   259,   260,    -1,    -1,   263,   264,    -1,
     266,   267,   268,   269,   270,    -1,    -1,   273,    -1,    -1,
     276,    -1,    -1,    -1,   247,   281,    -1,   250,    -1,   285,
     253,   287,    -1,    -1,    -1,   258,   259,   260,    -1,    -1,
     263,   264,    -1,   266,   267,    -1,    -1,   270,    -1,    -1,
     273,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   281,    -1,
      -1,     1,   285,   253,   287,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   172,   173,   174,   175,    -1,   267,    -1,    -1,
      -1,    -1,    22,   273,    24,    25,    26,    27,    -1,    -1,
      30,   281,    -1,    -1,    -1,   285,   253,   287,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    48,    49,
     267,    -1,    -1,    -1,    -1,    -1,   273,   274,   275,    -1,
      -1,    -1,    -1,    -1,   281,    -1,   253,    -1,   285,    69,
     287,    -1,    -1,    -1,    74,    -1,    -1,    -1,    -1,    79,
     267,    -1,    -1,    -1,     1,    -1,   273,   274,    -1,    -1,
     277,    -1,    -1,    -1,   281,    -1,    -1,    -1,   285,    -1,
     287,    -1,   253,    -1,    -1,    22,    -1,    24,    25,    26,
      27,    -1,    -1,    30,    -1,    -1,   267,     1,    -1,    -1,
      -1,    -1,   273,   274,   275,    -1,    -1,    -1,    -1,    -1,
     281,    48,    49,    -1,   285,    -1,   287,    -1,    22,    -1,
      24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,    -1,
       1,    -1,    69,    -1,    -1,    -1,    -1,    74,    -1,    -1,
      -1,    -1,    79,     1,    48,    49,    -1,    -1,    -1,    -1,
      -1,    22,    -1,    24,    25,    26,    27,    -1,    -1,    30,
      -1,    -1,    -1,    -1,    22,    69,    24,    25,    26,    27,
      74,    -1,    30,    -1,    -1,    79,     1,    48,    49,    -1,
      22,    -1,    24,    25,    26,    27,    -1,    -1,    30,     1,
      48,    49,    -1,    -1,    -1,    -1,    -1,    22,    69,    24,
      25,    26,    27,    74,    -1,    30,    48,    49,    79,    -1,
      22,    69,    24,    25,    26,    27,    74,    -1,    30,    -1,
      -1,    -1,    -1,    48,    49,    -1,    -1,    69,    -1,    -1,
      -1,    -1,    74,   253,    -1,    -1,    48,    49,    -1,    -1,
      -1,    -1,    -1,    -1,    69,    -1,    -1,   267,    -1,    74,
     270,    -1,    -1,   273,    -1,    -1,    -1,    69,    -1,    -1,
      -1,   281,    74,    -1,    -1,   285,    -1,   287,    38,    39,
      40,    41,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    52,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    65,    -1,    67,    -1,    69,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   253,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     267,    -1,    -1,   270,    -1,    -1,   273,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   281,    -1,    -1,    -1,   285,   253,
     287,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   267,    -1,    -1,    -1,    -1,    -1,   273,
     274,    -1,    -1,    -1,    -1,    -1,    -1,   281,    -1,    -1,
      -1,   285,   253,   287,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   253,   267,    -1,    -1,    -1,
      -1,    -1,   273,    -1,    -1,    -1,    -1,    -1,    -1,   267,
     281,   253,    -1,    -1,   285,   273,   287,    -1,    -1,   277,
      -1,    -1,    -1,   281,    -1,   267,    -1,   285,   253,   287,
      -1,   273,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   281,
      -1,   253,   267,   285,    -1,   287,    -1,    -1,   273,   274,
      -1,    -1,    -1,    -1,    -1,   267,   281,    -1,    -1,    -1,
     285,   273,   287,    -1,    -1,    -1,    -1,    -1,    -1,   281,
      -1,    -1,    -1,   285,    -1,   287,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   271,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   279,
     280,   281,   282,   283,   284,   285,   286,   287,    -1,    -1,
     290
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_int16 yystos[] =
{
       0,   293,   294,     0,   295,    54,   254,   261,   262,   265,
     297,   302,   310,   311,   312,   270,   296,   311,    50,   247,
     250,   252,   258,   259,   260,   263,   264,   266,   314,   315,
     271,   300,   316,   317,    24,   273,   421,   422,    22,    65,
      67,   417,   270,   275,   422,    22,   298,   284,   318,   303,
     300,   316,   274,   270,    24,   272,   273,   307,    22,     1,
      22,    24,    25,    26,    27,    30,    48,    49,    69,    74,
     253,   267,   273,   281,   285,   287,   299,   313,   370,   372,
     381,   383,   385,   386,   387,   388,   389,   390,   391,   392,
     393,   394,   402,   404,   405,   406,   408,   409,   411,   412,
     415,   416,   418,   419,   420,   255,   259,   274,   305,   308,
     309,   311,   312,   304,    42,    43,    44,    45,    53,    60,
      62,    64,    66,    68,   272,   375,   273,   406,   418,   418,
     273,   273,   394,   418,   410,   416,   273,    79,   276,   290,
     315,   367,   368,   370,    22,    55,   273,   396,   397,   401,
     402,   415,   420,   394,   394,   394,   288,   246,   245,   279,
     280,   281,    38,    39,    40,    41,    65,    67,   282,   283,
     284,   285,    52,   271,   286,   289,    55,   273,   290,   273,
     273,   253,    26,    27,   375,   274,   274,   275,   300,   270,
     272,   276,   301,   319,   372,   370,   370,   273,    38,    39,
      40,    41,    52,    65,    67,    69,   271,   279,   280,   281,
     282,   283,   284,   285,   286,   287,   290,   403,   367,   370,
     377,   378,   370,   379,   380,   300,   274,   369,    22,   367,
     273,    55,   373,   382,   384,   386,   387,   388,   390,   390,
     390,   390,   391,   391,   390,   390,   392,   392,   394,   394,
     394,   394,    22,   377,    78,   367,   377,   377,    22,   370,
     255,   305,    22,    30,   422,   320,   275,   275,   367,   291,
     274,   277,   275,   278,   291,   275,   274,   275,   395,   274,
     370,   398,   399,   400,    22,   371,   372,   381,   383,   274,
     407,    78,   291,   274,   274,   306,   270,   270,     1,    23,
      47,    70,    72,   243,   248,   251,   257,   268,   269,   270,
     315,   319,   321,   326,   327,   328,   332,   333,   335,   336,
     340,   342,   345,   352,   354,   366,   367,   376,   423,   425,
     370,   370,   274,   274,   370,   381,   274,   370,   370,   273,
     274,   275,   374,   367,   291,   367,   272,   270,   367,   273,
     329,   338,   273,   273,   270,   270,    30,    69,   273,   285,
     287,   355,   356,   357,   358,   359,   360,   361,   362,   363,
     364,   365,   421,   278,   300,   322,   323,   325,   277,   326,
     241,   242,   270,   270,   327,   275,   413,   275,   278,   398,
     370,   399,   400,   278,   291,   291,   370,   367,   327,   273,
     338,   367,    30,   356,    30,    30,    78,   278,   279,   280,
     281,    38,    41,    39,    40,   282,   283,    65,    67,   284,
     285,    52,   271,   286,    22,   324,   275,   270,   273,   327,
     424,   414,   418,   274,   370,   381,   274,   372,   274,    74,
     315,   339,   346,   274,   274,   355,   273,   357,   358,   359,
     360,   360,   361,   361,   361,   361,   362,   362,   363,   363,
     364,   364,   364,   272,   325,   367,   337,   240,   426,   413,
     413,   353,   330,   322,   275,   278,   315,   344,   351,   367,
     278,   370,   274,   241,   327,   274,   327,   273,   339,   367,
     325,   270,   334,   273,   315,   278,   274,   347,   327,   367,
     322,   367,   343,   350,   367,   274,   274,   274,   327,   270,
     270,   331,   341,   348,   327,   327,   351,   274,   349,   327
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_int16 yyr1[] =
{
       0,   292,   294,   293,   295,   295,   296,   296,   297,   298,
     298,   299,   300,   300,   301,   301,   301,   301,   303,   304,
     302,   302,   302,   305,   306,   305,   307,   307,   307,   308,
     308,   308,   309,   309,   310,   310,   310,   310,   310,   311,
     311,   312,   313,   314,   314,   315,   315,   315,   315,   315,
     315,   315,   315,   315,   316,   316,   317,   318,   317,   320,
     319,   321,   322,   323,   324,   323,   325,   325,   326,   326,
     326,   327,   327,   327,   327,   327,   327,   327,   327,   327,
     327,   327,   327,   327,   327,   327,   327,   327,   329,   330,
     331,   328,   333,   334,   332,   336,   337,   335,   338,   339,
     341,   340,   343,   342,   344,   344,   346,   347,   348,   349,
     345,   350,   350,   351,   351,   353,   352,   354,   354,   355,
     355,   356,   356,   357,   357,   358,   358,   359,   359,   359,
     360,   360,   360,   360,   360,   361,   361,   361,   362,   362,
     362,   363,   363,   363,   363,   364,   364,   365,   365,   365,
     365,   366,   367,   367,   368,   369,   368,   370,   370,   370,
     371,   371,   372,   373,   374,   372,   375,   375,   375,   375,
     375,   375,   375,   375,   375,   375,   375,   376,   376,   377,
     377,   377,   378,   378,   379,   379,   379,   380,   380,   381,
     382,   381,   383,   384,   383,   385,   385,   386,   386,   387,
     387,   388,   388,   388,   389,   389,   389,   389,   389,   390,
     390,   390,   391,   391,   391,   392,   392,   392,   392,   392,
     393,   393,   394,   394,   394,   394,   394,   394,   394,   395,
     394,   396,   396,   397,   397,   397,   398,   398,   398,   399,
     399,   400,   400,   401,   401,   402,   403,   403,   403,   403,
     403,   403,   403,   403,   403,   403,   403,   403,   403,   403,
     403,   403,   403,   403,   403,   404,   404,   404,   405,   406,
     406,   406,   407,   406,   406,   406,   406,   406,   406,   406,
     406,   406,   406,   406,   406,   406,   406,   406,   408,   410,
     409,   411,   412,   413,   413,   414,   415,   415,   416,   416,
     417,   417,   417,   418,   418,   419,   420,   421,   422,   422,
     422,   424,   423,   425,   426,   426
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     0,     2,     3,     0,     0,     1,     5,     0,
       1,     1,     0,     1,     1,     1,     3,     3,     0,     0,
       7,     3,     1,     3,     0,     6,     2,     3,     3,     1,
       3,     1,     1,     3,     1,     1,     1,     1,     1,     0,
       2,     2,     4,     1,     0,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     3,     2,     0,     5,     0,
       4,     3,     2,     1,     0,     4,     1,     3,     0,     2,
       2,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       2,     1,     1,     1,     1,     1,     2,     2,     0,     0,
       0,    11,     0,     0,     7,     0,     0,     9,     0,     2,
       0,    11,     0,     9,     1,     2,     0,     0,     0,     0,
      14,     0,     1,     0,     1,     0,     6,     3,     5,     1,
       1,     1,     3,     1,     3,     1,     3,     1,     3,     3,
       1,     3,     3,     3,     3,     1,     3,     3,     1,     3,
       3,     1,     3,     3,     3,     1,     3,     1,     2,     2,
       2,     2,     1,     2,     1,     0,     4,     1,     3,     3,
       0,     1,     1,     0,     0,     7,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     2,     0,
       1,     2,     1,     3,     0,     1,     2,     3,     5,     1,
       0,     4,     1,     0,     4,     1,     3,     1,     3,     1,
       3,     1,     3,     3,     1,     3,     3,     3,     3,     1,
       3,     3,     1,     3,     3,     1,     3,     3,     3,     3,
       1,     2,     1,     2,     2,     2,     2,     2,     5,     0,
       7,     1,     3,     1,     1,     3,     0,     1,     1,     3,
       3,     1,     0,     1,     1,     4,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     2,     1,     1,     1,     2,     2,     1,     1,
       1,     6,     0,     6,     5,     1,     1,     1,     3,     1,
       1,     1,     5,     5,     1,     4,     4,     4,     3,     0,
       5,     7,     9,     0,     3,     1,     1,     2,     1,     3,
       1,     1,     1,     1,     4,     1,     1,     1,     1,     3,
       3,     0,     4,     4,     0,     2
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Backward compatibility with an undocumented macro.
   Use YYerror or YYUNDEF. */
#define YYERRCODE YYUNDEF


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)




# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Kind, Value); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo,
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  FILE *yyoutput = yyo;
  YY_USE (yyoutput);
  if (!yyvaluep)
    return;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo,
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  YYFPRINTF (yyo, "%s %s (",
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));

  yy_symbol_value_print (yyo, yykind, yyvaluep);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
                 int yyrule)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
                       &yyvsp[(yyi + 1) - (yynrhs)]);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args) ((void) 0)
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
  YY_USE (yyvaluep);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/* Lookahead token kind.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;
/* Number of syntax errors so far.  */
int yynerrs;




/*----------.
| yyparse.  |
`----------*/

int
yyparse (void)
{
    yy_state_fast_t yystate = 0;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus = 0;

    /* Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* Their size.  */
    YYPTRDIFF_T yystacksize = YYINITDEPTH;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

    /* The semantic value stack: array, bottom, top.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs = yyvsa;
    YYSTYPE *yyvsp = yyvs;

  int yyn;
  /* The return value of yyparse.  */
  int yyresult;
  /* Lookahead symbol kind.  */
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yysetstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  YY_IGNORE_USELESS_CAST_BEGIN
  *yyssp = YY_CAST (yy_state_t, yystate);
  YY_IGNORE_USELESS_CAST_END
  YY_STACK_PRINT (yyss, yyssp);

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    YYNOMEM;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        yy_state_t *yyss1 = yyss;
        YYSTYPE *yyvs1 = yyvs;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * YYSIZEOF (*yyssp),
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yy_state_t *yyss1 = yyss;
        union yyalloc *yyptr =
          YY_CAST (union yyalloc *,
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
        if (! yyptr)
          YYNOMEM;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YY_IGNORE_USELESS_CAST_BEGIN
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
                  YY_CAST (long, yystacksize)));
      YY_IGNORE_USELESS_CAST_END

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:
  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex ();
    }

  if (yychar <= YYEOF)
    {
      yychar = YYEOF;
      yytoken = YYSYMBOL_YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else if (yychar == YYerror)
    {
      /* The scanner already issued an error message, process directly
         to error recovery.  But do not keep the error token as
         lookahead, it is too special and may lead us to an endless
         loop in error recovery. */
      yychar = YYUNDEF;
      yytoken = YYSYMBOL_YYerror;
      goto yyerrlab1;
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  /* Discard the shifted token.  */
  yychar = YYEMPTY;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 2: /* $@1: %empty  */
#line 1159 "lang.y"
     { block_depth = 0; }
#line 3065 "lang.c"
    break;

  case 7: /* possible_semi_colon: ';'  */
#line 1165 "lang.y"
                         { yyerror("Extra ';'. Ignored."); }
#line 3071 "lang.c"
    break;

  case 8: /* inheritance: type_modifier_list F_INHERIT string_constant opt_inherit_name ';'  */
#line 1168 "lang.y"
                {
		    struct object *ob;
		    
                    if (mem_block[A_VARIABLES].current_size ||
		        mem_block[A_FUNCTIONS].current_size)
                        yyerror("Inherit after other definitions\n");

		    ob = find_object2((yyvsp[-2].string));
		    if (ob == 0) {
			if (inherit_file)
			    free(inherit_file);
			inherit_file = string_copy((yyvsp[-2].string));
			/* Return back to load_object() */
			YYACCEPT;
		    }
                    if (ob->prog->flags & PRAGMA_NO_INHERIT)
                    {
                        yyerror("Inheriting bad object.\n");
                    }
		    if (!check_inherits(ob->prog))
                    {
			if (inherit_file)
			    free(inherit_file);
			inherit_file = string_copy((yyvsp[-2].string));
			/* Return back to load_object() */
			YYACCEPT;
                    }
		    copy_inherits(ob->prog, (yyvsp[-4].number), (yyvsp[-1].string));
		}
#line 3105 "lang.c"
    break;

  case 9: /* opt_inherit_name: %empty  */
#line 1199 "lang.y"
                {
                    char *n = strrchr((yyvsp[0].string), '/');
                    
                    if (n)
                    {
                        char *s = tmpstring_copy(n + 1);
                        char *p = strchr(s, '.');

                        if (p)
                        {
                            *p = '\0';
                            (yyval.string) = tmpstring_copy(s);
                        }
                        (yyval.string) = s;
                    }
                    else
                        (yyval.string) = tmpstring_copy((yyvsp[0].string));
                }
#line 3128 "lang.c"
    break;

  case 10: /* opt_inherit_name: F_IDENTIFIER  */
#line 1218 "lang.y"
                {
                    (yyval.string) = (yyvsp[0].string);
                }
#line 3136 "lang.c"
    break;

  case 11: /* number: F_NUMBER  */
#line 1223 "lang.y"
        {
	    if ( (yyvsp[0].number) == 0 ) {
		ins_f_byte(F_CONST0); (yyval.type) = TYPE_ANY;
	    } else if ( (yyvsp[0].number) == 1 ) {
		ins_f_byte(F_CONST1); (yyval.type) = TYPE_NUMBER;
	    } else {
		ins_f_byte(F_NUMBER); ins_mem(&(yyvsp[0].number), sizeof((yyvsp[0].number))); (yyval.type) = TYPE_NUMBER;
	    }
	}
#line 3150 "lang.c"
    break;

  case 12: /* optional_star: %empty  */
#line 1233 "lang.y"
                           { (yyval.number) = 0; }
#line 3156 "lang.c"
    break;

  case 13: /* optional_star: '*'  */
#line 1233 "lang.y"
                                             { (yyval.number) = TYPE_MOD_POINTER; }
#line 3162 "lang.c"
    break;

  case 14: /* block_or_semi: block  */
#line 1235 "lang.y"
                     { (yyval.number) = 0; }
#line 3168 "lang.c"
    break;

  case 15: /* block_or_semi: ';'  */
#line 1236 "lang.y"
               { (yyval.number) = ';'; }
#line 3174 "lang.c"
    break;

  case 16: /* block_or_semi: '=' string_con1 ';'  */
#line 1237 "lang.y"
                               { (yyval.string) = (yyvsp[-1].string); }
#line 3180 "lang.c"
    break;

  case 17: /* block_or_semi: '=' F_NUMBER ';'  */
#line 1239 "lang.y"
         {
	     if ((yyvsp[-1].number) != 0)
	     {
		 yyerror("Syntax error");
	     }
	     (yyval.number) = 1;
	 }
#line 3192 "lang.c"
    break;

  case 18: /* $@2: %empty  */
#line 1248 "lang.y"
        {
	    /* Save start of function. */
	    clear_init_arg_stack();
	    deref_index = 0;
	    push_address();
	    try_level = break_try_level = continue_try_level = 0;
	    true_varargs = 0;
	    first_default_arg = current_arg = 0;
	    is_ctor = is_dtor = 0;

	    return_label = make_label();
	    if ((yyvsp[0].string) == CTOR_FUNC)
	    {
		(yyvsp[0].string) = tmpstring_copy(".CTOR");
		is_ctor = 1;
	    }
	    else if ((yyvsp[0].string) == DTOR_FUNC)
	    {
		(yyvsp[0].string) = tmpstring_copy(".DTOR");
		is_dtor = 1;
	    }

	    if (is_ctor | is_dtor)
	    {
		if ((yyvsp[-2].number) | (yyvsp[-1].number))
		{
		    yyerror("Constructors and destructors don't have a type");
		    (yyvsp[-2].number) = (yyvsp[-1].number) = 0;
		}
		if (pragma_strict_types)
		{
		    (yyvsp[-2].number) = exact_types = TYPE_VOID;
		}
		else
		    exact_types = 0;
	    }
	    else if ((yyvsp[-2].number) & TYPE_MASK)
	    {
		exact_types = (yyvsp[-2].number) | (yyvsp[-1].number);
	    } 
	    else 
	    {
		if (pragma_strict_types)
		    yyerror("\"#pragma strict_types\" requires type of function");
		exact_types = 0;
	    }
	}
#line 3244 "lang.c"
    break;

  case 19: /* $@3: %empty  */
#line 1296 "lang.y"
        {
	    /*
	     * Define a prototype. If it is a real function, then the
	     * prototype will be replaced below.
	     */
	    if ((yyvsp[0].number) && is_ctor | is_dtor)
	    {
		yyerror("Constructors and destructors don't take arguments");
	    }

	    ins_f_byte(F_JUMP);
	    push_address();
	    ins_short(0);
	    {
	        int i;
	        unsigned short j;
		i = pop_address();
		push_address();
		dump_init_arg_table((yyvsp[0].number));
		j = mem_block[A_PROGRAM].current_size;
		upd_short(i, (short)mem_block[A_PROGRAM].current_size);
		((char *)mem_block[A_PROGRAM].block)[i] = ((char *)&j)[0];
		((char *)mem_block[A_PROGRAM].block)[i + 1] = ((char *)&j)[1];
		define_new_function((yyvsp[-2].string), (char)(yyvsp[0].number), 0, 0,
				    NAME_PROTOTYPE | (yyvsp[-4].number) | (yyvsp[-3].number) | true_varargs,
				    (char)first_default_arg);
	    }
	}
#line 3277 "lang.c"
    break;

  case 20: /* def: type optional_star fun_identifier $@2 fun_args $@3 block_or_semi  */
#line 1325 "lang.y"
        {
		  
	    /* Either a prototype or a block */
	    if ((yyvsp[0].number) == ';') /* its only a prototype */
	    {
		(void)pop_address(); /* Not used here */
		mem_block[A_PROGRAM].current_size = 
		    pop_address(); 
	    } 
	    else if ((yyvsp[0].number) == 0)
	    {
		define_new_function((yyvsp[-4].string), (char)(yyvsp[-2].number),
				    (unsigned char)(max_number_of_locals - (yyvsp[-2].number)),
				    pop_address(), (yyvsp[-6].number) | (yyvsp[-5].number) | true_varargs,
				    (char)first_default_arg);
		ins_f_byte(F_CONST0);
		set_label(return_label, (short)mem_block[A_PROGRAM].current_size);
		ins_f_byte(F_RETURN);
		(void)pop_address(); /* Not used here */
	    }
	    else if ((yyvsp[0].number) == 1)
	    {
		if (is_ctor | is_dtor)
		    yyerror("Constructors and destructors can't be abstract");
		define_new_function((yyvsp[-4].string), (char)(yyvsp[-2].number), 0, 0,
				    NAME_ABSTRACT | (yyvsp[-6].number) | (yyvsp[-5].number) | true_varargs,
				    (char)first_default_arg);
		yyerror("Abstract functions aren't implemented yet");
	    }
	    else
            {
		extern void (* get_C_fun_address(char *, char *))(struct svalue *);
		void (*funca)(struct svalue *);

		define_new_function((yyvsp[-4].string), (char)(yyvsp[-2].number),
				    (unsigned char)(max_number_of_locals - (yyvsp[-2].number)),
				    pop_address(), (yyvsp[-6].number) | (yyvsp[-5].number) | true_varargs,
				    (char)first_default_arg);
		ins_f_byte(F_CALL_C);
		funca = get_C_fun_address(current_file, (yyvsp[0].string));
		if (!funca) 
                {
		    char buf[256];

		    (void)snprintf(buf, sizeof(buf), "Undefined interface %s() = \"%s\".\n",
			    (yyvsp[-4].string), (yyvsp[0].string));
		    yyerror(buf);
		}
		ins_mem(&funca, sizeof(funca));
		ins_f_byte(F_RETURN);
		(void)pop_address(); /* Not used here */
	    }
	    free_all_local_names();
	    is_ctor = is_dtor = 0;
	}
#line 3337 "lang.c"
    break;

  case 21: /* def: type name_list ';'  */
#line 1380 "lang.y"
                        { if ((yyvsp[-2].number) == 0) yyerror("Missing type"); }
#line 3343 "lang.c"
    break;

  case 23: /* new_arg_name: type optional_star F_IDENTIFIER  */
#line 1384 "lang.y"
        {
	    if (exact_types && (yyvsp[-2].number) == 0) {
		yyerror("Missing type for argument");
		(void)add_local_name((yyvsp[0].string), TYPE_ANY);	/* Supress more errors */
	    } else {
		(void)add_local_name((yyvsp[0].string), (yyvsp[-2].number) | (yyvsp[-1].number));
	    }
	    if (first_default_arg != current_arg)
		yyerror("non default argument defined after default one");
	    else
		first_default_arg++;
	    push_init_arg_address(mem_block[A_PROGRAM].current_size);
	}
#line 3361 "lang.c"
    break;

  case 24: /* $@4: %empty  */
#line 1398 "lang.y"
          {
              int var_num;
	      if (exact_types && (yyvsp[-2].number) == 0) {
		  yyerror("Missing type for argument");
		  var_num = add_local_name((yyvsp[0].string), TYPE_ANY);	/* Supress more errors */
	      } else {
		  var_num = add_local_name((yyvsp[0].string), (yyvsp[-2].number) | (yyvsp[-1].number));
	      }
	      push_init_arg_address(mem_block[A_PROGRAM].current_size);
	      ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
	      ins_byte((char)var_num);
	  }
#line 3378 "lang.c"
    break;

  case 25: /* new_arg_name: type optional_star F_IDENTIFIER $@4 '=' expr0  */
#line 1411 "lang.y"
          {
	      if (!compatible_types((((yyvsp[-5].number) ? (yyvsp[-5].number) : TYPE_ANY) | (yyvsp[-4].number)) & TYPE_MASK, (yyvsp[0].type))){
		  char buff[100];

		  (void)snprintf(buff, sizeof(buff), "Type mismatch %s when initializing %s",
			  get_two_types((yyvsp[-5].number) | (yyvsp[-4].number), (yyvsp[0].type)), (yyvsp[-3].string));
		  yyerror(buff);
	      }
	      ins_f_byte(F_ASSIGN);
	      ins_f_byte(F_POP_VALUE);
	  }
#line 3394 "lang.c"
    break;

  case 26: /* fun_args: '(' ')'  */
#line 1423 "lang.y"
                                { (yyval.number) = 0; }
#line 3400 "lang.c"
    break;

  case 27: /* fun_args: '(' argument ')'  */
#line 1424 "lang.y"
                                { (yyval.number) = (yyvsp[-1].number); }
#line 3406 "lang.c"
    break;

  case 28: /* fun_args: '(' F_VOID ')'  */
#line 1425 "lang.y"
                                { (yyval.number) = 0; }
#line 3412 "lang.c"
    break;

  case 30: /* argument: argument_list ',' F_VARARG  */
#line 1429 "lang.y"
          {
              int var_num = add_local_name(tmpstring_copy("argv"), TYPE_ANY | TYPE_MOD_POINTER);
	      (yyval.number) = (yyvsp[-2].number) + 1;
              true_varargs = TYPE_MOD_TRUE_VARARGS;
	      push_init_arg_address(mem_block[A_PROGRAM].current_size);
	      ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
	      ins_byte((char)var_num);
	      ins_f_byte(F_AGGREGATE);
	      ins_short(0);
	      ins_f_byte(F_ASSIGN);
	      ins_f_byte(F_POP_VALUE);
	      current_arg++;
	  }
#line 3430 "lang.c"
    break;

  case 31: /* argument: F_VARARG  */
#line 1443 "lang.y"
          {
              int var_num = add_local_name(tmpstring_copy("argv"), TYPE_ANY | TYPE_MOD_POINTER);
	      (yyval.number) = 1;
              true_varargs = TYPE_MOD_TRUE_VARARGS;
	      push_init_arg_address(mem_block[A_PROGRAM].current_size);
	      ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
	      ins_byte((char)var_num);
	      ins_f_byte(F_AGGREGATE);
	      ins_short(0);
	      ins_f_byte(F_ASSIGN);
	      ins_f_byte(F_POP_VALUE);
	      current_arg++;
	  }
#line 3448 "lang.c"
    break;

  case 32: /* argument_list: new_arg_name  */
#line 1457 "lang.y"
                            { (yyval.number) = 1; current_arg++; }
#line 3454 "lang.c"
    break;

  case 33: /* argument_list: argument_list ',' new_arg_name  */
#line 1458 "lang.y"
                                              { (yyval.number) = (yyvsp[-2].number) + 1; current_arg++; }
#line 3460 "lang.c"
    break;

  case 34: /* type_modifier: F_NO_MASK  */
#line 1460 "lang.y"
                         { (yyval.number) = TYPE_MOD_NO_MASK; }
#line 3466 "lang.c"
    break;

  case 35: /* type_modifier: F_STATIC  */
#line 1461 "lang.y"
                        { (yyval.number) = TYPE_MOD_STATIC; }
#line 3472 "lang.c"
    break;

  case 36: /* type_modifier: F_PRIVATE  */
#line 1462 "lang.y"
                         { (yyval.number) = TYPE_MOD_PRIVATE; }
#line 3478 "lang.c"
    break;

  case 37: /* type_modifier: F_PUBLIC  */
#line 1463 "lang.y"
                        { (yyval.number) = TYPE_MOD_PUBLIC; }
#line 3484 "lang.c"
    break;

  case 38: /* type_modifier: F_VARARGS  */
#line 1464 "lang.y"
                         { (yyval.number) = TYPE_MOD_VARARGS; }
#line 3490 "lang.c"
    break;

  case 39: /* type_modifier_list: %empty  */
#line 1466 "lang.y"
                                { (yyval.number) = 0; }
#line 3496 "lang.c"
    break;

  case 40: /* type_modifier_list: type_modifier type_modifier_list  */
#line 1467 "lang.y"
                                                     { (yyval.number) = (yyvsp[-1].number) | (yyvsp[0].number); }
#line 3502 "lang.c"
    break;

  case 41: /* type: type_modifier_list opt_basic_type  */
#line 1469 "lang.y"
                                        { (yyval.number) = (yyvsp[-1].number) | (yyvsp[0].number); current_type = (yyval.number); }
#line 3508 "lang.c"
    break;

  case 42: /* cast: '(' basic_type optional_star ')'  */
#line 1472 "lang.y"
        {
	    (yyval.type) = (yyvsp[-2].number) | (yyvsp[-1].number);
	}
#line 3516 "lang.c"
    break;

  case 44: /* opt_basic_type: %empty  */
#line 1476 "lang.y"
                                         { (yyval.number) = TYPE_UNKNOWN; }
#line 3522 "lang.c"
    break;

  case 45: /* basic_type: F_STATUS  */
#line 1478 "lang.y"
                     { (yyval.number) = TYPE_NUMBER; current_type = (yyval.number); }
#line 3528 "lang.c"
    break;

  case 46: /* basic_type: F_INT  */
#line 1479 "lang.y"
                { (yyval.number) = TYPE_NUMBER; current_type = (yyval.number); }
#line 3534 "lang.c"
    break;

  case 47: /* basic_type: F_STRING_DECL  */
#line 1480 "lang.y"
                        { (yyval.number) = TYPE_STRING; current_type = (yyval.number); }
#line 3540 "lang.c"
    break;

  case 48: /* basic_type: F_OBJECT  */
#line 1481 "lang.y"
                   { (yyval.number) = TYPE_OBJECT; current_type = (yyval.number); }
#line 3546 "lang.c"
    break;

  case 49: /* basic_type: F_VOID  */
#line 1482 "lang.y"
                 {(yyval.number) = TYPE_VOID; current_type = (yyval.number); }
#line 3552 "lang.c"
    break;

  case 50: /* basic_type: F_MIXED  */
#line 1483 "lang.y"
                  { (yyval.number) = TYPE_ANY; current_type = (yyval.number); }
#line 3558 "lang.c"
    break;

  case 51: /* basic_type: F_MAPPING  */
#line 1484 "lang.y"
                    { (yyval.number) = TYPE_MAPPING; current_type = (yyval.number); }
#line 3564 "lang.c"
    break;

  case 52: /* basic_type: F_FLOAT  */
#line 1485 "lang.y"
                  { (yyval.number) = TYPE_FLOAT; current_type = (yyval.number); }
#line 3570 "lang.c"
    break;

  case 53: /* basic_type: F_FUNCTION  */
#line 1486 "lang.y"
                     { (yyval.number) = TYPE_FUNCTION; current_type = (yyval.number); }
#line 3576 "lang.c"
    break;

  case 56: /* new_name: optional_star F_IDENTIFIER  */
#line 1492 "lang.y"
        {
	    define_variable((yyvsp[0].string), current_type | (yyvsp[-1].number));
	}
#line 3584 "lang.c"
    break;

  case 57: /* $@5: %empty  */
#line 1496 "lang.y"
        {
	    define_variable((yyvsp[0].string), current_type | (yyvsp[-1].number));
	    transfer_init_control();
	    ins_f_byte(F_PUSH_IDENTIFIER_LVALUE);
	    ins_byte((char)variable_inherit_found);
	    ins_byte((char)variable_index_found);
	}
#line 3596 "lang.c"
    break;

  case 58: /* new_name: optional_star F_IDENTIFIER $@5 '=' expr0  */
#line 1504 "lang.y"
        {
	    if (pragma_strict_types &&
		!compatible_types((current_type | (yyvsp[-4].number)) & TYPE_MASK, (yyvsp[0].type))){
		char buff[100];

		(void)snprintf(buff, sizeof(buff), "Type mismatch %s when initializing %s",
			get_two_types(current_type | (yyvsp[-4].number), (yyvsp[0].type)), (yyvsp[-3].string));
		yyerror(buff);
	    }
	    ins_f_byte(F_ASSIGN);
	    ins_f_byte(F_POP_VALUE);
	    add_new_init_jump();
	}
#line 3614 "lang.c"
    break;

  case 59: /* $@6: %empty  */
#line 1519 "lang.y"
        {
		start_block();
        }
#line 3622 "lang.c"
    break;

  case 60: /* block: '{' $@6 statements '}'  */
#line 1523 "lang.y"
        {
		end_block();
        }
#line 3630 "lang.c"
    break;

  case 61: /* local_declaration: basic_type local_name_list ';'  */
#line 1527 "lang.y"
                                                  { ;}
#line 3636 "lang.c"
    break;

  case 62: /* new_local_name2: optional_star F_IDENTIFIER  */
#line 1530 "lang.y"
        {
            (yyval.number) = add_local_name((yyvsp[0].string), current_type | (yyvsp[-1].number));
        }
#line 3644 "lang.c"
    break;

  case 63: /* new_local_name: new_local_name2  */
#line 1535 "lang.y"
        { /* To shut bison up */ }
#line 3650 "lang.c"
    break;

  case 64: /* $@7: %empty  */
#line 1537 "lang.y"
        {
            ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
            ins_byte((char)(yyvsp[0].number));
        }
#line 3659 "lang.c"
    break;

  case 65: /* new_local_name: new_local_name2 $@7 '=' expr0  */
#line 1542 "lang.y"
        {
            if (exact_types &&
                !compatible_types(type_of_locals[(yyvsp[-3].number)] & TYPE_MASK, (yyvsp[0].type)))
            {
                char buff[100];

                (void)snprintf(buff, sizeof(buff),
			       "Type mismatch %s when initializing %s",
			       get_two_types(type_of_locals[(yyvsp[-3].number)], (yyvsp[0].type)),
			       local_names[(yyvsp[-3].number)]);
                yyerror(buff);
            }
            ins_f_byte(F_ASSIGN);
            ins_f_byte(F_POP_VALUE);
        }
#line 3679 "lang.c"
    break;

  case 71: /* statement: comma_expr ';'  */
#line 1567 "lang.y"
        {
	    ins_f_byte(F_POP_VALUE);
	    /* if (exact_types && !TYPE($1,TYPE_VOID))
		yyerror("Value thrown away"); */
	}
#line 3689 "lang.c"
    break;

  case 86: /* statement: F_BREAK ';'  */
#line 1576 "lang.y"
                {
		    if (current_break_address == 0)
			yyerror("break statement outside loop");
		    for (int i = try_level; i > break_try_level; i--)
			ins_f_byte(F_END_TRY);
		    ins_f_byte(F_JUMP);
		    add_jump();
		    ins_label(current_break_address);
		}
#line 3703 "lang.c"
    break;

  case 87: /* statement: F_CONTINUE ';'  */
#line 1586 "lang.y"
                {
		    if (current_continue_address == 0)
			yyerror("continue statement outside loop");
		    for (int i = try_level; i > continue_try_level; i--)
			ins_f_byte(F_END_TRY);
		    ins_f_byte(F_JUMP);
		    add_jump();
		    ins_label(current_continue_address);
		}
#line 3717 "lang.c"
    break;

  case 88: /* $@8: %empty  */
#line 1598 "lang.y"
        {
	    ins_f_byte(F_TRY);
	    push_address();
	    ins_short(0);
	    ins_byte(0);
	    try_level++;
	}
#line 3729 "lang.c"
    break;

  case 89: /* $@9: %empty  */
#line 1604 "lang.y"
                            {start_block();}
#line 3735 "lang.c"
    break;

  case 90: /* $@10: %empty  */
#line 1605 "lang.y"
        {
	    short try_start = pop_address();	    
	    try_level--;
	    ins_f_byte(F_END_TRY);
	    ins_f_byte(F_JUMP);
	    push_address();
	    ins_short(0);
	    upd_short(try_start,
		      (short)mem_block[A_PROGRAM].current_size);
	    upd_byte(try_start + 2, (yyvsp[-1].number));
	}
#line 3751 "lang.c"
    break;

  case 91: /* try: F_TRY $@8 statement F_CATCH $@9 '(' basic_type new_local_name2 ')' $@10 statement  */
#line 1616 "lang.y"
        {
	    end_block();
	    upd_short(pop_address(),
		      (short)mem_block[A_PROGRAM].current_size);
	}
#line 3761 "lang.c"
    break;

  case 92: /* $@11: %empty  */
#line 1623 "lang.y"
        {   push_explicit(current_continue_address);
	    push_explicit(continue_try_level);
	    push_explicit(current_break_address);
	    push_explicit(break_try_level);
	    current_continue_address = make_label();
	    current_break_address = make_label();
	    continue_try_level = break_try_level = try_level;
	    set_label(current_continue_address, (short)mem_block[A_PROGRAM].current_size);
	}
#line 3775 "lang.c"
    break;

  case 93: /* $@12: %empty  */
#line 1632 "lang.y"
        {
	    ins_f_byte(F_JUMP_WHEN_ZERO);
	    add_jump();
	    ins_label(current_break_address);
	}
#line 3785 "lang.c"
    break;

  case 94: /* while: $@11 F_WHILE '(' comma_expr ')' $@12 statement  */
#line 1638 "lang.y"
        {
	  ins_f_byte(F_JUMP);
	  add_jump();
	  ins_label(current_continue_address);
	  set_label(current_break_address, (short)mem_block[A_PROGRAM].current_size);
	  break_try_level = pop_address();
	  current_break_address = pop_address();
	  continue_try_level = pop_address();
	  current_continue_address = pop_address();
        }
#line 3800 "lang.c"
    break;

  case 95: /* $@13: %empty  */
#line 1649 "lang.y"
    {
        push_explicit(current_continue_address);
	push_explicit(continue_try_level);
	push_explicit(current_break_address);
	push_explicit(break_try_level);
	current_continue_address = make_label();
	current_break_address = make_label();
	continue_try_level = break_try_level = try_level;
        push_address();
    }
#line 3815 "lang.c"
    break;

  case 96: /* $@14: %empty  */
#line 1660 "lang.y"
    {
	set_label(current_continue_address, (short)mem_block[A_PROGRAM].current_size);
    }
#line 3823 "lang.c"
    break;

  case 97: /* do: $@13 F_DO statement $@14 F_WHILE '(' comma_expr ')' ';'  */
#line 1664 "lang.y"
    {
	ins_f_byte(F_JUMP_WHEN_NON_ZERO);
	add_jump();
	ins_short((short)pop_address());
	set_label(current_break_address, (short)mem_block[A_PROGRAM].current_size);
	break_try_level = pop_address();
	current_break_address = pop_address();
	continue_try_level = pop_address();
	current_continue_address = pop_address();
    }
#line 3838 "lang.c"
    break;

  case 98: /* start_block: %empty  */
#line 1676 "lang.y"
    { start_block();}
#line 3844 "lang.c"
    break;

  case 99: /* foreach_var: basic_type new_local_name2  */
#line 1678 "lang.y"
                                        {
            ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
            ins_byte((char)(yyvsp[0].number));
	}
#line 3853 "lang.c"
    break;

  case 100: /* $@15: %empty  */
#line 1683 "lang.y"
                                                                                    {
          ins_f_byte(F_DUP);
          ins_f_byte(F_M_INDEXES);
	  ins_f_byte(F_CONST0);
          push_explicit(current_continue_address);
	  push_explicit(continue_try_level);
	  push_explicit(current_break_address);
	  push_explicit(break_try_level);
	  current_continue_address = make_label();
	  current_break_address = make_label();
	  continue_try_level = break_try_level = try_level;
	  set_label(current_continue_address, get_address());
	  ins_f_byte(F_FOREACH_M);
          add_jump();
	  ins_label(current_break_address);
	}
#line 3874 "lang.c"
    break;

  case 101: /* foreach_m: F_FOREACH start_block '(' foreach_var ',' foreach_var ':' comma_expr ')' $@15 statement  */
#line 1700 "lang.y"
        {
            ins_f_byte(F_JUMP);
            add_jump();
            ins_label(current_continue_address);
            set_label(current_break_address, get_address());
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            end_block();
	    break_try_level = pop_address();
            current_break_address = pop_address();
	    continue_try_level = pop_address();
            current_continue_address = pop_address();
	}
#line 3895 "lang.c"
    break;

  case 102: /* $@16: %empty  */
#line 1717 "lang.y"
                                                                  {
	  ins_f_byte(F_CONST0);
          push_explicit(current_continue_address);
	  push_explicit(continue_try_level);
	  push_explicit(current_break_address);
	  push_explicit(break_try_level);
	  current_continue_address = make_label();
	  current_break_address = make_label();
	  continue_try_level = break_try_level = try_level;
	  set_label(current_continue_address, get_address());
	  ins_f_byte(F_FOREACH);
          add_jump();
	  ins_label(current_break_address);
	}
#line 3914 "lang.c"
    break;

  case 103: /* foreach: F_FOREACH start_block '(' foreach_var ':' comma_expr ')' $@16 statement  */
#line 1732 "lang.y"
        {
            ins_f_byte(F_JUMP);
            add_jump();
            ins_label(current_continue_address);
            set_label(current_break_address, get_address());
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            ins_f_byte(F_POP_VALUE);
            end_block();
	    break_try_level = pop_address();
            current_break_address = pop_address();
	    continue_try_level = pop_address();
            current_continue_address = pop_address();
	}
#line 3933 "lang.c"
    break;

  case 105: /* for_init_expr: basic_type local_name_list  */
#line 1748 "lang.y"
                                     {;}
#line 3939 "lang.c"
    break;

  case 106: /* $@17: %empty  */
#line 1750 "lang.y"
                             { 
    push_explicit(current_continue_address);
    push_explicit(continue_try_level);
    push_explicit(current_break_address);
    push_explicit(break_try_level);
    continue_try_level = break_try_level = try_level;
    }
#line 3951 "lang.c"
    break;

  case 107: /* $@18: %empty  */
#line 1756 "lang.y"
                        {
		      push_address();
		  }
#line 3959 "lang.c"
    break;

  case 108: /* $@19: %empty  */
#line 1759 "lang.y"
                   {
		    push_address();
		    ins_short(0);
		    current_continue_address = make_label();
		    current_break_address = make_label();
		    ins_f_byte(F_JUMP);
		    add_jump();
		    ins_label(current_break_address);
		    set_label(current_continue_address, (short)mem_block[A_PROGRAM].current_size);
		  }
#line 3974 "lang.c"
    break;

  case 109: /* $@20: %empty  */
#line 1769 "lang.y"
                  {
		    upd_short(pop_address(), (short)(mem_block[A_PROGRAM].current_size + 3));
		    ins_f_byte(F_JUMP);
		    add_jump();
		    ins_short((short)pop_address());
		  }
#line 3985 "lang.c"
    break;

  case 110: /* for: F_FOR '(' start_block $@17 for_init_expr ';' $@18 for_guard ';' $@19 for_expr ')' $@20 statement  */
#line 1776 "lang.y"
   {
       ins_f_byte(F_JUMP);
       add_jump();
       ins_label(current_continue_address);
       set_label(current_break_address, (short)mem_block[A_PROGRAM].current_size);
       end_block();
       break_try_level = pop_address();
       current_break_address = pop_address();
       continue_try_level = pop_address();
       current_continue_address = pop_address();
   }
#line 4001 "lang.c"
    break;

  case 111: /* for_guard: %empty  */
#line 1789 "lang.y"
        {
	    ins_f_byte(F_JUMP);
	    add_jump();
	}
#line 4010 "lang.c"
    break;

  case 112: /* for_guard: comma_expr  */
#line 1794 "lang.y"
        {
	    ins_f_byte(F_JUMP_WHEN_NON_ZERO);
	    add_jump();
	}
#line 4019 "lang.c"
    break;

  case 114: /* for_expr: comma_expr  */
#line 1801 "lang.y"
                     { ins_f_byte(F_POP_VALUE); }
#line 4025 "lang.c"
    break;

  case 115: /* $@21: %empty  */
#line 1804 "lang.y"
      {
	  /* initialize switch */
	  push_explicit(current_case_number_heap);
	  push_explicit(current_case_string_heap);
	  push_explicit(zero_case_label);
	  push_explicit(current_break_address);
	  push_explicit(break_try_level);
	  break_try_level = try_level;
	  push_explicit(current_case_address);

	  ins_f_byte(F_SWITCH);
	  current_case_address = mem_block[A_PROGRAM].current_size;
	  ins_byte((char)0xff); /* kind of table */
	  current_case_number_heap = mem_block[A_CASE_NUMBERS].current_size;
	  current_case_string_heap = mem_block[A_CASE_STRINGS].current_size;
	  zero_case_label = NO_STRING_CASE_LABELS;
	  ins_short(0); /* address of table */
	  ins_short(0); /* break address to push, table is entered before */
	  ins_short(0); /* default address */

	  current_break_address = make_label();
      }
#line 4052 "lang.c"
    break;

  case 116: /* switch: F_SWITCH '(' comma_expr ')' $@21 statement  */
#line 1827 "lang.y"
      {
	  int block_index;
	  int current_case_heap;
	  short default_addr;

	  /* Wrap up switch */
	  /* It is not unusual that the last case/default has no break 
	   */
	  /* Default address */
	  if (!(default_addr = read_short(current_case_address + 5)))
	  {
	      upd_short(current_case_address + 5,   /* no default given ->  */
			(short)mem_block[A_PROGRAM].current_size);  /* create one   */
	      default_addr = mem_block[A_PROGRAM].current_size;
	  }

	  ins_f_byte(F_JUMP);
	  add_jump();
	  ins_label(current_break_address);

	  /* Table address */
	  upd_short(current_case_address + 1,
		    (short)mem_block[A_PROGRAM].current_size);

	  /* What type of table? */
	  if (zero_case_label & (NO_STRING_CASE_LABELS|SOME_NUMERIC_CASE_LABELS))
	  {
	      block_index = A_CASE_NUMBERS;
	      current_case_heap = current_case_number_heap;
	      mem_block[A_PROGRAM].block[current_case_address] = 0;
	  } 
	  else 
	  {
	      block_index = A_CASE_STRINGS;
	      current_case_heap = current_case_string_heap;
	      mem_block[A_PROGRAM].block[current_case_address] = 1;
	      if (zero_case_label & 0xffff) 
	      {
		  ins_long_long(0); /* not used */
		  ins_short((short)zero_case_label); /* the address */
	      }
	      else
	      {
		  ins_long_long(0); /* not used */
		  ins_short(default_addr); /* the address */
	      }
	  }
	  
	  /* Dump the table */
	  {
	      struct case_heap_entry *ent, *end;

	      ent = (struct case_heap_entry *)
		  (mem_block[block_index].block + current_case_heap);
	      end = (struct case_heap_entry *)
		  (mem_block[block_index].block +
		   mem_block[block_index].current_size);
	      for (; ent < end; ent++)
	      {
		  ins_long_long(ent->key);
		  ins_short(ent->addr);
	      }
	  }

	  /* Break address */
	  upd_short(current_case_address + 3, 
		    (short)mem_block[A_PROGRAM].current_size);
	  set_label(current_break_address, 
		    (short)mem_block[A_PROGRAM].current_size);

	  mem_block[A_CASE_NUMBERS].current_size = current_case_number_heap;
	  mem_block[A_CASE_STRINGS].current_size = current_case_string_heap;
	  current_case_address = pop_address();
	  break_try_level = pop_address();
	  current_break_address = pop_address();
	  zero_case_label = pop_address();
	  current_case_string_heap = pop_address();
	  current_case_number_heap = pop_address();
      }
#line 4136 "lang.c"
    break;

  case 117: /* case: F_CASE case_label ':'  */
#line 1909 "lang.y"
    {
	/* Register label */
	struct case_heap_entry temp;

	if ( !current_case_address ) 
	{
	    yyerror("Case outside switch");
	    break;
	}
	temp.key = (yyvsp[-1].case_label).key;
	temp.addr = mem_block[A_PROGRAM].current_size;
	temp.line = current_line;
	add_to_case_heap((yyvsp[-1].case_label).block,&temp, NULL);

    }
#line 4156 "lang.c"
    break;

  case 118: /* case: F_CASE case_label F_RANGE case_label ':'  */
#line 1925 "lang.y"
    {
	/* Register range label */
	struct case_heap_entry temp1, temp2;

	if ( !current_case_address) 
	{
	    yyerror("Case outside switch");
	    break;
	}

	if ((yyvsp[-3].case_label).block != (yyvsp[-1].case_label).block)
	    yyerror("Incompatible types in case label range bounds");
	else
	{
	    temp1.key = (yyvsp[-3].case_label).key;
	    temp1.addr = -1;
	    temp1.line = current_line;
	    temp2.key = (yyvsp[-1].case_label).key;
	    temp2.addr = mem_block[A_PROGRAM].current_size;
	    temp2.line = current_line;
	    add_to_case_heap((yyvsp[-3].case_label).block, &temp1, &temp2);
	}
    }
#line 4184 "lang.c"
    break;

  case 119: /* case_label: constant  */
#line 1951 "lang.y"
        {
	    if ( !(zero_case_label & NO_STRING_CASE_LABELS) )
		yyerror("Mixed case label list not allowed");
	    if ( ((yyval.case_label).key = (yyvsp[0].number)) != 0 )
	        zero_case_label |= SOME_NUMERIC_CASE_LABELS;
	    else
		zero_case_label |= mem_block[A_PROGRAM].current_size;
	    (yyval.case_label).block = A_CASE_NUMBERS;
	}
#line 4198 "lang.c"
    break;

  case 120: /* case_label: string_constant  */
#line 1961 "lang.y"
        {
	    if ( zero_case_label & SOME_NUMERIC_CASE_LABELS )
		yyerror("Mixed case label list not allowed");
	    zero_case_label &= ~NO_STRING_CASE_LABELS;
            (yyval.case_label).key = (unsigned short)store_prog_string((yyvsp[0].string));
	    (yyval.case_label).block = A_CASE_STRINGS;
        }
#line 4210 "lang.c"
    break;

  case 122: /* constant: constant '|' const1  */
#line 1971 "lang.y"
                              { (yyval.number) = (yyvsp[-2].number) | (yyvsp[0].number); }
#line 4216 "lang.c"
    break;

  case 124: /* const1: const1 '^' const2  */
#line 1974 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) ^ (yyvsp[0].number); }
#line 4222 "lang.c"
    break;

  case 126: /* const2: const2 '&' const3  */
#line 1977 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) & (yyvsp[0].number); }
#line 4228 "lang.c"
    break;

  case 128: /* const3: const3 F_EQ const4  */
#line 1980 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) == (yyvsp[0].number); }
#line 4234 "lang.c"
    break;

  case 129: /* const3: const3 F_NE const4  */
#line 1981 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) != (yyvsp[0].number); }
#line 4240 "lang.c"
    break;

  case 131: /* const4: const4 '>' const5  */
#line 1984 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) >  (yyvsp[0].number); }
#line 4246 "lang.c"
    break;

  case 132: /* const4: const4 F_GE const5  */
#line 1985 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) >= (yyvsp[0].number); }
#line 4252 "lang.c"
    break;

  case 133: /* const4: const4 '<' const5  */
#line 1986 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) <  (yyvsp[0].number); }
#line 4258 "lang.c"
    break;

  case 134: /* const4: const4 F_LE const5  */
#line 1987 "lang.y"
                           { (yyval.number) = (yyvsp[-2].number) <= (yyvsp[0].number); }
#line 4264 "lang.c"
    break;

  case 136: /* const5: const5 F_LSH const6  */
#line 1990 "lang.y"
                            { (yyval.number) = (yyvsp[-2].number) << (yyvsp[0].number); }
#line 4270 "lang.c"
    break;

  case 137: /* const5: const5 F_RSH const6  */
#line 1991 "lang.y"
                            { (yyval.number) = (unsigned)(yyvsp[-2].number) >> (yyvsp[0].number); }
#line 4276 "lang.c"
    break;

  case 139: /* const6: const6 '+' const7  */
#line 1994 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) + (yyvsp[0].number); }
#line 4282 "lang.c"
    break;

  case 140: /* const6: const6 '-' const7  */
#line 1995 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) - (yyvsp[0].number); }
#line 4288 "lang.c"
    break;

  case 142: /* const7: const7 '*' const8  */
#line 1998 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) * (yyvsp[0].number); }
#line 4294 "lang.c"
    break;

  case 143: /* const7: const7 F_MOD const8  */
#line 1999 "lang.y"
                            { (yyval.number) = (yyvsp[-2].number) % (yyvsp[0].number); }
#line 4300 "lang.c"
    break;

  case 144: /* const7: const7 '/' const8  */
#line 2000 "lang.y"
                          { (yyval.number) = (yyvsp[-2].number) / (yyvsp[0].number); }
#line 4306 "lang.c"
    break;

  case 146: /* const8: '(' constant ')'  */
#line 2003 "lang.y"
                         { (yyval.number) = (yyvsp[-1].number); }
#line 4312 "lang.c"
    break;

  case 148: /* const9: '-' F_NUMBER  */
#line 2006 "lang.y"
                       { (yyval.number) = -(yyvsp[0].number); }
#line 4318 "lang.c"
    break;

  case 149: /* const9: F_NOT F_NUMBER  */
#line 2007 "lang.y"
                       { (yyval.number) = !(yyvsp[0].number); }
#line 4324 "lang.c"
    break;

  case 150: /* const9: '~' F_NUMBER  */
#line 2008 "lang.y"
                       { (yyval.number) = ~(yyvsp[0].number); }
#line 4330 "lang.c"
    break;

  case 151: /* default: F_DEFAULT ':'  */
#line 2011 "lang.y"
    {
	if ( !current_case_address) 
        {
	    yyerror("Default outside switch");
	    break;
	}
	if ( read_short(current_case_address + 5 ) )
	    yyerror("Duplicate default");
	upd_short(current_case_address + 5, 
            (short)mem_block[A_PROGRAM].current_size);
    }
#line 4346 "lang.c"
    break;

  case 153: /* comma_expr: F_THROW comma_expr  */
#line 2025 "lang.y"
                          { ins_f_byte(F_THROW); (yyval.type) = TYPE_NONE; }
#line 4352 "lang.c"
    break;

  case 154: /* c_expr: expr0  */
#line 2027 "lang.y"
              { (yyval.type) = (yyvsp[0].type); }
#line 4358 "lang.c"
    break;

  case 155: /* $@22: %empty  */
#line 2028 "lang.y"
                   { ins_f_byte(F_POP_VALUE); }
#line 4364 "lang.c"
    break;

  case 156: /* c_expr: c_expr $@22 ',' expr0  */
#line 2030 "lang.y"
        { (yyval.type) = (yyvsp[0].type); }
#line 4370 "lang.c"
    break;

  case 158: /* expr0: lvalue assign expr0  */
#line 2034 "lang.y"
        {
	    deref_index--;
	    if (!((yyvsp[-2].type) & TYPE_LVALUE))
		yyerror("Illegal LHS");
	    (yyvsp[-2].type) &= ~TYPE_LVALUE;
	    if (exact_types && !compatible_types((yyvsp[-2].type), (yyvsp[0].type)) &&
		!((yyvsp[-2].type) == TYPE_STRING && (yyvsp[0].type) == TYPE_NUMBER && (yyvsp[-1].number) == F_ADD_EQ) &&
		!(((yyvsp[-2].type) == TYPE_STRING || ((yyvsp[-2].type) & TYPE_MOD_POINTER)) &&
		  (yyvsp[0].type) == TYPE_NUMBER && (yyvsp[-1].number) == F_MULT_EQ))
		type_error("Bad assignment. Rhs", (yyvsp[0].type));
	    ins_f_byte((unsigned)(yyvsp[-1].number));
	    (yyval.type) = (yyvsp[0].type);
	}
#line 4388 "lang.c"
    break;

  case 159: /* expr0: error assign expr01  */
#line 2047 "lang.y"
                           { yyerror("Illegal LHS"); (yyval.type) = TYPE_ANY; }
#line 4394 "lang.c"
    break;

  case 160: /* opt_expr01: %empty  */
#line 2049 "lang.y"
            { (yyval.type) = TYPE_NONE;}
#line 4400 "lang.c"
    break;

  case 162: /* expr01: expr1  */
#line 2052 "lang.y"
              { (yyval.type) = (yyvsp[0].type); }
#line 4406 "lang.c"
    break;

  case 163: /* $@23: %empty  */
#line 2054 "lang.y"
        {
	    push_address();
	    ins_f_byte(F_JUMP_WHEN_ZERO);
	    add_jump();
	    push_address();
	    ins_short(0);
	}
#line 4418 "lang.c"
    break;

  case 164: /* $@24: %empty  */
#line 2062 "lang.y"
        {
	    int i;
	    i = pop_address();
	    if ((yyvsp[0].type) != TYPE_NONE)
	    {
	      (void)pop_address();
	      ins_f_byte(F_JUMP);
	      add_jump();
	      push_address();
	      ins_short(0);
	      upd_short(i, (short)mem_block[A_PROGRAM].current_size);
	    }
	    else
	    {
	      mem_block[A_PROGRAM].current_size = pop_address();
	      ins_f_byte(F_SKIP_NZ);
	      push_address();
	      ins_short(0);
	      (yyvsp[0].type) = (yyvsp[-3].type);
	    }
	}
#line 4444 "lang.c"
    break;

  case 165: /* expr01: expr1 '?' $@23 opt_expr01 $@24 ':' expr01  */
#line 2084 "lang.y"
        {
	    upd_short(pop_address(), (short)mem_block[A_PROGRAM].current_size);
	    if (exact_types && !compatible_types((yyvsp[-3].type), (yyvsp[0].type))) {
		type_error("Different types in ?: expr", (yyvsp[-3].type));
		type_error("                      and ", (yyvsp[0].type));
	    }
	    if ((yyvsp[-3].type) == TYPE_ANY) (yyval.type) = (yyvsp[0].type);
	    else if ((yyvsp[0].type) == TYPE_ANY) (yyval.type) = (yyvsp[-3].type);
	    else if (TYPE((yyvsp[-3].type), TYPE_MOD_POINTER|TYPE_ANY)) (yyval.type) = (yyvsp[0].type);
	    else if (TYPE((yyvsp[0].type), TYPE_MOD_POINTER|TYPE_ANY)) (yyval.type) = (yyvsp[-3].type);
	    else (yyval.type) = (yyvsp[-3].type);
	}
#line 4461 "lang.c"
    break;

  case 166: /* assign: '='  */
#line 2097 "lang.y"
            { (yyval.number) = F_ASSIGN; }
#line 4467 "lang.c"
    break;

  case 167: /* assign: F_AND_EQ  */
#line 2098 "lang.y"
                 { (yyval.number) = F_AND_EQ; }
#line 4473 "lang.c"
    break;

  case 168: /* assign: F_OR_EQ  */
#line 2099 "lang.y"
                { (yyval.number) = F_OR_EQ; }
#line 4479 "lang.c"
    break;

  case 169: /* assign: F_XOR_EQ  */
#line 2100 "lang.y"
                 { (yyval.number) = F_XOR_EQ; }
#line 4485 "lang.c"
    break;

  case 170: /* assign: F_LSH_EQ  */
#line 2101 "lang.y"
                 { (yyval.number) = F_LSH_EQ; }
#line 4491 "lang.c"
    break;

  case 171: /* assign: F_RSH_EQ  */
#line 2102 "lang.y"
                 { (yyval.number) = F_RSH_EQ; }
#line 4497 "lang.c"
    break;

  case 172: /* assign: F_ADD_EQ  */
#line 2103 "lang.y"
                 { (yyval.number) = F_ADD_EQ; }
#line 4503 "lang.c"
    break;

  case 173: /* assign: F_SUB_EQ  */
#line 2104 "lang.y"
                 { (yyval.number) = F_SUB_EQ; }
#line 4509 "lang.c"
    break;

  case 174: /* assign: F_MULT_EQ  */
#line 2105 "lang.y"
                  { (yyval.number) = F_MULT_EQ; }
#line 4515 "lang.c"
    break;

  case 175: /* assign: F_MOD_EQ  */
#line 2106 "lang.y"
                 { (yyval.number) = F_MOD_EQ; }
#line 4521 "lang.c"
    break;

  case 176: /* assign: F_DIV_EQ  */
#line 2107 "lang.y"
                 { (yyval.number) = F_DIV_EQ; }
#line 4527 "lang.c"
    break;

  case 177: /* return: F_RETURN  */
#line 2110 "lang.y"
        {
	    if (exact_types && !TYPE(exact_types, TYPE_VOID))
		type_error("Must return a value for a function declared",
			   exact_types);
	    ins_f_byte(F_CONST0);
	    for (int i = try_level;i > 0; i--)
		ins_f_byte(F_END_TRY);
	    ins_f_byte(F_JUMP);
	    add_jump();
	    ins_label(return_label);
	}
#line 4543 "lang.c"
    break;

  case 178: /* return: F_RETURN comma_expr  */
#line 2122 "lang.y"
        {
	    if (exact_types && !TYPE((yyvsp[0].type), exact_types & TYPE_MASK))
		type_error("Return type not matching", exact_types);
	    for (int i = try_level; i > 0; i--)
		ins_f_byte(F_END_TRY);
	    ins_f_byte(F_JUMP);
	    add_jump();
	    ins_label(return_label);
	}
#line 4557 "lang.c"
    break;

  case 179: /* expr_list: %empty  */
#line 2132 "lang.y"
                                { (yyval.number) = 0; }
#line 4563 "lang.c"
    break;

  case 180: /* expr_list: expr_list2  */
#line 2133 "lang.y"
                                { (yyval.number) = (yyvsp[0].number); }
#line 4569 "lang.c"
    break;

  case 181: /* expr_list: expr_list2 ','  */
#line 2134 "lang.y"
                                { (yyval.number) = (yyvsp[-1].number); }
#line 4575 "lang.c"
    break;

  case 182: /* expr_list2: expr0  */
#line 2136 "lang.y"
                                { (yyval.number) = 1; add_arg_type((yyvsp[0].type)); }
#line 4581 "lang.c"
    break;

  case 183: /* expr_list2: expr_list2 ',' expr0  */
#line 2137 "lang.y"
                                { (yyval.number) = (yyvsp[-2].number) + 1; add_arg_type((yyvsp[0].type)); }
#line 4587 "lang.c"
    break;

  case 184: /* m_expr_list: %empty  */
#line 2139 "lang.y"
                                { (yyval.number) = 0; }
#line 4593 "lang.c"
    break;

  case 185: /* m_expr_list: m_expr_list2  */
#line 2140 "lang.y"
                                { (yyval.number) = (yyvsp[0].number); }
#line 4599 "lang.c"
    break;

  case 186: /* m_expr_list: m_expr_list2 ','  */
#line 2141 "lang.y"
                                { (yyval.number) = (yyvsp[-1].number); }
#line 4605 "lang.c"
    break;

  case 187: /* m_expr_list2: expr0 ':' expr1  */
#line 2143 "lang.y"
                                { (yyval.number) = 2; add_arg_type((yyvsp[-2].type)); add_arg_type((yyvsp[0].type)); }
#line 4611 "lang.c"
    break;

  case 188: /* m_expr_list2: m_expr_list2 ',' expr0 ':' expr1  */
#line 2144 "lang.y"
                                            { (yyval.number) = (yyvsp[-4].number) + 2; add_arg_type((yyvsp[-2].type)); add_arg_type((yyvsp[0].type)); }
#line 4617 "lang.c"
    break;

  case 189: /* expr1: expr2  */
#line 2146 "lang.y"
             { (yyval.type) = (yyvsp[0].type); }
#line 4623 "lang.c"
    break;

  case 190: /* $@25: %empty  */
#line 2148 "lang.y"
        {
	    ins_f_byte(F_DUP);
	    ins_f_byte(F_JUMP_WHEN_NON_ZERO);
	    add_jump();
	    push_address();
	    ins_short(0);
	    ins_f_byte(F_POP_VALUE);
	}
#line 4636 "lang.c"
    break;

  case 191: /* expr1: expr2 F_LOR $@25 expr1  */
#line 2157 "lang.y"
        {
	    upd_short(pop_address(), (short)mem_block[A_PROGRAM].current_size);
	    if ((yyvsp[-3].type) == (yyvsp[0].type))
		(yyval.type) = (yyvsp[-3].type);
	    else
		(yyval.type) = TYPE_ANY;	/* Return type can't be known */
	}
#line 4648 "lang.c"
    break;

  case 192: /* expr2: expr211  */
#line 2165 "lang.y"
               { (yyval.type) = (yyvsp[0].type); }
#line 4654 "lang.c"
    break;

  case 193: /* $@26: %empty  */
#line 2167 "lang.y"
        {
	    ins_f_byte(F_DUP);
	    ins_f_byte(F_JUMP_WHEN_ZERO);
	    add_jump();
	    push_address();
	    ins_short(0);
	    ins_f_byte(F_POP_VALUE);
	}
#line 4667 "lang.c"
    break;

  case 194: /* expr2: expr211 F_LAND $@26 expr2  */
#line 2176 "lang.y"
        {
	    upd_short(pop_address(), (short)mem_block[A_PROGRAM].current_size);
	    if ((yyvsp[-3].type) == (yyvsp[0].type))
		(yyval.type) = (yyvsp[-3].type);
	    else
		(yyval.type) = TYPE_ANY;	/* Return type can't be known */
	}
#line 4679 "lang.c"
    break;

  case 196: /* expr211: expr211 '|' expr212  */
#line 2186 "lang.y"
          {
	    int t1 = (yyvsp[-2].type) & TYPE_MASK, t3 = (yyvsp[0].type) & TYPE_MASK;
	    if (((yyvsp[-2].type) & TYPE_MOD_POINTER && (yyvsp[0].type) & TYPE_MOD_POINTER) && 
		 (t1 == t3))
	      (yyval.type) = (yyvsp[-2].type);
	    else  if (((t1 == TYPE_ANY) && (yyvsp[0].type) & TYPE_MOD_POINTER) || 
		((yyvsp[-2].type) & TYPE_MOD_POINTER && (t3 == TYPE_ANY)))
	      (yyval.type) = TYPE_MOD_POINTER | TYPE_ANY;
	    else if ((t1 == TYPE_ANY) && (t3 == TYPE_ANY))
	      (yyval.type) = TYPE_ANY;
	    else
	    {
	      if (exact_types && !TYPE((yyvsp[-2].type),TYPE_NUMBER))
		  type_error("Bad argument 1 to |", (yyvsp[-2].type));
	      if (exact_types && !TYPE((yyvsp[0].type),TYPE_NUMBER))
		  type_error("Bad argument 2 to |", (yyvsp[0].type));
	      (yyval.type) = TYPE_NUMBER;
	    }
	    ins_f_byte(F_OR);
	  }
#line 4704 "lang.c"
    break;

  case 198: /* expr212: expr212 '^' expr213  */
#line 2209 "lang.y"
          {
	      if (exact_types && !TYPE((yyvsp[-2].type),TYPE_NUMBER))
		  type_error("Bad argument 1 to ^", (yyvsp[-2].type));
	      if (exact_types && !TYPE((yyvsp[0].type),TYPE_NUMBER))
		  type_error("Bad argument 2 to ^", (yyvsp[0].type));
	      (yyval.type) = TYPE_NUMBER;
	      ins_f_byte(F_XOR);
	  }
#line 4717 "lang.c"
    break;

  case 200: /* expr213: expr213 '&' expr22  */
#line 2220 "lang.y"
          {
	    int t1 = (yyvsp[-2].type) & TYPE_MASK, t3 = (yyvsp[0].type) & TYPE_MASK;
	    if (((yyvsp[-2].type) & TYPE_MOD_POINTER && (yyvsp[0].type) & TYPE_MOD_POINTER) && 
		 (t1 == t3))
	      (yyval.type) = (yyvsp[-2].type);
	    else  if (((t1 == TYPE_ANY) && (yyvsp[0].type) & TYPE_MOD_POINTER) || 
		((yyvsp[-2].type) & TYPE_MOD_POINTER && (t3 == TYPE_ANY)))
	      (yyval.type) = TYPE_MOD_POINTER | TYPE_ANY;
	    else if ((t1 == TYPE_ANY) && (t3 == TYPE_ANY))
	      (yyval.type) = TYPE_ANY;
	    else
	    {
	      if (exact_types && !TYPE((yyvsp[-2].type),TYPE_NUMBER))
		type_error("Bad argument 1 to &", (yyvsp[-2].type));
	      if (exact_types && !TYPE((yyvsp[0].type),TYPE_NUMBER))
		type_error("Bad argument 2 to &", (yyvsp[0].type));
	      (yyval.type) = TYPE_NUMBER;
	    }
	    ins_f_byte(F_AND);
	  }
#line 4742 "lang.c"
    break;

  case 202: /* expr22: expr24 F_EQ expr24  */
#line 2243 "lang.y"
        {
	    int t1 = (yyvsp[-2].type) & TYPE_MASK, t2 = (yyvsp[0].type) & TYPE_MASK;
	    if (exact_types && t1 != t2 && t1 != TYPE_ANY && t2 != TYPE_ANY) {
		type_error("== always false because of different types", (yyvsp[-2].type));
		type_error("                               compared to", (yyvsp[0].type));
	    }
	    ins_f_byte(F_EQ);
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4756 "lang.c"
    break;

  case 203: /* expr22: expr24 F_NE expr24  */
#line 2253 "lang.y"
        {
	    int t1 = (yyvsp[-2].type) & TYPE_MASK, t2 = (yyvsp[0].type) & TYPE_MASK;
	    if (exact_types && t1 != t2 && t1 != TYPE_ANY && t2 != TYPE_ANY) {
		type_error("!= always true because of different types", (yyvsp[-2].type));
		type_error("                               compared to", (yyvsp[0].type));
	    }
	    ins_f_byte(F_NE);
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4770 "lang.c"
    break;

  case 205: /* expr23: expr24 '>' expr24  */
#line 2265 "lang.y"
        { (yyval.type) = TYPE_NUMBER; ins_f_byte(F_GT); }
#line 4776 "lang.c"
    break;

  case 206: /* expr23: expr24 F_GE expr24  */
#line 2267 "lang.y"
        { (yyval.type) = TYPE_NUMBER; ins_f_byte(F_GE); }
#line 4782 "lang.c"
    break;

  case 207: /* expr23: expr24 '<' expr24  */
#line 2269 "lang.y"
        { (yyval.type) = TYPE_NUMBER; ins_f_byte(F_LT); }
#line 4788 "lang.c"
    break;

  case 208: /* expr23: expr24 F_LE expr24  */
#line 2271 "lang.y"
        { (yyval.type) = TYPE_NUMBER; ins_f_byte(F_LE); }
#line 4794 "lang.c"
    break;

  case 210: /* expr24: expr24 F_LSH expr25  */
#line 2275 "lang.y"
        {
	    ins_f_byte(F_LSH);
	    (yyval.type) = TYPE_NUMBER;
	    if (exact_types && !TYPE((yyvsp[-2].type), TYPE_NUMBER))
		type_error("Bad argument number 1 to '<<'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument number 2 to '<<'", (yyvsp[0].type));
	}
#line 4807 "lang.c"
    break;

  case 211: /* expr24: expr24 F_RSH expr25  */
#line 2284 "lang.y"
        {
	    ins_f_byte(F_RSH);
	    (yyval.type) = TYPE_NUMBER;
	    if (exact_types && !TYPE((yyvsp[-2].type), TYPE_NUMBER))
		type_error("Bad argument number 1 to '>>'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument number 2 to '>>'", (yyvsp[0].type));
	}
#line 4820 "lang.c"
    break;

  case 213: /* expr25: expr25 '+' expr27  */
#line 2295 "lang.y"
        { ins_f_byte(F_ADD); (yyval.type) = TYPE_ANY; }
#line 4826 "lang.c"
    break;

  case 214: /* expr25: expr25 '-' expr27  */
#line 2297 "lang.y"
        {
	    int bad_arg = 0;

	    if (exact_types) {
		if (!(TYPE((yyvsp[-2].type), TYPE_NUMBER) || TYPE((yyvsp[-2].type), TYPE_FLOAT)) &&
		    !((yyvsp[-2].type) & TYPE_MOD_POINTER) ) {
                    type_error("Bad argument number 1 to '-'", (yyvsp[-2].type));
		    bad_arg++;
		}
		if (!TYPE((yyvsp[0].type), (yyvsp[-2].type)) && !((yyvsp[0].type) & TYPE_MOD_POINTER) ) {
                    type_error("Bad argument number 2 to '-'", (yyvsp[0].type));
		    bad_arg++;
		}
	    }
	    (yyval.type) = TYPE_ANY;
	    if (((yyvsp[-2].type) & TYPE_MOD_POINTER) || ((yyvsp[0].type) & TYPE_MOD_POINTER)) 
		(yyval.type) = TYPE_MOD_POINTER | TYPE_ANY;
	    if (!((yyvsp[-2].type) & TYPE_MOD_POINTER) || !((yyvsp[0].type) & TYPE_MOD_POINTER)) {
	      if (exact_types && (yyval.type) != TYPE_ANY && !bad_arg)
		yyerror("Arguments to '-' don't match");
	      (yyval.type) = ((yyvsp[-2].type) & TYPE_MOD_POINTER)?(yyvsp[0].type):(yyvsp[-2].type);
	    }
	    ins_f_byte(F_SUBTRACT);
	}
#line 4855 "lang.c"
    break;

  case 216: /* expr27: expr27 '*' expr3  */
#line 2325 "lang.y"
        {
            if (exact_types &&
	        !(TYPE((yyvsp[-2].type), TYPE_NUMBER) || TYPE((yyvsp[-2].type), TYPE_FLOAT) ||
		TYPE((yyvsp[-2].type), TYPE_STRING) || TYPE((yyvsp[-2].type), TYPE_ANY | TYPE_MOD_POINTER)))
		type_error("Bad argument number 1 to '*'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[-2].type), (yyvsp[0].type)) && 
	        !(TYPE((yyvsp[-2].type), TYPE_STRING) && TYPE((yyvsp[0].type), TYPE_NUMBER)) &&
	        !(TYPE((yyvsp[0].type), TYPE_STRING) && TYPE((yyvsp[-2].type), TYPE_NUMBER)) &&
		!(TYPE((yyvsp[-2].type), TYPE_ANY | TYPE_MOD_POINTER) && TYPE((yyvsp[0].type), TYPE_NUMBER)) &&
		!(TYPE((yyvsp[0].type), TYPE_ANY | TYPE_MOD_POINTER) && TYPE((yyvsp[-2].type), TYPE_NUMBER)))
		type_error("Bad argument number 2 to '*'", (yyvsp[0].type));

	    ins_f_byte(F_MULTIPLY);

            if (TYPE((yyvsp[0].type), TYPE_STRING) ||
	        TYPE((yyvsp[0].type), TYPE_ANY | TYPE_MOD_POINTER))
		(yyval.type) = (yyvsp[0].type);
            else
                (yyval.type) = (yyvsp[-2].type);

	}
#line 4881 "lang.c"
    break;

  case 217: /* expr27: expr27 F_MOD expr3  */
#line 2347 "lang.y"
        {
	    if (exact_types && !TYPE((yyvsp[-2].type), TYPE_NUMBER))
		type_error("Bad argument number 1 to '%'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument number 2 to '%'", (yyvsp[0].type));
	    ins_f_byte(F_MOD);
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4894 "lang.c"
    break;

  case 218: /* expr27: expr27 '/' expr3  */
#line 2356 "lang.y"
        {
	    if (exact_types && !(TYPE((yyvsp[-2].type), TYPE_NUMBER) || TYPE((yyvsp[-2].type), TYPE_FLOAT)))
		type_error("Bad argument number 1 to '/'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[0].type), (yyvsp[-2].type)))
		type_error("Bad argument number 2 to '/'", (yyvsp[0].type));
	    ins_f_byte(F_DIVIDE);
	    (yyval.type) = (yyvsp[-2].type);
	}
#line 4907 "lang.c"
    break;

  case 219: /* expr27: expr27 '@' expr3  */
#line 2365 "lang.y"
        {
	    if (exact_types && !TYPE((yyvsp[-2].type), TYPE_FUNCTION))
		type_error("Bad argument number 1 to '@'", (yyvsp[-2].type));
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_FUNCTION))
		type_error("Bad argument number 2 to '@'", (yyvsp[0].type));
	    ins_f_byte(F_BUILD_CLOSURE);
	    ins_byte(FUN_COMPOSE);
	    (yyval.type) = TYPE_FUNCTION;
	}
#line 4921 "lang.c"
    break;

  case 221: /* expr28: cast expr3  */
#line 2378 "lang.y"
              {
		  (yyval.type) = (yyvsp[-1].type);
		  if (exact_types && (yyvsp[0].type) != TYPE_ANY && (yyvsp[0].type) != TYPE_UNKNOWN &&
		      (yyvsp[-1].type) != TYPE_VOID)
		      type_error("Casts are only legal for type mixed, or when unknown", (yyvsp[0].type));
	      }
#line 4932 "lang.c"
    break;

  case 223: /* expr3: F_INC lvalue  */
#line 2387 "lang.y"
        {
	    deref_index--;
	    ins_f_byte(F_INC);
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument to ++", (yyvsp[0].type));
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4944 "lang.c"
    break;

  case 224: /* expr3: F_DEC lvalue  */
#line 2395 "lang.y"
        {
	    deref_index--;
	    ins_f_byte(F_DEC);
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument to --", (yyvsp[0].type));
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4956 "lang.c"
    break;

  case 225: /* expr3: F_NOT expr3  */
#line 2403 "lang.y"
        {
	    ins_f_byte(F_NOT);	/* Any type is valid here. */
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4965 "lang.c"
    break;

  case 226: /* expr3: '~' expr3  */
#line 2408 "lang.y"
        {
	    ins_f_byte(F_COMPL);
	    if (exact_types && !TYPE((yyvsp[0].type), TYPE_NUMBER))
		type_error("Bad argument to ~", (yyvsp[0].type));
	    (yyval.type) = TYPE_NUMBER;
	}
#line 4976 "lang.c"
    break;

  case 227: /* expr3: '-' expr3  */
#line 2415 "lang.y"
        {
	    ins_f_byte(F_NEGATE);
	    if (exact_types && !(TYPE((yyvsp[0].type), TYPE_NUMBER) || TYPE((yyvsp[0].type), TYPE_FLOAT)))
		type_error("Bad argument to unary '-'", (yyvsp[0].type));
	    (yyval.type) = (yyvsp[0].type);
	}
#line 4987 "lang.c"
    break;

  case 228: /* expr3: '&' funexpr '(' oexpr_list ')'  */
#line 2422 "lang.y"
        {
	    if ((yyvsp[-1].number)) {
		pop_arg_stack((yyvsp[-1].number));
		ins_f_byte(F_PAPPLY);
		ins_byte((char)(yyvsp[-1].number));
	    }
	    if (exact_types && !TYPE((yyvsp[-3].type), TYPE_FUNCTION))
		type_error("Bad argument to unary '&'", (yyvsp[-3].type));
	    (yyval.type) = TYPE_FUNCTION;
	}
#line 5002 "lang.c"
    break;

  case 229: /* $@27: %empty  */
#line 2433 "lang.y"
        {
	    /* emulate &call_other(,id) */

	    ins_f_byte(F_BUILD_CLOSURE);
	    ins_byte(FUN_EFUN);
	    ins_short(F_CALL_OTHER); /* call_other */
	    
	    ins_f_byte(F_BUILD_CLOSURE);
	    ins_byte(FUN_EMPTY); /* empty arg */

	    ins_f_byte(F_STRING);
	    ins_short(store_prog_string((yyvsp[0].string))); /* the string for the id */

	}
#line 5021 "lang.c"
    break;

  case 230: /* expr3: '&' F_ARROW F_IDENTIFIER $@27 '(' oexpr_list ')'  */
#line 2447 "lang.y"
        {
	    pop_arg_stack((yyvsp[-1].number));
	    ins_f_byte(F_PAPPLY);
	    ins_byte((char)(2 + (yyvsp[-1].number)));	/* two args above & the oexpr_list  */

	    (yyval.type) = TYPE_FUNCTION;
	}
#line 5033 "lang.c"
    break;

  case 231: /* funexpr: funident  */
#line 2457 "lang.y"
                                { (yyval.type) = (yyvsp[0].type); }
#line 5039 "lang.c"
    break;

  case 232: /* funexpr: string_or_id F_ARROW F_IDENTIFIER  */
#line 2459 "lang.y"
        {
	    ins_f_byte(F_STRING);
	    ins_short(store_prog_string((yyvsp[0].string)));
	    ins_f_byte(F_BUILD_CLOSURE);
	    ins_byte(FUN_LFUNO);
	    (yyval.type) = TYPE_FUNCTION;
	}
#line 5051 "lang.c"
    break;

  case 233: /* string_or_id: string  */
#line 2471 "lang.y"
        {
	    (yyval.type) = (yyvsp[0].type);
	}
#line 5059 "lang.c"
    break;

  case 234: /* string_or_id: identifier  */
#line 2475 "lang.y"
        {
            int var_num = lookup_local_name((yyvsp[0].string));
            if (var_num != -1) {
	        ins_f_byte(F_LOCAL_NAME);
	        ins_byte((char)var_num);
            } else {
	        int i = verify_declared((yyvsp[0].string));

	        if (i == -1) {
		    char buff[100];

		    (void)snprintf(buff, sizeof(buff), "Variable %s not declared!", (yyvsp[0].string));
		    yyerror(buff);
	        } else {
		    ins_f_byte(F_IDENTIFIER);
		    ins_byte((char)variable_inherit_found);
		    ins_byte((char)variable_index_found);
	        }
           }
	}
#line 5084 "lang.c"
    break;

  case 236: /* oexpr_list: %empty  */
#line 2498 "lang.y"
                                        { (yyval.number) = 0; }
#line 5090 "lang.c"
    break;

  case 237: /* oexpr_list: expr0  */
#line 2499 "lang.y"
                                        { add_arg_type((yyvsp[0].type)); (yyval.number) = 1; }
#line 5096 "lang.c"
    break;

  case 238: /* oexpr_list: oexpr_list1  */
#line 2500 "lang.y"
                                        { (yyval.number) = (yyvsp[0].number); }
#line 5102 "lang.c"
    break;

  case 239: /* oexpr_list1: oexpr0 ',' oexpr0  */
#line 2502 "lang.y"
                                        { (yyval.number) = 2; }
#line 5108 "lang.c"
    break;

  case 240: /* oexpr_list1: oexpr0 ',' oexpr_list1  */
#line 2503 "lang.y"
                                        { (yyval.number) = (yyvsp[0].number) + 1; }
#line 5114 "lang.c"
    break;

  case 241: /* oexpr0: expr0  */
#line 2505 "lang.y"
                                        { add_arg_type((yyvsp[0].type)); }
#line 5120 "lang.c"
    break;

  case 242: /* oexpr0: %empty  */
#line 2506 "lang.y"
                                        {
					  ins_f_byte(F_BUILD_CLOSURE);
					  ins_byte(FUN_EMPTY);
					  add_arg_type(TYPE_ANY);
					}
#line 5130 "lang.c"
    break;

  case 243: /* funident: F_IDENTIFIER  */
#line 2514 "lang.y"
        {
            int var_num = lookup_local_name((yyvsp[0].string));
            if (var_num != -1) {
	        ins_f_byte(F_LOCAL_NAME);
	        ins_byte((char)var_num);
                (yyval.type) = type_of_locals[var_num];
            } else {
	        int i = verify_declared((yyvsp[0].string));

	        if (i == -1) {
		    if (handle_function_id((yyvsp[0].string))) {
		        (yyval.type) = TYPE_FUNCTION;
		    } else {
		        char buff[100];

		        (void)snprintf(buff, sizeof(buff), "Variable %s not declared!", (yyvsp[0].string));
		        yyerror(buff);
		        (yyval.type) = TYPE_ANY;
		    }
	        } else {
		    ins_f_byte(F_IDENTIFIER);
		    ins_byte((char)variable_inherit_found);
		    ins_byte((char)variable_index_found);
		    (yyval.type) = i & TYPE_MASK;
	        }
            }
        }
#line 5162 "lang.c"
    break;

  case 244: /* funident: funoperator  */
#line 2542 "lang.y"
        {
 	    (yyval.type) = TYPE_FUNCTION;
	}
#line 5170 "lang.c"
    break;

  case 245: /* funoperator: F_OPERATOR '(' funop ')'  */
#line 2548 "lang.y"
        {
	    ins_f_byte(F_BUILD_CLOSURE); /* and build the function closure */
	    ins_byte(FUN_EFUN);
	    ins_short((short)(yyvsp[-1].number));
	}
#line 5180 "lang.c"
    break;

  case 246: /* funop: '+'  */
#line 2554 "lang.y"
            { (yyval.number) = F_ADD; }
#line 5186 "lang.c"
    break;

  case 247: /* funop: '-'  */
#line 2555 "lang.y"
            { (yyval.number) = F_SUBTRACT; }
#line 5192 "lang.c"
    break;

  case 248: /* funop: '*'  */
#line 2556 "lang.y"
            { (yyval.number) = F_MULTIPLY; }
#line 5198 "lang.c"
    break;

  case 249: /* funop: '/'  */
#line 2557 "lang.y"
            { (yyval.number) = F_DIVIDE; }
#line 5204 "lang.c"
    break;

  case 250: /* funop: F_MOD  */
#line 2558 "lang.y"
              { (yyval.number) = F_MOD; }
#line 5210 "lang.c"
    break;

  case 251: /* funop: '>'  */
#line 2559 "lang.y"
            { (yyval.number) = F_GT; }
#line 5216 "lang.c"
    break;

  case 252: /* funop: '<'  */
#line 2560 "lang.y"
            { (yyval.number) = F_LT; }
#line 5222 "lang.c"
    break;

  case 253: /* funop: F_GE  */
#line 2561 "lang.y"
             { (yyval.number) = F_GE; }
#line 5228 "lang.c"
    break;

  case 254: /* funop: F_LE  */
#line 2562 "lang.y"
             { (yyval.number) = F_LE; }
#line 5234 "lang.c"
    break;

  case 255: /* funop: F_EQ  */
#line 2563 "lang.y"
             { (yyval.number) = F_EQ; }
#line 5240 "lang.c"
    break;

  case 256: /* funop: F_NE  */
#line 2564 "lang.y"
             { (yyval.number) = F_NE; }
#line 5246 "lang.c"
    break;

  case 257: /* funop: '&'  */
#line 2565 "lang.y"
            { (yyval.number) = F_AND; }
#line 5252 "lang.c"
    break;

  case 258: /* funop: '^'  */
#line 2566 "lang.y"
            { (yyval.number) = F_XOR; }
#line 5258 "lang.c"
    break;

  case 259: /* funop: '|'  */
#line 2567 "lang.y"
            { (yyval.number) = F_OR; }
#line 5264 "lang.c"
    break;

  case 260: /* funop: F_LSH  */
#line 2568 "lang.y"
              { (yyval.number) = F_LSH; }
#line 5270 "lang.c"
    break;

  case 261: /* funop: F_RSH  */
#line 2569 "lang.y"
              { (yyval.number) = F_RSH; }
#line 5276 "lang.c"
    break;

  case 262: /* funop: '[' ']'  */
#line 2570 "lang.y"
                { (yyval.number) = F_INDEX; }
#line 5282 "lang.c"
    break;

  case 263: /* funop: F_NOT  */
#line 2571 "lang.y"
              { (yyval.number) = F_NOT; }
#line 5288 "lang.c"
    break;

  case 264: /* funop: '~'  */
#line 2572 "lang.y"
            { (yyval.number) = F_COMPL; }
#line 5294 "lang.c"
    break;

  case 266: /* expr31: lvalue F_INC  */
#line 2578 "lang.y"
         {
	     deref_index--;
	     ins_f_byte(F_POST_INC);
	     if (exact_types && !TYPE((yyvsp[-1].type), TYPE_NUMBER))
		 type_error("Bad argument to ++", (yyvsp[-1].type));
	     (yyval.type) = TYPE_NUMBER;
	 }
#line 5306 "lang.c"
    break;

  case 267: /* expr31: lvalue F_DEC  */
#line 2586 "lang.y"
         {
	     deref_index--;
	     ins_f_byte(F_POST_DEC);
	     if (exact_types && !TYPE((yyvsp[-1].type), TYPE_NUMBER))
		 type_error("Bad argument to --", (yyvsp[-1].type));
	     (yyval.type) = TYPE_NUMBER;
	 }
#line 5318 "lang.c"
    break;

  case 268: /* rvalue: lvalue  */
#line 2595 "lang.y"
        {
	    int i, lastl;
	    /* This is yucky!  But the way the parser is structured
	     * together with YACC forces it.
	     */
	    if (deref_index <= 0)
		fatal("deref_index\n");
	    lastl = deref_stack[--deref_index];
	    if (lastl != -1) {
		switch(mem_block[A_PROGRAM].block[lastl]) {
		case F_PUSH_IDENTIFIER_LVALUE-EFUN_FIRST:
		    i = F_IDENTIFIER-EFUN_FIRST; break;
		case F_PUSH_LOCAL_VARIABLE_LVALUE-EFUN_FIRST:
		    i = F_LOCAL_NAME-EFUN_FIRST; break;
		case F_PUSH_INDEXED_LVALUE-EFUN_FIRST:
		    i = F_INDEX-EFUN_FIRST; break;
		default:i = -1; break;
		}
		if (i == -1) fatal("Should be a push at this point!\n");
		mem_block[A_PROGRAM].block[lastl] = i;
	    }
	    (yyval.type) = (yyvsp[0].type) & ~TYPE_LVALUE;
	}
#line 5346 "lang.c"
    break;

  case 270: /* expr4: funoperator  */
#line 2621 "lang.y"
          {
 	    (yyval.type) = TYPE_FUNCTION;
	  }
#line 5354 "lang.c"
    break;

  case 271: /* expr4: expr4 '[' comma_expr F_RANGE comma_expr ']'  */
#line 2625 "lang.y"
          {
	      ins_f_byte(F_RANGE);
	      if (exact_types && !((yyvsp[-5].type) & TYPE_MAPPING))
		{
		  if (((yyvsp[-5].type) & TYPE_MOD_POINTER) == 0 && !TYPE((yyvsp[-5].type), TYPE_STRING))
		      type_error("Bad type to indexed value", (yyvsp[-5].type));
		  if (!TYPE((yyvsp[-3].type), TYPE_NUMBER))
		      type_error("Bad type of index", (yyvsp[-3].type));
		  if (!TYPE((yyvsp[-1].type), TYPE_NUMBER))
		      type_error("Bad type of index", (yyvsp[-1].type));
		}
	      if ((yyvsp[-5].type) == TYPE_ANY)
		  (yyval.type) = TYPE_ANY;
	      else if (TYPE((yyvsp[-5].type), TYPE_STRING))
		  (yyval.type) = TYPE_STRING;
	      else if ((yyvsp[-5].type) & TYPE_MOD_POINTER)
		  (yyval.type) = (yyvsp[-5].type);
	      else if (exact_types)
		  type_error("Bad type of argument used for range", (yyvsp[-5].type));
	  }
#line 5379 "lang.c"
    break;

  case 272: /* $@28: %empty  */
#line 2645 "lang.y"
                            { ins_f_byte(F_CONST0); }
#line 5385 "lang.c"
    break;

  case 273: /* expr4: expr4 '[' F_RANGE $@28 comma_expr ']'  */
#line 2646 "lang.y"
          {
	      ins_f_byte(F_RANGE);
	      if (exact_types && !((yyvsp[-5].type) & TYPE_MAPPING))
		{
		  if (((yyvsp[-5].type) & TYPE_MOD_POINTER) == 0 && !TYPE((yyvsp[-5].type), TYPE_STRING))
		      type_error("Bad type to indexed value", (yyvsp[-5].type));
		  if (!TYPE((yyvsp[-1].type), TYPE_NUMBER))
		      type_error("Bad type of index", (yyvsp[-1].type));
		}
	      if ((yyvsp[-5].type) == TYPE_ANY)
		  (yyval.type) = TYPE_ANY;
	      else if (TYPE((yyvsp[-5].type), TYPE_STRING))
		  (yyval.type) = TYPE_STRING;
	      else if ((yyvsp[-5].type) & TYPE_MOD_POINTER)
		  (yyval.type) = (yyvsp[-5].type);
	      else if (exact_types)
		  type_error("Bad type of argument used for range", (yyvsp[-5].type));
	  }
#line 5408 "lang.c"
    break;

  case 274: /* expr4: expr4 '[' comma_expr F_RANGE ']'  */
#line 2665 "lang.y"
          {
              static long long maxint = ~(unsigned long long)0 >> 1;
	      ins_f_byte(F_NUMBER);
	      ins_mem(&maxint, sizeof(maxint)); /* MAXINT */

	      ins_f_byte(F_RANGE);
	      if (exact_types && !((yyvsp[-4].type) & TYPE_MAPPING))
		{
		  if (((yyvsp[-4].type) & TYPE_MOD_POINTER) == 0 && !TYPE((yyvsp[-4].type), TYPE_STRING))
		      type_error("Bad type to indexed value", (yyvsp[-4].type));
		  if (!TYPE((yyvsp[-2].type), TYPE_NUMBER))
		      type_error("Bad type of index", (yyvsp[-2].type));
		}
	      if ((yyvsp[-4].type) == TYPE_ANY)
		  (yyval.type) = TYPE_ANY;
	      else if (TYPE((yyvsp[-4].type), TYPE_STRING))
		  (yyval.type) = TYPE_STRING;
	      else if ((yyvsp[-4].type) & TYPE_MOD_POINTER)
		  (yyval.type) = (yyvsp[-4].type);
	      else if (exact_types)
		  type_error("Bad type of argument used for range", (yyvsp[-4].type));
	  }
#line 5435 "lang.c"
    break;

  case 278: /* expr4: '(' comma_expr ')'  */
#line 2689 "lang.y"
                          { (yyval.type) = (yyvsp[-1].type); }
#line 5441 "lang.c"
    break;

  case 279: /* expr4: catch  */
#line 2690 "lang.y"
             { (yyval.type) = TYPE_ANY; }
#line 5447 "lang.c"
    break;

  case 280: /* expr4: sscanf  */
#line 2691 "lang.y"
              { (yyval.type) = TYPE_NUMBER; }
#line 5453 "lang.c"
    break;

  case 281: /* expr4: parse_command  */
#line 2692 "lang.y"
                     { (yyval.type) = TYPE_NUMBER; }
#line 5459 "lang.c"
    break;

  case 282: /* expr4: '(' '{' expr_list '}' ')'  */
#line 2694 "lang.y"
       {
	   pop_arg_stack((yyvsp[-2].number));		/* We don't care about these types */
	   ins_f_byte(F_AGGREGATE);
	   ins_short((short)(yyvsp[-2].number));
	   (yyval.type) = TYPE_MOD_POINTER | TYPE_ANY;
       }
#line 5470 "lang.c"
    break;

  case 283: /* expr4: '(' '[' m_expr_list ']' ')'  */
#line 2701 "lang.y"
       {
	   pop_arg_stack((yyvsp[-2].number));
	   ins_f_byte(F_M_AGGREGATE);
	   ins_short((short)(yyvsp[-2].number));
	   (yyval.type) = TYPE_MAPPING;
       }
#line 5481 "lang.c"
    break;

  case 284: /* expr4: call_other_start  */
#line 2711 "lang.y"
        {
	    ins_f_byte(F_BUILD_CLOSURE);
	    ins_byte(FUN_LFUNO);
	    (yyval.type) = TYPE_FUNCTION;	    
	}
#line 5491 "lang.c"
    break;

  case 285: /* expr4: expr4 '(' expr_list ')'  */
#line 2717 "lang.y"
        {
            if ((yyvsp[-3].type) != TYPE_FUNCTION && (yyvsp[-3].type) != TYPE_ANY)
		type_error("Call of non-function", (yyvsp[-3].type));
	    ins_f_byte(F_CALL_VAR);
	    ins_byte((char)(yyvsp[-1].number));
	    pop_arg_stack((yyvsp[-1].number));
#if MUSTCASTFUN
	    (yyval.type) = TYPE_UNKNOWN;
#else
	    (yyval.type) = TYPE_ANY;
#endif
	}
#line 5508 "lang.c"
    break;

  case 286: /* expr4: call_other_start '(' expr_list ')'  */
#line 2729 "lang.y"
                                             {
	    ins_f_byte(F_CALL_OTHER);
	    ins_byte((char)((yyvsp[-1].number) + 2));
	    pop_arg_stack((yyvsp[-1].number));	/* No good need of these arguments */
	    (yyval.type) = TYPE_ANY;          /* TYPE_UNKNOWN forces casts */
	}
#line 5519 "lang.c"
    break;

  case 287: /* expr4: identifier '(' expr_list ')'  */
#line 2736 "lang.y"
        { 
          int var_num = lookup_local_name((yyvsp[-3].string));
          if (var_num != -1) {
	    int t;
	    ins_f_byte(F_LOCAL_NAME);
	    ins_byte((char)var_num);
	    t = type_of_locals[var_num];
            if (t != TYPE_FUNCTION && t != TYPE_ANY)
		type_error("Call of non-function", t);
	    ins_f_byte(F_CALL_VAR);
	    ins_byte((char)(yyvsp[-1].number));
	    pop_arg_stack((yyvsp[-1].number));	/* Argument types not needed more */
#if MUSTCASTFUN
	    (yyval.type) = TYPE_UNKNOWN;
#else
	    (yyval.type) = TYPE_ANY;
#endif
          } else {
          /* Note that this code could be made a lot cleaner if some 
           * support functions were added. (efun_call() is a good one) 
	   */
	  int inherited_override = strchr((yyvsp[-3].string), ':') != NULL;
	  int efun_override = inherited_override && strncmp((yyvsp[-3].string),"efun::", 6) == 0;
	  int is_sfun = 0;
	  int f;
  
          (yyval.type) = TYPE_ANY;		/* in case anything goes wrong we need a default type. /LA */
	  if (inherited_override && !efun_override) 
	  {
	      struct function *funp;

	      /* Find the right function to call 
		         
                   This assumes max 255 inherited programs
		   and 32767 functions in one program.
	       */
	      if (defined_function((yyvsp[-3].string))) 
	      {

		  funp = &function_prog_found->functions[function_index_found];
		  (yyval.type) = funp->type_flags & TYPE_MASK;
		  ins_f_byte(F_CALL_NON_VIRT);
		  ins_byte ((char)function_inherit_found);
                  ins_short ((short)function_index_found);
		  ins_byte((char)(yyvsp[-1].number)); /* Number of arguments */
	      }
	      else 
	      {
		  char buff[100];

		  (void)snprintf(buff, sizeof(buff), "Function %s undefined", (yyvsp[-3].string));
		  yyerror(buff);
              }
           }

           /* All simul_efuns are considered defined. 
	    */
	   else if (!efun_override && 
                  (defined_function ((yyvsp[-3].string)) || ((is_sfun = 1) && is_simul_efun ((yyvsp[-3].string)))) ) 
	   {
	       struct function *funp;
	       unsigned short *arg_indices;
	       unsigned short *arg_types; 
 
	       if (function_prog_found) 
	       {
		   funp = &(function_prog_found->
			    functions[function_index_found]);
		   arg_indices = function_prog_found->type_start;
		   arg_types = function_prog_found->argument_types;
	       }
	       else
	       {
		   funp = FUNCTION(function_index_found);
		   
		   /* Beware... these are pointers to volatile structures 
		    */
		   arg_indices = (unsigned short *) mem_block[A_ARGUMENT_INDEX].block;
		   arg_types = (unsigned short *) mem_block[A_ARGUMENT_TYPES].block;
		   /* Assumption: exact_types implies correct 
		      values for arg_types 
		    */
	       }

	       /* Private functions in inherited programs may not be called. 
	        */
	       if (function_prog_found && 
		   function_type_mod_found & TYPE_MOD_PRIVATE) 
	       {
		   char buff[100];

		   (void)snprintf(buff, sizeof(buff), "Function %s marked 'private'", 
			    funp->name);
		   yyerror (buff);
	       }
	       (yyval.type) = funp->type_flags & TYPE_MASK;
              
               if (is_sfun)
	       {
                   ins_f_byte(F_CALL_SIMUL);
		   store_reloc_data(R_CALL,
				    (unsigned short)mem_block[A_PROGRAM].current_size,
				    (yyvsp[-3].string),0,0);
	       }
               else if (function_type_mod_found & (TYPE_MOD_NO_MASK|TYPE_MOD_PRIVATE))
	       {
                   ins_f_byte(F_CALL_NON_VIRT);
	       }
               else
	       {
		   ins_f_byte (F_CALL_VIRT);
		   if (function_prog_found)
		       store_reloc_data(R_CALL,
					(unsigned short)mem_block[A_PROGRAM].current_size,
					(yyvsp[-3].string),0,0);
	       }
	       ins_byte ((char)function_inherit_found);
               ins_short ((short)function_index_found);
               /* Insert function name into string list and code its index 
		*/
	       ins_byte ((char)(yyvsp[-1].number));

	       /*
		* Check number of arguments.
		*/
	       if ((funp->type_flags & NAME_STRICT_TYPES) && exact_types &&
		   funp->num_arg != (yyvsp[-1].number) && 

		   /* An old varargs function */
		   !((funp->type_flags & TYPE_MOD_VARARGS) &&
		     (yyvsp[-1].number) < funp->num_arg) &&

		   /* A true varargs function? */
		   !((funp->type_flags & TYPE_MOD_TRUE_VARARGS) &&
		   (yyvsp[-1].number) + 1 >= funp->num_arg) &&

		   /* A function with default values for arguments? */
		   !((yyvsp[-1].number) < funp->num_arg && funp->first_default <= (yyvsp[-1].number)))
	       {
		   char buff[100];

		   (void)snprintf(buff, sizeof(buff), "Wrong number of arguments to %s", (yyvsp[-3].string));
		   yyerror(buff);
	       }

	       /*
		* Check the argument types.
		*/
	       if (funp->type_flags & NAME_STRICT_TYPES &&
		   exact_types && arg_indices && 
		   arg_indices[function_index_found] != INDEX_START_NONE) 
	       {
		   int i, first;
		   int num_check = funp->num_arg;
		   
		   if (funp->type_flags & TYPE_MOD_TRUE_VARARGS)
		       num_check--;

		   first = arg_indices[function_index_found];
		   for (i=0; i < num_check && i < (yyvsp[-1].number); i++) 
		   {
		       int tmp = get_argument_type(i, (yyvsp[-1].number));
		       if (!TYPE(tmp, arg_types[first + i])) 
		       {
			   char buff[100];

			   (void)snprintf(buff, sizeof(buff),
					  "Bad type for argument %d %s", i+1,
					  get_two_types(arg_types[first+i], tmp));
			   yyerror(buff);
		       }
		   }
	       }
	   }

	   else if (efun_override || (f = lookup_predef((yyvsp[-3].string))) != -1)
	   {
	       int min, max, def, *argp;
	       extern int efun_arg_types[];
 
	       if (efun_override) 
		   f = lookup_predef((yyvsp[-3].string)+6);

	       if (f == -1) 	/* Only possible for efun_override */
	       {
		   char buff[100];

		   (void)snprintf(buff, sizeof(buff), "Unknown efun: %s", (yyvsp[-3].string)+6);
		   yyerror(buff);
	       }
	       else
	       {
		   min = instrs[f-EFUN_FIRST].min_arg;
		   max = instrs[f-EFUN_FIRST].max_arg;
		   def = instrs[f-EFUN_FIRST].Default;
		   (yyval.type) = instrs[f-EFUN_FIRST].ret_type;
		   argp = &efun_arg_types[instrs[f-EFUN_FIRST].arg_index];
		   if (def && (yyvsp[-1].number) == min-1) 
		   {
		       ins_f_byte((unsigned)def);
		       max--;
		       min--;
		   } 
		   else if ((yyvsp[-1].number) < min) 
		   {
		       char bff[100];

		       (void)snprintf(bff, sizeof(bff), "Too few arguments to %s", 
				      instrs[f-EFUN_FIRST].name);
		       yyerror(bff);
		   } 
		   else if ((yyvsp[-1].number) > max && max != -1) 
		   {
		       char bff[100];

		       (void)snprintf(bff, sizeof(bff), "Too many arguments to %s",
				      instrs[f - EFUN_FIRST].name);
		       yyerror(bff);
		   } 
		   else if (max != -1 && exact_types) 
		   {
		       /*
			* Now check all types of the arguments to efuns.
			*/
		       int i, argn;
		       char buff[100];
		       for (argn=0; argn < (yyvsp[-1].number); argn++) 
		       {
			   int tmp = get_argument_type(argn, (yyvsp[-1].number));
			   for(i=0; !TYPE(argp[i], tmp) && argp[i] != 0; i++)
			       ;
			   if (argp[i] == 0) 
			   {
			       (void)snprintf(buff, sizeof(buff),
				       "Bad argument %d type to efun %s()",
				       argn+1, instrs[f-EFUN_FIRST].name);
			       yyerror(buff);
			   }
			   while(argp[i] != 0)
			       i++;
			   argp += i + 1;
		       }
		   }
		   ins_f_byte((unsigned)f);

		   /* Only store number of arguments for instructions
		    * that allowed a variable number.
		    */
		   if (max != min)
		       ins_byte((char)(yyvsp[-1].number)); /* Number of actual arguments */
	       }
	   } 
	   else 
	   {
	       int i;
	       i = verify_declared((yyvsp[-3].string));
	       if (i != -1 && (i & TYPE_MASK) == TYPE_FUNCTION) {
		   ins_f_byte(F_IDENTIFIER);
		   ins_byte((char)variable_inherit_found);
		   ins_byte((char)variable_index_found);
		   ins_f_byte(F_CALL_VAR);
		   ins_byte((char)(yyvsp[-1].number));
#if MUSTCASTFUN
		   (yyval.type) = TYPE_UNKNOWN;
#else
		   (yyval.type) = TYPE_ANY;
#endif
	       } else {

		   if (exact_types) {
		       char buff[200];

		       (void)snprintf(buff, sizeof(buff), "Undefined function: %s", (yyvsp[-3].string));
		       yyerror (buff);
		   }

		   /* Function not found 
		    */
		   ins_f_byte(F_CALL_VIRT);
		   store_reloc_data(R_CALL,
				    (unsigned short)mem_block[A_PROGRAM].current_size,
				    (yyvsp[-3].string),0,0);
		   ins_byte((char)0xFF);
		   ins_short (-1);
		   ins_byte((char)(yyvsp[-1].number)); /* Number of arguments */
		   (yyval.type) = TYPE_ANY; /* just a guess */
	       }
	   }
	   pop_arg_stack((yyvsp[-1].number));	/* Argument types not needed more */
           }
	}
#line 5815 "lang.c"
    break;

  case 288: /* call_other_start: expr4 F_ARROW F_IDENTIFIER  */
#line 3029 "lang.y"
        {
	    ins_f_byte(F_STRING);
	    ins_short(store_prog_string((yyvsp[0].string)));
	}
#line 5824 "lang.c"
    break;

  case 289: /* $@29: %empty  */
#line 3033 "lang.y"
               { ins_f_byte(F_CATCH); push_address(); ins_short(0);}
#line 5830 "lang.c"
    break;

  case 290: /* catch: F_CATCH $@29 '(' comma_expr ')'  */
#line 3035 "lang.y"
               {
		   ins_f_byte(F_POP_VALUE);
		   ins_f_byte(F_END_CATCH);
		   upd_short(pop_address(),
			     (short)mem_block[A_PROGRAM].current_size);
	       }
#line 5841 "lang.c"
    break;

  case 291: /* sscanf: F_SSCANF '(' expr0 ',' expr0 lvalue_list ')'  */
#line 3043 "lang.y"
        {
	    ins_f_byte(F_SSCANF); ins_byte((char)((yyvsp[-1].number) + 2));
	}
#line 5849 "lang.c"
    break;

  case 292: /* parse_command: F_PARSE_COMMAND '(' expr0 ',' expr0 ',' expr0 lvalue_list ')'  */
#line 3048 "lang.y"
        {
	    ins_f_byte(F_PARSE_COMMAND); ins_byte((char)((yyvsp[-1].number) + 3));
	}
#line 5857 "lang.c"
    break;

  case 293: /* lvalue_list: %empty  */
#line 3052 "lang.y"
                         { (yyval.number) = 0; }
#line 5863 "lang.c"
    break;

  case 294: /* lvalue_list: ',' lvaluec lvalue_list  */
#line 3053 "lang.y"
                                     { (yyval.number) = 1 + (yyvsp[0].number); }
#line 5869 "lang.c"
    break;

  case 295: /* lvaluec: lvalue  */
#line 3054 "lang.y"
                { if (!((yyvsp[0].type) & TYPE_LVALUE)) yyerror("Illegal lvalue"); (yyval.type) = (yyvsp[0].type) & TYPE_LVALUE; deref_index--; }
#line 5875 "lang.c"
    break;

  case 297: /* identifier: F_COLON_COLON identifier2  */
#line 3058 "lang.y"
           {
               (yyval.string) = tmpalloc(strlen((yyvsp[0].string)) + 3);
               (void)sprintf((yyval.string), "::%s", (yyvsp[0].string));
           }
#line 5884 "lang.c"
    break;

  case 299: /* identifier2: identifier2 F_COLON_COLON F_IDENTIFIER  */
#line 3064 "lang.y"
           {
               (yyval.string) = tmpalloc(strlen((yyvsp[-2].string)) + strlen((yyvsp[0].string)) + 3);
               (void)sprintf((yyval.string), "%s::%s", (yyvsp[-2].string), (yyvsp[0].string));
           }
#line 5893 "lang.c"
    break;

  case 301: /* fun_identifier: F_LSH  */
#line 3069 "lang.y"
                   { (yyval.string) = DTOR_FUNC;}
#line 5899 "lang.c"
    break;

  case 302: /* fun_identifier: F_RSH  */
#line 3070 "lang.y"
                   { (yyval.string) = CTOR_FUNC;}
#line 5905 "lang.c"
    break;

  case 303: /* lvalue: identifier  */
#line 3073 "lang.y"
        {
            int var_num = lookup_local_name((yyvsp[0].string));
            if (var_num != -1) {
	        deref_stack[deref_index++] = mem_block[A_PROGRAM].current_size;
	        if (deref_index >= DEREFSIZE)
		    fatal("deref_index overflow\n");
	        ins_f_byte(F_PUSH_LOCAL_VARIABLE_LVALUE);
	        ins_byte((char)var_num);
                (yyval.type) = type_of_locals[var_num] | TYPE_LVALUE;
            } else {
	        int i = verify_declared((yyvsp[0].string));

	        if (i == -1) {
		    deref_stack[deref_index++] = -1;
		    if (deref_index >= DEREFSIZE)
		        fatal("deref_index overflow\n");
		    if (handle_function_id((yyvsp[0].string))) {
		        (yyval.type) = TYPE_FUNCTION;
		    } else {
		        char buff[100];

		        (void)snprintf(buff, sizeof(buff), "Variable %s not declared!", (yyvsp[0].string));
		        yyerror(buff);
		        (yyval.type) = TYPE_ANY;
		    }
	        } else {
		    deref_stack[deref_index++] = mem_block[A_PROGRAM].current_size;
		    if (deref_index >= DEREFSIZE)
		        fatal("deref_index overflow\n");
		    ins_f_byte(F_PUSH_IDENTIFIER_LVALUE);
		    ins_byte((char)variable_inherit_found);
		    ins_byte((char)variable_index_found);
		    (yyval.type) = (i & TYPE_MASK) | TYPE_LVALUE;
	        }
            }
	}
#line 5946 "lang.c"
    break;

  case 304: /* lvalue: expr4 '[' comma_expr ']'  */
#line 3110 "lang.y"
          {
	      deref_stack[deref_index++] = mem_block[A_PROGRAM].current_size;
	      if (deref_index >= DEREFSIZE)
		  fatal("deref_index overflow\n");
	      ins_f_byte(F_PUSH_INDEXED_LVALUE);
	      if (exact_types  && !((yyvsp[-3].type) & TYPE_MAPPING)) {
		  if (((yyvsp[-3].type) & TYPE_MOD_POINTER) == 0 && !TYPE((yyvsp[-3].type), TYPE_STRING))
		      type_error("Bad type to indexed value", (yyvsp[-3].type));
		  if (!TYPE((yyvsp[-1].type), TYPE_NUMBER))
		      type_error("Bad type of index", (yyvsp[-1].type));
	      }
	      if ((yyvsp[-3].type) == TYPE_ANY)
		  (yyval.type) = TYPE_ANY;
	      else if (TYPE((yyvsp[-3].type), TYPE_STRING))
		  (yyval.type) = TYPE_NUMBER;
	      else if ((yyvsp[-3].type) == TYPE_MAPPING)
		  (yyval.type) = TYPE_ANY;
	      else
		  (yyval.type) = (yyvsp[-3].type) & TYPE_MASK & ~TYPE_MOD_POINTER;
	      (yyval.type) |= TYPE_LVALUE;
	  }
#line 5972 "lang.c"
    break;

  case 305: /* real: F_FLOATC  */
#line 3133 "lang.y"
        {
	    ins_f_byte(F_FLOATC);
	    ins_mem(&(yyvsp[0].real), sizeof((yyvsp[0].real)));
	    (yyval.type) = TYPE_FLOAT;
	}
#line 5982 "lang.c"
    break;

  case 306: /* string: F_STRING  */
#line 3140 "lang.y"
        {
	    ins_f_byte(F_STRING);
	    ins_short(store_prog_string((yyvsp[0].string)));
	    (yyval.type) = TYPE_STRING;
	}
#line 5992 "lang.c"
    break;

  case 307: /* string_constant: string_con1  */
#line 3147 "lang.y"
        {
            (yyval.string) = (yyvsp[0].string);
        }
#line 6000 "lang.c"
    break;

  case 309: /* string_con1: string_con1 '+' F_STRING  */
#line 3153 "lang.y"
        {
	    (yyval.string) = tmpalloc( strlen((yyvsp[-2].string)) + strlen((yyvsp[0].string)) + 1 );
	    (void)strcpy((yyval.string), (yyvsp[-2].string));
	    (void)strcat((yyval.string), (yyvsp[0].string));
	}
#line 6010 "lang.c"
    break;

  case 310: /* string_con1: '(' string_con1 ')'  */
#line 3159 "lang.y"
        {
	    (yyval.string) = (yyvsp[-1].string);
	}
#line 6018 "lang.c"
    break;

  case 311: /* $@30: %empty  */
#line 3165 "lang.y"
        {
	    int i;
	    i = pop_address();
	    ins_f_byte(F_JUMP);
	    add_jump();
	    push_address();
	    ins_short(0);
	    upd_short(i, (short)mem_block[A_PROGRAM].current_size);
	}
#line 6032 "lang.c"
    break;

  case 312: /* cond: condStart statement $@30 optional_else_part  */
#line 3175 "lang.y"
        { upd_short(pop_address(), (short)mem_block[A_PROGRAM].current_size); }
#line 6038 "lang.c"
    break;

  case 313: /* condStart: F_IF '(' comma_expr ')'  */
#line 3178 "lang.y"
        {
	    ins_f_byte(F_JUMP_WHEN_ZERO);
	    add_jump();
	    push_address();
	    ins_short(0);
	}
#line 6049 "lang.c"
    break;


#line 6053 "lang.c"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;

  *++yyvsp = yyval;

  /* Now 'shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror (YY_("syntax error"));
    }

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval);
          yychar = YYEMPTY;
        }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  /* Pop stack until we find a state that shifts the error token.  */
  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYSYMBOL_YYerror;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;


      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif

  return yyresult;
}

#line 3187 "lang.y"

#line 2115 "postlang.y"

int link_errors;

static void ins_f_byte(unsigned int b)
{
    if (b - EFUN_FIRST < 256)
	ins_byte((char)(b - EFUN_FIRST));
    else
    {
	ins_byte((char)(F_EXT - EFUN_FIRST));
	ins_short((short)(b - EFUN_FIRST));
    }
}

void 
yyerror(char *str)
{
    extern int num_parse_error;

    if (num_parse_error > 5)
	return;

    fprintf(stderr, "/%s: %s line %d\n", current_file, str, current_line);
    fflush(stderr);
    smart_log(current_file, current_line, str);
    num_parse_error++;
}

static int 
check_declared(char *str)
{
    struct variable *vp;
    
    int offset;
    int inh;
    char *super_name = 0;
    char *sub_name;
    char *real_name;
    char *search;
    
    variable_index_found = variable_inherit_found = 255;
    real_name = strrchr(str, ':') + 1;
    sub_name = strchr(str, ':') + 2;
    
    if(!(real_name = (find_sstring((real_name == (char *)1) ? str : real_name))))
        return -1;
    if (sub_name == (char *)2)
	for (offset = 0; offset < mem_block[A_VARIABLES].current_size;
	     offset += sizeof (struct variable)) 
	    {
		vp = (struct variable *)&mem_block[A_VARIABLES].block[offset];
		/* Only index, prog, and type will be defined. */
		if (real_name == vp->name) 
		    {
			variable_type_mod_found = vp->type;
			variable_index_found = offset / sizeof (struct variable);
			variable_inherit_found = 255;
			return variable_index_found;
		    }
	    }
    else
	if (sub_name - str > 2)
	{
	    super_name = xalloc((size_t)(sub_name - str - 1));
	    (void)memcpy(super_name, str, (size_t)(sub_name - str - 2));
	    super_name[sub_name - str - 2] = 0;
	    if (strcmp(super_name, "this") == 0)
		return check_declared(sub_name);
	}
	else
	    str = sub_name;
    
    /* Look for the variable in the inherited programs
	*/

    for (inh = mem_block[A_INHERITS].current_size / sizeof (struct inherit) - 1;
          inh >= 0; inh -= ((struct inherit *)mem_block[A_INHERITS].block)[inh].prog->
	 num_inherited) 
    {
	if (super_name &&
	    strcmp(super_name, ((struct inherit *)mem_block[A_INHERITS].block)[inh].name) == 0)
	    search = sub_name;
	else
	    search = str;
        if (find_status (((struct inherit *)mem_block[A_INHERITS].block)[inh].prog,
			      search, TYPE_MOD_PRIVATE) != -1)
	{
	    /* Adjust for inherit-type */
	    int type = ((struct inherit *)mem_block[A_INHERITS].block)[inh].type;
	    
	    if (variable_type_mod_found & TYPE_MOD_PRIVATE)
		type &= ~TYPE_MOD_PUBLIC;
	    if (variable_type_mod_found & TYPE_MOD_PUBLIC)
		type &= ~TYPE_MOD_PRIVATE;
            variable_type_mod_found |= type & TYPE_MOD_MASK;

	    variable_inherit_found += inh -
		(((struct inherit *)mem_block[A_INHERITS].block)[inh].prog->
		 num_inherited - 1);
	    return 1;
	}
    }
    return -1;
}

static int 
handle_function_id(char *str)
{
    short i;

    if (defined_function(str)) {
	ins_f_byte(F_STRING);	/* XXX */
	ins_short(store_prog_string(str)); /* XXX */
	ins_f_byte(F_BUILD_CLOSURE); /* and build the function closure */
	if (function_type_mod_found & (TYPE_MOD_NO_MASK|TYPE_MOD_PRIVATE)) {
	    if (function_prog_found && function_prog_found->
		functions[function_index_found].type_flags & TYPE_MOD_PRIVATE)
	    {
		char buff[100];
		(void)snprintf(buff, sizeof(buff), "Function %s marked 'private'", 
			       str);
		yyerror (buff);
	    }
	    ins_byte(FUN_LFUN_NOMASK);
	    ins_byte((char)function_inherit_found);
	    ins_short((short)function_index_found);
	} else {
	    ins_byte(FUN_LFUN);
	    ins_byte((char)function_inherit_found);
	    ins_short((short)function_index_found);
	}
	return 1;
    } else if (is_simul_efun(str)) {
	ins_f_byte(F_STRING);
	ins_short(store_prog_string(str));
	ins_f_byte(F_BUILD_CLOSURE); /* and build the function closure */
	ins_byte(FUN_SFUN);
	return 1;
    } else if ((i = lookup_predef(str)) != -1) {
	ins_f_byte(F_BUILD_CLOSURE); /* and build the function closure */
	ins_byte(FUN_EFUN);
	ins_short(i);
	return 1;
    } else {
	return 0;
    }
}

static int 
verify_declared(char *str)
{
    int r;

    r = check_declared(str);
    if (r == -1)
    {
	return -1;
    }
    if (variable_inherit_found == 255)
	return ((struct variable *)mem_block[A_VARIABLES].block)[variable_index_found].
	    type;
    else
	return ((struct inherit *)mem_block[A_INHERITS].block)[variable_inherit_found].
	    prog->variable_names[variable_index_found].type;
}

void 
free_all_local_names()
{
    current_number_of_locals = 0;
    max_number_of_locals = 0;
}

static void
start_block(void)
{
    block_depth++;
}

static void end_block(void)
{
    block_depth--;
    for(;current_number_of_locals > 0 &&
        local_blockdepth[current_number_of_locals - 1] > block_depth;
        current_number_of_locals--)
        ;
}

int
lookup_local_name(char *str)
{
    int i;

    for (i = current_number_of_locals - 1; i >= 0; i--)
    {
        if (strcmp(local_names[i], str) == 0)
            return i;
    }

    return -1;
}

int 
add_local_name(char *str, int type)
{
    int var_num = lookup_local_name(str);
    if (var_num != -1) 
        if (local_blockdepth[var_num] == block_depth) {
            char buff[100];

            (void)snprintf(buff, sizeof(buff), "redefinition of variable '%s'",
                           str);
            yyerror(buff);
        }

    if (current_number_of_locals == MAX_LOCAL)
	yyerror("Too many local variables");
    else {
	type_of_locals[current_number_of_locals] = type;
	local_blockdepth[current_number_of_locals] = block_depth;
	local_names[current_number_of_locals++] = str;
    }
    if (current_number_of_locals > max_number_of_locals)
        max_number_of_locals = current_number_of_locals;
    return current_number_of_locals - 1;
}


int 
find_inherit(struct program *prog1, struct program *prog2)
{
    int i;
    
    for (i = 0; i < (int)prog1->num_inherited; i++)
	if (prog1->inherit[i].prog == prog2)
	    return i;
    return -1;
}

static void 
copy_inherits(struct program *from, int type, char *name)
{
    int i;
    struct inherit inh;
    int j[256], k = 0;
    char buf[256];
    
    if (!has_inherited)
    {
	free_sstring(((struct inherit *)mem_block[A_INHERITS].block)->name);
	mem_block[A_INHERITS].current_size = 0;
	has_inherited = 1;
    }
    for(i = 0; i < (int)from->num_variables; i++)
	if ((type | from->variable_names[i].type) & TYPE_MOD_NO_MASK &&
	    check_declared(from->variable_names[i].name) != -1 &&
	    (variable_inherit_found == 255 || ((struct inherit *)
	     (mem_block[A_INHERITS].block))[variable_inherit_found].prog != from))
	{
	    (void)snprintf(buf, sizeof(buf),
			   "Redefinition of no_mask variable %s in program %s.\n",
			   from->variable_names[i].name,
			   from->name);
            yyerror(buf);
	}

    for (i = 0; i < (int) from->num_functions; i++)
	if ((type | from->functions[i].type_flags) & TYPE_MOD_NO_MASK &&
	    defined_function(from->functions[i].name) &&
	    function_prog_found != from)
	{
	    (void)snprintf(buf, sizeof(buf),
			   "Redefinition of no_mask function %s in program %s.\n",
			   from->functions[i].name,
			   from->name);
	    yyerror(buf);
	}

    for (i = from->num_inherited - 2; i >= 0;
	 i -= from->inherit[i].prog->num_inherited)
	j[k++] = i;

    while (k) {
	/* Correct the type */
	int new_type = type;
	int old_type;
	
	i = j[--k];
	old_type = from->inherit[i].type;

	if (old_type & TYPE_MOD_PRIVATE)
	    new_type &= ~TYPE_MOD_PUBLIC;
	if (old_type & TYPE_MOD_PUBLIC)
	    new_type &= ~TYPE_MOD_PRIVATE;
	
	copy_inherits(from->inherit[i].prog,
		      old_type | new_type,
		      from->inherit[i].name);
    }
    
    inh = from->inherit[from->num_inherited - 1]; /* Make a copy */

    /* Adjust the info */
    inh.name = make_sstring(name);
    inh.type = type;
    add_to_mem_block (A_INHERITS, (char *)&inh, sizeof inh);
}

static int
check_inherits(struct program *from)
{
    int i, update = 0;
    struct object *ob;
    size_t len = strlen(from->name) - 1;
    char *ob_name = alloca(len);
    
    (void)strncpy(ob_name, from->name, len - 1);
    ob_name[len - 1] = 0;
    ob = find_object2(ob_name);

    if (!ob || ob->prog != from)
	return 0;

    for (i = from->num_inherited - 2; i >= 0;
	 i -= from->inherit[i].prog->num_inherited)
	if (!check_inherits(from->inherit[i].prog))
	    update = 1;

    if (update)
    {
	if (ob) {
	    ob->prog->flags &= ~PRAGMA_RESIDENT;
	    destruct_object(ob);
	}
	return 0;
    }
    return 1;
}

void
hash_func (int size, struct function *from, struct function_hash *hash)
{
    int i, probe, count, last_coll;
    int *coll;

    if (size <= 0)
        return;

    /* Allocate the list where we store collisions */
    coll = (int *)xalloc(sizeof(int) * size);

    /* Prepare the lists */
    for (i = 0; i < size; i++)
    {
        hash[i].next_hashed_function = -1; /* forward */
        hash[i].name = 0; /* free entry */
        coll[i] = -1;
    }

    /* Hash all non-collisions and mark collisions */
    count = 0;
    for (i = 0; i < size; i++)
    {
        probe = PTR_HASH(from[i].name, size);

        if (!hash[probe].name)
        {
            /* Free */
            hash[probe].name = from[i].name;
            hash[probe].func_index = i;
            from[i].hash_idx = probe;
        }
        else
        {
            /* Collision */
            coll[count] = i;
            count++;
        }
    }

    /* Plug collisions into the holes */
    i = 0;
    last_coll = 0;
    while (last_coll < count && i < size)
    {
        if (!hash[i].name)
        {
            /*
             * A hole, walk probe chain, update last next_hashed_function
             * to point here.
             */
            probe = PTR_HASH(from[coll[last_coll]].name, size);

            while (hash[probe].name && hash[probe].next_hashed_function != -1)
                probe = hash[probe].next_hashed_function;
            hash[probe].next_hashed_function = i;
            hash[i].name = from[coll[last_coll]].name;
            hash[i].func_index = coll[last_coll];
            from[coll[last_coll]].hash_idx = i;
            last_coll++;
        }

        i++;
    }

    free(coll);
}

/*
 * This function is called from lex.c for every new line read.
 */

void
init_lineno_info()
{
}

void
end_lineno_info()
{
}

void
store_line_number_info(int file, int line)
{
    struct lineno tmp;
    unsigned int code = mem_block[A_PROGRAM].current_size;
    struct lineno *last_lineno =
      (struct lineno *)(mem_block[A_LINENUMBERS].block + 
			mem_block[A_LINENUMBERS].current_size) - 1;

    if (mem_block[A_LINENUMBERS].current_size &&
	last_lineno->code == code) {
      last_lineno->file = file;
      last_lineno->lineno = line;
      return;
    }
    tmp.code = code;
    tmp.file = file;
    tmp.lineno = line;
    add_to_mem_block(A_LINENUMBERS, (char *)&tmp, sizeof(tmp));
}

static void 
store_reloc_data(char type, unsigned short address, char *name,
			     int value, char modifier)
{
    struct reloc rel;
    rel.type = type;
    rel.modifier = modifier;
    rel.address = address;
    rel.name = string_copy(name);
    rel.value = value;

    add_to_mem_block(A_RELOC, (char *)&rel, sizeof(struct reloc));
}
static char *
get_type_name(int type)
{
    static char buff[100];
    static char *type_name[] = { "unknown", "int", "string",
				     "void", "object", "mixed", "mapping",
				     "float", "function" };
    int pointer = 0;

    buff[0] = 0;
    if (type & TYPE_MOD_STATIC)
	(void)strcat(buff, "static ");
    if (type & TYPE_MOD_NO_MASK)
	(void)strcat(buff, "nomask ");
    if (type & TYPE_MOD_PRIVATE)
	(void)strcat(buff, "private ");
    if (type & TYPE_MOD_PUBLIC)
	(void)strcat(buff, "public ");
    if (type & TYPE_MOD_VARARGS)
	(void)strcat(buff, "varargs ");
    type &= TYPE_MASK;
    if (type & TYPE_MOD_POINTER) {
	pointer = 1;
	type &= ~TYPE_MOD_POINTER;
    }
    if (type >= sizeof type_name / sizeof type_name[0])
	fatal("Bad type\n");
    (void)strcat(buff, type_name[type]);
    (void)strcat(buff," ");
    if (pointer)
	(void)strcat(buff, "* ");
    return buff;
}

void 
type_error(char *str, int type)
{
    static char buff[100];
    char *p;
    p = get_type_name(type);
    if (strlen(str) + strlen(p) + 5 >= sizeof buff)
    {
	yyerror(str);
    }
    else
    {
	(void)strcpy(buff, str);
	(void)strcat(buff, ": \"");
	(void)strcat(buff, p);
	(void)strcat(buff, "\"");
	yyerror(buff);
    }
}

int 
remove_undefined_prototypes (int num_functions, struct function *functions) 
{
    int i;
    for (i = 0; i < num_functions;i++)
    {
	if (functions[i].type_flags & NAME_PROTOTYPE) 
	{
	    char buff[500];

	    (void)snprintf(buff, sizeof(buff),
			   "Function %s declared but never defined",
			   functions[i].name);
	    yyerror(buff);
	}
    }
    return num_functions;
}

/*
 * Compile an LPC file.
 */
void 
compile_file()
{
    int yyparse (void);

    prolog();
    (void)yyparse();
    epilog();
}

static char *
get_two_types(int type1, int type2)
{
    static char buff[100];

    (void)strcpy(buff, "( ");
    (void)strcat(buff, get_type_name(type1));
    (void)strcat(buff, "vs ");
    (void)strcat(buff, get_type_name(type2));
    (void)strcat(buff, ")");
    return buff;
}

/*
  This is used as an index of includefiles for giving correct runtime error
  messages references.
*/
void 
remember_include(char *buf)
{
    struct stat sbuf;
    char number[128];

    if (stat(buf, &sbuf)==-1) 
        fatal("LIB not able to stat open file\n");
    (void)sprintf(number,"%ld:", (long)sbuf.st_mtime);
    add_to_mem_block(A_INCLUDES, number, (int)strlen(number));
    add_to_mem_block(A_INCLUDES, buf, (int)strlen(buf) + 1);
}


/*
 * The program has been compiled. Prepare a 'struct program' to be returned.
 */

int current_id_number = 1;
#define H_OFFSET(arg) (((char *)&(((struct program *)0)->arg)) -\
		       ((char *)((struct program *)0)))

static struct section_desc sec_hdr[] =
{
    {A_HEADER, -1, -1, sizeof(struct program)},
    {A_INHERITS, H_OFFSET(inherit), H_OFFSET(num_inherited),
     sizeof(struct inherit)},
    {A_FUNC_HASH, H_OFFSET(func_hash), -1, sizeof(struct function_hash)},
    {-1, 0, 0, 0},
};
static struct section_desc sec_exe[] =
{
    {A_PROGRAM, H_OFFSET(program), H_OFFSET(program_size), 1},
    {A_RODATA, H_OFFSET(rodata), H_OFFSET(rodata_size), 1},
    {A_FUNCTIONS, H_OFFSET(functions), H_OFFSET(num_functions),
     sizeof(struct function)},
    {A_VARIABLES, H_OFFSET(variable_names), H_OFFSET(num_variables),
     sizeof(struct variable)},
    {A_CFUN, H_OFFSET(cfuns), -1, sizeof(struct cfun_desc)},
    {-1, 0, 0, 0},
};
static struct section_desc sec_dbg[] =
{
    {A_LINENUMBERS, H_OFFSET(line_numbers),
     H_OFFSET(sizeof_line_numbers), sizeof(struct lineno)},
    {A_INCLUDES, H_OFFSET(include_files),
     H_OFFSET(sizeof_include_files), 1},
    {-1, 0, 0, 0},
};

struct segment_desc segm_desc[] =
{
    /* S_HDR */
    { -1, -1, H_OFFSET(total_size),sec_hdr, },

    /* S_EXEQ */
    { H_OFFSET(program), H_OFFSET(swap_num), H_OFFSET(exec_size),sec_exe, },

    /* S_DBG */
    { H_OFFSET(line_numbers), H_OFFSET(swap_lineno_index),
    H_OFFSET(debug_size),sec_dbg, },
    { -1, -1, -1, (struct section_desc *)0 },
};

char *
load_segments(struct segment_desc *seg, struct mem_block *mem_block1)
{
    char *hdr = 0;
    int size;
    char *block;
    struct section_desc *sect;

    for ( ; seg->sections != NULL; seg++)
    {
	size = 0;
	for (sect = seg->sections; sect->section != -1; sect++)
	    size += align(mem_block1[sect->section].current_size);
	
	if (size)
	    block = xalloc((size_t)size);
	else
	    block = xalloc(1);
#ifdef PURIFY
	(void)memset(block, '\0', size ? size : 1);
#endif

	if (!hdr)
	    hdr = block;

	if (seg->ptr_offset != -1)
	    *(char **)(hdr + seg->ptr_offset) = block;

	for (sect = seg->sections; sect->section != -1; sect++)
	{
	    (void)memcpy(block, mem_block1[sect->section].block,
			 (size_t)mem_block1[sect->section].current_size);

	    if (sect->ptr_offset != -1)
		*(char **)(hdr + sect->ptr_offset) = block;
	    if (sect->num_offset != -1)
		*(unsigned short *)(hdr + sect->num_offset) = 
		    mem_block1[sect->section].current_size /
			sect->ent_size;

	    block += align(mem_block1[sect->section].current_size);
	}
	if (seg->size_offset != -1)
	    *(int *)(hdr + seg->size_offset) = size;
    }
    return hdr;
}

static void
process_reloc(struct reloc *reloc, int num_relocs, int num_inherited)
{
    unsigned int i;
    char *name;
    unsigned short fix;
    unsigned int psize;

    psize = mem_block[A_PROGRAM].current_size;
    link_errors = 0;
    
    for (i = 0; i < num_relocs; i++, reloc++)
    {
	if (reloc->address >= psize)
	    fatal("Corrupt relocation address.\n");
	
	name = reloc->name;
	switch (reloc->type)
	{
	    int call_efun;
	case R_CALL:
	    call_efun = 0;
	    if (!defined_function(name) ||
		((function_type_mod_found & TYPE_MOD_PRIVATE) &&
		function_inherit_found != num_inherited))
	    {
		if (is_simul_efun(name))
		{
		    call_efun = F_CALL_SIMUL;
		    function_index_found = store_prog_string(name);
		    function_inherit_found = 0;
		}
		else
		{
		    link_errors++;
		    (void)fprintf(stderr,"%s Function %s doesn't exist.\n",
                        inner_get_srccode_position(reloc->address,
                            (struct lineno *)mem_block[A_LINENUMBERS].block,
                            mem_block[A_LINENUMBERS].current_size /
                            sizeof(struct lineno),
                            mem_block[A_INCLUDES].block,
                            current_file), name);
                    
		    (void)fflush(stderr);
		    break;
		}
	    }
	    else if (strchr(name,':') || function_type_mod_found & (TYPE_MOD_NO_MASK|TYPE_MOD_PRIVATE))
		call_efun = F_CALL_NON_VIRT;
	    else
		call_efun = F_CALL_VIRT;
	    
	    fix = function_index_found;
	    mem_block[A_PROGRAM].block[reloc->address - 1] =
		call_efun - EFUN_FIRST;
	    mem_block[A_PROGRAM].block[reloc->address] =
		function_inherit_found;
	    mem_block[A_PROGRAM].block[reloc->address + 1] =
		((char *)&fix)[0];
	    mem_block[A_PROGRAM].block[reloc->address + 2] =
		((char *)&fix)[1];
	    break;
	    
	default:
	    fatal("Unsupported reloc data.\n");
	}
    }
}

void
link_C_functions(char *name)
{
    int i, j;
    struct cfun_desc cfun;
    int num_inherited;
    num_inherited = 
	mem_block[A_INHERITS].current_size /
	    sizeof(struct inherit);

    for(i = 0; interface[i]; i++)
	if (strcmp(interface[i]->program, name) == 0)
	    for(j = 0; interface[i]->vars[j]; j++)
	    {
		if (check_declared(interface[i]->vars[j]->name)
		    == -1)
		{
		    char buf[100];

		    (void)snprintf(buf, sizeof(buf),
				   "Variable %s (referenced from cfun) not defined.\n",
				   interface[i]->vars[j]->name);
		    current_line = -1;
		    yyerror(buf);
		}

		if (variable_inherit_found == 255)
		    variable_inherit_found = num_inherited;
		cfun.idx = variable_index_found;
		cfun.inh = variable_inherit_found - num_inherited;
		add_to_mem_block(A_CFUN, (char *)&cfun, sizeof(cfun));
	    }
}

/*
 * Optimize jumps.  If a jump's target is an unconditional jump, then update
 * the jump's target to be that of the unconditional jump.
 */
static void
optimize_jumps(void)
{
    int jumps, *ip, i, offset1, offset2, opcode;

    /*
     * Compute the number of jumps in the jump table.
     */
    jumps = mem_block_size(A_JUMPS, sizeof (int));

    /*
     * Get a pointer to the base of the jump table.
     */
    ip = (int *)mem_block[A_JUMPS].block;

    /*
     * Loop through each jump table entry.
     */
    for (i = 0; i < jumps; i++)
    {
	/*
	 * Read the target PC from the program section.
	 */
	offset2 = (unsigned short)read_short(*ip);

	/*
	 * Short-circuit all unconditional jumps.
	 */
	for (;;)
	{
	    /*
	     * Get the target PC of the jump.
	     */
	    offset1 = offset2;

	    /*
	     * Get the opcode.
	     */
	    opcode = (unsigned char)read_byte(offset2++);
	    if (opcode == F_EXT - EFUN_FIRST)
	    {
		opcode = (unsigned short)read_short(offset2);
		offset2 += 2;
	    }

	    /*
	     * If the target is not an unconditional jump, then proceed to
	     * the next jump table entry.
	     */
	    if (opcode != F_JUMP - EFUN_FIRST)
		break;

	    /*
	     * Get the target PC of the unconditional jump.
	     */
	    offset2 = (unsigned short)read_short(offset2);

	    /*
	     * If the target PC of the jump is the same as the target PC of
	     * the unconditional jump, then the jump is self-referential and
	     * not interesting.
	     */
	    if (offset2 == offset1)
		break;

	    /*
	     * Short-circuit the unconditional jump.
	     */
	    upd_short(*ip, (short)offset2);
	}

	ip++;
    }
}

static int
find_function(char *name) {
    int num_functions = mem_block[A_FUNCTIONS].current_size / sizeof (struct function);
    struct function *funcs = (struct function *)mem_block[A_FUNCTIONS].block;

    for (int idx = 0; idx < num_functions; idx++)
        if (strcmp(name, funcs[idx].name) == 0)
            return idx;
    return -1;
}

void
epilog()
{
    int i, ix;
    extern int pragma_resident;
    int functions_left; /* Functions left after removing dangling prototypes */
    extern int total_program_size;
    struct inherit inherit_self;
    int has_dtor, has_ctor;

#ifdef DEBUG
    if (num_parse_error == 0 && type_of_arguments.current_size != 0)
	fatal("Failed to deallocate argument type stack\n");
#endif
#ifdef DEALLOCATE_MEMORY_AT_SHUTDOWN
    if (type_of_arguments.block != NULL)
    {
	type_of_arguments.max_size = 0;
	type_of_arguments.current_size = 0;
	free(type_of_arguments.block);
	type_of_arguments.block = NULL;
    }
#endif
    /*
     * Define the .CTOR function, but only if there was any code
     * to initialize.
     */
    has_ctor = find_function(".CTOR");
    has_dtor = find_function(".DTOR");

    if (first_last_initializer_end != last_initializer_end)
    {
	if (has_ctor != -1)
	{
	    struct function *funp1;
	    
	    funp1 = &((struct function *)
		    mem_block[A_FUNCTIONS].block)[has_ctor];
	    upd_short(last_initializer_end, funp1->offset);
	    funp1->offset = 0;
	}
	else
	{
	    has_ctor = mem_block[A_FUNCTIONS].current_size /
		sizeof(struct function);
	    define_new_function(".CTOR", 0, 0, 0,
				TYPE_MOD_PRIVATE | TYPE_VOID, 0);
	    /*
	     * Change the last jump after the last initializer into a
	     * return(1) statement.
	     */
	    mem_block[A_PROGRAM].block[last_initializer_end - 1] =
		F_CONST1 - EFUN_FIRST;
	    mem_block[A_PROGRAM].block[last_initializer_end] =
		F_RETURN - EFUN_FIRST;
	}
    }

    functions_left = remove_undefined_prototypes (
              (int)(mem_block[A_FUNCTIONS].current_size / sizeof (struct function)),
    (struct function *)mem_block[A_FUNCTIONS].block);

    /* I don't like doing this, but I see no other way. |D| */
    mem_block[A_FUNCTIONS].current_size = 
        functions_left * sizeof (struct function);


    if (!(num_parse_error || inherit_file))
    {
	optimize_jumps();

	link_C_functions(current_file);

	link_errors = 0;
	process_reloc((struct reloc *)mem_block[A_RELOC].block,
		      (int)(mem_block[A_RELOC].current_size / sizeof(struct reloc)),
		      (int)(mem_block[A_INHERITS].current_size / sizeof(struct inherit)));
	num_parse_error += link_errors;
    }
    {
	int c;

	for (c = 0;
	     c < mem_block[A_RELOC].current_size / sizeof(struct reloc);
	     c++)
	    free(((struct reloc *)mem_block[A_RELOC].block)[c].name);
    }

    inherit_self.type = 0;
    inherit_self.name = make_sstring("this");
    inherit_self.prog = 0;
    inherit_self.variable_index_offset = 0;
    add_to_mem_block(A_INHERITS, (char *) &inherit_self, sizeof(struct inherit));

    add_to_mem_block(A_HEADER, (char *)&NULL_program, sizeof(NULL_program));
    {
	int num_func = 
	    mem_block[A_FUNCTIONS].current_size / sizeof(struct function);

	    mem_block[A_FUNC_HASH].current_size = num_func *
		sizeof(struct function_hash);
	if (num_func)
	{
	    mem_block[A_FUNC_HASH].block =
		realloc(mem_block[A_FUNC_HASH].block, num_func *
			sizeof(struct function_hash));
	    	mem_block[A_FUNC_HASH].max_size = 
		    mem_block[A_FUNC_HASH].current_size;
	}
	hash_func(num_func, (struct function *)mem_block[A_FUNCTIONS].block,
		  (struct function_hash *)mem_block[A_FUNC_HASH].block);
    }
    end_lineno_info();

    prog = (struct program *)load_segments(segm_desc, mem_block);

    prog->ref = 1;
    prog->swap_num = 0;
    prog->ctor_index = has_ctor;
    prog->dtor_index = has_dtor;
    prog->mod_time = current_time;
    prog->name = string_copy(current_file);
    prog->id_number = current_id_number++;
    prog->clones = NULL;
    prog->num_clones = 0;
#if defined(PROFILE_LPC)
    prog->cpu = 0;
    prog->last_avg_update = 0;
#endif
    prog->swap_lineno_index = 0;
    prog->flags = (pragma_no_inherit ? PRAGMA_NO_INHERIT : 0) |
	(pragma_no_clone ? PRAGMA_NO_CLONE : 0) |
	(pragma_no_shadow ? PRAGMA_NO_SHADOW : 0) |
        (pragma_resident ? PRAGMA_RESIDENT : 0);
    
    prog->inherit[prog->num_inherited - 1].prog = prog;

    for (i = ix = 0; i < (int)prog->num_inherited; i++)
    {
	int inh = find_inherit(prog, prog->inherit[i].prog);
	if (inh == i)
	{
	    prog->inherit[i].variable_index_offset = ix;
	    ix += prog->inherit[i].prog->num_variables;
	    prog->inherit[i].type &= ~TYPE_MOD_SECOND;
	}
	else
	{
	    prog->inherit[i].variable_index_offset = 
		prog->inherit[inh].variable_index_offset;
	    prog->inherit[i].type |= TYPE_MOD_SECOND;
	}
    }

    /*  don't forget the following:
     *   prog->sizeof_argument_types = 
     *			mem_block[A_ARGUMENT_TYPES??].current_size);
     *   if you have fixed it one day .... ok ? :-=)
     *   remember to remove the above change to total_size !!!!!!!!
     */
    prog->sizeof_argument_types=0;
    /* NOTE: Don't forget to hash the argument types along with the functions
     */  
    prog->argument_types = 0;	/* For now. Will be fixed someday */

    prog->type_start = 0;


    for (i = 0; i < (int)prog->num_inherited - 1; i++)
    {
	reference_prog (prog->inherit[i].prog, "inheritance");
    }

    prog->load_time = current_time;
    
    register_program(prog);

    /*  marion
	Do referencing here - avoid multiple referencing when an object
	inherits more than one object and one of the inherited is already
	loaded and not the last inherited
    */
    total_program_size += prog->exec_size;
    total_prog_block_size += prog->total_size;
    total_num_prog_blocks += 1;

    for (i=0; i < A_NUM; i++)
        free((char *)mem_block[i].block);

    if (num_parse_error || inherit_file)
    {
        free_prog(prog);
        prog = NULL;
    }
}

/*
 * Initialize the environment that the compiler needs.
 */
static void 
prolog() 
{
    int i;
#ifdef AUTO_INCLUDE
    char auto_include[] = AUTO_INCLUDE;
#endif
    if (type_of_arguments.block == 0) {
	type_of_arguments.max_size = 100;
	type_of_arguments.block = xalloc((size_t)type_of_arguments.max_size);
    }
    type_of_arguments.current_size = 0;
    prog = 0;		/* 0 means fail to load. */
    comp_stackp = 0;	/* Local temp stack used by compiler */
    current_continue_address = 0;
    current_break_address = 0;
    current_case_address = 0;
    num_parse_error = 0;
    try_level = break_try_level = continue_try_level = 0;
    free_all_local_names();	/* In case of earlier error */
    /* Initialize memory blocks where the result of the compilation
     * will be stored.
     */
    for (i=0; i < NUMAREAS; i++) {
	mem_block[i].block = xalloc(START_BLOCK_SIZE);
	mem_block[i].current_size = 0;
	mem_block[i].max_size = START_BLOCK_SIZE;
    }
    init_lineno_info();
    add_new_init_jump();
    first_last_initializer_end = last_initializer_end;
    has_inherited = 1;
    if (auto_ob && strcmp(current_file, auto_ob->prog->name))
    {
	copy_inherits(auto_ob->prog, 0, "auto");
	has_inherited = 0;
    }
#ifdef AUTO_INCLUDE
    current_line = 0;
    if (!handle_include(auto_include, 1))
       current_line = 1;
#endif

}

/*
 * Add a trailing jump after the last initialization code.
 */
void 
add_new_init_jump() 
{
    /*
     * Add a new jump.
     */
    ins_f_byte(F_JUMP);
    last_initializer_end = mem_block[A_PROGRAM].current_size;
    ins_short(0);
}

static int
search_for_ext_function(char *name, struct program *prog1)
{
    char *ix;
    int i, res;
    
    ix = strchr(name, ':');
    if (ix == NULL)
    {
	/* its a simple name so search for it the normal way */
	return search_for_function(name, prog1);
    }

    if (ix - name == 4 && strncmp(name, "this", 4) == 0)
	return search_for_ext_function(ix + 2, prog1);

    for (i = prog1->num_inherited - 2; i >= 0; i--) 
    {
	if (ix == name || (strlen(prog1->inherit[i].name) == ix - name &&
			   strncmp(prog1->inherit[i].name, name, (size_t)(ix - name)) == 0))
	{
	    res = search_for_ext_function(ix + 2, prog1->inherit[i].prog);
	    if (res)
	    {
		int type_mod;
		
		/* adjust values and return */
		function_inherit_found += i -
		    (prog1->inherit[i].prog->num_inherited - 1);
		type_mod = prog1->inherit[function_inherit_found].type;
		
		/* Correct function_type_mod_found */
		if (function_type_mod_found & TYPE_MOD_PRIVATE)
		    type_mod &= ~TYPE_MOD_PUBLIC;
		if (function_type_mod_found & TYPE_MOD_PUBLIC)
		    type_mod &= ~TYPE_MOD_PRIVATE;
		function_type_mod_found |= type_mod;

		return res;
	    }
	    else
	    {
		/* skip program and continue */
		i -= prog1->inherit[i].prog->num_inherited - 1;
	    }
	    
	}
	
    }
    return 0;
}
