1 /*   -*- buffer-read-only: t -*- vi: set ro:
2  *
3  *  DO NOT EDIT THIS FILE   (defParse-fsm.h)
4  *
5  *  It has been AutoGen-ed
6  *  From the definitions    defParse.def
7  *  and the template file   fsm
8  *
9  *  Automated Finite State Machine
10  *
11  *  Copyright (C) 1992-2018 Bruce Korb - all rights reserved
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. Neither the name ``Bruce Korb'' nor the name of any other
22  *    contributor may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * AutoFSM IS PROVIDED BY Bruce Korb ``AS IS'' AND ANY EXPRESS
26  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL Bruce Korb OR ANY OTHER CONTRIBUTORS
29  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 /*
38  *  This file enumerates the states and transition events for a FSM.
39  *
40  *  te_dp_state
41  *      The available states.  FSS_INIT is always defined to be zero
42  *      and FSS_INVALID and FSS_DONE are always made the last entries.
43  *
44  *  te_dp_event
45  *      The transition events.  These enumerate the event values used
46  *      to select the next state from the current state.
47  *      DP_EV_INVALID is always defined at the end.
48  */
49 #ifndef AUTOFSM_DEFPARSE_FSM_H_GUARD
50 #define AUTOFSM_DEFPARSE_FSM_H_GUARD 1
51 /**
52  *  Finite State machine States
53  *
54  *  Count of non-terminal states.  The generated states INVALID and DONE
55  *  are terminal, but INIT is not  :-).
56  */
57 #define DP_STATE_CT  11
58 typedef enum {
59     DP_ST_INIT,       DP_ST_NEED_DEF,   DP_ST_NEED_TPL,   DP_ST_NEED_SEMI,
60     DP_ST_NEED_NAME,  DP_ST_HAVE_NAME,  DP_ST_NEED_VALUE, DP_ST_NEED_IDX,
61     DP_ST_NEED_CBKT,  DP_ST_INDX_NAME,  DP_ST_HAVE_VALUE, DP_ST_INVALID,
62     DP_ST_DONE
63 } te_dp_state;
64 
65 /**
66  *  Finite State machine transition Events.
67  *
68  *  Count of the valid transition events
69  */
70 #define DP_EVENT_CT 16
71 typedef enum {
72     DP_EV_AUTOGEN,       DP_EV_DEFINITIONS,   DP_EV_END,
73     DP_EV_VAR_NAME,      DP_EV_OTHER_NAME,    DP_EV_STRING,
74     DP_EV_HERE_STRING,   DP_EV_DELETE_ENT,    DP_EV_NUMBER,
75     DP_EV_LIT_SEMI,      DP_EV_LIT_EQ,        DP_EV_LIT_COMMA,
76     DP_EV_LIT_O_BRACE,   DP_EV_LIT_C_BRACE,   DP_EV_LIT_OPEN_BKT,
77     DP_EV_LIT_CLOSE_BKT, DP_EV_INVALID
78 } te_dp_event;
79 
80 /**
81  *  Run the FSM.  Will return DP_ST_DONE or DP_ST_INVALID
82  */
83 extern te_dp_state
84 dp_run_fsm( void );
85 
86 #endif /* AUTOFSM_DEFPARSE_FSM_H_GUARD */
87 /*
88  * Local Variables:
89  * mode: C
90  * c-file-style: "stroustrup"
91  * indent-tabs-mode: nil
92  * End:
93  * end of defParse-fsm.h */
94