package lustre-v6

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

Module LxmSource

Lexemes

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

column numbers

Sourceval cend : t -> int
Sourceval 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
Sourceval new_line : Lexing.lexbuf -> unit
Sourceval make_string : Lexing.lexbuf -> t
Sourceval add_pragma : t -> pragma list -> t

compiler interface

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

used to attach a source information to a lexeme

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

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

Erreur/Warning printing

Sourceval details : t -> string
Sourceval short_details : t -> string

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

Sourceval position : t -> string

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

OCaml

Innovation. Community. Security.