REGEXP signature
signature REGEXP
This is the signature of a regular expressions matching structure. Such a structure is created by applying the functor RegExpFn to a given concrete syntax for regular expressions and a given matching engine.
type regexp
val compile : (char,'a) StringCvt.reader -> (regexp,'a) StringCvt.reader
val compileString : string -> regexp
val find : regexp -> (char,'a) StringCvt.reader -> ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader
val prefix : regexp -> (char,'a) StringCvt.reader -> ({pos : 'a, len : int} option MatchTree.match_tree,'a) StringCvt.reader
val match : (string * ({pos : 'a, len : int} option MatchTree.match_tree -> 'b)) list -> (char,'a) StringCvt.reader -> ('b,'a) StringCvt.reader
type regexp
compile getc
compileString s
compileString is equivalent to StringCvt.scanString compile.
find r getc
NONE if no match is found.
prefix r getc
NONE if there is not match at the current position of the stream.
match l getc
'b, and given a character reader getc, this function returns a reader that attempts to match one of the given regular expressions at the current position of the stream. If a match is found, the corresponding function is applied to the match tree and the result is returned. The reader returns NONE if no match is found.
RegExpFn, MatchTree
Last Modified June 3, 1998
Comments to John Reppy
Copyright © 1998 Bell Labs, Lucent Technologies