A dcode file is a byte stream. It contains three parts; a magic number that identifies it as a dcode file, a sequence of infix expression declarations, and a body declaration. The following BNF gives the deail.
dcode ::= magic_number infix_decls '\0' expr
expr ::= fcall_expr | num_expr | string_expr | char_expr
fcall_expr ::= 'F' identifier args '\0'
identifier ::= string
args ::= { 'A' expr }*
num_expr ::= 'N' num
string_expr ::= 'S' string
char_expr ::= 'C' char
string ::= char* '\0'
infix_decls ::= { 'I' infix_decl }*
infix_decl ::= identifier priority associativity
priority ::= num
associativity ::= 'L' | 'R' | 'N'
The magic number is a word that includes the LARD version numbeer.
The lexemes of this BNF are num, which indicates a word stored in
binary, char, which indicates a character, and the literal characters
enclosed in ''.dcode is bytesex sensitive.