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
|
/*
* Statement.h
*
* Created on: Nov 23, 2017
* Author: naopross
*/
#ifndef SRC_STATEMENT_H_
#define SRC_STATEMENT_H_
#include <string>
namespace samb {
/* Possible types of statement, according to the NS diagram paper
*
* PROCESS,
* DECISION,
* SWITCH,
* WHILE,
* UNTIL,
* SCOPE,
* PARALLEL,
*/
/* this class should behave like a std::list, or a std::map storing the data
* with a tree structure, BUT it is not a tree because allows 2 notes to point
* at a single node
*
* Normal Tree: Statements:
* A - B - C - D A - B - C - D - G
* \ \ /
* E - F E - F
*
* Because a statement contains branching elmeents. (if / switch)
*/
class Statement {
private:
Statement *next;
Statement *prev;
public:
const enum Type {
PROCESS,
DECISION,
SWITCH,
WHILE,
UNTIL,
SCOPE,
PARALLEL,
} m_type;
Statement(Type type, Statement *prev): m_type(type), m_prev(prev);
virtual ~Statement();
};
} /* namespace samb */
#endif /* SRC_STATEMENT_H_ */
|