mirror of
https://github.com/github/codeql.git
synced 2026-07-11 22:45:33 +02:00
29 lines
705 B
Plaintext
29 lines
705 B
Plaintext
/** Provides classes for modifiers. */
|
|
|
|
import Element
|
|
|
|
/**
|
|
* A modifier, for example `static`, `virtual`, `public` and so on.
|
|
*/
|
|
class Modifier extends Element, @modifier {
|
|
/** Gets the name of this modifier, for example `public`. */
|
|
string getName() { modifiers(this, result) }
|
|
|
|
/** Holds if this modifier has name `name`. */
|
|
predicate hasName(string name) { name = this.getName() }
|
|
|
|
override string toString() { result = this.getName() }
|
|
}
|
|
|
|
/**
|
|
* An access modifier: `public`, `private`, `internal` or `protected`.
|
|
*/
|
|
class AccessModifier extends Modifier {
|
|
AccessModifier() {
|
|
hasName("public") or
|
|
hasName("private") or
|
|
hasName("internal") or
|
|
hasName("protected")
|
|
}
|
|
}
|