Skip to content

naming

record Declared

A declared name: the node that declares it, the name, whether at file scope.

def Naming.isIn (x : String) (xs : List String) : Bool

Whether a name is in a list.

def Naming.underscoreCapital (name : String) : Bool

Whether a name begins with an underscore and then a capital letter.

def Naming.headers (p : Program) : List String

The headers a program’s C text includes, as cfamily.generate prints it (#include <h>).

def Naming.listedIn (headers : List String) (table : List (String * String)) (name : String) : Option String

The header of the included ones whose table lists a name, if any.

def Naming.why (headers : List String) (d : Declared) : Option String

Why a name may not be declared (none when it may), with the headers the program includes.

def Naming.member (n : NodeId) (f : Field) : List Declared

A member’s name (in its own name space: not file scope); an unnamed bit-field has none.

def Naming.item (it : Item) : List Declared

The names an item declares: at file scope, and in its body or members.

def Naming.firstReserved (p : Program) (items : List Item) : Option (NodeId * String)

The first name a program may not declare: the node that declares it and why.