Skip to content

Commit ede0e01

Browse files
committed
Added SPLDOC.
1 parent 8252561 commit ede0e01

File tree

4 files changed

+57
-30
lines changed

4 files changed

+57
-30
lines changed

com.ibm.streamsx.regex/com.ibm.streamsx.regex.re2/RegexMatch/RegexMatch.xml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,37 @@
22
<operatorModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ibm.com/xmlns/prod/streams/spl/operator" xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/operator operatorModel.xsd">
33
<cppOperatorModel>
44
<context>
5-
<description></description>
5+
<description>
6+
RegexMatch operator has three custom output functions:
7+
* RegexSimpleMatch performs a partial match and runs in interpretation mode (like SPL regexMatch function).
8+
* RegexPartialMatch performs a partial match and runs in compilation mode.
9+
* RegexFullMatch performs a full match and runs in compilation mode.
10+
</description>
611
<customOutputFunctions>
712
<customOutputFunction>
813
<name>RegexFS</name>
914
<function pseudoFunction="true">
10-
<description></description>
15+
<description>Assign value to the output attribute.</description>
1116
<prototype>&lt;any T> T AsIs(T v)</prototype>
1217
</function>
1318
<function pseudoFunction="true">
14-
<description></description>
19+
<description>Tries to match the whole string with the pattern (defined as the operator parameter).</description>
1520
<prototype>boolean RegexFullMatch(rstring str)</prototype>
1621
</function>
1722
<function pseudoFunction="true">
18-
<description></description>
23+
<description>Tries to match the whole string with the pattern.</description>
1924
<prototype>boolean RegexFullMatch(rstring str, rstring pattern)</prototype>
2025
</function>
2126
<function pseudoFunction="true">
22-
<description></description>
27+
<description>Tries to match the string with the pattern (defined as the operator parameter).</description>
2328
<prototype>boolean RegexPartialMatch(rstring str)</prototype>
2429
</function>
2530
<function pseudoFunction="true">
26-
<description></description>
31+
<description>Tries to match the string with the pattern.</description>
2732
<prototype>boolean RegexPartialMatch(rstring str, rstring pattern)</prototype>
2833
</function>
2934
<function pseudoFunction="true">
30-
<description></description>
35+
<description>Tries to match the string with the pattern.</description>
3136
<prototype>boolean RegexSimpleMatch(rstring str, rstring pattern)</prototype>
3237
</function>
3338
</customOutputFunction>
@@ -51,7 +56,7 @@
5156
<allowAny>false</allowAny>
5257
<parameter>
5358
<name>pattern</name>
54-
<description></description>
59+
<description>The optional 'rstring' parameter specifies the pattern to match.</description>
5560
<optional>true</optional>
5661
<rewriteAllowed>true</rewriteAllowed>
5762
<expressionMode>AttributeFree</expressionMode>
@@ -60,7 +65,7 @@
6065
</parameter>
6166
<parameter>
6267
<name>maxMemory</name>
63-
<description></description>
68+
<description>The optional 'int64' parameter specifies maxMemory to allocate in bytes.</description>
6469
<optional>true</optional>
6570
<rewriteAllowed>true</rewriteAllowed>
6671
<expressionMode>AttributeFree</expressionMode>
@@ -69,7 +74,7 @@
6974
</parameter>
7075
<parameter>
7176
<name>logErrors</name>
72-
<description></description>
77+
<description>The optional 'boolean' parameter specifies if error logging is enabled.</description>
7378
<optional>true</optional>
7479
<rewriteAllowed>true</rewriteAllowed>
7580
<expressionMode>AttributeFree</expressionMode>
@@ -79,7 +84,7 @@
7984
</parameters>
8085
<inputPorts>
8186
<inputPortSet>
82-
<description/>
87+
<description>The RegexMatch operator is configurable with a single input port. The input port is non-mutating and its punctuation mode is Oblivious.</description>
8388
<windowingDescription/>
8489
<tupleMutationAllowed>false</tupleMutationAllowed>
8590
<windowingMode>NonWindowed</windowingMode>
@@ -90,7 +95,7 @@
9095
</inputPorts>
9196
<outputPorts>
9297
<outputPortSet>
93-
<description/>
98+
<description>The RegexMatch operator is configurable with one output port. The output port is mutating and their punctuation mode is Preserving.</description>
9499
<expressionMode>Expression</expressionMode>
95100
<autoAssignment>true</autoAssignment>
96101
<completeAssignment>true</completeAssignment>

com.ibm.streamsx.regex/com.ibm.streamsx.regex.re2/RegexMatchFused/RegexMatchFused.xml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
<operatorModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ibm.com/xmlns/prod/streams/spl/operator" xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/operator operatorModel.xsd">
33
<cppOperatorModel>
44
<context>
5-
<description></description>
5+
<description>
6+
RegexMatchFused operator must run collocated with the calling operator.
7+
The calling operator must have mutating output port (like Custom or Functor operators).
8+
9+
Depending on regexFunction parameter value RegexMatchFused will run one of the following regex functions:
10+
* regexSimpleMatch performs a partial match and runs in interpretation mode (like SPL regexMatch function).
11+
* regexPartialMatch performs a partial match and runs in compilation mode.
12+
* regexFullMatch performs a full match and runs in compilation mode.
13+
</description>
614
<customLiterals>
715
<enumeration>
816
<name>regexTypes</name>
@@ -29,7 +37,7 @@
2937
<allowAny>false</allowAny>
3038
<parameter>
3139
<name>pattern</name>
32-
<description></description>
40+
<description>The optional 'rstring' parameter specifies the pattern to match.</description>
3341
<optional>true</optional>
3442
<rewriteAllowed>true</rewriteAllowed>
3543
<expressionMode>Expression</expressionMode>
@@ -38,7 +46,7 @@
3846
</parameter>
3947
<parameter>
4048
<name>maxMemory</name>
41-
<description></description>
49+
<description>The optional 'int64' parameter specifies maxMemory to allocate in bytes.</description>
4250
<optional>true</optional>
4351
<rewriteAllowed>true</rewriteAllowed>
4452
<expressionMode>Expression</expressionMode>
@@ -47,7 +55,7 @@
4755
</parameter>
4856
<parameter>
4957
<name>logErrors</name>
50-
<description></description>
58+
<description>The optional 'boolean' parameter specifies if error logging is enabled.</description>
5159
<optional>true</optional>
5260
<rewriteAllowed>true</rewriteAllowed>
5361
<expressionMode>Expression</expressionMode>
@@ -56,7 +64,7 @@
5664
</parameter>
5765
<parameter>
5866
<name>regexFunction</name>
59-
<description></description>
67+
<description>Mandatory 'regexTypes' custom literal parameter specifies which regex function to call.</description>
6068
<optional>false</optional>
6169
<rewriteAllowed>true</rewriteAllowed>
6270
<expressionMode>CustomLiteral</expressionMode>
@@ -65,7 +73,7 @@
6573
</parameter>
6674
<parameter>
6775
<name>patternAttr</name>
68-
<description></description>
76+
<description>The optional 'attribute name' parameter specifies which input attribute holds the pattern to match.</description>
6977
<optional>true</optional>
7078
<rewriteAllowed>true</rewriteAllowed>
7179
<expressionMode>Attribute</expressionMode>
@@ -74,7 +82,7 @@
7482
</parameter>
7583
<parameter>
7684
<name>searchAttr</name>
77-
<description></description>
85+
<description>The mandatory 'attribute name' parameter specifies which input attribute holds the string to match.</description>
7886
<optional>false</optional>
7987
<rewriteAllowed>true</rewriteAllowed>
8088
<expressionMode>Attribute</expressionMode>
@@ -83,7 +91,7 @@
8391
</parameter>
8492
<parameter>
8593
<name>resultAttr</name>
86-
<description></description>
94+
<description>The mandatory 'attribute name' parameter specifies which input attribute gets the result.</description>
8795
<optional>false</optional>
8896
<rewriteAllowed>true</rewriteAllowed>
8997
<expressionMode>Attribute</expressionMode>
@@ -93,8 +101,8 @@
93101
</parameters>
94102
<inputPorts>
95103
<inputPortSet>
96-
<description/>
97-
<windowingDescription/>
104+
<description>The RegexMatchFused operator is configurable with a single input port. The input port is mutating and its punctuation mode is Oblivious.</description>
105+
<windowingDescription></windowingDescription>
98106
<tupleMutationAllowed>true</tupleMutationAllowed>
99107
<windowingMode>NonWindowed</windowingMode>
100108
<windowPunctuationInputMode>Oblivious</windowPunctuationInputMode>

com.ibm.streamsx.regex/com.ibm.streamsx.regex.re2/native.function/function.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
<cppNamespaceName>regex</cppNamespaceName>
66
<functions>
77
<function>
8-
<description>An example native function</description>
8+
<description>Tries to match the whole string with the pattern (overloaded version, called after the initial pattern is already compiled).</description>
99
<prototype>public boolean regexFullMatch(rstring str)</prototype>
1010
</function>
1111
<function>
12-
<description>An example native function</description>
12+
<description sampleUri="">Tries to match the whole string with the pattern.</description>
1313
<prototype>public boolean regexFullMatch(rstring str, rstring pattern)</prototype>
1414
</function>
1515
<function>
16-
<description>An example native function</description>
16+
<description>Tries to match the whole string with the pattern (additionally allows to control max memory allocated).</description>
1717
<prototype>public boolean regexFullMatch(rstring str, rstring pattern, int32 maxmem)</prototype>
1818
</function>
1919
<function>
20-
<description></description>
20+
<description>Tries to match the string with the pattern (overloaded version, called after the initial pattern is already compiled).</description>
2121
<prototype>public boolean regexPartialMatch(rstring str)</prototype>
2222
</function>
2323
<function>
24-
<description></description>
24+
<description>Tries to match the string with the pattern.</description>
2525
<prototype>public boolean regexPartialMatch(rstring str, rstring pattern)</prototype>
2626
</function>
2727
<function>
28-
<description></description>
28+
<description>Tries to match the string with the pattern (additionally allows to control max memory allocated).</description>
2929
<prototype>public boolean regexPartialMatch(rstring str, rstring pattern, int32 maxmem)</prototype>
3030
</function>
3131
<function>
32-
<description></description>
32+
<description>Tries to match the string with the pattern.</description>
3333
<prototype>public boolean regexSimpleMatch(rstring str, rstring pattern)</prototype>
3434
</function>
3535
</functions>

com.ibm.streamsx.regex/info.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,21 @@
33
xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
44
<info:identity>
55
<info:name>com.ibm.streamsx.regex</info:name>
6-
<info:description></info:description>
6+
<info:description>
7+
Support for [http://code.google.com/p/re2|RE2] regular expression library.
8+
9+
RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python.
10+
RE2 uses [http://swtch.com/~rsc/regexp/regexp1.html|automata theory] to guarantee that regular expressions run in time linear in the size of the input.
11+
12+
This toolkit provides several operators and native finctions to run RE2 engine in compilation or interpretation mode.
13+
* Compilation mode: The regex is compiled and executed on the first call, then directly executed on the subsequent calls.
14+
* Interpretation mode: The regex is interpreted on each call.
15+
16+
Each operator/native function implements partial or full regex match.
17+
18+
**Third-party libraries**
19+
* This toolkit embeds RE2 headers/libraries under impl/&lt;include|lib&gt;.
20+
</info:description>
721
<info:version>1.0.0</info:version>
822
<info:requiredProductVersion>3.1.0</info:requiredProductVersion>
923
</info:identity>

0 commit comments

Comments
 (0)