Skip to main content

Module data

Module data 

Source
Expand description

.fis data-layer AST nodes: struct types and constants (#69).

The data layer is the system-wide vocabulary shared by every PD and by the C/Pancake implementations: payload struct types (referenced by typed channel buffers, #122) and layout constants. Items are flat, C-like, top-level declarations in the .fis file:

struct Packet {
    id: uint32;
    length: uint16;
    payload: uint8;
}

const RBD_COUNT: uint = 64;
const RING_BYTES: uint = RBD_COUNT * sizeof(Packet);

Const right-hand sides parse as full Expr; tast folds them (tast/fold.rs) and admits only the constant subset: literals, references to other consts, sizeof(T), and unary/binary arithmetic — calls and runtime variables are rejected in const position.

Language reference: Data Layer: Structs and Constants.

Structs§

ConstDecl
A constant declaration: const NAME: Type = expr;.
StructDecl
A struct type declaration: struct Name { field: Type; ... }.
StructField
One field of a struct declaration: name: Type;.

Enums§

DataDecl
A data-layer item — dispatch type for the .fis top-level parser.