Cpp.AbstractPointerDeclarator Class
Namespace: Cpp
Superclasses: AstNodeProperties
Represents the asbtract_pointer_declarator nodes in the
syntax tree of your code
Since R2026a
Description
The PQL class AbstractPointerDeclarator represents the node abstract_pointer_declarator in the syntax tree of your code.
void read_data(const int *);
The preceding code contains an abstract pointer declarator in the parameter list of
read_data.
Predicates
| Type | Raisable | Printable |
|---|---|---|
AbstractPointerDeclarator
| 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 AbstractPointerDeclarator &decl)
| Matches any abstract_pointer_declarator node and returns it as &decl, useful to directly examine a pointer declarator. | This PQL defect checks for occurrences of
defect defectIs =
when
Cpp.AbstractPointerDeclarator.is(&decl)
and decl.nodeText(&txt)
raise "AbstractPointerDeclarator.is matched: \"{txt}\""
on declIn this C++ code, the defect finds the abstract pointer declarator.
void read_data(const int *); //macthes * |
cast(Cpp.Node.Node node, required AbstractPointerDeclarator &cast)
| Checks whether a given generic node is an abstract_pointer_declarator and, if so, returns it as &cast for further inspection. | This PQL defect checks whether a generic defect defectCast =
when
Cpp.Node.is(&node, &,&,&)
and Cpp.AbstractPointerDeclarator.cast(node, &decl)
and decl.nodeText(&txt)
raise "AbstractPointerDeclarator.cast matched: \"{txt}\""
on declIn this C++ code, the defect finds the abstract
pointer declarator in the function
void foo() {
void* raw_ptr = (int*) 0x1000;
} |
isa(Cpp.Node.Node node)
| Returns true if node is an abstract_pointer_declarator; useful for boolean checks or negations. | This PQL defect checks whether a node is an
defect defectIsa =
when
Cpp.Node.is(&node, &,&,&)
and Cpp.AbstractPointerDeclarator.isa(node)
raise "Node is an AbstractPointerDeclarator"
on nodeIn this C++ code, the defect finds the abstract
pointer declarator in the function
void foo() {
void* raw_ptr = (int*) 0x1000;
} |
declarator(AbstractPointerDeclarator self, Cpp.Node.Node &child)
| Matches the nested declarator inside an abstract_pointer_declarator (e.g., the inner pointer or direct declarator). | This PQL defect checks for the nested declarator node contained by an
defect defectDeclarator =
when
Cpp.AbstractPointerDeclarator.is(&decl)
and decl.declarator(&inner)
and inner.nodeText(&txt)
raise "AbstractPointerDeclarator.declarator matched: \"{txt}\""
on decl |
typeQualifier(AbstractPointerDeclarator self, Cpp.Node.Node &child)
| Matches a type qualifier (e.g., const, volatile) that modifies the pointer in an abstract_pointer_declarator. | This PQL defect checks for type qualifiers attached to pointer declarators. defect defectTypeQualifier =
when
Cpp.AbstractPointerDeclarator.is(&decl)
and decl.typeQualifier(&tq)
and tq.nodeText(&txt)
raise "AbstractPointerDeclarator.typeQualifier matched: \"{txt}\""
on declIn this C++ code, the defect finds the
void foo() {
int* raw_ptr = (int* const) 0x1000;
} |
msPointerModifier(AbstractPointerDeclarator self, Cpp.Node.Node &child)
| Matches Microsoft-specific pointer modifiers, such as
__restrict, that are present an
abstract_pointer_declarator. |
This PQL defect checks for MSVC pointer modifiers on defect defectMsPointerModifier =
when
Cpp.AbstractPointerDeclarator.is(&decl)
and decl.msPointerModifier(&mod)
and mod.nodeText(&txt)
raise "AbstractPointerDeclarator.msPointerModifier matched: \"{txt}\""
on declIn this C++ code, the defect finds the MSVC modifier
void foo() {
int* raw_ptr = (int* __restrict const) 0x1000;
} |
getEnclosingAbstractPointerDeclarator(Cpp.Node.Node child, required AbstractPointerDeclarator &parent)
| Finds the closest enclosing abstract_pointer_declarator ancestor of child and returns it as &parent. | This PQL defect checks for the nearest
defect defectGetEnclosing =
when
Cpp.Node.is(&node, &,&,&)
and Cpp.MsPointerModifier.isa(node)
and Cpp.AbstractPointerDeclarator.getEnclosingAbstractPointerDeclarator(node, &parent)
and parent.nodeText(&txt)
raise "Enclosing AbstractPointerDeclarator of an MS pointer modifier node: \"{txt}\""
on parentIn this C++ code, the defect locates the
enclosing pointer declarator around the
void foo() {
int* raw_ptr = (int* __restrict const) 0x1000;
} |
isEnclosedInAbstractPointerDeclarator(Cpp.Node.Node
child) | Matches every abstract_pointer_declarator ancestor of child; useful to enumerate all enclosing pointer declarators. | This PQL defect checks for an
defect defectIsEnclosedIn =
when
Cpp.Node.is(&node, &,&,&)
and Cpp.MsRestrictModifier.isa(node)
and Cpp.AbstractPointerDeclarator.isEnclosedInAbstractPointerDeclarator(node)
and node.nodeText(&txt)
raise "restrict with an ancestor AbstractPointerDeclarator: \"{txt}\""
on nodeIn this C++ code, the defect lists both pointer
declarators that enclose the base declarator in
void foo() {
int* raw_ptr = (int* __restrict const) 0x1000;
} |
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)