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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2957, Thu Mar 6 03:17:28 2008 UTC revision 2958, Tue Mar 18 16:08:01 2008 UTC
# Line 1  Line 1 
1  (* engine-sig.sml  (* engine-sig.sml
2   *   *
3   * COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies.   * COPYRIGHT (c) 2008 The Fellowship of SML/NJ (http://www.smlnj.org)
4     * All rights reserved.
5   *)   *)
6    
7  signature REGEXP_ENGINE =  signature REGEXP_ENGINE =
# Line 10  Line 11 
11              (* the type of a compiled regular expression              (* the type of a compiled regular expression
12               *)               *)
13    
14      (* 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    
17          val compile : RegExpSyntax.syntax -> regexp          val compile : RegExpSyntax.syntax -> regexp
18              (* compile a regular expression from the abstract syntax              (* compile a regular expression from the abstract syntax
19               *)               *)
20    
21          val find : regexp ->      val find : regexp -> (char,'a) StringCvt.reader -> ('a match, 'a) StringCvt.reader
22                        (char,'a) StringCvt.reader ->          (* scan the stream for the first occurence of the regular expression.  The call
23                        ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader           *
24              (* scan the stream for the first occurence of the regular expression           *    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 ->      val prefix : regexp ->(char,'a) StringCvt.reader -> ('a match, 'a) StringCvt.reader
                         (char,'a) StringCvt.reader ->  
                         ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader  
32              (* attempt to match the stream at the current position with the              (* attempt to match the stream at the current position with the
33               * regular expression               * regular expression
34               *)               *)
35    
36          val match : (RegExpSyntax.syntax *      val match : (RegExpSyntax.syntax * ('a match -> 'b)) list
37                       ({pos: 'a, len:int} option MatchTree.match_tree -> 'b)) list ->                    -> (char,'a) StringCvt.reader -> ('b, 'a) StringCvt.reader
                          (char,'a) StringCvt.reader -> ('b, 'a) StringCvt.reader  
38              (* attempt to the match the stream at the current position with one of              (* attempt to the match the stream at the current position with one of
39               * the abstract syntax representations of regular expressions and trigger               * the abstract syntax representations of regular expressions and trigger
40               * the corresponding action               * the corresponding action
41               *)               *)
42    
43      end      end

Legend:
Removed from v.2957  
changed lines
  Added in v.2958

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