Files
codeql/rust/ql/lib/codeql/rust/elements/internal/generated/MacroCall.qll
2025-04-25 16:16:49 +02:00

81 lines
2.3 KiB
Plaintext
Generated

// generated by codegen, do not edit
/**
* This module provides the generated definition of `MacroCall`.
* INTERNAL: Do not import directly.
*/
private import codeql.rust.elements.internal.generated.Synth
private import codeql.rust.elements.internal.generated.Raw
import codeql.rust.elements.internal.AssocItemImpl::Impl as AssocItemImpl
import codeql.rust.elements.Attr
import codeql.rust.elements.internal.ExternItemImpl::Impl as ExternItemImpl
import codeql.rust.elements.internal.ItemImpl::Impl as ItemImpl
import codeql.rust.elements.Path
import codeql.rust.elements.TokenTree
/**
* INTERNAL: This module contains the fully generated definition of `MacroCall` and should not
* be referenced directly.
*/
module Generated {
/**
* A MacroCall. For example:
* ```rust
* todo!()
* ```
* INTERNAL: Do not reference the `Generated::MacroCall` class directly.
* Use the subclass `MacroCall`, where the following predicates are available.
*/
class MacroCall extends Synth::TMacroCall, AssocItemImpl::AssocItem, ExternItemImpl::ExternItem,
ItemImpl::Item
{
override string getAPrimaryQlClass() { result = "MacroCall" }
/**
* Gets the `index`th attr of this macro call (0-based).
*/
Attr getAttr(int index) {
result =
Synth::convertAttrFromRaw(Synth::convertMacroCallToRaw(this).(Raw::MacroCall).getAttr(index))
}
/**
* Gets any of the attrs of this macro call.
*/
final Attr getAnAttr() { result = this.getAttr(_) }
/**
* Gets the number of attrs of this macro call.
*/
final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) }
/**
* Gets the path of this macro call, if it exists.
*/
Path getPath() {
result =
Synth::convertPathFromRaw(Synth::convertMacroCallToRaw(this).(Raw::MacroCall).getPath())
}
/**
* Holds if `getPath()` exists.
*/
final predicate hasPath() { exists(this.getPath()) }
/**
* Gets the token tree of this macro call, if it exists.
*/
TokenTree getTokenTree() {
result =
Synth::convertTokenTreeFromRaw(Synth::convertMacroCallToRaw(this)
.(Raw::MacroCall)
.getTokenTree())
}
/**
* Holds if `getTokenTree()` exists.
*/
final predicate hasTokenTree() { exists(this.getTokenTree()) }
}
}