?? symbol.h
字號:
#ifndef __SYMBOL_H__
#define __SYMBOL_H__
/* pxdscript symbol.h
*/
#include "tree.h"
/* It has been shown by experiments that using a hashtable size of 317 will lead to
the best distribution of symbol names under the hash-code function used here */
#define HashSize 317
/* functions defining the datastructure used */
typedef struct SymbolTable {
SYMBOL *table[HashSize];
struct SymbolTable *parent;
} SymbolTable;
/* Initialize the hash table which makes up the symbol table. */
SymbolTable *initSymbolTable();
SymbolTable *scopeSymbolTable(SymbolTable *t);
/* Insert into the symboltable. */
SYMBOL *putSymbol(SymbolTable *t, char *name, SymbolKind kind);
/* Retrieve from the symbol table. */
SYMBOL *getSymbol(SymbolTable *t, char *name);
/* Returns 1 (true) if a symbol of the given name is found in the symbol table, 0 otherwise */
int defSymbol(SymbolTable *t, char *name);
/* the functions that build the symboltable */
void symSCRIPTCOLLECTION(SCRIPTCOLLECTION *s);
/* First pass functions */
void sym1PassSCRIPTCOLLECTION(SCRIPTCOLLECTION *s);
void sym1PassTOPLEVEL(TOPLEVEL *t, SymbolTable *sym);
void sym1PassFUNCTION(FUNCTION *f, SymbolTable *sym);
void sym1PassPROGRAM(PROGRAM *s, SymbolTable *sym);
void sym1PassDECL(DECL *d, SymbolTable *sym);
void sym1PassFORINIT(FORINIT *f, SymbolTable *sym);
void sym1PassSTM(STM *s, SymbolTable *sym);
void sym1PassIDENTIFIER(IDENTIFIER *i, DECL *decl, SymbolTable *sym);
void sym1PassEXP(EXP * e, SymbolTable *sym);
void sym1PassLVALUE(LVALUE *l, SymbolTable *sym);
/* Second pass functions */
void sym2PassSCRIPTCOLLECTION(SCRIPTCOLLECTION *s);
void sym2PassTOPLEVEL(TOPLEVEL *t, SymbolTable *sym);
void sym2PassFUNCTION(FUNCTION *f, SymbolTable *sym);
void sym2PassPROGRAM(PROGRAM *s, SymbolTable *sym);
void sym2PassDECL(DECL *d, SymbolTable *sym);
void sym2PassFORINIT(FORINIT *f, SymbolTable *sym);
void sym2PassSTM(STM *s, SymbolTable *sym);
void sym2PassEXP(EXP * e, SymbolTable *sym);
/* chenhongyu, 2004-9-17. */
void sym1PassSIMPLEDECL(DECL *d, SymbolTable *sym);
void sym2PassSIMPLEDECL(DECL *d, SymbolTable *sym);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -