* A simple SOD module for testing.
*/
-code c : includes {
+code c: includes {
#include <stdio.h>
#include "chimaera.h"
}
-code h : includes {
+code h: includes {
#include "sod.h"
}
[nick = nml, link = SodObject]
-class Animal : SodObject {
+class Animal: SodObject {
int tickles = 0;
[combination = progn] void tickle();
[role = before] void nml.tickle() { me->nml.tickles++; }
}
-class Lion : Animal {
+class Lion: Animal {
void bite() { puts("Munch!"); }
void nml.tickle() { Lion_bite(me); }
}
-class Goat : Animal {
+class Goat: Animal {
void butt() { puts("Bonk!"); }
void nml.tickle() { Goat_butt(me); }
}
-class Serpent : Animal {
+class Serpent: Animal {
int limit = 2;
void hiss() { puts("Sssss!"); }
}
[nick = sir, link = Animal]
-class Chimaera : Lion, Goat, Serpent {
+class Chimaera: Lion, Goat, Serpent {
serpent.limit = 1;
}
-code c : user {
+code c: user {
/*----- Main driver code --------------------------------------------------*/
static void tickle_animal(Animal *a)
int main(void)
{
{
- SOD_DECL(Lion, l);
+ SOD_DECL(Lion, l, NO_KWARGS);
provoke_lion(l);
tickle_animal(LION__CONV_NML(l));
}
{
- SOD_DECL(Goat, g);
+ SOD_DECL(Goat, g, NO_KWARGS);
provoke_goat(g);
tickle_animal(GOAT__CONV_NML(g));
}
{
- SOD_DECL(Serpent, s);
+ SOD_DECL(Serpent, s, NO_KWARGS);
provoke_serpent(s);
tickle_animal(SERPENT__CONV_NML(s));
}
{
- SOD_DECL(Chimaera, c);
+ SOD_DECL(Chimaera, c, NO_KWARGS);
provoke_lion(CHIMAERA__CONV_LION(c));
provoke_goat(CHIMAERA__CONV_GOAT(c));
provoke_serpent(CHIMAERA__CONV_SERPENT(c));