scyther/src/symbol.h
ccremers 60b02eea0e - Renamed nearly all files. Now, we try to use singular terms.
Exception: states.h is the plural form.
2004-07-24 19:07:29 +00:00

48 lines
890 B
C

#ifndef SYMBOLS
#define SYMBOLS
//! Size of symbol hashtable.
/** Optimistically large. Should be a prime, says theory.
*/
#define HASHSIZE 997
#define T_UNDEF -1
#define T_PROTOCOL 0
#define T_CONST 1
#define T_VAR 2
#define T_SYSCONST 3
#define EOS 0
struct symbol
{
//! Type of symbol.
/**
*\sa T_UNDEF, T_PROTOCOL, T_CONST, T_VAR, T_SYSCONST
*/
int type;
//! Line number at which it occurred.
int lineno;
//! Ascii string with name of the symbol.
char *text;
//! Possible next pointer.
struct symbol *next;
//! Used for linking all symbol blocks, freed or in use.
struct symbol *allocnext;
};
typedef struct symbol *Symbol;
void symbolsInit (void);
void symbolsDone (void);
Symbol get_symb (void);
void free_symb (Symbol s);
void insert (Symbol s);
Symbol lookup (char *s);
void symbolPrint (Symbol s);
Symbol symbolSysConst (char *str);
#endif