module Ptree:sig
..end
Arbres issus du parsing
typeloc =
Stdlib.Lexing.position * Stdlib.Lexing.position
type
ident = {
|
id : |
|
id_loc : |
type
typ =
| |
Tint |
| |
Tstructp of |
type
unop =
| |
Unot |
| |
Uminus |
type
binop =
| |
Beq |
| |
Bneq |
| |
Blt |
| |
Ble |
| |
Bgt |
| |
Bge |
| |
Badd |
| |
Bsub |
| |
Bmul |
| |
Bdiv |
| |
Band |
| |
Bor |
type
expr = {
|
expr_node : |
|
expr_loc : |
Expression C
type
expr_node =
| |
Econst of |
| |
Eright of |
| |
Eassign of |
| |
Eunop of |
| |
Ebinop of |
| |
Ecall of |
| |
Esizeof of |
type
lvalue =
| |
Lident of |
| |
Larrow of |
Une valeur gauche (en anglais, left value), c'est-à-dire une expression pouvant apparaître à gauche d'une affectation. Dans mini-C, une valeur gauche est soit un identificateur, soit un accès à un champ de structure.
typedecl_var =
typ * ident
type
stmt = {
|
stmt_node : |
|
stmt_loc : |
Instruction C
type
stmt_node =
| |
Sskip |
| |
Sexpr of |
| |
Sif of |
| |
Swhile of |
| |
Sblock of |
| |
Sreturn of |
typeblock =
decl_var list * stmt list
typedecl_struct =
ident * decl_var list
type
decl_fun = {
|
fun_typ : |
|
fun_name : |
|
fun_formals : |
|
fun_body : |
type
decl =
| |
Dstruct of |
| |
Dfun of |
Un fichier C est une liste de déclarations de structures et de fonctions
typefile =
decl list