package mopsa

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

Module Repl.FrontendSource

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

Interpreter state

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

Sourceval init_ctx : unit -> ctx

Parsing

***********

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

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

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

Parse an expression.

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

Parse a statement.

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

Parse a variable declaration.

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

Parse a function declaration.

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

Parse a variable.

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

Try to guess the nature of the input.

Printing

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

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

Prints a string with some locations highlighted.

Main loop

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

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

Main loop.

Interactive "program"

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

Ignore files and return the constant P_REPL program.

Sourcemodule Domain : sig ... end
OCaml

Innovation. Community. Security.