File: reparse.mli

package info (click to toggle)
otags 3.12.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 584 kB
  • sloc: ml: 2,642; sh: 496; makefile: 239
file content (96 lines) | stat: -rw-r--r-- 2,594 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(* Otags reloaded
 * 
 * Hendrik Tews Copyright (C) 2010 - 2012
 * 
 * This file is part of "Otags reloaded".
 * 
 * "Otags reloaded" is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * "Otags reloaded" is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License in file COPYING in this or one of the parent
 * directories for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with "Otags reloaded". If not, see
 * <http://www.gnu.org/licenses/>.
 * 
 * $Id: reparse.mli,v 1.8 2012-01-14 21:31:39 tews Exp $
 * 
 * location-parsing hack for those ast nodes that do not provide
 * sufficient location info
 *)

open Types

(* Return the character at the start position.
 *)
val start_char : loc_t -> char


(* Return the end character, that is, the character before
 * the end position
 *)
val stop_char : loc_t -> char


(* computes the location of the n-th word in the string described 
 * by loc
 *)
val loc_of_nth_word : int -> loc_t -> loc_t


(* same as loc_of_nth_word 1
 *)
val loc_of_first_word : loc_t -> loc_t


(* same as loc_of_nth_word 2
 *)
val loc_of_second_word : loc_t -> loc_t


(* same as loc_of_nth_word 3
 *)
val loc_of_third_word : loc_t -> loc_t


(* returns location without the first word and the following white space 
 *)
val loc_without_first_word : loc_t -> loc_t


(* returns the location of the word after skipping over one 
 * type parameter. The start position must be the start position 
 * of the type parameter.
 *)
val loc_of_word_after_type_param : loc_t -> loc_t


(* return the location of the word after the first closing parenthesis ')'
 *)
val loc_of_word_after_paren : loc_t -> loc_t


(* loc_of_first_word_after_word word loc
 * returns the location of the first word in the string designated by loc,
 * except for the case when this string starts with word, then the 
 * location of the second word is returned.
 *)
val loc_of_first_word_after_word : string -> loc_t -> loc_t

(* loc_of_last_word loc 
 * computes the location of the last word in the string described 
 * by loc in channel ic
 *)
val loc_of_last_word : loc_t -> loc_t


(* chop parenthesis on start and end and skip the surrounding 
 * white space.
 *) 
val loc_inside_parens : loc_t -> loc_t