statement.h
1.41 KB
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
#ifndef _STMT_H_
#define _STMT_H_
#define STMT_CONST 0
#define STMT_BLOCK 1
#define STMT_PRINT 10
#define STMT_IF 11
#define STMT_FOREACH 12
#define STMT_REPEAT 13
#define STMT_ASSIGN 14
#define STMT_UNSET 15
#define STMT_EVAL_PLUS 20
#define STMT_EVAL_MINUS 21
#define STMT_EVAL_TIMES 22
#define STMT_EVAL_OVER 23
#define STMT_EVAL_MODULO 24
#define STMT_EVAL_NEG 25
#define STMT_IDENT_VAR 30
#define STMT_IDENT_ARRAY 31
#define STMT_IDENT_VAL 32
#define STMT_CAST_INT 40
#define STMT_CAST_FLOAT 41
#define STMT_CAST_STRING 42
#define STMT_COMP_EQ 50
#define STMT_COMP_NE 51
#define STMT_COMP_LT 52
#define STMT_COMP_GT 53
#define STMT_COMP_LE 54
#define STMT_COMP_GE 55
#define STMT_COND_EXPR 60
#define STMT_COND_AND 61
#define STMT_COND_OR 62
#define STMT_COND_NEG 63
#define STYP_NONE 0
#define STYP_COND 1
#define STYP_EVAL 2
#define STYP_IDVAL 3
/*
* Deklaration und Definition
*/
union stmtType
{
int cond;
struct expVal * eVal;
struct ident * idVal;
};
typedef struct stmt s_stmt;
typedef union stmtType u_stmtType;
#include <stmtQueue.h>
#include <block.h>
/*
* Interface
*/
s_stmt * stmtNew (int, s_stmtQueue *, int, u_stmtType);
void stmtFree (s_stmt *);
s_stmtQueue * stmtGetArgs (s_stmt *);
u_stmtType stmtGetVal (s_stmt *);
int stmtGetConstTyp (s_stmt *);
u_stmtType stmtDo (s_stmt *, s_block *);
#endif /* _STMT_H_ */