package mopsa

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

Definition of the abstract syntax trees output by the parser.

type 'a ext = 'a * extent
type var = string
type typ =
  1. | AST_INT
  2. | AST_REAL
  3. | AST_ARRAY of typ
  4. | AST_STRING
  5. | AST_CHAR
type unary_op =
  1. | AST_UNARY_PLUS
  2. | AST_UNARY_MINUS
  3. | AST_NOT
  4. | AST_ROUND
type binary_op =
  1. | AST_PLUS
  2. | AST_MINUS
  3. | AST_MULTIPLY
  4. | AST_DIVIDE
  5. | AST_EQUAL
  6. | AST_NOT_EQUAL
  7. | AST_LESS
  8. | AST_LESS_EQUAL
  9. | AST_GREATER
  10. | AST_GREATER_EQUAL
  11. | AST_AND
  12. | AST_OR
  13. | AST_CONCAT
and expr =
  1. | AST_unary of unary_op * expr ext
  2. | AST_len of expr ext
  3. | AST_binary of binary_op * expr ext * expr ext
  4. | AST_identifier of var ext
  5. | AST_int_const of string ext
  6. | AST_unit_const
  7. | AST_bool_const of bool ext
  8. | AST_real_const of string ext
  9. | AST_string_const of string ext
  10. | AST_char_const of char ext
  11. | AST_array_const of expr ext array ext
  12. | AST_rand of string ext * string ext
  13. | AST_randf of string ext * string ext
  14. | AST_array_access of expr ext * expr ext
  15. | AST_fun_call of var ext * expr ext list
type typed_var = (typ * var) ext
type declaration = typed_var * expr ext option
type stat =
  1. | AST_block of stat ext list
  2. | AST_assign of expr ext * expr ext
  3. | AST_if of expr ext * stat ext * stat ext option
  4. | AST_while of expr ext * stat ext
  5. | AST_for of var ext * expr ext * expr ext * stat ext
  6. | AST_return of expr ext option
  7. | AST_break
  8. | AST_continue
  9. | AST_assert of expr ext
  10. | AST_assume of expr ext
  11. | AST_expr of expr ext
  12. | AST_print
type fundec = {
  1. funname : var;
  2. parameters : typed_var list;
  3. body : stat ext;
  4. locvars : declaration ext list;
  5. return_type : typ option;
  6. range : extent;
}
type prog = {
  1. gvars : declaration ext list;
  2. funs : fundec ext list;
  3. main : stat ext;
}
OCaml

Innovation. Community. Security.