package lascar

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

The type of identifiers occuring in expressions

type value = int

The type of expression values

type t =
  1. | EConst of value
    (*

    Constants

    *)
  2. | EVar of ident
    (*

    Input, output or local variable

    *)
  3. | EBinop of string * t * t
    (*

    Binary operation

    *)
  4. | EUnop of char * t
    (*

    Unary operation

    *)

The type of expressions

type env = (ident * value option) list
exception Unknown of ident
exception Unknown_op of string
exception Unbound of ident
exception Illegal_expr
val test_ops : (string * (value -> value -> bool)) list

name, fun

val to_string : t -> string
val of_string : string -> t
val lookup : env -> ident -> value
val eval : env -> t -> value
val lexer : string -> Genlex.token Stream.t
val parse : Genlex.token Stream.t -> t
val keywords : string list
val mk_unaries : string -> string
OCaml

Innovation. Community. Security.