Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /smlnj-lib/trunk/RegExp/BackEnd/engine-sig.sml
ViewVC logotype

Annotation of /smlnj-lib/trunk/RegExp/BackEnd/engine-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2958 - (view) (download)

1 : monnier 104 (* engine-sig.sml
2 :     *
3 : jhr 2958 * COPYRIGHT (c) 2008 The Fellowship of SML/NJ (http://www.smlnj.org)
4 :     * All rights reserved.
5 : monnier 104 *)
6 :    
7 :     signature REGEXP_ENGINE =
8 : jhr 2958 sig
9 : monnier 104
10 : jhr 2958 type regexp
11 :     (* the type of a compiled regular expression
12 :     *)
13 : monnier 104
14 : jhr 2958 (* a match specifies the position (as a stream) and the length of the match *)
15 :     type 'a match = {pos : 'a, len : int} MatchTree.match_tree
16 : monnier 104
17 : jhr 2958 val compile : RegExpSyntax.syntax -> regexp
18 :     (* compile a regular expression from the abstract syntax
19 :     *)
20 : monnier 104
21 : jhr 2958 val find : regexp -> (char,'a) StringCvt.reader -> ('a match, 'a) StringCvt.reader
22 :     (* scan the stream for the first occurence of the regular expression. The call
23 :     *
24 :     * find re getc strm
25 :     *
26 :     * returns NONE if the end of stream is reached without a match. Otherwise it
27 :     * returns SOME(match, strm'), where match is the match-tree for the match and
28 :     * strm' is the stream following the match.
29 :     *)
30 :    
31 :     val prefix : regexp ->(char,'a) StringCvt.reader -> ('a match, 'a) StringCvt.reader
32 :     (* attempt to match the stream at the current position with the
33 :     * regular expression
34 :     *)
35 :    
36 :     val match : (RegExpSyntax.syntax * ('a match -> 'b)) list
37 :     -> (char,'a) StringCvt.reader -> ('b, 'a) StringCvt.reader
38 :     (* attempt to the match the stream at the current position with one of
39 :     * the abstract syntax representations of regular expressions and trigger
40 :     * the corresponding action
41 :     *)
42 :    
43 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0