Cpp.AbstractParenthesizedDeclarator Class
Namespace: Cpp
Superclasses: AstNodeProperties
Represents the abstract_parenthesized_declarator nodes in the syntax tree of your code
Since R2026a
Description
The PQL class AbstractParenthesizedDeclarator represents the node abstract_parenthesized_declarator in the syntax tree of your code.
using ArrayRefType = int (&)[5];
The preceding declarations contain abstract_parenthesized_declarator
nodes (&), which corresponds to the PQL class
AbstractParenthesizedDeclarator.
Predicates
| Type | Raisable | Printable |
|---|---|---|
AbstractParenthesizedDeclarator
| Yes | No |
This class defines these predicates that act on the objects of this class. In addition, objects of this class can access the predicates defined by the base class AstNodeProperties. An object of this class is an object of AstNodeProperties class.
| Predicates | Description | Example |
|---|---|---|
is(required AbstractParenthesizedDeclarator &decl)
| Checks whether a node is an AbstractParenthesizedDeclarator and returns it as decl for further predicates. | This PQL defect checks for any
defect find_parenthesized =
when
Cpp.AbstractParenthesizedDeclarator.is(&decl)
and decl.nodeText(&txt)
raise "Found abstract parenthesized declarator: \"{txt}\""
on declIn this C++ code, the defect finds the parenthesized
abstract declarator
using ArrayRefType = int (&)[5]; |
cast(Cpp.Node.Node node, required AbstractParenthesizedDeclarator &cast)
| Treats an arbitrary Cpp.Node.Node as an AbstractParenthesizedDeclarator when the node actually represents that form, returning it as cast. | This PQL defect checks whether a generic node is specifically an
defect cast_to_parenthesized =
when
Cpp.Node.is(&n, &,&,&)
and Cpp.AbstractParenthesizedDeclarator.cast(n, &decl)
and decl.nodeText(&txt)
raise "Node cast to AbstractParenthesizedDeclarator: \"{txt}\""
on declIn this C++ code, the defect identifies the
using ArrayRefType = int (&)[5]; |
isa(Cpp.Node.Node node)
| Returns true if the given Cpp.Node.Node is an AbstractParenthesizedDeclarator; useful for membership checks or negation. | This PQL defect checks for nodes that are
defect isa_parenthesized =
when
Cpp.Node.is(&n, &,&,&)
and Cpp.AbstractParenthesizedDeclarator.isa(n)
raise "Node is an AbstractParenthesizedDeclarator"
on nIn this C++ code, the defect checks that the node
corresponding to
using ArrayRefType = int (&)[5]; |
msCallModifier(AbstractParenthesizedDeclarator self, Cpp.Node.Node &child)
| Matches an MSVC calling-convention modifier (e.g., __stdcall, __cdecl) appearing inside the parenthesized declarator and returns it as child. | This PQL defect checks for MSVC calling-convention modifiers inside a parenthesized abstract declarator. defect find_ms_callconv =
when
Cpp.AbstractParenthesizedDeclarator.is(&decl)
and decl.msCallModifier(&mod)
and mod.nodeText(&txt)
raise "Found MS call modifier: \"{txt}\""
on modIn this C++ code, the defect finds the
using ComplexPtrType = int (__stdcall *)(float); |
abstractDeclarator(AbstractParenthesizedDeclarator self, Cpp.Node.Node &child)
| Returns the nested abstract declarator node within the parenthesized declarator (for example, the (*f) inner declarator). | This PQL defect checks for the inner abstract declarator part inside a parenthesized declarator. defect find_inner_abstract_declarator =
when
Cpp.AbstractParenthesizedDeclarator.is(&decl)
and decl.abstractDeclarator(&inner)
and inner.nodeText(&txt)
raise "Inner abstract declarator: \"{txt}\""
on inner |
getEnclosingAbstractParenthesizedDeclarator(Cpp.Node.Node child, required AbstractParenthesizedDeclarator &parent)
| Finds the closest enclosing AbstractParenthesizedDeclarator ancestor of child and returns it as parent. | This PQL defect checks for the nearest parenthesized abstract declarator
that encloses a child defect find_enclosing_parent =
when
Cpp.Node.is(&n, &,&,&)
and Cpp.MsCallModifier.isa(n)
and Cpp.AbstractParenthesizedDeclarator.getEnclosingAbstractParenthesizedDeclarator(n, &parent)
and parent.nodeText(&txt)
raise "Enclosing parenthesized declarator: \"{txt}\""
on parentIn this C++ code, the defect locates the
parenthesized declarator that encloses the
using ComplexPtrType = int (__stdcall *)(float); |
isEnclosedInAbstractParenthesizedDeclarator(Cpp.Node.Node child)
| Matches every AbstractParenthesizedDeclarator ancestor of child, allowing detection of any parenthesized declarator surrounding the node. | This PQL defect checks all parenthesized declarator ancestors that enclose a given child node. defect find_all_enclosing_parents =
when
Cpp.Node.is(&n, &,&,&)
and Cpp.MsCallModifier.isa(n)
and Cpp.AbstractParenthesizedDeclarator.isEnclosedInAbstractParenthesizedDeclarator(n)
and n.nodeText(&txt)
raise "Node with enclosing ancestor: \"{txt}\""
on nIn this C++ code, the defect detects the enclosing
parenthesized declarator of the
using ComplexPtrType = int (__stdcall *)(float); |
Version History
Introduced in R2026a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)