-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a60634d
commit ab39ecd
Showing
113 changed files
with
12,114 additions
and
11,619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,137 changes: 0 additions & 1,137 deletions
1,137
domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Accessors.scala
This file was deleted.
Oops, something went wrong.
10,481 changes: 0 additions & 10,481 deletions
10,481
domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Traversals.scala
This file was deleted.
Oops, something went wrong.
1,119 changes: 1,119 additions & 0 deletions
1,119
...ses/src/main/generated/io/shiftleft/codepropertygraph/generated/accessors/Accessors.scala
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
127 changes: 127 additions & 0 deletions
127
...nerated/io/shiftleft/codepropertygraph/generated/traversals/TraversalAnnotationBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package io.shiftleft.codepropertygraph.generated.traversals | ||
|
||
import io.shiftleft.codepropertygraph.generated.nodes | ||
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.* | ||
|
||
final class TraversalAnnotationBase[NodeType <: nodes.AnnotationBase](val traversal: Iterator[NodeType]) | ||
extends AnyVal { | ||
|
||
/** Traverse to fullName property */ | ||
def fullName: Iterator[String] = | ||
traversal.map(_.fullName) | ||
|
||
/** Traverse to nodes where the fullName matches the regular expression `value` | ||
*/ | ||
def fullName(pattern: String): Iterator[NodeType] = | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
fullNameExact(pattern) | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filter { item => matcher.reset(item.fullName).matches } | ||
} | ||
|
||
/** Traverse to nodes where the fullName matches at least one of the regular expressions in `values` | ||
*/ | ||
def fullName(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.exists { _.reset(item.fullName).matches } } | ||
} | ||
|
||
/** Traverse to nodes where fullName matches `value` exactly. | ||
*/ | ||
def fullNameExact(value: String): Iterator[NodeType] = traversal match { | ||
case init: flatgraph.misc.InitNodeIterator[flatgraph.GNode @unchecked] if init.isVirgin && init.hasNext => | ||
val someNode = init.next | ||
flatgraph.Accessors | ||
.getWithInverseIndex(someNode.graph, someNode.nodeKind, 22, value) | ||
.asInstanceOf[Iterator[NodeType]] | ||
case _ => traversal.filter { _.fullName == value } | ||
} | ||
|
||
/** Traverse to nodes where fullName matches one of the elements in `values` exactly. | ||
*/ | ||
def fullNameExact(values: String*): Iterator[NodeType] = | ||
if (values.length == 1) fullNameExact(values.head) | ||
else { | ||
val valueSet = values.toSet | ||
traversal.filter { item => valueSet.contains(item.fullName) } | ||
} | ||
|
||
/** Traverse to nodes where fullName does not match the regular expression `value`. | ||
*/ | ||
def fullNameNot(pattern: String): Iterator[NodeType] = { | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
traversal.filter { node => node.fullName != pattern } | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filterNot { item => matcher.reset(item.fullName).matches } | ||
} | ||
} | ||
|
||
/** Traverse to nodes where fullName does not match any of the regular expressions in `values`. | ||
*/ | ||
def fullNameNot(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.find { _.reset(item.fullName).matches }.isEmpty } | ||
} | ||
|
||
/** Traverse to name property */ | ||
def name: Iterator[String] = | ||
traversal.map(_.name) | ||
|
||
/** Traverse to nodes where the name matches the regular expression `value` | ||
*/ | ||
def name(pattern: String): Iterator[NodeType] = | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
nameExact(pattern) | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filter { item => matcher.reset(item.name).matches } | ||
} | ||
|
||
/** Traverse to nodes where the name matches at least one of the regular expressions in `values` | ||
*/ | ||
def name(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.exists { _.reset(item.name).matches } } | ||
} | ||
|
||
/** Traverse to nodes where name matches `value` exactly. | ||
*/ | ||
def nameExact(value: String): Iterator[NodeType] = traversal match { | ||
case init: flatgraph.misc.InitNodeIterator[flatgraph.GNode @unchecked] if init.isVirgin && init.hasNext => | ||
val someNode = init.next | ||
flatgraph.Accessors | ||
.getWithInverseIndex(someNode.graph, someNode.nodeKind, 39, value) | ||
.asInstanceOf[Iterator[NodeType]] | ||
case _ => traversal.filter { _.name == value } | ||
} | ||
|
||
/** Traverse to nodes where name matches one of the elements in `values` exactly. | ||
*/ | ||
def nameExact(values: String*): Iterator[NodeType] = | ||
if (values.length == 1) nameExact(values.head) | ||
else { | ||
val valueSet = values.toSet | ||
traversal.filter { item => valueSet.contains(item.name) } | ||
} | ||
|
||
/** Traverse to nodes where name does not match the regular expression `value`. | ||
*/ | ||
def nameNot(pattern: String): Iterator[NodeType] = { | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
traversal.filter { node => node.name != pattern } | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filterNot { item => matcher.reset(item.name).matches } | ||
} | ||
} | ||
|
||
/** Traverse to nodes where name does not match any of the regular expressions in `values`. | ||
*/ | ||
def nameNot(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.find { _.reset(item.name).matches }.isEmpty } | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
.../io/shiftleft/codepropertygraph/generated/traversals/TraversalAnnotationliteralBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package io.shiftleft.codepropertygraph.generated.traversals | ||
|
||
import io.shiftleft.codepropertygraph.generated.nodes | ||
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.* | ||
|
||
final class TraversalAnnotationliteralBase[NodeType <: nodes.AnnotationLiteralBase](val traversal: Iterator[NodeType]) | ||
extends AnyVal { | ||
|
||
/** Traverse to name property */ | ||
def name: Iterator[String] = | ||
traversal.map(_.name) | ||
|
||
/** Traverse to nodes where the name matches the regular expression `value` | ||
*/ | ||
def name(pattern: String): Iterator[NodeType] = | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
nameExact(pattern) | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filter { item => matcher.reset(item.name).matches } | ||
} | ||
|
||
/** Traverse to nodes where the name matches at least one of the regular expressions in `values` | ||
*/ | ||
def name(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.exists { _.reset(item.name).matches } } | ||
} | ||
|
||
/** Traverse to nodes where name matches `value` exactly. | ||
*/ | ||
def nameExact(value: String): Iterator[NodeType] = traversal match { | ||
case init: flatgraph.misc.InitNodeIterator[flatgraph.GNode @unchecked] if init.isVirgin && init.hasNext => | ||
val someNode = init.next | ||
flatgraph.Accessors | ||
.getWithInverseIndex(someNode.graph, someNode.nodeKind, 39, value) | ||
.asInstanceOf[Iterator[NodeType]] | ||
case _ => traversal.filter { _.name == value } | ||
} | ||
|
||
/** Traverse to nodes where name matches one of the elements in `values` exactly. | ||
*/ | ||
def nameExact(values: String*): Iterator[NodeType] = | ||
if (values.length == 1) nameExact(values.head) | ||
else { | ||
val valueSet = values.toSet | ||
traversal.filter { item => valueSet.contains(item.name) } | ||
} | ||
|
||
/** Traverse to nodes where name does not match the regular expression `value`. | ||
*/ | ||
def nameNot(pattern: String): Iterator[NodeType] = { | ||
if (!flatgraph.misc.Regex.isRegex(pattern)) { | ||
traversal.filter { node => node.name != pattern } | ||
} else { | ||
val matcher = flatgraph.misc.Regex.multilineMatcher(pattern) | ||
traversal.filterNot { item => matcher.reset(item.name).matches } | ||
} | ||
} | ||
|
||
/** Traverse to nodes where name does not match any of the regular expressions in `values`. | ||
*/ | ||
def nameNot(patterns: String*): Iterator[NodeType] = { | ||
val matchers = patterns.map(flatgraph.misc.Regex.multilineMatcher) | ||
traversal.filter { item => matchers.find { _.reset(item.name).matches }.isEmpty } | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...o/shiftleft/codepropertygraph/generated/traversals/TraversalAnnotationparameterBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.shiftleft.codepropertygraph.generated.traversals | ||
|
||
import io.shiftleft.codepropertygraph.generated.nodes | ||
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.* | ||
|
||
final class TraversalAnnotationparameterBase[NodeType <: nodes.AnnotationParameterBase]( | ||
val traversal: Iterator[NodeType] | ||
) extends AnyVal {} |
8 changes: 8 additions & 0 deletions
8
...tleft/codepropertygraph/generated/traversals/TraversalAnnotationparameterassignBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.shiftleft.codepropertygraph.generated.traversals | ||
|
||
import io.shiftleft.codepropertygraph.generated.nodes | ||
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.* | ||
|
||
final class TraversalAnnotationparameterassignBase[NodeType <: nodes.AnnotationParameterAssignBase]( | ||
val traversal: Iterator[NodeType] | ||
) extends AnyVal {} |
7 changes: 7 additions & 0 deletions
7
...d/io/shiftleft/codepropertygraph/generated/traversals/TraversalArrayinitializerBase.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.shiftleft.codepropertygraph.generated.traversals | ||
|
||
import io.shiftleft.codepropertygraph.generated.nodes | ||
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.* | ||
|
||
final class TraversalArrayinitializerBase[NodeType <: nodes.ArrayInitializerBase](val traversal: Iterator[NodeType]) | ||
extends AnyVal {} |
Oops, something went wrong.