mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Swift: add auto-generated docs for getters
This commit is contained in:
@@ -14,15 +14,38 @@ module Generated {
|
||||
*/
|
||||
{{/has_doc}}
|
||||
class {{name}} extends Synth::T{{name}}{{#bases}}, {{.}}{{/bases}} {
|
||||
{{#root}}
|
||||
{{#root}}
|
||||
/**
|
||||
* Gets the string representation of this element.
|
||||
*/
|
||||
string toString() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets the name of a primary CodeQL class to which this element belongs.
|
||||
*
|
||||
* This is the most precise syntactic category to which they belong; for
|
||||
* example, `CallExpr` is a primary class, but `ApplyExpr` is not.
|
||||
*
|
||||
* There might be some corner cases when this returns multiple classes, or none.
|
||||
*/
|
||||
string getAPrimaryQlClass() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
|
||||
*/
|
||||
final string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
|
||||
|
||||
/**
|
||||
* Gets the most immediate element that should substitute this element in the explicit AST, if any.
|
||||
* Classes can override this to indicate this node should be in the "hidden" AST, mostly reserved
|
||||
* for conversions and syntactic sugar nodes like parentheses.
|
||||
*/
|
||||
{{name}} getResolveStep() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets the element that should substitute this element in the explicit AST, applying `getResolveStep`
|
||||
* transitively.
|
||||
*/
|
||||
final {{name}} resolve() {
|
||||
not exists(getResolveStep()) and result = this
|
||||
or
|
||||
@@ -35,6 +58,10 @@ module Generated {
|
||||
{{#properties}}
|
||||
|
||||
{{#type_is_class}}
|
||||
/**
|
||||
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
{{type}} getImmediate{{singular}}({{#is_repeated}}int index{{/is_repeated}}) {
|
||||
{{^ipa}}
|
||||
result = Synth::convert{{type}}FromRaw(Synth::convert{{name}}ToRaw(this){{^root}}.(Raw::{{name}}){{/root}}.{{getter}}({{#is_repeated}}index{{/is_repeated}}))
|
||||
@@ -44,12 +71,41 @@ module Generated {
|
||||
{{/ipa}}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
|
||||
{{#has_doc}}
|
||||
*
|
||||
{{#doc}}
|
||||
* {{.}}
|
||||
{{/doc}}
|
||||
{{/has_doc}}
|
||||
*/
|
||||
final {{type}} {{getter}}({{#is_repeated}}int index{{/is_repeated}}) {
|
||||
result = getImmediate{{singular}}({{#is_repeated}}index{{/is_repeated}}).resolve()
|
||||
}
|
||||
|
||||
{{/type_is_class}}
|
||||
{{^type_is_class}}
|
||||
{{^is_predicate}}
|
||||
/**
|
||||
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
|
||||
{{#has_doc}}
|
||||
*
|
||||
{{#doc}}
|
||||
* {{.}}
|
||||
{{/doc}}
|
||||
{{/has_doc}}
|
||||
*/
|
||||
{{/is_predicate}}
|
||||
{{#is_predicate}}
|
||||
{{#has_doc}}
|
||||
/**
|
||||
{{#doc}}
|
||||
* {{.}}
|
||||
{{/doc}}
|
||||
*/
|
||||
{{/has_doc}}
|
||||
{{/is_predicate}}
|
||||
{{type}} {{getter}}({{#is_repeated}}int index{{/is_repeated}}) {
|
||||
{{^ipa}}
|
||||
{{^is_predicate}}result = {{/is_predicate}}Synth::convert{{name}}ToRaw(this){{^root}}.(Raw::{{name}}){{/root}}.{{getter}}({{#is_repeated}}index{{/is_repeated}})
|
||||
@@ -61,17 +117,26 @@ module Generated {
|
||||
|
||||
{{/type_is_class}}
|
||||
{{#is_optional}}
|
||||
/**
|
||||
* Holds if `{{getter}}({{#is_repeated}}index{{/is_repeated}})` exists.
|
||||
*/
|
||||
final predicate has{{singular}}({{#is_repeated}}int index{{/is_repeated}}) {
|
||||
exists({{getter}}({{#is_repeated}}index{{/is_repeated}}))
|
||||
}
|
||||
{{/is_optional}}
|
||||
{{#is_repeated}}
|
||||
|
||||
/**
|
||||
* Gets any of the {{doc_name_plural}}.
|
||||
*/
|
||||
final {{type}} {{indefinite_getter}}() {
|
||||
result = {{getter}}(_)
|
||||
}
|
||||
{{^is_optional}}
|
||||
|
||||
/**
|
||||
* Gets the number of {{doc_name_plural}}.
|
||||
*/
|
||||
final int getNumberOf{{plural}}() {
|
||||
result = count({{indefinite_getter}}())
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ import codeql.swift.elements.decl.ParamDecl
|
||||
|
||||
module Generated {
|
||||
class Callable extends Synth::TCallable, Element {
|
||||
/**
|
||||
* Gets the self param, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ParamDecl getImmediateSelfParam() {
|
||||
result =
|
||||
Synth::convertParamDeclFromRaw(Synth::convertCallableToRaw(this)
|
||||
@@ -14,10 +18,20 @@ module Generated {
|
||||
.getSelfParam())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the self param, if it exists.
|
||||
*/
|
||||
final ParamDecl getSelfParam() { result = getImmediateSelfParam().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getSelfParam()` exists.
|
||||
*/
|
||||
final predicate hasSelfParam() { exists(getSelfParam()) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ParamDecl getImmediateParam(int index) {
|
||||
result =
|
||||
Synth::convertParamDeclFromRaw(Synth::convertCallableToRaw(this)
|
||||
@@ -25,19 +39,38 @@ module Generated {
|
||||
.getParam(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
*/
|
||||
final ParamDecl getParam(int index) { result = getImmediateParam(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the params.
|
||||
*/
|
||||
final ParamDecl getAParam() { result = getParam(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of params.
|
||||
*/
|
||||
final int getNumberOfParams() { result = count(getAParam()) }
|
||||
|
||||
/**
|
||||
* Gets the body, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertCallableToRaw(this).(Raw::Callable).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body, if it exists.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getBody()` exists.
|
||||
*/
|
||||
final predicate hasBody() { exists(getBody()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class Comment extends Synth::TComment, Locatable {
|
||||
override string getAPrimaryQlClass() { result = "Comment" }
|
||||
|
||||
/**
|
||||
* Gets the text.
|
||||
*/
|
||||
string getText() { result = Synth::convertCommentToRaw(this).(Raw::Comment).getText() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,37 @@ private import codeql.swift.generated.Raw
|
||||
|
||||
module Generated {
|
||||
class Element extends Synth::TElement {
|
||||
/**
|
||||
* Gets the string representation of this element.
|
||||
*/
|
||||
string toString() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets the name of a primary CodeQL class to which this element belongs.
|
||||
*
|
||||
* This is the most precise syntactic category to which they belong; for
|
||||
* example, `CallExpr` is a primary class, but `ApplyExpr` is not.
|
||||
*
|
||||
* There might be some corner cases when this returns multiple classes, or none.
|
||||
*/
|
||||
string getAPrimaryQlClass() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
|
||||
*/
|
||||
final string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
|
||||
|
||||
/**
|
||||
* Gets the most immediate element that should substitute this element in the explicit AST, if any.
|
||||
* Classes can override this to indicate this node should be in the "hidden" AST, mostly reserved
|
||||
* for conversions and syntactic sugar nodes like parentheses.
|
||||
*/
|
||||
Element getResolveStep() { none() } // overridden by subclasses
|
||||
|
||||
/**
|
||||
* Gets the element that should substitute this element in the explicit AST, applying `getResolveStep`
|
||||
* transitively.
|
||||
*/
|
||||
final Element resolve() {
|
||||
not exists(getResolveStep()) and result = this
|
||||
or
|
||||
|
||||
@@ -5,6 +5,9 @@ import codeql.swift.elements.Element
|
||||
|
||||
module Generated {
|
||||
class File extends Synth::TFile, Element {
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() { result = Synth::convertFileToRaw(this).(Raw::File).getName() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.Location
|
||||
|
||||
module Generated {
|
||||
class Locatable extends Synth::TLocatable, Element {
|
||||
/**
|
||||
* Gets the location, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Location getImmediateLocation() {
|
||||
result =
|
||||
Synth::convertLocationFromRaw(Synth::convertLocatableToRaw(this)
|
||||
@@ -13,8 +17,14 @@ module Generated {
|
||||
.getLocation())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location, if it exists.
|
||||
*/
|
||||
final Location getLocation() { result = getImmediateLocation().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getLocation()` exists.
|
||||
*/
|
||||
final predicate hasLocation() { exists(getLocation()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,21 +6,40 @@ import codeql.swift.elements.File
|
||||
|
||||
module Generated {
|
||||
class Location extends Synth::TLocation, Element {
|
||||
/**
|
||||
* Gets the file.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
File getImmediateFile() {
|
||||
result =
|
||||
Synth::convertFileFromRaw(Synth::convertLocationToRaw(this).(Raw::Location).getFile())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file.
|
||||
*/
|
||||
final File getFile() { result = getImmediateFile().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the start line.
|
||||
*/
|
||||
int getStartLine() { result = Synth::convertLocationToRaw(this).(Raw::Location).getStartLine() }
|
||||
|
||||
/**
|
||||
* Gets the start column.
|
||||
*/
|
||||
int getStartColumn() {
|
||||
result = Synth::convertLocationToRaw(this).(Raw::Location).getStartColumn()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end line.
|
||||
*/
|
||||
int getEndLine() { result = Synth::convertLocationToRaw(this).(Raw::Location).getEndLine() }
|
||||
|
||||
/**
|
||||
* Gets the end column.
|
||||
*/
|
||||
int getEndColumn() { result = Synth::convertLocationToRaw(this).(Raw::Location).getEndColumn() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import codeql.swift.elements.decl.ValueDecl
|
||||
module Generated {
|
||||
class AbstractFunctionDecl extends Synth::TAbstractFunctionDecl, GenericContext, ValueDecl,
|
||||
Callable {
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertAbstractFunctionDeclToRaw(this).(Raw::AbstractFunctionDecl).getName()
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.decl.ValueDecl
|
||||
|
||||
module Generated {
|
||||
class AbstractStorageDecl extends Synth::TAbstractStorageDecl, ValueDecl {
|
||||
/**
|
||||
* Gets the `index`th accessor decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
AccessorDecl getImmediateAccessorDecl(int index) {
|
||||
result =
|
||||
Synth::convertAccessorDeclFromRaw(Synth::convertAbstractStorageDeclToRaw(this)
|
||||
@@ -13,12 +17,21 @@ module Generated {
|
||||
.getAccessorDecl(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th accessor decl.
|
||||
*/
|
||||
final AccessorDecl getAccessorDecl(int index) {
|
||||
result = getImmediateAccessorDecl(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the accessor decls.
|
||||
*/
|
||||
final AccessorDecl getAnAccessorDecl() { result = getAccessorDecl(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of accessor decls.
|
||||
*/
|
||||
final int getNumberOfAccessorDecls() { result = count(getAnAccessorDecl()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class ConcreteVarDecl extends Synth::TConcreteVarDecl, VarDecl {
|
||||
override string getAPrimaryQlClass() { result = "ConcreteVarDecl" }
|
||||
|
||||
/**
|
||||
* Gets the introducer int.
|
||||
*/
|
||||
int getIntroducerInt() {
|
||||
result = Synth::convertConcreteVarDeclToRaw(this).(Raw::ConcreteVarDecl).getIntroducerInt()
|
||||
}
|
||||
|
||||
@@ -6,11 +6,18 @@ import codeql.swift.elements.decl.ModuleDecl
|
||||
|
||||
module Generated {
|
||||
class Decl extends Synth::TDecl, AstNode {
|
||||
/**
|
||||
* Gets the module.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ModuleDecl getImmediateModule() {
|
||||
result =
|
||||
Synth::convertModuleDeclFromRaw(Synth::convertDeclToRaw(this).(Raw::Decl).getModule())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the module.
|
||||
*/
|
||||
final ModuleDecl getModule() { result = getImmediateModule().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class EnumCaseDecl extends Synth::TEnumCaseDecl, Decl {
|
||||
override string getAPrimaryQlClass() { result = "EnumCaseDecl" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
EnumElementDecl getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertEnumElementDeclFromRaw(Synth::convertEnumCaseDeclToRaw(this)
|
||||
@@ -15,10 +19,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final EnumElementDecl getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final EnumElementDecl getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,17 @@ module Generated {
|
||||
class EnumElementDecl extends Synth::TEnumElementDecl, ValueDecl {
|
||||
override string getAPrimaryQlClass() { result = "EnumElementDecl" }
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertEnumElementDeclToRaw(this).(Raw::EnumElementDecl).getName()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ParamDecl getImmediateParam(int index) {
|
||||
result =
|
||||
Synth::convertParamDeclFromRaw(Synth::convertEnumElementDeclToRaw(this)
|
||||
@@ -19,10 +26,19 @@ module Generated {
|
||||
.getParam(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
*/
|
||||
final ParamDecl getParam(int index) { result = getImmediateParam(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the params.
|
||||
*/
|
||||
final ParamDecl getAParam() { result = getParam(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of params.
|
||||
*/
|
||||
final int getNumberOfParams() { result = count(getAParam()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ module Generated {
|
||||
class ExtensionDecl extends Synth::TExtensionDecl, GenericContext, IterableDeclContext, Decl {
|
||||
override string getAPrimaryQlClass() { result = "ExtensionDecl" }
|
||||
|
||||
/**
|
||||
* Gets the extended type decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
NominalTypeDecl getImmediateExtendedTypeDecl() {
|
||||
result =
|
||||
Synth::convertNominalTypeDeclFromRaw(Synth::convertExtensionDeclToRaw(this)
|
||||
@@ -17,6 +21,9 @@ module Generated {
|
||||
.getExtendedTypeDecl())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the extended type decl.
|
||||
*/
|
||||
final NominalTypeDecl getExtendedTypeDecl() {
|
||||
result = getImmediateExtendedTypeDecl().resolve()
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.decl.GenericTypeParamDecl
|
||||
|
||||
module Generated {
|
||||
class GenericContext extends Synth::TGenericContext, Element {
|
||||
/**
|
||||
* Gets the `index`th generic type param.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
GenericTypeParamDecl getImmediateGenericTypeParam(int index) {
|
||||
result =
|
||||
Synth::convertGenericTypeParamDeclFromRaw(Synth::convertGenericContextToRaw(this)
|
||||
@@ -13,12 +17,21 @@ module Generated {
|
||||
.getGenericTypeParam(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th generic type param.
|
||||
*/
|
||||
final GenericTypeParamDecl getGenericTypeParam(int index) {
|
||||
result = getImmediateGenericTypeParam(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the generic type params.
|
||||
*/
|
||||
final GenericTypeParamDecl getAGenericTypeParam() { result = getGenericTypeParam(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of generic type params.
|
||||
*/
|
||||
final int getNumberOfGenericTypeParams() { result = count(getAGenericTypeParam()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class IfConfigDecl extends Synth::TIfConfigDecl, Decl {
|
||||
override string getAPrimaryQlClass() { result = "IfConfigDecl" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th active element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
AstNode getImmediateActiveElement(int index) {
|
||||
result =
|
||||
Synth::convertAstNodeFromRaw(Synth::convertIfConfigDeclToRaw(this)
|
||||
@@ -15,12 +19,21 @@ module Generated {
|
||||
.getActiveElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th active element.
|
||||
*/
|
||||
final AstNode getActiveElement(int index) {
|
||||
result = getImmediateActiveElement(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the active elements.
|
||||
*/
|
||||
final AstNode getAnActiveElement() { result = getActiveElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of active elements.
|
||||
*/
|
||||
final int getNumberOfActiveElements() { result = count(getAnActiveElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ module Generated {
|
||||
|
||||
predicate isExported() { Synth::convertImportDeclToRaw(this).(Raw::ImportDecl).isExported() }
|
||||
|
||||
/**
|
||||
* Gets the imported module, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ModuleDecl getImmediateImportedModule() {
|
||||
result =
|
||||
Synth::convertModuleDeclFromRaw(Synth::convertImportDeclToRaw(this)
|
||||
@@ -18,10 +22,20 @@ module Generated {
|
||||
.getImportedModule())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the imported module, if it exists.
|
||||
*/
|
||||
final ModuleDecl getImportedModule() { result = getImmediateImportedModule().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getImportedModule()` exists.
|
||||
*/
|
||||
final predicate hasImportedModule() { exists(getImportedModule()) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th declaration.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ValueDecl getImmediateDeclaration(int index) {
|
||||
result =
|
||||
Synth::convertValueDeclFromRaw(Synth::convertImportDeclToRaw(this)
|
||||
@@ -29,10 +43,19 @@ module Generated {
|
||||
.getDeclaration(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th declaration.
|
||||
*/
|
||||
final ValueDecl getDeclaration(int index) { result = getImmediateDeclaration(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the declarations.
|
||||
*/
|
||||
final ValueDecl getADeclaration() { result = getDeclaration(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of declarations.
|
||||
*/
|
||||
final int getNumberOfDeclarations() { result = count(getADeclaration()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class InfixOperatorDecl extends Synth::TInfixOperatorDecl, OperatorDecl {
|
||||
override string getAPrimaryQlClass() { result = "InfixOperatorDecl" }
|
||||
|
||||
/**
|
||||
* Gets the precedence group, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
PrecedenceGroupDecl getImmediatePrecedenceGroup() {
|
||||
result =
|
||||
Synth::convertPrecedenceGroupDeclFromRaw(Synth::convertInfixOperatorDeclToRaw(this)
|
||||
@@ -15,10 +19,16 @@ module Generated {
|
||||
.getPrecedenceGroup())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the precedence group, if it exists.
|
||||
*/
|
||||
final PrecedenceGroupDecl getPrecedenceGroup() {
|
||||
result = getImmediatePrecedenceGroup().resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getPrecedenceGroup()` exists.
|
||||
*/
|
||||
final predicate hasPrecedenceGroup() { exists(getPrecedenceGroup()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.Element
|
||||
|
||||
module Generated {
|
||||
class IterableDeclContext extends Synth::TIterableDeclContext, Element {
|
||||
/**
|
||||
* Gets the `index`th member.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Decl getImmediateMember(int index) {
|
||||
result =
|
||||
Synth::convertDeclFromRaw(Synth::convertIterableDeclContextToRaw(this)
|
||||
@@ -13,10 +17,19 @@ module Generated {
|
||||
.getMember(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th member.
|
||||
*/
|
||||
final Decl getMember(int index) { result = getImmediateMember(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the members.
|
||||
*/
|
||||
final Decl getAMember() { result = getMember(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of members.
|
||||
*/
|
||||
final int getNumberOfMembers() { result = count(getAMember()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ module Generated {
|
||||
Synth::convertModuleDeclToRaw(this).(Raw::ModuleDecl).isSystemModule()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th imported module.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ModuleDecl getImmediateImportedModule(int index) {
|
||||
result =
|
||||
Synth::convertModuleDeclFromRaw(Synth::convertModuleDeclToRaw(this)
|
||||
@@ -22,14 +26,27 @@ module Generated {
|
||||
.getImportedModule(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th imported module.
|
||||
*/
|
||||
final ModuleDecl getImportedModule(int index) {
|
||||
result = getImmediateImportedModule(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the imported modules.
|
||||
*/
|
||||
final ModuleDecl getAnImportedModule() { result = getImportedModule(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of imported modules.
|
||||
*/
|
||||
final int getNumberOfImportedModules() { result = count(getAnImportedModule()) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th exported module.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ModuleDecl getImmediateExportedModule(int index) {
|
||||
result =
|
||||
Synth::convertModuleDeclFromRaw(Synth::convertModuleDeclToRaw(this)
|
||||
@@ -37,12 +54,21 @@ module Generated {
|
||||
.getExportedModule(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th exported module.
|
||||
*/
|
||||
final ModuleDecl getExportedModule(int index) {
|
||||
result = getImmediateExportedModule(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the exported modules.
|
||||
*/
|
||||
final ModuleDecl getAnExportedModule() { result = getExportedModule(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of exported modules.
|
||||
*/
|
||||
final int getNumberOfExportedModules() { result = count(getAnExportedModule()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ import codeql.swift.elements.type.Type
|
||||
|
||||
module Generated {
|
||||
class NominalTypeDecl extends Synth::TNominalTypeDecl, GenericTypeDecl, IterableDeclContext {
|
||||
/**
|
||||
* Gets the type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateType() {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertNominalTypeDeclToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type.
|
||||
*/
|
||||
final Type getType() { result = getImmediateType().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import codeql.swift.elements.decl.Decl
|
||||
|
||||
module Generated {
|
||||
class OperatorDecl extends Synth::TOperatorDecl, Decl {
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertOperatorDeclToRaw(this).(Raw::OperatorDecl).getName()
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ module Generated {
|
||||
class PatternBindingDecl extends Synth::TPatternBindingDecl, Decl {
|
||||
override string getAPrimaryQlClass() { result = "PatternBindingDecl" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th init, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateInit(int index) {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertPatternBindingDeclToRaw(this)
|
||||
@@ -16,12 +20,25 @@ module Generated {
|
||||
.getInit(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th init, if it exists.
|
||||
*/
|
||||
final Expr getInit(int index) { result = getImmediateInit(index).resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getInit(index)` exists.
|
||||
*/
|
||||
final predicate hasInit(int index) { exists(getInit(index)) }
|
||||
|
||||
/**
|
||||
* Gets any of the inits.
|
||||
*/
|
||||
final Expr getAnInit() { result = getInit(_) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediatePattern(int index) {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertPatternBindingDeclToRaw(this)
|
||||
@@ -29,10 +46,19 @@ module Generated {
|
||||
.getPattern(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th pattern.
|
||||
*/
|
||||
final Pattern getPattern(int index) { result = getImmediatePattern(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the patterns.
|
||||
*/
|
||||
final Pattern getAPattern() { result = getPattern(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of patterns.
|
||||
*/
|
||||
final int getNumberOfPatterns() { result = count(getAPattern()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ module Generated {
|
||||
class SubscriptDecl extends Synth::TSubscriptDecl, AbstractStorageDecl, GenericContext {
|
||||
override string getAPrimaryQlClass() { result = "SubscriptDecl" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ParamDecl getImmediateParam(int index) {
|
||||
result =
|
||||
Synth::convertParamDeclFromRaw(Synth::convertSubscriptDeclToRaw(this)
|
||||
@@ -17,12 +21,25 @@ module Generated {
|
||||
.getParam(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th param.
|
||||
*/
|
||||
final ParamDecl getParam(int index) { result = getImmediateParam(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the params.
|
||||
*/
|
||||
final ParamDecl getAParam() { result = getParam(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of params.
|
||||
*/
|
||||
final int getNumberOfParams() { result = count(getAParam()) }
|
||||
|
||||
/**
|
||||
* Gets the element type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateElementType() {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertSubscriptDeclToRaw(this)
|
||||
@@ -30,6 +47,9 @@ module Generated {
|
||||
.getElementType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the element type.
|
||||
*/
|
||||
final Type getElementType() { result = getImmediateElementType().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class TopLevelCodeDecl extends Synth::TTopLevelCodeDecl, Decl {
|
||||
override string getAPrimaryQlClass() { result = "TopLevelCodeDecl" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertTopLevelCodeDeclToRaw(this)
|
||||
@@ -15,6 +19,9 @@ module Generated {
|
||||
.getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,15 @@ import codeql.swift.elements.decl.ValueDecl
|
||||
|
||||
module Generated {
|
||||
class TypeDecl extends Synth::TTypeDecl, ValueDecl {
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() { result = Synth::convertTypeDeclToRaw(this).(Raw::TypeDecl).getName() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th base type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateBaseType(int index) {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertTypeDeclToRaw(this)
|
||||
@@ -15,10 +22,19 @@ module Generated {
|
||||
.getBaseType(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th base type.
|
||||
*/
|
||||
final Type getBaseType(int index) { result = getImmediateBaseType(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the base types.
|
||||
*/
|
||||
final Type getABaseType() { result = getBaseType(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of base types.
|
||||
*/
|
||||
final int getNumberOfBaseTypes() { result = count(getABaseType()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.type.Type
|
||||
|
||||
module Generated {
|
||||
class ValueDecl extends Synth::TValueDecl, Decl {
|
||||
/**
|
||||
* Gets the interface type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateInterfaceType() {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertValueDeclToRaw(this)
|
||||
@@ -13,6 +17,9 @@ module Generated {
|
||||
.getInterfaceType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the interface type.
|
||||
*/
|
||||
final Type getInterfaceType() { result = getImmediateInterfaceType().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,28 @@ import codeql.swift.elements.type.Type
|
||||
|
||||
module Generated {
|
||||
class VarDecl extends Synth::TVarDecl, AbstractStorageDecl {
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() { result = Synth::convertVarDeclToRaw(this).(Raw::VarDecl).getName() }
|
||||
|
||||
/**
|
||||
* Gets the type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateType() {
|
||||
result = Synth::convertTypeFromRaw(Synth::convertVarDeclToRaw(this).(Raw::VarDecl).getType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type.
|
||||
*/
|
||||
final Type getType() { result = getImmediateType().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the attached property wrapper type, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateAttachedPropertyWrapperType() {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertVarDeclToRaw(this)
|
||||
@@ -23,12 +37,22 @@ module Generated {
|
||||
.getAttachedPropertyWrapperType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the attached property wrapper type, if it exists.
|
||||
*/
|
||||
final Type getAttachedPropertyWrapperType() {
|
||||
result = getImmediateAttachedPropertyWrapperType().resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getAttachedPropertyWrapperType()` exists.
|
||||
*/
|
||||
final predicate hasAttachedPropertyWrapperType() { exists(getAttachedPropertyWrapperType()) }
|
||||
|
||||
/**
|
||||
* Gets the parent pattern, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateParentPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertVarDeclToRaw(this)
|
||||
@@ -36,10 +60,20 @@ module Generated {
|
||||
.getParentPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parent pattern, if it exists.
|
||||
*/
|
||||
final Pattern getParentPattern() { result = getImmediateParentPattern().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getParentPattern()` exists.
|
||||
*/
|
||||
final predicate hasParentPattern() { exists(getParentPattern()) }
|
||||
|
||||
/**
|
||||
* Gets the parent initializer, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateParentInitializer() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertVarDeclToRaw(this)
|
||||
@@ -47,8 +81,14 @@ module Generated {
|
||||
.getParentInitializer())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parent initializer, if it exists.
|
||||
*/
|
||||
final Expr getParentInitializer() { result = getImmediateParentInitializer().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getParentInitializer()` exists.
|
||||
*/
|
||||
final predicate hasParentInitializer() { exists(getParentInitializer()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,18 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class AnyTryExpr extends Synth::TAnyTryExpr, Expr {
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertAnyTryExprToRaw(this).(Raw::AnyTryExpr).getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,24 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class ApplyExpr extends Synth::TApplyExpr, Expr {
|
||||
/**
|
||||
* Gets the function.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateFunction() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertApplyExprToRaw(this).(Raw::ApplyExpr).getFunction())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the function.
|
||||
*/
|
||||
final Expr getFunction() { result = getImmediateFunction().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th argument.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Argument getImmediateArgument(int index) {
|
||||
result =
|
||||
Synth::convertArgumentFromRaw(Synth::convertApplyExprToRaw(this)
|
||||
@@ -20,10 +31,19 @@ module Generated {
|
||||
.getArgument(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th argument.
|
||||
*/
|
||||
final Argument getArgument(int index) { result = getImmediateArgument(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the arguments.
|
||||
*/
|
||||
final Argument getAnArgument() { result = getArgument(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of arguments.
|
||||
*/
|
||||
final int getNumberOfArguments() { result = count(getAnArgument()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,23 @@ module Generated {
|
||||
class Argument extends Synth::TArgument, Locatable {
|
||||
override string getAPrimaryQlClass() { result = "Argument" }
|
||||
|
||||
/**
|
||||
* Gets the label.
|
||||
*/
|
||||
string getLabel() { result = Synth::convertArgumentToRaw(this).(Raw::Argument).getLabel() }
|
||||
|
||||
/**
|
||||
* Gets the expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertArgumentToRaw(this).(Raw::Argument).getExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the expr.
|
||||
*/
|
||||
final Expr getExpr() { result = getImmediateExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class ArrayExpr extends Synth::TArrayExpr, CollectionExpr {
|
||||
override string getAPrimaryQlClass() { result = "ArrayExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertArrayExprToRaw(this)
|
||||
@@ -15,10 +19,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final Expr getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final Expr getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,32 @@ module Generated {
|
||||
class AssignExpr extends Synth::TAssignExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "AssignExpr" }
|
||||
|
||||
/**
|
||||
* Gets the dest.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateDest() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertAssignExprToRaw(this).(Raw::AssignExpr).getDest())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the dest.
|
||||
*/
|
||||
final Expr getDest() { result = getImmediateDest().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the source.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSource() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertAssignExprToRaw(this).(Raw::AssignExpr).getSource())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source.
|
||||
*/
|
||||
final Expr getSource() { result = getImmediateSource().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class BindOptionalExpr extends Synth::TBindOptionalExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "BindOptionalExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertBindOptionalExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class BooleanLiteralExpr extends Synth::TBooleanLiteralExpr, BuiltinLiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "BooleanLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the value.
|
||||
*/
|
||||
boolean getValue() {
|
||||
result = Synth::convertBooleanLiteralExprToRaw(this).(Raw::BooleanLiteralExpr).getValue()
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ module Generated {
|
||||
class CaptureListExpr extends Synth::TCaptureListExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "CaptureListExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th binding decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
PatternBindingDecl getImmediateBindingDecl(int index) {
|
||||
result =
|
||||
Synth::convertPatternBindingDeclFromRaw(Synth::convertCaptureListExprToRaw(this)
|
||||
@@ -16,14 +20,27 @@ module Generated {
|
||||
.getBindingDecl(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th binding decl.
|
||||
*/
|
||||
final PatternBindingDecl getBindingDecl(int index) {
|
||||
result = getImmediateBindingDecl(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the binding decls.
|
||||
*/
|
||||
final PatternBindingDecl getABindingDecl() { result = getBindingDecl(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of binding decls.
|
||||
*/
|
||||
final int getNumberOfBindingDecls() { result = count(getABindingDecl()) }
|
||||
|
||||
/**
|
||||
* Gets the closure body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ClosureExpr getImmediateClosureBody() {
|
||||
result =
|
||||
Synth::convertClosureExprFromRaw(Synth::convertCaptureListExprToRaw(this)
|
||||
@@ -31,6 +48,9 @@ module Generated {
|
||||
.getClosureBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the closure body.
|
||||
*/
|
||||
final ClosureExpr getClosureBody() { result = getImmediateClosureBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,24 @@ module Generated {
|
||||
class DeclRefExpr extends Synth::TDeclRefExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "DeclRefExpr" }
|
||||
|
||||
/**
|
||||
* Gets the decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Decl getImmediateDecl() {
|
||||
result =
|
||||
Synth::convertDeclFromRaw(Synth::convertDeclRefExprToRaw(this).(Raw::DeclRefExpr).getDecl())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the decl.
|
||||
*/
|
||||
final Decl getDecl() { result = getImmediateDecl().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th replacement type.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateReplacementType(int index) {
|
||||
result =
|
||||
Synth::convertTypeFromRaw(Synth::convertDeclRefExprToRaw(this)
|
||||
@@ -23,12 +34,21 @@ module Generated {
|
||||
.getReplacementType(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th replacement type.
|
||||
*/
|
||||
final Type getReplacementType(int index) {
|
||||
result = getImmediateReplacementType(index).resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets any of the replacement types.
|
||||
*/
|
||||
final Type getAReplacementType() { result = getReplacementType(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of replacement types.
|
||||
*/
|
||||
final int getNumberOfReplacementTypes() { result = count(getAReplacementType()) }
|
||||
|
||||
predicate hasDirectToStorageSemantics() {
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class DefaultArgumentExpr extends Synth::TDefaultArgumentExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "DefaultArgumentExpr" }
|
||||
|
||||
/**
|
||||
* Gets the param decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ParamDecl getImmediateParamDecl() {
|
||||
result =
|
||||
Synth::convertParamDeclFromRaw(Synth::convertDefaultArgumentExprToRaw(this)
|
||||
@@ -15,13 +19,23 @@ module Generated {
|
||||
.getParamDecl())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the param decl.
|
||||
*/
|
||||
final ParamDecl getParamDecl() { result = getImmediateParamDecl().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the param index.
|
||||
*/
|
||||
int getParamIndex() {
|
||||
result =
|
||||
Synth::convertDefaultArgumentExprToRaw(this).(Raw::DefaultArgumentExpr).getParamIndex()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the caller side default, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateCallerSideDefault() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertDefaultArgumentExprToRaw(this)
|
||||
@@ -29,8 +43,14 @@ module Generated {
|
||||
.getCallerSideDefault())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the caller side default, if it exists.
|
||||
*/
|
||||
final Expr getCallerSideDefault() { result = getImmediateCallerSideDefault().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getCallerSideDefault()` exists.
|
||||
*/
|
||||
final predicate hasCallerSideDefault() { exists(getCallerSideDefault()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class DictionaryExpr extends Synth::TDictionaryExpr, CollectionExpr {
|
||||
override string getAPrimaryQlClass() { result = "DictionaryExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertDictionaryExprToRaw(this)
|
||||
@@ -15,10 +19,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final Expr getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final Expr getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class DotSyntaxBaseIgnoredExpr extends Synth::TDotSyntaxBaseIgnoredExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "DotSyntaxBaseIgnoredExpr" }
|
||||
|
||||
/**
|
||||
* Gets the qualifier.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateQualifier() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertDotSyntaxBaseIgnoredExprToRaw(this)
|
||||
@@ -14,8 +18,15 @@ module Generated {
|
||||
.getQualifier())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the qualifier.
|
||||
*/
|
||||
final Expr getQualifier() { result = getImmediateQualifier().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertDotSyntaxBaseIgnoredExprToRaw(this)
|
||||
@@ -23,6 +34,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class DynamicTypeExpr extends Synth::TDynamicTypeExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "DynamicTypeExpr" }
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBase() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertDynamicTypeExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getBase())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*/
|
||||
final Expr getBase() { result = getImmediateBase().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class EnumIsCaseExpr extends Synth::TEnumIsCaseExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "EnumIsCaseExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertEnumIsCaseExprToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
EnumElementDecl getImmediateElement() {
|
||||
result =
|
||||
Synth::convertEnumElementDeclFromRaw(Synth::convertEnumIsCaseExprToRaw(this)
|
||||
@@ -24,6 +35,9 @@ module Generated {
|
||||
.getElement())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the element.
|
||||
*/
|
||||
final EnumElementDecl getElement() { result = getImmediateElement().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class ExplicitCastExpr extends Synth::TExplicitCastExpr, Expr {
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertExplicitCastExprToRaw(this)
|
||||
@@ -12,6 +16,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,22 @@ module Generated {
|
||||
* The base class for all expressions in Swift.
|
||||
*/
|
||||
class Expr extends Synth::TExpr, AstNode {
|
||||
/**
|
||||
* Gets the type, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Type getImmediateType() {
|
||||
result = Synth::convertTypeFromRaw(Synth::convertExprToRaw(this).(Raw::Expr).getType())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type, if it exists.
|
||||
*/
|
||||
final Type getType() { result = getImmediateType().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getType()` exists.
|
||||
*/
|
||||
final predicate hasType() { exists(getType()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class FloatLiteralExpr extends Synth::TFloatLiteralExpr, NumberLiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "FloatLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the string value.
|
||||
*/
|
||||
string getStringValue() {
|
||||
result = Synth::convertFloatLiteralExprToRaw(this).(Raw::FloatLiteralExpr).getStringValue()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class ForceValueExpr extends Synth::TForceValueExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "ForceValueExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertForceValueExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class IdentityExpr extends Synth::TIdentityExpr, Expr {
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertIdentityExprToRaw(this)
|
||||
@@ -12,6 +16,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,25 +7,46 @@ module Generated {
|
||||
class IfExpr extends Synth::TIfExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "IfExpr" }
|
||||
|
||||
/**
|
||||
* Gets the condition.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateCondition() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertIfExprToRaw(this).(Raw::IfExpr).getCondition())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the condition.
|
||||
*/
|
||||
final Expr getCondition() { result = getImmediateCondition().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the then expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateThenExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertIfExprToRaw(this).(Raw::IfExpr).getThenExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the then expr.
|
||||
*/
|
||||
final Expr getThenExpr() { result = getImmediateThenExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the else expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateElseExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertIfExprToRaw(this).(Raw::IfExpr).getElseExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the else expr.
|
||||
*/
|
||||
final Expr getElseExpr() { result = getImmediateElseExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class ImplicitConversionExpr extends Synth::TImplicitConversionExpr, Expr {
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertImplicitConversionExprToRaw(this)
|
||||
@@ -12,6 +16,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,18 @@ module Generated {
|
||||
class InOutExpr extends Synth::TInOutExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "InOutExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertInOutExprToRaw(this).(Raw::InOutExpr).getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class IntegerLiteralExpr extends Synth::TIntegerLiteralExpr, NumberLiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "IntegerLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the string value.
|
||||
*/
|
||||
string getStringValue() {
|
||||
result =
|
||||
Synth::convertIntegerLiteralExprToRaw(this).(Raw::IntegerLiteralExpr).getStringValue()
|
||||
|
||||
@@ -10,6 +10,10 @@ module Generated {
|
||||
class InterpolatedStringLiteralExpr extends Synth::TInterpolatedStringLiteralExpr, LiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "InterpolatedStringLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the interpolation expr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
OpaqueValueExpr getImmediateInterpolationExpr() {
|
||||
result =
|
||||
Synth::convertOpaqueValueExprFromRaw(Synth::convertInterpolatedStringLiteralExprToRaw(this)
|
||||
@@ -17,12 +21,22 @@ module Generated {
|
||||
.getInterpolationExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the interpolation expr, if it exists.
|
||||
*/
|
||||
final OpaqueValueExpr getInterpolationExpr() {
|
||||
result = getImmediateInterpolationExpr().resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getInterpolationExpr()` exists.
|
||||
*/
|
||||
final predicate hasInterpolationExpr() { exists(getInterpolationExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the interpolation count expr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateInterpolationCountExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertInterpolatedStringLiteralExprToRaw(this)
|
||||
@@ -30,12 +44,22 @@ module Generated {
|
||||
.getInterpolationCountExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the interpolation count expr, if it exists.
|
||||
*/
|
||||
final Expr getInterpolationCountExpr() {
|
||||
result = getImmediateInterpolationCountExpr().resolve()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getInterpolationCountExpr()` exists.
|
||||
*/
|
||||
final predicate hasInterpolationCountExpr() { exists(getInterpolationCountExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the literal capacity expr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateLiteralCapacityExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertInterpolatedStringLiteralExprToRaw(this)
|
||||
@@ -43,10 +67,20 @@ module Generated {
|
||||
.getLiteralCapacityExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the literal capacity expr, if it exists.
|
||||
*/
|
||||
final Expr getLiteralCapacityExpr() { result = getImmediateLiteralCapacityExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getLiteralCapacityExpr()` exists.
|
||||
*/
|
||||
final predicate hasLiteralCapacityExpr() { exists(getLiteralCapacityExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the appending expr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
TapExpr getImmediateAppendingExpr() {
|
||||
result =
|
||||
Synth::convertTapExprFromRaw(Synth::convertInterpolatedStringLiteralExprToRaw(this)
|
||||
@@ -54,8 +88,14 @@ module Generated {
|
||||
.getAppendingExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the appending expr, if it exists.
|
||||
*/
|
||||
final TapExpr getAppendingExpr() { result = getImmediateAppendingExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getAppendingExpr()` exists.
|
||||
*/
|
||||
final predicate hasAppendingExpr() { exists(getAppendingExpr()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class KeyPathApplicationExpr extends Synth::TKeyPathApplicationExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "KeyPathApplicationExpr" }
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBase() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertKeyPathApplicationExprToRaw(this)
|
||||
@@ -14,8 +18,15 @@ module Generated {
|
||||
.getBase())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*/
|
||||
final Expr getBase() { result = getImmediateBase().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the key path.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateKeyPath() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertKeyPathApplicationExprToRaw(this)
|
||||
@@ -23,6 +34,9 @@ module Generated {
|
||||
.getKeyPath())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the key path.
|
||||
*/
|
||||
final Expr getKeyPath() { result = getImmediateKeyPath().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class KeyPathExpr extends Synth::TKeyPathExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "KeyPathExpr" }
|
||||
|
||||
/**
|
||||
* Gets the root, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
TypeRepr getImmediateRoot() {
|
||||
result =
|
||||
Synth::convertTypeReprFromRaw(Synth::convertKeyPathExprToRaw(this)
|
||||
@@ -15,10 +19,20 @@ module Generated {
|
||||
.getRoot())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the root, if it exists.
|
||||
*/
|
||||
final TypeRepr getRoot() { result = getImmediateRoot().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getRoot()` exists.
|
||||
*/
|
||||
final predicate hasRoot() { exists(getRoot()) }
|
||||
|
||||
/**
|
||||
* Gets the parsed path, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateParsedPath() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertKeyPathExprToRaw(this)
|
||||
@@ -26,8 +40,14 @@ module Generated {
|
||||
.getParsedPath())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parsed path, if it exists.
|
||||
*/
|
||||
final Expr getParsedPath() { result = getImmediateParsedPath().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getParsedPath()` exists.
|
||||
*/
|
||||
final predicate hasParsedPath() { exists(getParsedPath()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class LazyInitializerExpr extends Synth::TLazyInitializerExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "LazyInitializerExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertLazyInitializerExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,37 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class LookupExpr extends Synth::TLookupExpr, Expr {
|
||||
/**
|
||||
* Gets the base.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBase() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertLookupExprToRaw(this).(Raw::LookupExpr).getBase())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*/
|
||||
final Expr getBase() { result = getImmediateBase().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the member, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Decl getImmediateMember() {
|
||||
result =
|
||||
Synth::convertDeclFromRaw(Synth::convertLookupExprToRaw(this).(Raw::LookupExpr).getMember())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the member, if it exists.
|
||||
*/
|
||||
final Decl getMember() { result = getImmediateMember().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getMember()` exists.
|
||||
*/
|
||||
final predicate hasMember() { exists(getMember()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class MagicIdentifierLiteralExpr extends Synth::TMagicIdentifierLiteralExpr, BuiltinLiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "MagicIdentifierLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the kind.
|
||||
*/
|
||||
string getKind() {
|
||||
result =
|
||||
Synth::convertMagicIdentifierLiteralExprToRaw(this)
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class MakeTemporarilyEscapableExpr extends Synth::TMakeTemporarilyEscapableExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "MakeTemporarilyEscapableExpr" }
|
||||
|
||||
/**
|
||||
* Gets the escaping closure.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
OpaqueValueExpr getImmediateEscapingClosure() {
|
||||
result =
|
||||
Synth::convertOpaqueValueExprFromRaw(Synth::convertMakeTemporarilyEscapableExprToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getEscapingClosure())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the escaping closure.
|
||||
*/
|
||||
final OpaqueValueExpr getEscapingClosure() { result = getImmediateEscapingClosure().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the nonescaping closure.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateNonescapingClosure() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertMakeTemporarilyEscapableExprToRaw(this)
|
||||
@@ -24,8 +35,15 @@ module Generated {
|
||||
.getNonescapingClosure())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the nonescaping closure.
|
||||
*/
|
||||
final Expr getNonescapingClosure() { result = getImmediateNonescapingClosure().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertMakeTemporarilyEscapableExprToRaw(this)
|
||||
@@ -33,6 +51,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class ObjCSelectorExpr extends Synth::TObjCSelectorExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "ObjCSelectorExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertObjCSelectorExprToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the method.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
AbstractFunctionDecl getImmediateMethod() {
|
||||
result =
|
||||
Synth::convertAbstractFunctionDeclFromRaw(Synth::convertObjCSelectorExprToRaw(this)
|
||||
@@ -24,6 +35,9 @@ module Generated {
|
||||
.getMethod())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the method.
|
||||
*/
|
||||
final AbstractFunctionDecl getMethod() { result = getImmediateMethod().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,18 @@ module Generated {
|
||||
class OneWayExpr extends Synth::TOneWayExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "OneWayExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertOneWayExprToRaw(this).(Raw::OneWayExpr).getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class OpenExistentialExpr extends Synth::TOpenExistentialExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "OpenExistentialExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertOpenExistentialExprToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the existential.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateExistential() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertOpenExistentialExprToRaw(this)
|
||||
@@ -24,8 +35,15 @@ module Generated {
|
||||
.getExistential())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the existential.
|
||||
*/
|
||||
final Expr getExistential() { result = getImmediateExistential().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the opaque expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
OpaqueValueExpr getImmediateOpaqueExpr() {
|
||||
result =
|
||||
Synth::convertOpaqueValueExprFromRaw(Synth::convertOpenExistentialExprToRaw(this)
|
||||
@@ -33,6 +51,9 @@ module Generated {
|
||||
.getOpaqueExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the opaque expr.
|
||||
*/
|
||||
final OpaqueValueExpr getOpaqueExpr() { result = getImmediateOpaqueExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class OptionalEvaluationExpr extends Synth::TOptionalEvaluationExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "OptionalEvaluationExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertOptionalEvaluationExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class OtherConstructorDeclRefExpr extends Synth::TOtherConstructorDeclRefExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "OtherConstructorDeclRefExpr" }
|
||||
|
||||
/**
|
||||
* Gets the constructor decl.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
ConstructorDecl getImmediateConstructorDecl() {
|
||||
result =
|
||||
Synth::convertConstructorDeclFromRaw(Synth::convertOtherConstructorDeclRefExprToRaw(this)
|
||||
@@ -15,6 +19,9 @@ module Generated {
|
||||
.getConstructorDecl())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the constructor decl.
|
||||
*/
|
||||
final ConstructorDecl getConstructorDecl() { result = getImmediateConstructorDecl().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class RebindSelfInConstructorExpr extends Synth::TRebindSelfInConstructorExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "RebindSelfInConstructorExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertRebindSelfInConstructorExprToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the self.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
VarDecl getImmediateSelf() {
|
||||
result =
|
||||
Synth::convertVarDeclFromRaw(Synth::convertRebindSelfInConstructorExprToRaw(this)
|
||||
@@ -24,6 +35,9 @@ module Generated {
|
||||
.getSelf())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the self.
|
||||
*/
|
||||
final VarDecl getSelf() { result = getImmediateSelf().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import codeql.swift.elements.expr.Expr
|
||||
|
||||
module Generated {
|
||||
class SelfApplyExpr extends Synth::TSelfApplyExpr, ApplyExpr {
|
||||
/**
|
||||
* Gets the base.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBase() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertSelfApplyExprToRaw(this)
|
||||
@@ -13,6 +17,9 @@ module Generated {
|
||||
.getBase())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*/
|
||||
final Expr getBase() { result = getImmediateBase().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class SequenceExpr extends Synth::TSequenceExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "SequenceExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertSequenceExprToRaw(this)
|
||||
@@ -14,10 +18,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final Expr getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final Expr getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class StringLiteralExpr extends Synth::TStringLiteralExpr, BuiltinLiteralExpr {
|
||||
override string getAPrimaryQlClass() { result = "StringLiteralExpr" }
|
||||
|
||||
/**
|
||||
* Gets the value.
|
||||
*/
|
||||
string getValue() {
|
||||
result = Synth::convertStringLiteralExprToRaw(this).(Raw::StringLiteralExpr).getValue()
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class SubscriptExpr extends Synth::TSubscriptExpr, LookupExpr {
|
||||
override string getAPrimaryQlClass() { result = "SubscriptExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th argument.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Argument getImmediateArgument(int index) {
|
||||
result =
|
||||
Synth::convertArgumentFromRaw(Synth::convertSubscriptExprToRaw(this)
|
||||
@@ -15,10 +19,19 @@ module Generated {
|
||||
.getArgument(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th argument.
|
||||
*/
|
||||
final Argument getArgument(int index) { result = getImmediateArgument(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the arguments.
|
||||
*/
|
||||
final Argument getAnArgument() { result = getArgument(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of arguments.
|
||||
*/
|
||||
final int getNumberOfArguments() { result = count(getAnArgument()) }
|
||||
|
||||
predicate hasDirectToStorageSemantics() {
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class SuperRefExpr extends Synth::TSuperRefExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "SuperRefExpr" }
|
||||
|
||||
/**
|
||||
* Gets the self.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
VarDecl getImmediateSelf() {
|
||||
result =
|
||||
Synth::convertVarDeclFromRaw(Synth::convertSuperRefExprToRaw(this)
|
||||
@@ -15,6 +19,9 @@ module Generated {
|
||||
.getSelf())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the self.
|
||||
*/
|
||||
final VarDecl getSelf() { result = getImmediateSelf().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,27 +9,51 @@ module Generated {
|
||||
class TapExpr extends Synth::TTapExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "TapExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertTapExprToRaw(this).(Raw::TapExpr).getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr, if it exists.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getSubExpr()` exists.
|
||||
*/
|
||||
final predicate hasSubExpr() { exists(getSubExpr()) }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertTapExprToRaw(this).(Raw::TapExpr).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the var.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
VarDecl getImmediateVar() {
|
||||
result =
|
||||
Synth::convertVarDeclFromRaw(Synth::convertTapExprToRaw(this).(Raw::TapExpr).getVar())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the var.
|
||||
*/
|
||||
final VarDecl getVar() { result = getImmediateVar().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class TupleElementExpr extends Synth::TTupleElementExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "TupleElementExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertTupleElementExprToRaw(this)
|
||||
@@ -14,8 +18,14 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the index.
|
||||
*/
|
||||
int getIndex() {
|
||||
result = Synth::convertTupleElementExprToRaw(this).(Raw::TupleElementExpr).getIndex()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class TupleExpr extends Synth::TTupleExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "TupleExpr" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertTupleExprToRaw(this)
|
||||
@@ -14,10 +18,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final Expr getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final Expr getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class TypeExpr extends Synth::TTypeExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "TypeExpr" }
|
||||
|
||||
/**
|
||||
* Gets the type repr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
TypeRepr getImmediateTypeRepr() {
|
||||
result =
|
||||
Synth::convertTypeReprFromRaw(Synth::convertTypeExprToRaw(this)
|
||||
@@ -15,8 +19,14 @@ module Generated {
|
||||
.getTypeRepr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type repr, if it exists.
|
||||
*/
|
||||
final TypeRepr getTypeRepr() { result = getImmediateTypeRepr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getTypeRepr()` exists.
|
||||
*/
|
||||
final predicate hasTypeRepr() { exists(getTypeRepr()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,16 @@ module Generated {
|
||||
class UnresolvedDeclRefExpr extends Synth::TUnresolvedDeclRefExpr, Expr, UnresolvedElement {
|
||||
override string getAPrimaryQlClass() { result = "UnresolvedDeclRefExpr" }
|
||||
|
||||
/**
|
||||
* Gets the name, if it exists.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertUnresolvedDeclRefExprToRaw(this).(Raw::UnresolvedDeclRefExpr).getName()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getName()` exists.
|
||||
*/
|
||||
final predicate hasName() { exists(getName()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class UnresolvedDotExpr extends Synth::TUnresolvedDotExpr, Expr, UnresolvedElement {
|
||||
override string getAPrimaryQlClass() { result = "UnresolvedDotExpr" }
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBase() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertUnresolvedDotExprToRaw(this)
|
||||
@@ -15,8 +19,14 @@ module Generated {
|
||||
.getBase())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*/
|
||||
final Expr getBase() { result = getImmediateBase().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertUnresolvedDotExprToRaw(this).(Raw::UnresolvedDotExpr).getName()
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ module Generated {
|
||||
class UnresolvedMemberExpr extends Synth::TUnresolvedMemberExpr, Expr, UnresolvedElement {
|
||||
override string getAPrimaryQlClass() { result = "UnresolvedMemberExpr" }
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertUnresolvedMemberExprToRaw(this).(Raw::UnresolvedMemberExpr).getName()
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ module Generated {
|
||||
class UnresolvedPatternExpr extends Synth::TUnresolvedPatternExpr, Expr, UnresolvedElement {
|
||||
override string getAPrimaryQlClass() { result = "UnresolvedPatternExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertUnresolvedPatternExprToRaw(this)
|
||||
@@ -16,6 +20,9 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class VarargExpansionExpr extends Synth::TVarargExpansionExpr, Expr {
|
||||
override string getAPrimaryQlClass() { result = "VarargExpansionExpr" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertVarargExpansionExprToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class BindingPattern extends Synth::TBindingPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "BindingPattern" }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertBindingPatternToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class BoolPattern extends Synth::TBoolPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "BoolPattern" }
|
||||
|
||||
/**
|
||||
* Gets the value.
|
||||
*/
|
||||
boolean getValue() {
|
||||
result = Synth::convertBoolPatternToRaw(this).(Raw::BoolPattern).getValue()
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class EnumElementPattern extends Synth::TEnumElementPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "EnumElementPattern" }
|
||||
|
||||
/**
|
||||
* Gets the element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
EnumElementDecl getImmediateElement() {
|
||||
result =
|
||||
Synth::convertEnumElementDeclFromRaw(Synth::convertEnumElementPatternToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getElement())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the element.
|
||||
*/
|
||||
final EnumElementDecl getElement() { result = getImmediateElement().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertEnumElementPatternToRaw(this)
|
||||
@@ -24,8 +35,14 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern, if it exists.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getSubPattern()` exists.
|
||||
*/
|
||||
final predicate hasSubPattern() { exists(getSubPattern()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class ExprPattern extends Synth::TExprPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "ExprPattern" }
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSubExpr() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertExprPatternToRaw(this)
|
||||
@@ -15,6 +19,9 @@ module Generated {
|
||||
.getSubExpr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub expr.
|
||||
*/
|
||||
final Expr getSubExpr() { result = getImmediateSubExpr().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class IsPattern extends Synth::TIsPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "IsPattern" }
|
||||
|
||||
/**
|
||||
* Gets the cast type repr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
TypeRepr getImmediateCastTypeRepr() {
|
||||
result =
|
||||
Synth::convertTypeReprFromRaw(Synth::convertIsPatternToRaw(this)
|
||||
@@ -15,10 +19,20 @@ module Generated {
|
||||
.getCastTypeRepr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cast type repr, if it exists.
|
||||
*/
|
||||
final TypeRepr getCastTypeRepr() { result = getImmediateCastTypeRepr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getCastTypeRepr()` exists.
|
||||
*/
|
||||
final predicate hasCastTypeRepr() { exists(getCastTypeRepr()) }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertIsPatternToRaw(this)
|
||||
@@ -26,8 +40,14 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern, if it exists.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getSubPattern()` exists.
|
||||
*/
|
||||
final predicate hasSubPattern() { exists(getSubPattern()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ module Generated {
|
||||
class NamedPattern extends Synth::TNamedPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "NamedPattern" }
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*/
|
||||
string getName() {
|
||||
result = Synth::convertNamedPatternToRaw(this).(Raw::NamedPattern).getName()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class OptionalSomePattern extends Synth::TOptionalSomePattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "OptionalSomePattern" }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertOptionalSomePatternToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class ParenPattern extends Synth::TParenPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "ParenPattern" }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertParenPatternToRaw(this)
|
||||
@@ -14,6 +18,9 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ module Generated {
|
||||
class TuplePattern extends Synth::TTuplePattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "TuplePattern" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertTuplePatternToRaw(this)
|
||||
@@ -14,10 +18,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final Pattern getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final Pattern getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class TypedPattern extends Synth::TTypedPattern, Pattern {
|
||||
override string getAPrimaryQlClass() { result = "TypedPattern" }
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediateSubPattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertTypedPatternToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getSubPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sub pattern.
|
||||
*/
|
||||
final Pattern getSubPattern() { result = getImmediateSubPattern().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the type repr, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
TypeRepr getImmediateTypeRepr() {
|
||||
result =
|
||||
Synth::convertTypeReprFromRaw(Synth::convertTypedPatternToRaw(this)
|
||||
@@ -24,8 +35,14 @@ module Generated {
|
||||
.getTypeRepr())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type repr, if it exists.
|
||||
*/
|
||||
final TypeRepr getTypeRepr() { result = getImmediateTypeRepr().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getTypeRepr()` exists.
|
||||
*/
|
||||
final predicate hasTypeRepr() { exists(getTypeRepr()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class BraceStmt extends Synth::TBraceStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "BraceStmt" }
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
AstNode getImmediateElement(int index) {
|
||||
result =
|
||||
Synth::convertAstNodeFromRaw(Synth::convertBraceStmtToRaw(this)
|
||||
@@ -15,10 +19,19 @@ module Generated {
|
||||
.getElement(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th element.
|
||||
*/
|
||||
final AstNode getElement(int index) { result = getImmediateElement(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the elements.
|
||||
*/
|
||||
final AstNode getAnElement() { result = getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of elements.
|
||||
*/
|
||||
final int getNumberOfElements() { result = count(getAnElement()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,19 +7,35 @@ module Generated {
|
||||
class BreakStmt extends Synth::TBreakStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "BreakStmt" }
|
||||
|
||||
/**
|
||||
* Gets the target name, if it exists.
|
||||
*/
|
||||
string getTargetName() {
|
||||
result = Synth::convertBreakStmtToRaw(this).(Raw::BreakStmt).getTargetName()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getTargetName()` exists.
|
||||
*/
|
||||
final predicate hasTargetName() { exists(getTargetName()) }
|
||||
|
||||
/**
|
||||
* Gets the target, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Stmt getImmediateTarget() {
|
||||
result =
|
||||
Synth::convertStmtFromRaw(Synth::convertBreakStmtToRaw(this).(Raw::BreakStmt).getTarget())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the target, if it exists.
|
||||
*/
|
||||
final Stmt getTarget() { result = getImmediateTarget().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getTarget()` exists.
|
||||
*/
|
||||
final predicate hasTarget() { exists(getTarget()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ module Generated {
|
||||
class CaseLabelItem extends Synth::TCaseLabelItem, AstNode {
|
||||
override string getAPrimaryQlClass() { result = "CaseLabelItem" }
|
||||
|
||||
/**
|
||||
* Gets the pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediatePattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertCaseLabelItemToRaw(this)
|
||||
@@ -16,8 +20,15 @@ module Generated {
|
||||
.getPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pattern.
|
||||
*/
|
||||
final Pattern getPattern() { result = getImmediatePattern().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the guard, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateGuard() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertCaseLabelItemToRaw(this)
|
||||
@@ -25,8 +36,14 @@ module Generated {
|
||||
.getGuard())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the guard, if it exists.
|
||||
*/
|
||||
final Expr getGuard() { result = getImmediateGuard().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getGuard()` exists.
|
||||
*/
|
||||
final predicate hasGuard() { exists(getGuard()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,24 @@ module Generated {
|
||||
class CaseStmt extends Synth::TCaseStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "CaseStmt" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Stmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertStmtFromRaw(Synth::convertCaseStmtToRaw(this).(Raw::CaseStmt).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final Stmt getBody() { result = getImmediateBody().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th label.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
CaseLabelItem getImmediateLabel(int index) {
|
||||
result =
|
||||
Synth::convertCaseLabelItemFromRaw(Synth::convertCaseStmtToRaw(this)
|
||||
@@ -23,12 +34,25 @@ module Generated {
|
||||
.getLabel(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th label.
|
||||
*/
|
||||
final CaseLabelItem getLabel(int index) { result = getImmediateLabel(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the labels.
|
||||
*/
|
||||
final CaseLabelItem getALabel() { result = getLabel(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of labels.
|
||||
*/
|
||||
final int getNumberOfLabels() { result = count(getALabel()) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th variable.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
VarDecl getImmediateVariable(int index) {
|
||||
result =
|
||||
Synth::convertVarDeclFromRaw(Synth::convertCaseStmtToRaw(this)
|
||||
@@ -36,10 +60,19 @@ module Generated {
|
||||
.getVariable(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th variable.
|
||||
*/
|
||||
final VarDecl getVariable(int index) { result = getImmediateVariable(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the variables.
|
||||
*/
|
||||
final VarDecl getAVariable() { result = getVariable(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of variables.
|
||||
*/
|
||||
final int getNumberOfVariables() { result = count(getAVariable()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ module Generated {
|
||||
class ConditionElement extends Synth::TConditionElement, AstNode {
|
||||
override string getAPrimaryQlClass() { result = "ConditionElement" }
|
||||
|
||||
/**
|
||||
* Gets the boolean, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateBoolean() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertConditionElementToRaw(this)
|
||||
@@ -16,10 +20,20 @@ module Generated {
|
||||
.getBoolean())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the boolean, if it exists.
|
||||
*/
|
||||
final Expr getBoolean() { result = getImmediateBoolean().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getBoolean()` exists.
|
||||
*/
|
||||
final predicate hasBoolean() { exists(getBoolean()) }
|
||||
|
||||
/**
|
||||
* Gets the pattern, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediatePattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertConditionElementToRaw(this)
|
||||
@@ -27,10 +41,20 @@ module Generated {
|
||||
.getPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pattern, if it exists.
|
||||
*/
|
||||
final Pattern getPattern() { result = getImmediatePattern().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getPattern()` exists.
|
||||
*/
|
||||
final predicate hasPattern() { exists(getPattern()) }
|
||||
|
||||
/**
|
||||
* Gets the initializer, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateInitializer() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertConditionElementToRaw(this)
|
||||
@@ -38,8 +62,14 @@ module Generated {
|
||||
.getInitializer())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the initializer, if it exists.
|
||||
*/
|
||||
final Expr getInitializer() { result = getImmediateInitializer().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getInitializer()` exists.
|
||||
*/
|
||||
final predicate hasInitializer() { exists(getInitializer()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,22 @@ module Generated {
|
||||
class ContinueStmt extends Synth::TContinueStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "ContinueStmt" }
|
||||
|
||||
/**
|
||||
* Gets the target name, if it exists.
|
||||
*/
|
||||
string getTargetName() {
|
||||
result = Synth::convertContinueStmtToRaw(this).(Raw::ContinueStmt).getTargetName()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getTargetName()` exists.
|
||||
*/
|
||||
final predicate hasTargetName() { exists(getTargetName()) }
|
||||
|
||||
/**
|
||||
* Gets the target, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Stmt getImmediateTarget() {
|
||||
result =
|
||||
Synth::convertStmtFromRaw(Synth::convertContinueStmtToRaw(this)
|
||||
@@ -20,8 +30,14 @@ module Generated {
|
||||
.getTarget())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the target, if it exists.
|
||||
*/
|
||||
final Stmt getTarget() { result = getImmediateTarget().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getTarget()` exists.
|
||||
*/
|
||||
final predicate hasTarget() { exists(getTarget()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,18 @@ module Generated {
|
||||
class DeferStmt extends Synth::TDeferStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "DeferStmt" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertDeferStmtToRaw(this).(Raw::DeferStmt).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,24 @@ module Generated {
|
||||
class DoCatchStmt extends Synth::TDoCatchStmt, LabeledStmt {
|
||||
override string getAPrimaryQlClass() { result = "DoCatchStmt" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Stmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertStmtFromRaw(Synth::convertDoCatchStmtToRaw(this).(Raw::DoCatchStmt).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final Stmt getBody() { result = getImmediateBody().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th catch.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
CaseStmt getImmediateCatch(int index) {
|
||||
result =
|
||||
Synth::convertCaseStmtFromRaw(Synth::convertDoCatchStmtToRaw(this)
|
||||
@@ -23,10 +34,19 @@ module Generated {
|
||||
.getCatch(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th catch.
|
||||
*/
|
||||
final CaseStmt getCatch(int index) { result = getImmediateCatch(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the catches.
|
||||
*/
|
||||
final CaseStmt getACatch() { result = getCatch(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of catches.
|
||||
*/
|
||||
final int getNumberOfCatches() { result = count(getACatch()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,18 @@ module Generated {
|
||||
class DoStmt extends Synth::TDoStmt, LabeledStmt {
|
||||
override string getAPrimaryQlClass() { result = "DoStmt" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertDoStmtToRaw(this).(Raw::DoStmt).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ module Generated {
|
||||
class FallthroughStmt extends Synth::TFallthroughStmt, Stmt {
|
||||
override string getAPrimaryQlClass() { result = "FallthroughStmt" }
|
||||
|
||||
/**
|
||||
* Gets the fallthrough source.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
CaseStmt getImmediateFallthroughSource() {
|
||||
result =
|
||||
Synth::convertCaseStmtFromRaw(Synth::convertFallthroughStmtToRaw(this)
|
||||
@@ -15,8 +19,15 @@ module Generated {
|
||||
.getFallthroughSource())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fallthrough source.
|
||||
*/
|
||||
final CaseStmt getFallthroughSource() { result = getImmediateFallthroughSource().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the fallthrough dest.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
CaseStmt getImmediateFallthroughDest() {
|
||||
result =
|
||||
Synth::convertCaseStmtFromRaw(Synth::convertFallthroughStmtToRaw(this)
|
||||
@@ -24,6 +35,9 @@ module Generated {
|
||||
.getFallthroughDest())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fallthrough dest.
|
||||
*/
|
||||
final CaseStmt getFallthroughDest() { result = getImmediateFallthroughDest().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ module Generated {
|
||||
class ForEachStmt extends Synth::TForEachStmt, LabeledStmt {
|
||||
override string getAPrimaryQlClass() { result = "ForEachStmt" }
|
||||
|
||||
/**
|
||||
* Gets the pattern.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Pattern getImmediatePattern() {
|
||||
result =
|
||||
Synth::convertPatternFromRaw(Synth::convertForEachStmtToRaw(this)
|
||||
@@ -17,8 +21,15 @@ module Generated {
|
||||
.getPattern())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pattern.
|
||||
*/
|
||||
final Pattern getPattern() { result = getImmediatePattern().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the sequence.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateSequence() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertForEachStmtToRaw(this)
|
||||
@@ -26,17 +37,34 @@ module Generated {
|
||||
.getSequence())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sequence.
|
||||
*/
|
||||
final Expr getSequence() { result = getImmediateSequence().resolve() }
|
||||
|
||||
/**
|
||||
* Gets the where, if it exists.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
Expr getImmediateWhere() {
|
||||
result =
|
||||
Synth::convertExprFromRaw(Synth::convertForEachStmtToRaw(this).(Raw::ForEachStmt).getWhere())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the where, if it exists.
|
||||
*/
|
||||
final Expr getWhere() { result = getImmediateWhere().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if `getWhere()` exists.
|
||||
*/
|
||||
final predicate hasWhere() { exists(getWhere()) }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertForEachStmtToRaw(this)
|
||||
@@ -44,6 +72,9 @@ module Generated {
|
||||
.getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,18 @@ module Generated {
|
||||
class GuardStmt extends Synth::TGuardStmt, LabeledConditionalStmt {
|
||||
override string getAPrimaryQlClass() { result = "GuardStmt" }
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
|
||||
*/
|
||||
BraceStmt getImmediateBody() {
|
||||
result =
|
||||
Synth::convertBraceStmtFromRaw(Synth::convertGuardStmtToRaw(this).(Raw::GuardStmt).getBody())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the body.
|
||||
*/
|
||||
final BraceStmt getBody() { result = getImmediateBody().resolve() }
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user