File: token.ml

package info (click to toggle)
camlp5 8.04.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,968 kB
  • sloc: ml: 137,918; makefile: 2,055; perl: 1,729; sh: 1,653; python: 38
file content (39 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(* camlp5r *)
(* token.ml,v *)
(* Copyright (c) INRIA 2007-2017 *)

type pattern = Plexing.pattern;

exception Error of string;

type location = Ploc.t;
type location_function = int -> location;
type lexer_func 'te = Stream.t char -> (Stream.t 'te * Plexing.Locations.t);

type glexer 'te = Plexing.lexer 'te ==
  { tok_func : lexer_func 'te;
    tok_using : pattern -> unit;
    tok_removing : pattern -> unit;
    tok_match : mutable pattern -> 'te -> string;
    tok_text : pattern -> string;
    tok_comm : mutable option (list location);
    kwds : Hashtbl.t string string
   }
;

value make_loc = Ploc.make_unlined;
value dummy_loc = Ploc.dummy;

value make_stream_and_location = Plexing.make_stream_and_location;
value lexer_func_of_parser = Plexing.lexer_func_of_parser;
value lexer_func_of_ocamllex = Plexing.lexer_func_of_ocamllex;

value eval_char = Plexing.eval_char;
value eval_string = Plexing.eval_string;

value lexer_text = Plexing.lexer_text;
value default_match = Plexing.default_match;

value line_nb = Plexing.line_nb;
value bol_pos = Plexing.bol_pos;
value restore_lexing_info = Plexing.restore_lexing_info;