parrotcode: languages/cola/sym.c | |
Contents | Language Implementations | Cola |
languages/cola/sym.c
Symbol and Abstract Syntax Tree management utils.
void assert(void *p)
unsigned int hash_str(const char *str)
void init_symbol_tables()
SymbolTable *new_symbol_table()
Symbol *new_symbol(const char *name)
Symbol *new_identifier_symbol(const char *name)
Symbol *new_literal_symbol(const char *name)
Symbol *new_type_symbol(const char *name)
Symbol *mk_namespace_symbol(Symbol *identifier)
Symbol *mk_class_symbol(Symbol *identifier)
Symbol *mk_method_symbol(Symbol *rettype, const char *name, const char *sig)
Symbol *symbol_concat(Symbol *s1, Symbol *s2)
Symbol *symbol_join3(Symbol *s1, Symbol *s2, Symbol *s3)
Symbol *symbol_join4(Symbol *s1, Symbol *s2, Symbol *s3, Symbol *s4)
AST *new_ast(enum ASTKIND kind, int asttype, AST *arg1, AST *arg2)
void push(Node ** list, Node *p)
void tpush(Node ** list, Node *p)
void tunshift(Node ** list, Node *p)
Node *pop(Node ** list)
Node *tpop(Node ** list)
void push_sym(Symbol ** list, Symbol *p)
void tpush_sym(Symbol ** list, Symbol *p)
void tunshift_sym(Symbol ** list, Symbol *p)
Symbol *pop_sym(Symbol ** list)
Symbol *tpop_sym(Symbol ** list)
void push_namespace(Symbol *ns)
Symbol *pop_namespace()
void unshift_ast(AST ** list, AST *p)
AST *new_statement(int stmnttype, AST *left, AST *right)
AST *new_expr(int exprtype, AST *left, AST *right)
AST *new_op_expr(AST *left, int op, AST *right)
AST *new_logical_expr(AST *left, int op, AST *right)
AST *new_if(AST *condition, AST *then_part, AST *else_part)
AST *new_conditional(AST *condition, AST *then_part, AST *else_part)
AST *new_while(AST *condition, AST *block)
AST *new_for(AST *init, AST *condition, AST *iteration, AST *block)
Symbol *split(const char *pattern, const char *s)
Symbol *lookup_symbol(const char *name)
Symbol *lookup_symbol_in_tab(SymbolTable *tab, const char *name)
Symbol *lookup_namespace(SymbolTable *tab, const char *name)
Symbol *lookup_class(SymbolTable *tab, const char *name)
Symbol *lookup_symbol_scope(SymbolTable *tab, const char *name, int scope_level)
Symbol *store_symbol(SymbolTable *tab, Symbol *sym)
Symbol *store_method(SymbolTable *tab, const char *name, Type *type)
void declare_local(Symbol *s)
void declare_field(Symbol *s)
void dump_namespace(Symbol *ns)
void dump_symbol_table(SymbolTable *tab)
Symbol *check_id_redecl(SymbolTable *table, const char *name)
Symbol *check_id_decl(SymbolTable *table, const char *name)
int push_scope()
Symbol *pop_scope()
void discard_scope()
void push_primary_block(AST *p)
AST *pop_primary_block()
AST *get_cur_primary_block()
char *str_dup(const char *old)
char *str_cat(const char *s1, const char *s2)
|