Пример #1
0
/* Collection containing all line infos */
static Collection LineInfoList = STATIC_COLLECTION_INITIALIZER;

/* Collection with currently active line infos */
static Collection CurLineInfo = STATIC_COLLECTION_INITIALIZER;

/* Hash table functions */
static const HashFunctions HashFunc = {
    HT_GenHash,
    HT_GetKey,
    HT_Compare
};

/* Line info hash table */
static HashTable LineInfoTab = STATIC_HASHTABLE_INITIALIZER (1051, &HashFunc);

/* The current assembler input line */
static LineInfo* AsmLineInfo = 0;



/*****************************************************************************/
/*                           Hash table functions                            */
/*****************************************************************************/



static unsigned HT_GenHash (const void* Key)
/* Generate the hash over a key. */
{
Пример #2
0
    unsigned long       Size;           /* Size of file */
    unsigned long       MTime;          /* Time of last modification */
};

/* Array of all entries, listed by index */
static Collection FileTab = STATIC_COLLECTION_INITIALIZER;

/* Hash table functions */
static const HashFunctions HashFunc = {
    HT_GenHash,
    HT_GetKey,
    HT_Compare
};

/* Hash table, hashed by name */
static HashTable HashTab = STATIC_HASHTABLE_INITIALIZER (HASHTAB_COUNT, &HashFunc);



/*****************************************************************************/
/*                           Hash table functions                            */
/*****************************************************************************/



static unsigned HT_GenHash (const void* Key)
/* Generate the hash over a key. */
{
    return (*(const unsigned*)Key & HASHTAB_MASK);
}
Пример #3
0
    TokNode*        TokLast;    /* Pointer to last token in list */
    StrBuf          Name;       /* Macro name, dynamically allocated */
    unsigned        Expansions; /* Number of active macro expansions */
    unsigned char   Style;      /* Macro style */
    unsigned char   Incomplete; /* Macro is currently built */
};

/* Hash table functions */
static const HashFunctions HashFunc = {
    HT_GenHash,
    HT_GetKey,
    HT_Compare
};

/* Macro hash table */
static HashTable MacroTab = STATIC_HASHTABLE_INITIALIZER (117, &HashFunc);

/* Structs that holds data for a macro expansion */
typedef struct MacExp MacExp;
struct MacExp {
    MacExp*     Next;           /* Pointer to next expansion */
    Macro*      M;              /* Which macro do we expand? */
    unsigned    IfSP;           /* .IF stack pointer at start of expansion */
    TokNode*    Exp;            /* Pointer to current token */
    TokNode*    Final;          /* Pointer to final token */
    unsigned    MacExpansions;  /* Number of active macro expansions */
    unsigned    LocalStart;     /* Start of counter for local symbol names */
    unsigned    ParamCount;     /* Number of actual parameters */
    TokNode**   Params;         /* List of actual parameters */
    TokNode*    ParamExp;       /* Node for expanding parameters */
    LineInfo*   LI;             /* Line info for the expansion */