package tiny_languages

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ast_c

type name = {
  1. text : string;
  2. tok : int;
}
type ty =
  1. | Tbase
  2. | Tname of name
  3. | Tstruct of name option * decl list option
  4. | Tenum of name option * (name * expr option) list option
  5. | Tptr of ty
  6. | Tarray of ty * expr option
  7. | Tfunc of ty * decl list
  8. | Ttypeof of expr
and decl = {
  1. dname : name option;
  2. dty : ty;
  3. dinit : init option;
}
and init =
  1. | Iexpr of expr
  2. | Ilist of (designator list * init) list
and designator =
  1. | Dfield of name
  2. | Dindex of expr
and expr =
  1. | Econst
  2. | Eident of name
  3. | Efield of expr * name
  4. | Ecall of expr * expr list
  5. | Ecast of ty * expr
  6. | Etype of ty
  7. | Ecompound of ty * init
  8. | Estmt of stmt list
  9. | Emisc of expr list
and stmt =
  1. | Sexpr of expr
  2. | Sdecl of spec * decl list
  3. | Sblock of stmt list
  4. | Sfor of stmt option * expr list * stmt
  5. | Snest of expr list * stmt list
  6. | Slabel of name * stmt
  7. | Sgoto of name
and spec = {
  1. typedef : bool;
  2. base : ty;
}
type define = {
  1. mname : name;
  2. mparams : name list option;
  3. mbody : name list;
}
type item =
  1. | Ifunc of spec * decl * decl list * stmt list
  2. | Idecl of spec * decl list
  3. | Imacro of expr
type file = {
  1. items : item list;
  2. defines : define list;
  3. skipped : (int * int) list;
}