Annotation of 43BSDReno/sys/netiso/xebec/test.trans, revision 1.1.1.1

1.1       root        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: 
                     15: STATE_A
                     16: STATE_B
                     17: STATE_C
                     18: ALL_STATES = [STATE_A, STATE_B, STATE_C]
                     19: 
                     20: *EVENTS                { int ev_all; }                 SYNONYM  E
                     21: 
                     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:                        }
                     29: 
                     30: *TRANSITIONS
                     31: 
                     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:        }
                     41: 
                     42: ;
                     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:        }
                     49: ;
                     50: 
                     51: STATE_C                        <==                     [ STATE_A, STATE_B ]    EV_4
                     52:        ( $$.ev4_blahptr->blahfield & 0x1 )
                     53:        NULLACTION
                     54: ;
                     55: 
                     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:        }
                     64: ;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.