Contenuto principale

Cpp.CharLiteral Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the char_literal nodes in the syntax tree of your code

Since R2026a

Description

The PQL class CharLiteral represents the node char_literal in the syntax tree of your code.

// Demonstrates various char_literal nodes
#include <iostream>

void char_literals() {
    char a = 'a';
    char newline = '\n';
    char hex = '\x20';
    char octal = '\101';
    char quote = '\'';
    char backslash = '\\';
    char unicode = u'\u00E9';
    char wide = L'a';
    char utf8 = u8'a';
    char utf16 = u'a';
    char utf32 = U'a';
    (void)a; (void)newline; (void)hex; (void)octal;
    (void)quote; (void)backslash; (void)unicode;
    (void)wide; (void)utf8; (void)utf16; (void)utf32;
}
int main() { return 0; }

The C++ sample contains multiple char_literal instances, such as 'a', '\n' and '\x20'. These syntax nodes are matched by PQL CharLiteral class.

Predicates

expand all

Version History

Introduced in R2026a