byteOrdering :: little-endian;
format struct TreeFile {
magicnumber :: ascii("TREE");
rootnode :: Node;
}
struct Node{
type :: Type;
if( type == Leaf ) leaf :: Leaf;
if( type == Node ) nodeA :: Node;
if( type == Node ) nodeB :: Node;
}
enum Type :: byte {
0: Empty;
1: Node;
2: Leaf;
else: [error("Invalid node type")];
}
struct Leaf {
data :: byte [] until "\0" inclusive;
}