~ubuntu-branches/ubuntu/karmic/ocaml-doc/karmic

« back to all changes in this revision

Viewing changes to ocaml.html/libref/Lexing.html

  • Committer: Bazaar Package Importer
  • Author(s): Vanicat Rémi
  • Date: 2002-02-05 10:51:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020205105143-a061tunf8tev07ne
Tags: 3.04-4
* New debian maintainer
* Split doc-base file
* Move to non-free
* Change the copyright file to the copyright of the documentation
* remove FAQs (their license prohibit their redistribution)
* corrected the examples

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<link rel="stylesheet" href="style.css" type="text/css">
 
4
<link rel="Start" href="index.html">
 
5
<link rel="previous" href="Lazy.html">
 
6
<link rel="next" href="List.html">
 
7
<link rel="Up" href="index.html">
 
8
<link title="Index of types" rel="Appendix" href="index_types.html">
 
9
<link title="Index of exceptions" rel="Appendix" href="index_exceptions.html">
 
10
<link title="Index of values" rel="Appendix" href="index_values.html">
 
11
<link title="Index of class attributes" rel="Appendix" href="index_attributes.html">
 
12
<link title="Index of class methods" rel="Appendix" href="index_methods.html">
 
13
<link title="Index of classes" rel="Appendix" href="index_classes.html">
 
14
<link title="Index of class types" rel="Appendix" href="index_class_types.html">
 
15
<link title="Index of modules" rel="Appendix" href="index_modules.html">
 
16
<link title="Index of module types" rel="Appendix" href="index_module_types.html">
 
17
<link title="Arg" rel="Chapter" href="Arg.html">
 
18
 
 
19
<link title="Arith_status" rel="Chapter" href="Arith_status.html">
 
20
 
 
21
<link title="Array" rel="Chapter" href="Array.html">
 
22
 
 
23
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
 
24
 
 
25
<link title="Big_int" rel="Chapter" href="Big_int.html">
 
26
 
 
27
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
 
28
 
 
29
<link title="Buffer" rel="Chapter" href="Buffer.html">
 
30
 
 
31
<link title="Callback" rel="Chapter" href="Callback.html">
 
32
 
 
33
<link title="Char" rel="Chapter" href="Char.html">
 
34
 
 
35
<link title="Condition" rel="Chapter" href="Condition.html">
 
36
 
 
37
<link title="Dbm" rel="Chapter" href="Dbm.html">
 
38
 
 
39
<link title="Digest" rel="Chapter" href="Digest.html">
 
40
 
 
41
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
 
42
 
 
43
<link title="Event" rel="Chapter" href="Event.html">
 
44
 
 
45
<link title="Filename" rel="Chapter" href="Filename.html">
 
46
 
 
47
<link title="Format" rel="Chapter" href="Format.html">
 
48
 
 
49
<link title="Gc" rel="Chapter" href="Gc.html">
 
50
 
 
51
<link title="Genlex" rel="Chapter" href="Genlex.html">
 
52
 
 
53
<link title="Graphics" rel="Chapter" href="Graphics.html">
 
54
 
 
55
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
 
56
 
 
57
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
 
58
 
 
59
<link title="Int32" rel="Chapter" href="Int32.html">
 
60
 
 
61
<link title="Int64" rel="Chapter" href="Int64.html">
 
62
 
 
63
<link title="Lazy" rel="Chapter" href="Lazy.html">
 
64
 
 
65
<link title="Lexing" rel="Chapter" href="Lexing.html">
 
66
 
 
67
<link title="List" rel="Chapter" href="List.html">
 
68
 
 
69
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
 
70
 
 
71
<link title="Map" rel="Chapter" href="Map.html">
 
72
 
 
73
<link title="Marshal" rel="Chapter" href="Marshal.html">
 
74
 
 
75
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
 
76
 
 
77
<link title="Mutex" rel="Chapter" href="Mutex.html">
 
78
 
 
79
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
 
80
 
 
81
<link title="Num" rel="Chapter" href="Num.html">
 
82
 
 
83
<link title="Obj" rel="Chapter" href="Obj.html">
 
84
 
 
85
<link title="Oo" rel="Chapter" href="Oo.html">
 
86
 
 
87
<link title="Parsing" rel="Chapter" href="Parsing.html">
 
88
 
 
89
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
 
90
 
 
91
<link title="Printexc" rel="Chapter" href="Printexc.html">
 
92
 
 
93
<link title="Printf" rel="Chapter" href="Printf.html">
 
94
 
 
95
<link title="Queue" rel="Chapter" href="Queue.html">
 
96
 
 
97
<link title="Random" rel="Chapter" href="Random.html">
 
98
 
 
99
<link title="Set" rel="Chapter" href="Set.html">
 
100
 
 
101
<link title="Sort" rel="Chapter" href="Sort.html">
 
102
 
 
103
<link title="Stack" rel="Chapter" href="Stack.html">
 
104
 
 
105
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
 
106
 
 
107
<link title="Str" rel="Chapter" href="Str.html">
 
108
 
 
109
<link title="Stream" rel="Chapter" href="Stream.html">
 
110
 
 
111
<link title="String" rel="Chapter" href="String.html">
 
112
 
 
113
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
 
114
 
 
115
<link title="Sys" rel="Chapter" href="Sys.html">
 
116
 
 
117
<link title="Thread" rel="Chapter" href="Thread.html">
 
118
 
 
119
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
 
120
 
 
121
<link title="Tk" rel="Chapter" href="Tk.html">
 
122
 
 
123
<link title="Unix" rel="Chapter" href="Unix.html">
 
124
 
 
125
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
 
126
 
 
127
<link title="Weak" rel="Chapter" href="Weak.html">
 
128
<title>Lexing</title>
 
129
</head>
 
130
<body>
 
131
<div class="navbar"><a href="Lazy.html">Previous</a>
 
132
&nbsp;<a href="index.html">Up</a>
 
133
&nbsp;<a href="List.html">Next</a>
 
134
</div>
 
135
<center><h1>Module <a href="type_Lexing.html">Lexing</a></h1></center>
 
136
<br>
 
137
<pre><span class="keyword">module</span> Lexing = <code><span class="keyword">struct</span> ... <span class="keyword">end</span> </code></pre><div class="info">
 
138
The run-time library for lexers generated by <code>ocamllex</code>.<br>
 
139
</div>
 
140
<hr width="100%">
 
141
<br>
 
142
<br>
 
143
<table cellpadding=0 cellspacing=0 width="100%">
 
144
<tr class="title2"><td><div align=center>
 
145
<table><tr class="title2">
 
146
<td width="100%" align=center>
 
147
<span class="title2">Lexer buffers</span>
 
148
</td>
 
149
</tr>
 
150
</table>
 
151
</div>
 
152
</td>
 
153
</tr>
 
154
</table>
 
155
<br><br>
 
156
<br><code><span class="keyword">type</span> <a name="TYPElexbuf"></a>lexbuf = {<br></code><table border="0" cellpadding="1">
 
157
<tr>
 
158
<td align="left" valign="top" >
 
159
<code>&nbsp;&nbsp;refill_buff : <code class="type"><a href="Lexing.html#TYPElexbuf">lexbuf</a> -> unit</code>;</code></td>
 
160
 
 
161
</tr>
 
162
<tr>
 
163
<td align="left" valign="top" >
 
164
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_buffer : <code class="type">string</code>;</code></td>
 
165
 
 
166
</tr>
 
167
<tr>
 
168
<td align="left" valign="top" >
 
169
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_buffer_len : <code class="type">int</code>;</code></td>
 
170
 
 
171
</tr>
 
172
<tr>
 
173
<td align="left" valign="top" >
 
174
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_abs_pos : <code class="type">int</code>;</code></td>
 
175
 
 
176
</tr>
 
177
<tr>
 
178
<td align="left" valign="top" >
 
179
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_start_pos : <code class="type">int</code>;</code></td>
 
180
 
 
181
</tr>
 
182
<tr>
 
183
<td align="left" valign="top" >
 
184
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_curr_pos : <code class="type">int</code>;</code></td>
 
185
 
 
186
</tr>
 
187
<tr>
 
188
<td align="left" valign="top" >
 
189
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_last_pos : <code class="type">int</code>;</code></td>
 
190
 
 
191
</tr>
 
192
<tr>
 
193
<td align="left" valign="top" >
 
194
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_last_action : <code class="type">int</code>;</code></td>
 
195
 
 
196
</tr>
 
197
<tr>
 
198
<td align="left" valign="top" >
 
199
<code>&nbsp;&nbsp;<span class="keyword">mutable </span>lex_eof_reached : <code class="type">bool</code>;</code></td>
 
200
 
 
201
</tr></table>
 
202
}
 
203
 
 
204
<div class="info">
 
205
The type of lexer buffers. A lexer buffer is the argument passed
 
206
   to the scanning functions defined by the generated scanners.
 
207
   The lexer buffer holds the current state of the scanner, plus
 
208
   a function to refill the buffer from the input.<br>
 
209
</div>
 
210
<br>
 
211
<pre><span class="keyword">val</span> <a name="VALfrom_channel"></a>from_channel : <code class="type"><a href="Pervasives.html#TYPEin_channel">Pervasives.in_channel</a> -> <a href="Lexing.html#TYPElexbuf">lexbuf</a></code></pre><div class="info">
 
212
Create a lexer buffer on the given input channel.
 
213
   <code><span class="constructor">Lexing</span>.from_channel inchan</code> returns a lexer buffer which reads
 
214
   from the input channel <code>inchan</code>, at the current reading position.<br>
 
215
</div>
 
216
<pre><span class="keyword">val</span> <a name="VALfrom_string"></a>from_string : <code class="type">string -> <a href="Lexing.html#TYPElexbuf">lexbuf</a></code></pre><div class="info">
 
217
Create a lexer buffer which reads from
 
218
   the given string. Reading starts from the first character in
 
219
   the string. An end-of-input condition is generated when the
 
220
   end of the string is reached.<br>
 
221
</div>
 
222
<pre><span class="keyword">val</span> <a name="VALfrom_function"></a>from_function : <code class="type">(string -> int -> int) -> <a href="Lexing.html#TYPElexbuf">lexbuf</a></code></pre><div class="info">
 
223
Create a lexer buffer with the given function as its reading method.
 
224
   When the scanner needs more characters, it will call the given
 
225
   function, giving it a character string <code>s</code> and a character
 
226
   count <code>n</code>. The function should put <code>n</code> characters or less in <code>s</code>,
 
227
   starting at character number 0, and return the number of characters
 
228
   provided. A return value of 0 means end of input.<br>
 
229
</div>
 
230
<br>
 
231
<br>
 
232
<table cellpadding=0 cellspacing=0 width="100%">
 
233
<tr class="title2"><td><div align=center>
 
234
<table><tr class="title2">
 
235
<td width="100%" align=center>
 
236
<span class="title2">Functions for lexer semantic actions</span>
 
237
</td>
 
238
</tr>
 
239
</table>
 
240
</div>
 
241
</td>
 
242
</tr>
 
243
</table>
 
244
<br><br>
 
245
<br>
 
246
The following functions can be called from the semantic actions
 
247
   of lexer definitions (the ML code enclosed in braces that
 
248
   computes the value returned by lexing functions). They give
 
249
   access to the character string matched by the regular expression
 
250
   associated with the semantic action. These functions must be
 
251
   applied to the argument <code>lexbuf</code>, which, in the code generated by
 
252
   <code>ocamllex</code>, is bound to the lexer buffer passed to the parsing
 
253
   function.<br><br>
 
254
<pre><span class="keyword">val</span> <a name="VALlexeme"></a>lexeme : <code class="type"><a href="Lexing.html#TYPElexbuf">lexbuf</a> -> string</code></pre><div class="info">
 
255
<code><span class="constructor">Lexing</span>.lexeme lexbuf</code> returns the string matched by
 
256
           the regular expression.<br>
 
257
</div>
 
258
<pre><span class="keyword">val</span> <a name="VALlexeme_char"></a>lexeme_char : <code class="type"><a href="Lexing.html#TYPElexbuf">lexbuf</a> -> int -> char</code></pre><div class="info">
 
259
<code><span class="constructor">Lexing</span>.lexeme_char lexbuf i</code> returns character number <code>i</code> in
 
260
   the matched string.<br>
 
261
</div>
 
262
<pre><span class="keyword">val</span> <a name="VALlexeme_start"></a>lexeme_start : <code class="type"><a href="Lexing.html#TYPElexbuf">lexbuf</a> -> int</code></pre><div class="info">
 
263
<code><span class="constructor">Lexing</span>.lexeme_start lexbuf</code> returns the position in the
 
264
   input stream of the first character of the matched string.
 
265
   The first character of the stream has position 0.<br>
 
266
</div>
 
267
<pre><span class="keyword">val</span> <a name="VALlexeme_end"></a>lexeme_end : <code class="type"><a href="Lexing.html#TYPElexbuf">lexbuf</a> -> int</code></pre><div class="info">
 
268
<code><span class="constructor">Lexing</span>.lexeme_end lexbuf</code> returns the position in the input stream
 
269
   of the character following the last character of the matched
 
270
   string. The first character of the stream has position 0.<br>
 
271
</div>
 
272
</html>
 
 
b'\\ No newline at end of file'