mirror of
https://github.com/ubf/ubf.git
synced 2026-04-18 02:35:41 +00:00
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
+NAME("irc").
|
|
|
|
+VSN("ubf2.0").
|
|
|
|
+TYPES
|
|
info() :: info;
|
|
description() :: description;
|
|
contract() :: contract;
|
|
|
|
ok() :: ok;
|
|
bool() :: true | false;
|
|
nick() :: ubfstring();
|
|
oldnick() :: nick();
|
|
newnick() :: nick();
|
|
group() :: ubfstring();
|
|
groups() :: [group()];
|
|
|
|
logon() :: logon;
|
|
proceed() :: {ok, nick()};
|
|
listGroups() :: groups;
|
|
joinGroup() :: {join, group()};
|
|
leaveGroup() :: {leave, group()};
|
|
changeNick() :: {nick, nick()};
|
|
msg() :: {msg, group(), ubfstring()};
|
|
|
|
msgEvent() :: {msg, nick(), group(), ubfstring()};
|
|
joinEvent() :: {joins, nick(), group()};
|
|
leaveEvent() :: {leaves, nick(), group()};
|
|
changeNameEvent() :: {changesName, oldnick(), newnick(), group()}.
|
|
|
|
+STATE start
|
|
logon() => proceed() & active. %% Nick randomly assigned
|
|
|
|
+STATE active
|
|
listGroups() => groups() & active;
|
|
joinGroup() => ok() & active;
|
|
leaveGroup() => ok() & active;
|
|
changeNick() => bool() & active;
|
|
msg() => bool() & active; %% False if you have not joined a group
|
|
|
|
EVENT => msgEvent(); %% Group sends me a message
|
|
EVENT => joinEvent(); %% Nick joins group
|
|
EVENT => leaveEvent(); %% Nick leaves group
|
|
EVENT => changeNameEvent(). %% Nick changes name
|
|
|
|
+ANYSTATE
|
|
info() => ubfstring();
|
|
description() => ubfstring();
|
|
contract() => term().
|
|
|
|
|
|
|
|
|
|
|
|
|