加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
absyn.ml 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
Your Name 提交于 2021-08-03 03:58 . 1
type pos = int * int
type symbol = Symbol.t
type var =
| SimpleVar of symbol * pos
| FieldVar of var * symbol * pos
| SubscriptVar of var * exp * pos
and exp =
| VarExp of var
| NilExp
| IntExp of int
| StringExp of string * pos
| CallExp of symbol * exp list * pos
| OpExp of exp * oper * exp * pos
| RecordExp of (symbol * exp * pos) list * symbol * pos
| SeqExp of exp list
| AssignExp of var * exp * pos
| IfExp of exp * exp * exp option * pos
| WhileExp of exp * exp * pos
| ForExp of symbol * bool ref * exp * exp * exp * pos
| BreakExp of pos
| LetExp of dec list * exp * pos
| ArrayExp of symbol * exp * exp * pos
and dec =
| FunctionDec of fundec list
| VarDec of vardec
| TypeDec of tydec list
and ty =
| NameTy of symbol * pos
| RecordTy of field list
| ArrayTy of symbol * pos
and oper =
| PlusOp
| MinusOp
| TimesOp
| DivideOp
| EqOp
| NeqOp
| LtOp
| LeOp
| GtOp
| GeOp
and field = symbol * bool ref * symbol * pos
and fundec = symbol * field list * (symbol * pos) option * exp * pos
and tydec = (symbol * ty * pos)
and vardec = symbol * bool ref * (symbol * pos) option * exp * pos
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化