⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sem.mli

📁 用ocaml编写的pascal编译程序
💻 MLI
字号:
(* ---- Abstraction semantique pour les types  ----------------------------------- *)type a_btype = A_int | A_booland  a_call  = A_adr | A_val                   (* par adresse ou par valeur *)and  a_type  = A_bty of a_btype                (* type de base              *)              | A_arr of a_btype                (* type tableau de ...       *)and  a_name  = A_var of a_type*a_call          (* variable ou parametre     *)             | A_proc of (a_type*a_call) list  (* procedure                 *)type s_sem   = A_btype of a_btype             | A_name  of a_name             | A_none(* ---- Syntaxe abstraite pour les programmes ------------------------------------ *)type s_ident   = stringand  s_ident_s = s_ident*s_semtype s_number   = intand  s_number_s = s_number*s_semtype s_cst   = S_num of s_number | S_true | S_falsetype s_unop  = S_minus | S_nottype s_binop = S_add | S_sub | S_mul | S_div | S_and | S_or             | S_leq | S_les | S_geq | S_grt | S_eq  | S_neqtype s_expr    = S_cst of s_cst               | S_una of s_unop*s_expr_s               | S_bin of s_binop*s_expr_s*s_expr_s               | S_der of s_derefand  s_deref   = s_ident_s*(s_expr_s option)and  s_expr_s  = s_expr*s_semtype s_instr  = S_aff of s_deref*s_expr_s                  (* affectations  *)              | S_ite of s_expr_s*s_instr*s_instr          (* if then else  *)              | S_whi of s_expr_s*s_instr                  (* while do      *)              | S_lst of s_instr list                      (* begin end     *)              | S_cal of s_ident_s*(s_expr_s list)         (* appel proc.   *)type s_btype   = S_int | S_booltype s_tdecl   = S_dbty of s_btype                | S_darr of s_expr_s*s_expr_s*s_btypetype s_vdecl   = s_ident*s_tdecltype s_call    = S_value | S_addrtype s_tspec   = S_sbty of s_btype                | S_sarr of s_ident*s_ident*s_btypetype s_pspec   = s_call*s_ident*s_tspectype s_block   = S_blk of (s_vdecl list)*(s_procd list)*(s_instr list)and  s_procd   = s_ident*(s_pspec list)*s_blockand  s_program = s_ident*s_block(* ---- API des fonctions de typage -------------------------------- *)exception Not_available of stringexception Type_error of stringval sem_compute : s_program -> s_programval sem_null    : s_semval sem_btype   : s_sem ->  a_btypeval sem_var     : s_sem -> (a_type*a_call)val sem_proc    : s_sem -> (a_type*a_call) list

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -