Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / netiso / xebec / test.trans
blob591e5fe702910516b12ead1142a4429dc21fe3bd
1 /*      $NetBSD$        */
3 *PROTOCOL test
5 *INCLUDE
8 #include "test_def.h"
11 *PCB    test_pcbstruct  SYNONYM  P
13 *STATES
15 STATE_A
16 STATE_B
17 STATE_C
18 ALL_STATES = [STATE_A, STATE_B, STATE_C]
20 *EVENTS         { int ev_all; }                 SYNONYM  E
22 EV_1    { char *ev1_char; }
23 EV_2    { int   ev2_int; char ev2_char; }
24 EV_3
25 EV_4            { struct blah   *ev4_blahptr; 
26                           unsigned int  ev4_uint;
27                           int                   ev4_int; 
28                         }
30 *TRANSITIONS
32 SAME                    <==                     [ 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         }
43 STATE_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         }
51 STATE_C                 <==                     [ STATE_A, STATE_B ]    EV_4
52         ( $$.ev4_blahptr->blahfield & 0x1 )
53         NULLACTION
56 STATE_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         }