Skip to content

syntax

def NodeId : Type

The editor’s label of a syntax node.

def DeclId : Type

The label of a declaration’s node; variables are named by it.

def Temporary.of (n : NodeId) : DeclId

The variable a temporary made at a node is kept in (a call’s result, the old value of x++, a conditional’s value): the node behind #t:. A front end may label a declaration with a node’s own label, so a temporary named by the bare node could hide that variable; no label it writes starts with #.

def Temporary.is (x : DeclId) : Bool

Whether a variable is a temporary (Temporary.of).

data UnaryOp

A unary operator: -, !, ~.

data BinaryOp

A binary operator.

def BinaryOp.symbol (op : BinaryOp) : String

The binary operator op as written.

data Manipulator

An iostream manipulator without arguments: floating format, alignment, base, bool, sign, prefix, case.

data Capture

What a lambda captures ([expr.prim.lambda.capture]): every variable it uses, by copy (=) or by reference (&); one variable by copy or by reference (its declaration and name); the object this points to.

data Field

A member of a struct.

data StructDefinition

A struct or union: its members in declaration order.

def Tag.isUnnamed (name : String) : Bool

Whether a struct’s or union’s name is one a front end makes up for a definition without a tag (the type of struct { ... } v;, of an anonymous member), as clang names it: (unnamed struct at <node>), (unnamed union at <node>). No C or C++ program can write it.

def Tag.shown (name : String) : String

A struct’s or union’s name as messages show it: a made-up one without its place, (unnamed union), as clang’s messages write it without the source location.

def Field.isAnonymous (f : Field) : Bool

Whether the member f is an anonymous struct or union (C11 6.7.2.1p13, C++17 [class.union.anon]): no name, and a struct or union type; its members are members of the struct or union it is in. An unnamed bit-field is not one.

data Enumerator

An enumeration constant, named by its declaration’s node; its value is an integer constant expression.

data TypeDefinition

A type defined in a block (C11 6.7.2.1, 6.7.2.2, 6.7.8): a struct, a union, an enum or a typedef, its name in scope from its definition to the end of the block (6.2.1p4).

data Binder

A name a structured binding introduces: its declaration’s label and its name.

data Param

A parameter: its declaration’s node, name, type and (C++) default argument.

data FunctionDefinition

A function: noexcept or not, name, return type (none is void), parameters, body.

data Access

Member access; protected members are usable by the class and its derived classes ([class.access]p1).

data MemberInit

An entry of a constructor’s member initializer list: field(args), or field{xs} with a braced list (its items as a declaration’s braced initializer, iE and nested iL; field{} has none, [class.base.init]p7).

data Virtuality

Whether a member function is virtual: no, virtual, override (also virtual), or pure (= 0).

data TemplateParam

A template parameter: a type parameter or a value parameter of integer type, each with an optional default ([temp.param]; a value’s default is written as tVal and may use earlier parameters).

data Base

A base class: access, whether inherited virtually, and its name ([class.derived]).

data Member

A member of a class: a data member (with an optional default initializer), a member function, a member function template (its parameters, [temp.mem]), a constructor (explicit or not, noexcept or not, parameters, member initializers, body), a constructor template, the destructor, or a member type.

data ClassDefinition

A class: declared with class (default private) or struct (default public), its bases and members in order.

data Item

A top-level item.

data Language

The language: C11 or C++17.

data Program

A program: its language, items, and the Arduino board it is for (“uno”, “esp32”…; “arduino” is uno), which sets the widths of the integers and of double; without a board, plain C or C++ (LP64).

def plainProgram (n : NodeId) (lang : Language) (items : List Item) : Program

A program without a board: plain C or C++ (LP64).

def Expr.node (e : Expr) : NodeId

The node of an expression.

def Stmt.node (s : Stmt) : NodeId

The node of a statement.

data UB

Undefined behavior and divergences from the standard, catalogued by C11 annex J.2 as Cerberus does.

def holeReason : String

The reason a hole is rejected while checking; the verdict turns it into unknown.

def UB.clause (u : UB) : String

The clause of the C or C++ standard that a kind of undefined behavior or divergence comes from.