package tiny_languages

  1. Overview
  2. Docs
Small languages from scratch: Scheme, Lisp, Smalltalk-80, Pascal, BASIC, JavaScript, HTML, CSS and more

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.6.tar.gz
md5=7c636383d146d30ac6f2fa234a6253c8
sha512=c79f3823c5f8f57e5038eb640d487c61168b84aa07c61999d6622ef9fd0c890e2b03b4c6a7cdbbe9352a49e25dda00ac7bb14693cee8e3d7beeed251351a2af0

doc/tiny_languages.lang_c/Ast_c/index.html

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;
}