package lascar

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

Simple (int) expressions for FSMs

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 ("+", "-", "*" or "/")

    *)

The type of expressions

type env = (ident * value option) list
exception Unknown of ident
exception Unbound of ident
exception Illegal_expr
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
OCaml

Innovation. Community. Security.