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

SCM Repository

[smlnj] View of /sml/trunk/src/smlnj-lib/Doc/ML-Doc/RegExp/match-tree.mldoc
ViewVC logotype

View of /sml/trunk/src/smlnj-lib/Doc/ML-Doc/RegExp/match-tree.mldoc

Parent Directory Parent Directory | Revision Log Revision Log

Revision 137 - (download) (annotate)
Mon Sep 7 21:09:17 1998 UTC (20 years, 11 months ago) by monnier
File size: 2419 byte(s)
Initial revision
<!-- ML-Doc/match-tree.mldoc -->
<!-- Entities.sgml entry 
<!ENTITY MatchTree SDATA "../match-tree.sml">


<COPYRIGHT OWNER="Bell Labs, Lucent Technologies" YEAR=1998>
<TITLE>The MatchTree structure</TITLE>

<HEAD>The <CD/MatchTree/ structure</HEAD>
<!-- optional SEEALSO; uncomment to use     -->
<!-- <SEEALSO>    -->
<!--   non-empty list of XREFS here   -->
<!-- </SEEALSO>    -->

This structure implements the type used to report matching
information and associated operations. <PP>

        <CONS>Match<TY>('a * 'a match_tree list)
      <VAL>root<TY>'a match_tree -> 'a
          root <ARG/mt/
          returns the root (outermost) match in the tree <ARG/mt/.
      <VAL>nth<TY>('a match_tree * int) -> 'a
          nth (<ARG/mt/, <ARG/n/)
          returns the <ARG/n/th match in the tree <ARG/mt/. Matches
are labeled in preorder, starting at 0. The <ARG/n/th match in a tree
correspond to the match of the <ARG/n/th subexpression of a regular
expression, when counted from left to right (and letting the full
expression be indexed at 0).
      <VAL>map<TY>('a -> 'b) -> 'a match_tree -> 'b match_tree
          map <ARG/f/ <ARG/mt/
          maps a function <ARG/f/ over the tree <ARG/mt/ in preorder.
      <VAL>app<TY>('a -> unit) -> 'a match_tree -> unit
          app <ARG/f/ <ARG/mt/
          applies a given function <ARG/f/ over every element of the
tree <ARG/mt/ in preorder.
      <VAL>find<TY>('a -> bool) -> 'a match_tree -> 'a option
          find <ARG/f/ <ARG/mt/
          finds the first match in the tree <ARG/mt/ that satisfies
the predicate <ARG/f/ (or <CD/NONE/).
      <VAL>num<TY>'a match_tree -> int
          num <ARG/mt/
          returns the number of matches included in the tree <ARG/mt/.


ViewVC Help
Powered by ViewVC 1.0.0