QL AST: Add overlay annotations

This commit is contained in:
Kasper Svendsen
2025-05-27 10:16:47 +02:00
parent 164cfaf3e7
commit 5f65ea60d1

View File

@@ -2538,6 +2538,18 @@ private class NoOptArg extends AnnotationArg {
NoOptArg() { this.getValue() = "noopt" }
}
private class CallerArg extends AnnotationArg {
CallerArg() { this.getValue() = "caller" }
}
private class LocalArg extends AnnotationArg {
LocalArg() { this.getValue() = "local" }
}
private class LocalQArg extends AnnotationArg {
LocalQArg() { this.getValue() = "local?" }
}
private class MonotonicAggregatesArg extends AnnotationArg {
MonotonicAggregatesArg() { this.getValue() = "monotonicAggregates" }
}
@@ -2597,6 +2609,27 @@ class NoOpt extends Annotation {
override string toString() { result = "noopt" }
}
/** An `overlay[caller]` annotation. */
class OverlayCaller extends Annotation {
OverlayCaller() { this.getName() = "overlay" and this.getArgs(0) instanceof CallerArg }
override string toString() { result = "caller" }
}
/** An `overlay[local]` annotation. */
class OverlayLocal extends Annotation {
OverlayLocal() { this.getName() = "overlay" and this.getArgs(0) instanceof LocalArg }
override string toString() { result = "local" }
}
/** An `overlay[local?]` annotation. */
class OverlayLocalQ extends Annotation {
OverlayLocalQ() { this.getName() = "overlay" and this.getArgs(0) instanceof LocalQArg }
override string toString() { result = "local?" }
}
/** A `language[monotonicAggregates]` annotation. */
class MonotonicAggregates extends Annotation {
MonotonicAggregates() { this.getArgs(0) instanceof MonotonicAggregatesArg }