File: token_views_c.mli

package info (click to toggle)
coccinelle 1.0.8.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,148 kB
  • sloc: ml: 136,392; ansic: 23,594; sh: 2,189; makefile: 2,157; perl: 1,576; lisp: 840; python: 823; awk: 70; csh: 12
file content (63 lines) | stat: -rw-r--r-- 2,415 bytes parent folder | download | duplicates (3)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

type context = InFunction | InEnum | InStruct | InInitializer | NoContext

type token_extended = {
  mutable tok : Parser_c.token;
  mutable where : context;
  mutable new_tokens_before : Parser_c.token list;
  line : int;
  col : int;
}
val mk_token_extended : Parser_c.token -> token_extended

val rebuild_tokens_extented : token_extended list -> token_extended list

(* ---------------------------------------------------------------------- *)
type paren_grouped =
    Parenthised of paren_grouped list list * token_extended list
  | PToken of token_extended

type brace_grouped =
    Braceised of brace_grouped list list * token_extended *
      token_extended option
  | BToken of token_extended

type ifdef_grouped =
    Ifdef of ifdef_grouped list list * token_extended list
  | Ifdefbool of bool * ifdef_grouped list list * token_extended list
  | NotIfdefLine of token_extended list

type 'a line_grouped = Line of 'a list

type body_function_grouped =
    BodyFunction of token_extended list
  | NotBodyLine of token_extended list

(* ---------------------------------------------------------------------- *)
val mk_parenthised : token_extended list -> paren_grouped list
val mk_braceised : token_extended list -> brace_grouped list
val mk_ifdef : token_extended list -> ifdef_grouped list
val mk_line_parenthised :
  paren_grouped list -> paren_grouped line_grouped list
val mk_body_function_grouped :
  token_extended list -> body_function_grouped list

val line_of_paren : paren_grouped -> int
val span_line_paren :
  int -> paren_grouped list -> paren_grouped list * paren_grouped list

(* ---------------------------------------------------------------------- *)
val iter_token_paren : (token_extended -> unit) -> paren_grouped list -> unit
val iter_token_brace : (token_extended -> unit) -> brace_grouped list -> unit
val iter_token_ifdef : (token_extended -> unit) -> ifdef_grouped list -> unit

val tokens_of_paren : paren_grouped list -> token_extended list
val tokens_of_paren_ordered : paren_grouped list -> token_extended list

(* ---------------------------------------------------------------------- *)
val set_context_tag: brace_grouped list -> unit

(* ---------------------------------------------------------------------- *)
val set_as_comment : Token_c.cppcommentkind -> token_extended -> unit
val save_as_comment :
  (Token_c.ifdef -> Token_c.cppcommentkind)-> token_extended -> unit