package lustre-v6

  1. Overview
  2. Docs

Lexemes

type t
type pragma =
  1. | Pragma of string * string
val dummy : string -> t
val str : t -> string
val id : t -> Lv6Id.t
val line : t -> int
val file : t -> string
val pragma : t -> pragma list
val override_name : string -> t -> t
val cstart : t -> int

column numbers

val cend : t -> int
val make : Lexing.lexbuf -> t

lexer/parser interface

In order to able to compute line and colums numbers, the lexer is supposed to:

  • use Lxm.make to return a lexeme to the parser
  • use newline to add a new line
val new_line : Lexing.lexbuf -> unit
val make_string : Lexing.lexbuf -> t
val add_pragma : t -> pragma list -> t

compiler interface

type 'a srcflagged = {
  1. src : t;
  2. it : 'a;
}

used to attach a source information to a lexeme

val flagit : 'a -> t -> 'a srcflagged
val last_made : unit -> t

Returns the last created lexem. Useful to locate syntax errors.

Erreur/Warning printing

val details : t -> string
val short_details : t -> string

prints something like: 'machin' (line:10, col:3 to 7)

val position : t -> string

prints something like: line:10, col:3 to 7

OCaml

Innovation. Community. Security.