nightmare4_fluffos_v1/
nightmare4_fluffos_v1/bin/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/ChangeLog.old/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/Win32/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/simuls/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/clone/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/command/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/data/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/etc/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/master/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/log/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/compiler/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/efuns/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/operators/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/u/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/tmp/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/windows/
nightmare4_fluffos_v1/lib/cfg/
nightmare4_fluffos_v1/lib/cmds/admins/
nightmare4_fluffos_v1/lib/cmds/common/
nightmare4_fluffos_v1/lib/cmds/creators/include/
nightmare4_fluffos_v1/lib/cmds/creators/include/SCCS/
nightmare4_fluffos_v1/lib/cmds/hm/
nightmare4_fluffos_v1/lib/daemon/services/
nightmare4_fluffos_v1/lib/doc/
nightmare4_fluffos_v1/lib/doc/faq/
nightmare4_fluffos_v1/lib/doc/help/classes/
nightmare4_fluffos_v1/lib/doc/help/creators/
nightmare4_fluffos_v1/lib/doc/help/hm/
nightmare4_fluffos_v1/lib/doc/help/players/
nightmare4_fluffos_v1/lib/doc/help/races/
nightmare4_fluffos_v1/lib/doc/help/religion/
nightmare4_fluffos_v1/lib/doc/mudlib/
nightmare4_fluffos_v1/lib/doc/mudlib/cfg/
nightmare4_fluffos_v1/lib/domains/Ylsrim/
nightmare4_fluffos_v1/lib/domains/Ylsrim/adm/
nightmare4_fluffos_v1/lib/domains/Ylsrim/armour/
nightmare4_fluffos_v1/lib/domains/Ylsrim/fish/
nightmare4_fluffos_v1/lib/domains/Ylsrim/meal/
nightmare4_fluffos_v1/lib/domains/Ylsrim/npc/
nightmare4_fluffos_v1/lib/domains/Ylsrim/virtual/
nightmare4_fluffos_v1/lib/domains/Ylsrim/weapon/
nightmare4_fluffos_v1/lib/domains/Ylsrim/xtra/
nightmare4_fluffos_v1/lib/lib/comp/
nightmare4_fluffos_v1/lib/lib/lvs/
nightmare4_fluffos_v1/lib/lib/std/
nightmare4_fluffos_v1/lib/lib/user/
nightmare4_fluffos_v1/lib/news/
nightmare4_fluffos_v1/lib/obj/
nightmare4_fluffos_v1/lib/obj/include/
nightmare4_fluffos_v1/lib/save/
nightmare4_fluffos_v1/lib/save/kills/a/
nightmare4_fluffos_v1/lib/save/kills/b/
nightmare4_fluffos_v1/lib/save/kills/f/
nightmare4_fluffos_v1/lib/save/kills/m/
nightmare4_fluffos_v1/lib/save/kills/q/
nightmare4_fluffos_v1/lib/save/kills/r/
nightmare4_fluffos_v1/lib/secure/cfg/
nightmare4_fluffos_v1/lib/secure/cfg/classes/
nightmare4_fluffos_v1/lib/secure/cfg/races/SCCS/
nightmare4_fluffos_v1/lib/secure/cmds/creators/include/
nightmare4_fluffos_v1/lib/secure/cmds/players/
nightmare4_fluffos_v1/lib/secure/cmds/players/include/
nightmare4_fluffos_v1/lib/secure/daemon/include/
nightmare4_fluffos_v1/lib/secure/lib/
nightmare4_fluffos_v1/lib/secure/lib/include/
nightmare4_fluffos_v1/lib/secure/lib/net/
nightmare4_fluffos_v1/lib/secure/lib/std/
nightmare4_fluffos_v1/lib/secure/obj/
nightmare4_fluffos_v1/lib/secure/obj/include/
nightmare4_fluffos_v1/lib/secure/save/
nightmare4_fluffos_v1/lib/secure/save/boards/
nightmare4_fluffos_v1/lib/secure/save/votes/
nightmare4_fluffos_v1/lib/spells/
nightmare4_fluffos_v1/lib/verbs/admins/include/
nightmare4_fluffos_v1/lib/verbs/common/
nightmare4_fluffos_v1/lib/verbs/common/include/
nightmare4_fluffos_v1/lib/verbs/creators/
nightmare4_fluffos_v1/lib/verbs/creators/include/
nightmare4_fluffos_v1/lib/verbs/players/include/SCCS/
nightmare4_fluffos_v1/lib/verbs/rooms/
nightmare4_fluffos_v1/lib/verbs/rooms/include/
nightmare4_fluffos_v1/lib/www/
nightmare4_fluffos_v1/old/
nightmare4_fluffos_v1/old/tools/
nightmare4_fluffos_v1/win32/
#ifndef _LEX_H_
#define _LEX_H_

#define DEFMAX 20000 //at least 4 times MAXLINE
#define MAXLINE 4096
#define MLEN 4096
#define NSIZE 256
#define MAX_INSTRS 512
#define EXPANDMAX 25000
#define NARGS 25
#define MARKS '@'

#define SKIPWHITE while (isspace((unsigned char)*p) && (*p != '\n')) p++

#define DEFAULT_NONE           0xff
#define DEFAULT_THIS_OBJECT    0xfe

#define PRAGMA_STRICT_TYPES    1
#define PRAGMA_WARNINGS        2
#define PRAGMA_SAVE_TYPES      4
#define PRAGMA_SAVE_BINARY     8
#define PRAGMA_OPTIMIZE       16
#define PRAGMA_ERROR_CONTEXT  32
#define PRAGMA_OPTIMIZE_HIGH  64
/* for find_or_add_ident */
#define FOA_GLOBAL_SCOPE       0x1
#define FOA_NEEDS_MALLOC       0x2

typedef struct {
  SIGNED short local_num, global_num, efun_num;
  SIGNED short function_num, simul_num, class_num;
} defined_name_t;

typedef struct ifstate_s {
    struct ifstate_s *next;
    int state;
} ifstate_t;

typedef struct defn_s {
    struct defn_s *next;
    char *name;
    char *exps;
    int flags;
    int nargs;
} defn_t;

/* must be a power of 4 */
#define DEFHASH 128
#define defhash(s) (whashstr((s)) & (DEFHASH - 1))

#define DEF_IS_UNDEFINED 1
#define DEF_IS_PREDEF    2
/* used only in edit_source */
#define DEF_IS_NOT_LOCAL 4

/* to speed up cleaning the hash table, and identify the union */
#define IHE_RESWORD    0x8000   /* reserved word */
#define IHE_EFUN       0x4000   /* efun name */
#define IHE_SIMUL      0x2000   /* active simul efun name */
#define IHE_ORPHAN     0x1000   /* old and unused simul efun name */
#define IHE_PERMANENT  (IHE_RESWORD | IHE_EFUN | IHE_SIMUL | IHE_ORPHAN)
#define TOKEN_MASK     0x0fff

#define INDENT_HASH_SIZE 1024 /* must be a power of 2 */

typedef struct ident_hash_elem_s {
    const char *name;
    short token; /* only flags */
    unsigned short sem_value; /* for these, a count of the ambiguity */
    struct ident_hash_elem_s *next;
/* the fields above must correspond to struct keyword_t */
    struct ident_hash_elem_s *next_dirty;
    defined_name_t dn;
} ident_hash_elem_t;

typedef struct {
    const char *word;
    unsigned short token;       /* flags here too */
    unsigned short sem_value;   /* semantic value for predefined tokens */
    ident_hash_elem_t *next;
/* the fields above must correspond to struct ident_hash_elem */
    short min_args;             /* Minimum number of arguments. */
    short max_args;             /* Maximum number of arguments. */
    short ret_type;             /* The return type used by the compiler. */
    unsigned short arg_type1;   /* Type of argument 1 */
    unsigned short arg_type2;   /* Type of argument 2 */
    unsigned short arg_type3;   /* Type of argument 1 */
    unsigned short arg_type4;   /* Type of argument 2 */
    short arg_index;            /* Index pointing to where to find arg type */
    short Default;              /* an efun to use as default for last
                                 * argument */
} keyword_t;

typedef struct lpc_predef_s {
    char *flag;
    struct lpc_predef_s *next;
} lpc_predef_t;

#define EXPECT_ELSE 1
#define EXPECT_ENDIF 2

extern lpc_predef_t *lpc_predefs;

#define isalunum(c) (uisalnum(c) || (c) == '_')

/*
 * Information about all instructions. This is not really needed as the
 * automatically generated efun_arg_types[] should be used.
 */

/* indicates that the instruction is only used at compile time */
#define F_ALIAS_FLAG 1024

typedef struct {
    short max_arg, min_arg;  /* Can't use char to represent -1 */
    short type[4];           /* need a short to hold the biggest type flag */
    short Default;
    short ret_type;
    const char *name;
    int arg_index;
} instr_t;

/*
 * lex.c
 */
extern instr_t instrs[512];
extern int current_line;
extern int current_line_base;
extern int current_line_saved;
extern int total_lines;
extern char *current_file;
extern int current_file_id;
extern int pragmas;
extern int num_parse_error;
extern lpc_predef_t *lpc_predefs;
extern int efun_arg_types[];
extern char yytext[MAXLINE];
extern keyword_t predefs[];
extern int lex_fatal;
extern int arrow_efun, evaluate_efun, this_efun, to_float_efun, to_int_efun, new_efun;

INLINE void push_function_context (void);
void pop_function_context (void);
int yylex (void);
void init_num_args (void);
const char *query_instr_name (int);
char *get_f_name (int);
void set_inc_list (char *);
void start_new_file (int);
void end_new_file (void);
int lookup_predef (char *);
void add_predefines (void);
char *main_file_name (void);
char *get_defined_name (defined_name_t *);
ident_hash_elem_t *find_or_add_ident (const char *, int);
ident_hash_elem_t *find_or_add_perm_ident (const char *);
ident_hash_elem_t *lookup_ident (const char *);
void free_unused_identifiers (void);
void init_identifiers (void);
char *show_error_context (void);
#ifdef DEBUGMALLOC_EXTENSIONS
void mark_all_defines (void);
#endif

#endif