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 /sml/trunk/src/smlnj-lib/Doc/ML-Doc/RegExp/engine-sig.mldoc
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/Doc/ML-Doc/RegExp/engine-sig.mldoc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 422 <!-- ML-Doc/engine-sig.sml -->
2 :     <!-- Entities.sgml entry
3 :     <!ENTITY REGEXP-ENGINE SDATA "../engine-sig.sml">
4 :     -->
5 :    
6 :     <!DOCTYPE ML-DOC SYSTEM>
7 :    
8 :     <COPYRIGHT OWNER="Bell Labs, Lucent Technologies" YEAR=1998>
9 :     <VERSION VERID="1.0" YEAR=1998 MONTH=6 DAY=3>
10 :     <TITLE>The REGEXP_ENGINE signature</TITLE>
11 :    
12 :     <INTERFACE>
13 :     <HEAD>The <CD/REGEXP_ENGINE/ signature</HEAD>
14 :     <!-- optional SEEALSO; uncomment to use -->
15 :     <SEEALSO>
16 :     <STRREF/MatchTree/
17 :     <STRREF/RegExpSyntax/
18 :     </SEEALSO>
19 :    
20 :     <PP>
21 :     This is the signature of a concrete matching engine. It defines an
22 :     abstract type <CD/regexp/ into which regular expressions are compiled,
23 :     as well as functions to match the compiled regular expression with
24 :     various semantics. <PP>
25 :    
26 :     Two engines are provided. The structure <CD/BackTrackEngine/ is a
27 :     backtracking engine that is slow, but requires little memory, incurs
28 :     low startup overhead and reports full matching information (matching
29 :     information for all subexpressions of the regular expression). The
30 :     structure <CD/DfaEngine/ is a finite-automaton implementation, and thus
31 :     provides fast matching, but is memory-itensive, has a startup overhead
32 :     (the creation of the automaton), and only reports the root match.<PP>
33 :    
34 :    
35 :     <SIGNATURE SIGID="REGEXP_ENGINE">
36 :     <SIGBODY SIGID="REGEXP_ENGINE" FILE=REGEXP-ENGINE>
37 :     <SPEC>
38 :     <TYPE><ID>regexp
39 :     <COMMENT><PP>
40 :     the type of a compiled regular expression.
41 :     <SPEC>
42 :     <VAL>compile<TY>RegExpSyntax.syntax -> regexp
43 :     <COMMENT>
44 :     <PROTOTY>
45 :     compile <ARG/s/
46 :     </PROTOTY>
47 :     compiles a regular expression from the abstract syntax.
48 :     <SPEC>
49 :     <VAL>find<TY>regexp -> (char,'a) StringCvt.reader -> ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader
50 :     <COMMENT>
51 :     <PROTOTY>
52 :     find <ARG/r/ <ARG/getc/
53 :     </PROTOTY>
54 :     Given a compiled regular expression <ARG/r/ and a character
55 :     reader <ARG/getc/, this function returns a reader that scans the stream for the first
56 :     match of the regular expression. The reader returns <CD/NONE/ if
57 :     no match is found.
58 :     <SPEC>
59 :     <VAL>prefix<TY>regexp -> (char,'a) StringCvt.reader -> ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader
60 :     <COMMENT>
61 :     <PROTOTY>
62 :     prefix <ARG/r/ <ARG/getc/
63 :     </PROTOTY>
64 :     Given a compiled regular expression <ARG/r/ and a character
65 :     reader <ARG/getc/, this functions returns a reader that attempts to
66 :     match the stream at its current position with the regular
67 :     expression. The reader returns <CD/NONE/ if there is not match at the
68 :     current position of the stream.
69 :     <SPEC>
70 :     <VAL>match<TY>(RegExpSyntax.syntax * ({pos : 'a, len : int} option MatchTree.match_tree -> 'b)) list -> (char,'a) StringCvt.reader -> ('b,'a) StringCvt.reader
71 :     <COMMENT>
72 :     <PROTOTY>
73 :     match <ARG/l/ <ARG/getc/
74 :     </PROTOTY>
75 :     Given a list <ARG/l/ of tuples made up of a regular
76 :     expression (in abstract syntax) and a function from matching tree to values of type
77 :     <CD/'b/, and given a character reader <ARG/getc/, this function
78 :     returns a reader that attempts to match one of the given regular
79 :     expressions at the current position of the stream. If a match is
80 :     found, the corresponding function is applied to the match tree and the
81 :     result is returned. The reader returns <CD/NONE/ if no match is found.
82 :     <SIGINSTANCE><ID>BackTrackEngine
83 :     <SIGINSTANCE><ID>DfaEngine
84 :     </SIGNATURE>
85 :    
86 :     </INTERFACE>

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