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.smalltalk/St_ast/index.html

Module St_astSource

Sourcetype pos = int * int
Sourcetype literal =
  1. | L_int of int
  2. | L_large of bool * int list
  3. | L_float of float
  4. | L_char of char
  5. | L_string of string
  6. | L_symbol of string
  7. | L_array of literal list
  8. | L_nil
  9. | L_true
  10. | L_false
Sourcetype expr = {
  1. e : desc;
  2. pos : pos;
}
Sourceand desc =
  1. | Lit of literal
  2. | Var of string
  3. | Assign of string * expr
  4. | Send of expr * string * expr list
  5. | Cascade of expr * (string * expr list * pos) list
  6. | Block of string list * string list * stmt list
Sourceand stmt =
  1. | Expr of expr
  2. | Return of expr * pos
Sourcetype method_ = {
  1. selector : string;
  2. args : string list;
  3. temps : string list;
  4. primitive : int option;
  5. body : stmt list;
}
Sourceval arity : string -> int
Sourceval show_expr : expr -> string
Sourceval show_stmt : stmt -> string
Sourceval show_literal : literal -> string