UBF(A) - quick summary
UBF(A) - specification
USF Encoding rules
'...' Push an constant onto the stack
(within an constant ' must be escaped (\')
"..." Push a string on the stack
(within a string " must be escaped (\")
Int ~...~ Push a binary on the stack (length int)
`xxx` Tag the top object on the stack as being type xxx
(within a type ` must be escaped (\")
%....% Comment (skip)
[-][0-9]* Integer
\s\n\r\t, Ignore
# Push nil onto the stack
& Replace the two topmost entries on the stack
with (cons X Y)
{ Start of struct
} End of struct
$ Return the top stack entry (the stack must only have
ONE entry now)
Control = '"~%-0123456789{}#&$> (21 characters)
>C Pop the stack and store in register[C]
C is any character except Control
C Push register[C] on the stack
Thus:
'person'>p # {p,"Joe",123} & {p, 'fred', ~abc~} & $
Represents the UBF(B) term:
[{person, "Joe", 123}, {person, fred, <>}].
Objects can be "semantically tagged" thus
12345~....~ `jpeg`
Represents a 12345 byte object (contained between ~'s) that is of
type jpeg. It is assumed that the application knows what
this means.
16~ahsjgdjagdjadjadg~ `md5`
Might be an MD5 checksum etc.
Servers and Introspection
- Servers only understand USF(A) formatted messages:
- Servers always respond to
The message 'interface'$
- Client Server RCP is as follows
{rpc, Term} -> {reply, Reply, NextServerState}
All terms are UBF(A) encoded.
|