1 Star 0 Fork 1

ylyhappy/编译原理虎书代码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
symbol.h 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
ylyhappy 提交于 2024-05-21 15:41 . 解决了$1消失的问题
/*
* symbol.h - Symbols and symbol-tables
*
*/
#ifndef __SYMBOL_H
#define __SYMBOL_H
#include <stdio.h>
#include <string.h>
#include "util.h"
#include "table.h"
typedef struct S_symbol_ *S_symbol;
/* Make a unique symbol from a given string.
* Different calls to S_Symbol("foo") will yield the same S_symbol
* value, even if the "foo" strings are at different locations. */
S_symbol S_Symbol(string);
/* Extract the underlying string from a symbol */
string S_name(S_symbol);
/* S_table is a mapping from S_symbol->any, where "any" is represented
* here by void* */
typedef struct TAB_table_ *S_table;
/* Make a new table */
S_table S_empty(void);
/* Enter a binding "sym->value" into "t", shadowing but not deleting
* any previous binding of "sym". */
void S_enter(S_table t, S_symbol sym, void *value);
/* Look up the most recent binding of "sym" in "t", or return NULL
* if sym is unbound. */
void *S_look(S_table t, S_symbol sym);
/* Start a new "scope" in "t". Scopes are nested. */
void S_beginScope(S_table t);
/* Remove any bindings entered since the current scope began,
and end the current scope. */
void S_endScope(S_table t);
#endif // !__SYMBOL_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ylyhappy/hushu.git
git@gitee.com:ylyhappy/hushu.git
ylyhappy
hushu
编译原理虎书代码
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385