package mopsa

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

Read-eval-print-loop interactive frontend. Borrows the syntax and semantics from universal.

Interpreter state

*********************

val init_ctx : unit -> ctx

Parsing

***********

val range_of_string : ?org:int -> string -> Mopsa.range
val parse_string : ?org:int -> ((Lexing.lexbuf -> Mopsa_universal_parser.U_parser.token) -> Lexing.lexbuf -> 'a) -> string -> 'a

Helper to parse a string using a menhir parser entry point.

val parse_expr : ?org:int -> ctx -> string -> Mopsa.expr

Parse an expression.

val parse_stmt : ?org:int -> ctx -> string -> Mopsa.stmt

Parse a statement.

val parse_vardec : ?org:int -> ctx -> string -> ctx * Mopsa.stmt list * Mopsa.var list

Parse a variable declaration.

val parse_fundec : ?org:int -> ctx -> string -> ctx * Universal.Ast.fundec

Parse a function declaration.

val parse_var : ?org:int -> ctx -> string -> Mopsa.var

Parse a variable.

type input_class =
  1. | VarDecl
  2. | FunDecl
  3. | Stmt
val vardecl_str : Str.regexp
val fundecl_str : Str.regexp
val classify_input : string -> input_class

Try to guess the nature of the input.

Printing

************

val eol : Str.regexp
val print_highlight : string -> Mopsa.range -> unit

Prints a string with some locations highlighted.

Main loop

*************

val spaces : Str.regexp
val repl_ctx : Mopsa.LineEdit.ctx
val prompt : string
val col_reset : string
val col_error : string
val col_out : string
val pf : ('a, Format.formatter, unit) format -> 'a
val print_usage : unit -> unit
val repl_loop : ctx -> ('a, 'b) Core.Manager.man -> 'a Core.Flow.flow -> 'a Core.Flow.flow
val enter_repl : ('a, 'b) Core.Manager.man -> 'a Core.Flow.flow -> 'a Core.Flow.flow

Main loop.

Interactive "program"

type Mopsa.prog_kind +=
  1. | P_REPL
val parse_program : 'a list -> Mopsa.program

Ignore files and return the constant P_REPL program.

module Domain : sig ... end
OCaml

Innovation. Community. Security.