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/RegExp/FrontEnd/syntax-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/RegExp/FrontEnd/syntax-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 104 - (view) (download)

1 : monnier 104 (* syntax-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4 :     *
5 :     * This is the abstract syntax tree used to represent regular expressions.
6 :     * It serves as the glue between different front-ends (implementing
7 :     * different RE specification languages), and different back-ends (implementing
8 :     * different compilation/searching algorithms).
9 :     *)
10 :    
11 :     signature REGEXP_SYNTAX =
12 :     sig
13 :    
14 :     exception CannotParse
15 :     exception CannotCompile
16 :    
17 :     structure CharSet : ORD_SET where type Key.ord_key = char
18 :    
19 :     datatype syntax
20 :     = Group of syntax
21 :     | Alt of syntax list
22 :     | Concat of syntax list
23 :     | Interval of (syntax * int * int option)
24 :     | Option of syntax (* == Interval(re, 0, SOME 1) *)
25 :     | Star of syntax (* == Interval(re, 0, NONE) *)
26 :     | Plus of syntax (* == Interval(re, 1, NONE) *)
27 :     | MatchSet of CharSet.set
28 :     | NonmatchSet of CharSet.set
29 :     | Char of char
30 :     | Begin (* Matches beginning of stream *)
31 :     | End (* Matches end of stream *)
32 :    
33 :     val addRange : CharSet.set * char * char -> CharSet.set
34 :     val allChars : CharSet.set
35 :    
36 :     end;

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