1
0
mirror of https://github.com/ubf/ubf.git synced 2026-04-24 13:45:59 +00:00

add UBF(b) types documentation

This commit is contained in:
Joseph Wayne Norton
2010-10-25 09:40:44 +09:00
parent e5b686c695
commit fbcb6698c7
3 changed files with 186 additions and 13 deletions

55
misc-codes/irc_plugin.con Normal file
View File

@@ -0,0 +1,55 @@
+NAME("irc").
+VSN("ubf1.0").
+TYPES
info() = info;
description() = description;
contract() = contract;
ok() = ok;
bool() = true | false;
nick() = string();
oldnick() = nick();
newnick() = nick();
group() = string();
groups() = [group()];
logon() = logon;
proceed() = {ok, nick()};
listGroups() = groups;
joinGroup() = {join, group()};
leaveGroup() = {leave, group()};
changeNick() = {nick, nick()};
msg() = {msg, group(), string()};
msgEvent() = {msg, nick(), group(), string()};
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() => string();
description() => string();
contract() => term().