package lua-ml

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

Source file luaast.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module type S = sig
  module Value : Luavalue.S
  type value = Value.value
  type name = string

type varargs = bool
type funcargs = name list * varargs
type location = int (* character position *)
type stmt =
  | Stmt'       of location * stmt
  | Assign      of lval list * exp list
  | WhileDo     of exp * block
  | RepeatUntil of block * exp
  | If          of exp * block * (exp * block) list * block option
  | Return      of exp list
  | Callstmt    of call
  | Local       of name list * exp list
and block = stmt list
and lval =
  | Lvar   of name
  | Lindex of exp * exp
and exp =
  | Var   of name
  | Lit   of value
  | Binop of exp * op * exp
  | Unop  of op * exp
  | Index of exp * exp
  | Table of exp list * (name * exp) list
  | Call  of call
and call =
  | Funcall  of exp * exp list
  | Methcall of exp * name * exp list
and op = And | Or | Lt | Le | Gt | Ge | Eq | Ne | Concat
       | Plus | Minus | Times | Div | Mod | Not | Pow

type chunk =
  | Debug     of bool                   (* turn debugging on/off *)
  | Statement of stmt
  | Fundef    of location * lval       * funcargs * block
  | Methdef   of location * exp * name * funcargs * block

end

module Make (V : Luavalue.S) : S with module Value = V = struct
  module Value = V
  type value = Value.value
  type name = string

type varargs = bool
type funcargs = name list * varargs
type location = int (* character position *)
type stmt =
  | Stmt'       of location * stmt
  | Assign      of lval list * exp list
  | WhileDo     of exp * block
  | RepeatUntil of block * exp
  | If          of exp * block * (exp * block) list * block option
  | Return      of exp list
  | Callstmt    of call
  | Local       of name list * exp list
and block = stmt list
and lval =
  | Lvar   of name
  | Lindex of exp * exp
and exp =
  | Var   of name
  | Lit   of value
  | Binop of exp * op * exp
  | Unop  of op * exp
  | Index of exp * exp
  | Table of exp list * (name * exp) list
  | Call  of call
and call =
  | Funcall  of exp * exp list
  | Methcall of exp * name * exp list
and op = And | Or | Lt | Le | Gt | Ge | Eq | Ne | Concat
       | Plus | Minus | Times | Div | Mod | Not | Pow

type chunk =
  | Debug     of bool                   (* turn debugging on/off *)
  | Statement of stmt
  | Fundef    of location * lval       * funcargs * block
  | Methdef   of location * exp * name * funcargs * block

end
OCaml

Innovation. Community. Security.