File: scxml.h

package info (click to toggle)
faumachine 20180503-4
  • links: PTS
  • area: main
  • in suites: buster
  • size: 61,272 kB
  • sloc: ansic: 272,290; makefile: 6,199; asm: 4,251; sh: 3,022; perl: 886; xml: 563; pascal: 311; lex: 214; vhdl: 204
file content (193 lines) | stat: -rw-r--r-- 4,021 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/*
 * Copyright (C) 2015 FAUmachine Team <info@faumachine.org>.
 * This program is free software. You can redistribute it and/or modify it
 * under the terms of the GNU General Public License, either version 2 of
 * the License, or (at your option) any later version. See COPYING.
 */

#ifndef __SCXML_H_INCLUDED
#define __SCXML_H_INCLUDED

#include "xml.h"

#define MAX_NAME    64
#define MAX_DATA    96
#define MAX_STATES  64
#define MAX_ELEM    32
#define MAX_SUPER   128
#define MAX_BOOL    512
#define MAX_FLAG    128
#define MAX_PATH_LEN    32
#define MAX_ACTIVE	32
#define MAX_PATH	32
#define MAX_FUNCS	8
#define MAX_VAR		16

struct counter {
	int nif;
	int nelif;
	int ntrans;
};

struct scxml {
	struct scxml_datamodel *model_first;
	struct scxml_datamodel *model_last;
	struct scxml_state *state_first;
	struct scxml_state *state_last;
	struct scxml_function *func_first;
	struct scxml_function *func_last;

	const char* name;
	const char* initial;
	const char* type;
};

struct scxml_datamodel {
	struct scxml_datamodel *prev;
	struct scxml_datamodel *next;
	struct scxml_data *data_first;
	struct scxml_data *data_last;

	const char* name;
};

struct scxml_data {
	struct scxml_data *prev;
	struct scxml_data *next;

	const char *id;
	int expr;
	const char *flags;
	const char *bytes;
};

struct scxml_function {
	struct scxml_function *prev;
	struct scxml_function *next;

	struct scxml_datamodel *model_first;
	struct scxml_datamodel *model_last;

	const char* name;
};

struct scxml_extern {
	struct scxml_extern *prev;
	struct scxml_extern *next;
	const char* input;
	const char* output;
};

struct scxml_assign {
	struct scxml_assign *prev;
	struct scxml_assign *next;

	const char* location;
	const char* expr;
};

struct scxml_state {
	struct scxml_state *prev;
	struct scxml_state *next;

	struct scxml_trans *trans_first;
	struct scxml_trans *trans_last;
	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;
	struct scxml_onentry *onentry_first;
	struct scxml_onentry *onentry_last;
	struct scxml_onexit *onexit_first;
	struct scxml_onexit *onexit_last;

	const char *id;
};

struct scxml_onexit {
	struct scxml_onexit *prev;
	struct scxml_onexit *next;

	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;
};

struct scxml_onentry {
	struct scxml_onentry *prev;
	struct scxml_onentry *next;

	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;
};

struct scxml_trans {
	struct scxml_trans *prev;
	struct scxml_trans *next;

	const char* event;
	const char* cond;
	int count;
	const char* target;
};

struct scxml_if {
	struct scxml_if *prev;
	struct scxml_if *next;

	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;
	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_elif *elif_first;
	struct scxml_elif *elif_last;
	struct scxml_else *else_first;
	struct scxml_else *else_last;

	const char* cond;
	int count;
};

struct scxml_elif {
	struct scxml_elif *prev;
	struct scxml_elif *next;

	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;

	const char* cond;
	int count;
};

struct scxml_else {
	struct scxml_else *prev;
	struct scxml_else *next;

	struct scxml_assign *assign_first;
	struct scxml_assign *assign_last;
	struct scxml_if *if_first;
	struct scxml_if *if_last;
	struct scxml_extern *ex_first;
	struct scxml_extern *ex_last;
};

struct scxml* scxml_read(struct xml *);

void scxml_free(struct scxml *);

#endif /* __SCXML_H_INCLUDED */