@@ -7,71 +7,35 @@ overlay[local?]
77module ;
88
99import java
10- private import semmle.code.java.dataflow.DataFlow
1110private import semmle.code.java.frameworks.JavaxAnnotations
1211
1312/**
14- * A data-flow node that executes a regular expression.
13+ * An expression that represents a regular expression match .
1514 *
1615 * Extend this class to refine existing API models. If you want to model new APIs,
17- * extend `RegexExecution ::Range` instead.
16+ * extend `RegexMatch ::Range` instead.
1817 */
19- class RegexExecution extends DataFlow :: Node instanceof RegexExecution :: Range {
20- /** Gets the data flow node for the regex being executed by this node. */
21- DataFlow :: Node getRegex ( ) { result = super .getRegex ( ) }
18+ class RegexMatch extends Expr instanceof RegexMatch :: Range {
19+ /** Gets the expression for the regex being executed by this node. */
20+ Expr getRegex ( ) { result = super .getRegex ( ) }
2221
23- /** Gets a data flow node for the string to be searched or matched against. */
24- DataFlow :: Node getString ( ) { result = super .getString ( ) }
22+ /** Gets an expression for the string to be searched or matched against. */
23+ Expr getString ( ) { result = super .getString ( ) }
2524
2625 /**
27- * Gets the name of this regex execution , typically the name of an executing method.
26+ * Gets the name of this regex match , typically the name of an executing method.
2827 * This is used for nice alert messages and should include the module if possible.
2928 */
3029 string getName ( ) { result = super .getName ( ) }
3130}
3231
33- /** Provides classes for modeling new regular-expression execution APIs. */
34- module RegexExecution {
35- /**
36- * A data flow node that executes a regular expression.
37- *
38- * Extend this class to model new APIs. If you want to refine existing API models,
39- * extend `RegexExecution` instead.
40- */
41- abstract class Range extends DataFlow:: Node {
42- /** Gets the data flow node for the regex being executed by this node. */
43- abstract DataFlow:: Node getRegex ( ) ;
44-
45- /** Gets a data flow node for the string to be searched or matched against. */
46- abstract DataFlow:: Node getString ( ) ;
47-
48- /**
49- * Gets the name of this regex execution, typically the name of an executing method.
50- * This is used for nice alert messages and should include the module if possible.
51- */
52- abstract string getName ( ) ;
53- }
54-
55- private class RangeFromExpr extends Range {
56- private RegexExecutionExpr:: Range ree ;
57-
58- RangeFromExpr ( ) { this .asExpr ( ) = ree }
59-
60- override DataFlow:: Node getRegex ( ) { result .asExpr ( ) = ree .getRegex ( ) }
61-
62- override DataFlow:: Node getString ( ) { result .asExpr ( ) = ree .getString ( ) }
63-
64- override string getName ( ) { result = ree .getName ( ) }
65- }
66- }
67-
68- /** Provides classes for modeling new regular-expression execution APIs. */
69- module RegexExecutionExpr {
32+ /** Provides classes for modeling regular-expression execution APIs. */
33+ module RegexMatch {
7034 /**
7135 * An expression that executes a regular expression.
7236 *
7337 * Extend this class to model new APIs. If you want to refine existing API models,
74- * extend `RegexExecution ` instead.
38+ * extend `RegexMatch ` instead.
7539 */
7640 abstract class Range extends Expr {
7741 /** Gets the expression for the regex being executed by this node. */
@@ -81,7 +45,7 @@ module RegexExecutionExpr {
8145 abstract Expr getString ( ) ;
8246
8347 /**
84- * Gets the name of this regex execution , typically the name of an executing method.
48+ * Gets the name of this regex match , typically the name of an executing method.
8549 * This is used for nice alert messages and should include the module if possible.
8650 */
8751 abstract string getName ( ) ;
0 commit comments