SCM Repository
[smlnj] Diff of /smlnj-lib/trunk/Doc/src/RegExp/tutorial.adoc
Diff of /smlnj-lib/trunk/Doc/src/RegExp/tutorial.adoc
Parent Directory
|
Revision Log
|
Patch
17 |
== Assembling an Regular Expression Matcher |
== Assembling an Regular Expression Matcher |
18 |
|
|
19 |
Before we can do anything else, we must assemble a regular-expression |
Before we can do anything else, we must assemble a regular-expression |
20 |
matcher. For the purposes of this tutorial, we will use a combination |
matcher. For the purposes of this tutorial, we use a combination |
21 |
of the `AwkSyntax` front-end and the `BackTrackEngine` back-end. |
of the `AwkSyntax` front-end and the `BackTrackEngine` back-end. |
22 |
|
|
23 |
[source,sml] |
[source,sml] |
29 |
|
|
30 |
== Match trees |
== Match trees |
31 |
|
|
32 |
|
Regular expressions may contain xref:str-RegExpSyntax.adoc#con:Group[grouping] |
33 |
|
operators. When a pattern matches a string, these groups induce a nested |
34 |
|
tree structure on the matched string. |
35 |
|
The xref:str-MatchTree.adoc[``MatchTree``] structure defines |
36 |
|
a polymorphic representation of this structure, along with a |
37 |
|
number of utility functions for extracting information from |
38 |
|
a match. |
39 |
|
|
40 |
[source,sml] |
[source,sml] |
41 |
------------ |
------------ |
42 |
structure MT = MatchTree |
structure MT = MatchTree |
|
Legend:
Removed from v.7541 |
|
changed lines |
|
Added in v.7542 |
|
|