Initial import, 0.1 + pk 0.2.4-B1
[unix-history] / sys / netiso / xebec / test.trans
CommitLineData
15637ed4
RG
1/* $Header: test.trans,v 0.2 88/09/19 12:58:29 nhall Exp $
2 */
3*PROTOCOL test
4
5*INCLUDE
6
7{
8#include "test_def.h"
9}
10
11*PCB test_pcbstruct SYNONYM P
12
13*STATES
14
15STATE_A
16STATE_B
17STATE_C
18ALL_STATES = [STATE_A, STATE_B, STATE_C]
19
20*EVENTS { int ev_all; } SYNONYM E
21
22EV_1 { char *ev1_char; }
23EV_2 { int ev2_int; char ev2_char; }
24EV_3
25EV_4 { struct blah *ev4_blahptr;
26 unsigned int ev4_uint;
27 int ev4_int;
28 }
29
30*TRANSITIONS
31
32SAME <== [ STATE_A, STATE_B ] [ EV_1, EV_2, EV_3 ]
33 ( $E.ev_all > 0 )
34 {
35 if( $P.test_state == STATE_A )
36 printf("state is STATE_A\n");
37 else
38 printf("state is STATE_B\n");
39 printf("action first transition\n");
40 }
41
42;
43STATE_C <== [ STATE_A, STATE_B ] [ EV_1, EV_2, EV_3 ]
44 DEFAULT
45 {
46 printf("default - transition 2\n");
47 MACRO1( $P.test_pcbfield );
48 }
49;
50
51STATE_C <== [ STATE_A, STATE_B ] EV_4
52 ( $$.ev4_blahptr->blahfield & 0x1 )
53 NULLACTION
54;
55
56STATE_C <== ALL_STATES EV_4
57 DEFAULT
58 {
59 printf("default - transition 4\n");
60 printf("pcb is 0x%x, event is 0x%x \n", $P, $E);
61 printf("ev4 values are : blahptr 0x%x uint 0x%x int 0x%x\n",
62 $$.ev4_blahptr, $$.ev4_uint, $$.ev4_int);
63 }
64;