Math.NET Numerics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

104 lines
8.4 KiB

<HTML><HEAD><TITLE>Microsoft.FSharp.Compatibility.OCaml.Lexing</TITLE><link rel="stylesheet" type="text/css"href="../msdn.css"></link></HEAD><BODY>
<br><dl>
<dt></dt><dd>
<h1>[<a href='../namespaces.html'>Home</a>] Module <a href='Microsoft.FSharp.Compatibility.html'>Microsoft.FSharp.Compatibility</a>.<a href='Microsoft.FSharp.Compatibility.OCaml.html'>OCaml</a>.Lexing </h1><br>
</dd>
<dt></dt><dd>
<table>
<tr valign='top'><td><summary>
Lexing: ML-like lexing support
This file maintains rough compatibility for lexbuffers used by some ML
laxer generators. The lexbuf carries an associated pair of positions.
Beware that only the "cnum" (absolute character number) field is automatically
updated as each lexeme is matched. Upon each successful match the prior end
position is transferred to be the start position and a new start position
is allocated with an updated pos_cnum field.
</summary>
<dt><h3>Type Definitions</h3></dt><dd>
<table width="100%%">
<tr><th width=30%>Type</th><th>Description</th></tr>
<tr valign="top"><td>type <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></td><td><summary>
ASCII LexBuffers
The type "lexbuf" is opaque, but has an internal position information field
that can be updated by setting "lexbuf.EndPos", for example if you wish
to update the other fields in that position data before or during
lexing. You will need to do this if you wish to maintain accurate
line-count information. If you do this and wish to maintain strict
cross-compiling compatibility with OCamlLex and other tools you may need code
to conditionally use lexbuf_set_curr_p when compiling F# code.
</summary> Note: an abbreviation for <tt><a href='Microsoft.FSharp.Text.Lexing.type_LexBuffer-1.html'>LexBuffer</a>&lt;<a href='../FSharp.Core/Microsoft.FSharp.Core.type__byte.html'>byte</a>&gt;</tt></td></tr>
<tr valign="top"><td>type <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__position.html'>position</a></td><td> Note: an abbreviation for <tt><a href='Microsoft.FSharp.Text.Lexing.type_Position.html'>Position</a></tt></td></tr>
</table>
</dd>
<dt><h3>Values</h3></dt><dd>
<table width="100%%">
<tr><th width=60%>Value</th><th>Description</th></tr>
<tr valign="top"><td><pre>val flush_input : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Remove all input, though don't discard the except the current lexeme
</summary></td></tr>
<tr valign="top"><td><pre>val from_binary_reader : <a href='http://msdn2.microsoft.com/en-us/library/System.IO.BinaryReader.aspx'>BinaryReader</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer using the given BinaryReader.
</summary></td></tr>
<tr valign="top"><td><pre>val from_bytearray : <a href='../FSharp.Core/Microsoft.FSharp.Core.type__byte.html'>byte</a> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__[]-1.html'>[]</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer from an array of bytes
</summary></td></tr>
<tr valign="top"><td><pre>val from_channel : <a href='http://msdn2.microsoft.com/en-us/library/System.IO.TextReader.aspx'>TextReader</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer using the given in_channel. The bytes are read using Pervasives.input.
If the in_channel is a textual channel the bytes are
presented to the lexer by decoding the characters using System.Text.Encoding.ASCII.
</summary></td></tr>
<tr valign="top"><td><pre>val from_function : (<a href='../FSharp.Core/Microsoft.FSharp.Core.type__byte.html'>byte</a> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__[]-1.html'>[]</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a>) -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer from function that fills an array of bytes up to the given length, returning the
number of bytes filled.
</summary></td></tr>
<tr valign="top"><td><pre>val from_string : <a href='../FSharp.Core/Microsoft.FSharp.Core.type__string.html'>string</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer from a string, converted to ascii using <tt>System.Text.Encoding.ASCII.GetBytes</tt>
</summary></td></tr>
<tr valign="top"><td><pre>val from_text_reader : <a href='http://msdn2.microsoft.com/en-us/library/System.Text.Encoding.aspx'>Encoding</a> -> <a href='http://msdn2.microsoft.com/en-us/library/System.IO.TextReader.aspx'>TextReader</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a></pre></td><td><summary>
Fuel a lexer using the given TextReader or StreamReader.
The characters read are decoded to bytes using the given encoding (e.g. System.Text.Encoding.ASCII)
and the bytes presented to the lexer. The encoding used to decode the characters
is associated with the expectations of the lexer (e.g. a lexer may be constructed to accept only
ASCII or pseudo-UTF8 bytes) and will typically be different to
the encoding used to decode the file.
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__string.html'>string</a></pre></td><td><summary>
Return the matched string
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_bytes : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__byte.html'>byte</a> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__array-1.html'>array</a></pre></td><td><summary>
Return the bytes for the matched string
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_char : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__char.html'>char</a></pre></td><td><summary>
Return a character from the matched string, innterpreting the bytes using an ASCII encoding
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_end : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a></pre></td><td><summary>
Return absolute positions into the entire stream of characters
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_end_p : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__position.html'>position</a></pre></td><td><summary>
Return the positions stored in the lexbuf for the matched string
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_start : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a></pre></td><td><summary>
Return absolute positions into the entire stream of characters
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_start_p : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__position.html'>position</a></pre></td><td><summary>
Return the positions stored in the lexbuf for the matched string
</summary></td></tr>
<tr valign="top"><td><pre>val lexeme_utf8 : <a href='Microsoft.FSharp.Compatibility.OCaml.Lexing.type__lexbuf.html'>lexbuf</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__string.html'>string</a></pre></td><td><summary>
Return the matched string interpreting the bytes using the given Unicode text encoding
</summary></td></tr>
</table>
</dd>
</td></tr>
<tr valign='top'><td>
<dt><h3>See Also</h3></dt><dd>
<a href="Microsoft.FSharp.Compatibility.OCaml.html">Microsoft.FSharp.Compatibility.OCaml</a> </dd>
</td></tr>
</table>
</dd>
</dl>
<br /> <br/><p><i>Documentation for assembly FSharp.PowerPack, version 1.9.6.16, generated using <a href='http://research.microsoft.com/fsharp/'>F# Programming Language</a> version 1.9.6.16</i></p>
</BODY></HTML>