Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
009c922d
Commit
009c922d
authored
Mar 21, 2015
by
Uwe Schulzweida
Browse files
expr: added support for logical operator <=>
parent
6492a787
Changes
8
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
009c922d
...
...
@@ -2,10 +2,14 @@
* Version 1.6.8 released
2015-03-21 Uwe Schulzweida
* expr: added support for logical operator <=>
2015-03-20 Uwe Schulzweida
* Remap: renamed env. variable CDO_REMAP_NORMALIZE_OPT to CDO_REMAP_NORM
* Remap: renamed env. variable
CDO_REMAP_SEARCH_RADIUS to CDO_REMAP_RADIUS
* Remap: renamed env. variable CDO_REMAP_SEARCH_RADIUS to CDO_REMAP_RADIUS
2015-03-19 Uwe Schulzweida
...
...
NEWS
View file @
009c922d
...
...
@@ -5,7 +5,7 @@ Version 1.6.8 (26 March 2015):
New features:
* select, delete: added wildcard support for parameter name
* expr: added support for logical operators <, >, <=, >=, !=, ==
* expr: added support for logical operators <, >, <=, >=, !=, ==
, <=>
New operators:
* splityearmon: Split in years and months
* yseasadd: Add multi-year seasonal time series
...
...
src/expr.c
View file @
009c922d
...
...
@@ -18,12 +18,14 @@
#define COMPGE(x,y) ((x) >= (y) ? 1 : 0)
#define COMPNE(x,y) (IS_NOT_EQUAL(x,y) ? 1 : 0)
#define COMPEQ(x,y) (IS_EQUAL(x,y) ? 1 : 0)
#define COMPLEG(x,y) ((x) < (y) ? -1 : ((x) > (y) ? 1 : 0))
#define MVCOMPLT(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPLT(x,y))
#define MVCOMPGT(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPGT(x,y))
#define MVCOMPLE(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPLE(x,y))
#define MVCOMPGE(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPGE(x,y))
#define MVCOMPNE(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPNE(x,y))
#define MVCOMPEQ(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPEQ(x,y))
#define MVCOMPLEG(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPLEG(x,y))
static
double
f_int
(
double
x
)
{
return
((
int
)(
x
));
}
static
double
f_nint
(
double
x
)
{
return
(
round
(
x
));
}
...
...
@@ -173,6 +175,10 @@ nodeType *expr_con_var(int oper, nodeType *p1, nodeType *p2)
if
(
nmiss
)
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
MVCOMPEQ
(
cval
,
idat
[
i
]);
else
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
COMPEQ
(
cval
,
idat
[
i
]);
break
;
case
LEG
:
if
(
nmiss
)
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
MVCOMPLEG
(
cval
,
idat
[
i
]);
else
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
COMPLEG
(
cval
,
idat
[
i
]);
break
;
default:
cdoAbort
(
"%s: operator %c unsupported!"
,
__func__
,
oper
);
break
;
...
...
@@ -263,6 +269,10 @@ nodeType *expr_var_con(int oper, nodeType *p1, nodeType *p2)
if
(
nmiss
)
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
MVCOMPEQ
(
idat
[
i
],
cval
);
else
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
COMPEQ
(
idat
[
i
],
cval
);
break
;
case
LEG
:
if
(
nmiss
)
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
MVCOMPLEG
(
idat
[
i
],
cval
);
else
for
(
i
=
0
;
i
<
n
;
++
i
)
odat
[
i
]
=
COMPLEG
(
idat
[
i
],
cval
);
break
;
default:
cdoAbort
(
"%s: operator %c unsupported!"
,
__func__
,
oper
);
break
;
...
...
@@ -403,6 +413,10 @@ nodeType *expr_var_var(int oper, nodeType *p1, nodeType *p2)
if
(
nmiss
)
for
(
i
=
0
;
i
<
ngp
;
++
i
)
odat
[
i
]
=
MVCOMPEQ
(
idat1
[
i
],
idat2
[
i
]);
else
for
(
i
=
0
;
i
<
ngp
;
++
i
)
odat
[
i
]
=
COMPEQ
(
idat1
[
i
],
idat2
[
i
]);
break
;
case
LEG
:
if
(
nmiss
)
for
(
i
=
0
;
i
<
ngp
;
++
i
)
odat
[
i
]
=
MVCOMPLEG
(
idat1
[
i
],
idat2
[
i
]);
else
for
(
i
=
0
;
i
<
ngp
;
++
i
)
odat
[
i
]
=
COMPLEG
(
idat1
[
i
],
idat2
[
i
]);
break
;
default:
cdoAbort
(
"%s: operator %c unsupported!"
,
__func__
,
oper
);
break
;
...
...
@@ -895,6 +909,7 @@ nodeType *expr_run(nodeType *p, parse_parm_t *parse_arg)
case
GE
:
printf
(
"
\t
compGE
\n
"
);
break
;
case
NE
:
printf
(
"
\t
compNE
\n
"
);
break
;
case
EQ
:
printf
(
"
\t
compEQ
\n
"
);
break
;
case
LEG
:
printf
(
"
\t
compLEG
\n
"
);
break
;
}
}
else
...
...
src/expr_lex.c
View file @
009c922d
...
...
@@ -350,8 +350,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 1
4
#define YY_END_OF_BUFFER 1
5
#define YY_NUM_RULES 1
5
#define YY_END_OF_BUFFER 1
6
/* This struct is not used in this scanner,
but its presence is necessary. */
struct
yy_trans_info
...
...
@@ -359,26 +359,26 @@ struct yy_trans_info
flex_int32_t
yy_verify
;
flex_int32_t
yy_nxt
;
};
static
yyconst
flex_int16_t
yy_acclist
[
8
4
]
=
static
yyconst
flex_int16_t
yy_acclist
[
8
5
]
=
{
0
,
4
,
4
,
1
5
,
13
,
14
,
1
2
,
1
3
,
1
4
,
1
2
,
1
4
,
1
3
,
1
4
,
1
,
1
3
,
1
4
,
7
,
1
3
,
1
4
,
4
,
7
,
1
3
,
1
4
,
4
,
1
3
,
1
4
,
7
,
1
3
,
1
4
,
7
,
1
3
,
1
4
,
7
,
1
3
,
1
4
,
6
,
1
3
,
1
4
,
16389
,
4
,
6
,
1
3
,
1
4
,
16389
,
6
,
1
3
,
1
4
,
16389
,
6
,
1
3
,
1
4
,
16389
,
1
2
,
1
1
,
1
,
4
,
4
,
4
,
4
,
9
,
1
0
,
8
,
8197
,
6
,
16389
,
4
,
6
,
16389
,
6
,
16389
,
4
,
4
,
4
,
6
,
16389
,
3
,
6
,
16389
,
6
,
16389
,
4
,
2
,
6
,
16389
4
,
4
,
1
6
,
14
,
1
5
,
13
,
1
4
,
1
5
,
1
3
,
1
5
,
1
4
,
1
5
,
1
,
1
4
,
1
5
,
7
,
1
4
,
1
5
,
4
,
7
,
1
4
,
1
5
,
4
,
1
4
,
1
5
,
7
,
1
4
,
1
5
,
7
,
1
4
,
1
5
,
7
,
1
4
,
1
5
,
6
,
1
4
,
1
5
,
16389
,
4
,
6
,
1
4
,
1
5
,
16389
,
6
,
1
4
,
1
5
,
16389
,
6
,
1
4
,
1
5
,
16389
,
1
3
,
1
2
,
1
,
4
,
4
,
4
,
4
,
10
,
1
1
,
9
,
8197
,
6
,
16389
,
4
,
6
,
16389
,
6
,
16389
,
4
,
4
,
8
,
4
,
6
,
16389
,
3
,
6
,
16389
,
6
,
16389
,
4
,
2
,
6
,
16389
}
;
static
yyconst
flex_int16_t
yy_accept
[
4
7
]
=
static
yyconst
flex_int16_t
yy_accept
[
4
8
]
=
{
0
,
1
,
2
,
3
,
4
,
6
,
9
,
11
,
13
,
16
,
19
,
23
,
26
,
29
,
32
,
35
,
39
,
44
,
48
,
52
,
53
,
54
,
55
,
56
,
57
,
57
,
58
,
59
,
59
,
60
,
61
,
62
,
62
,
63
,
65
,
65
,
68
,
70
,
70
,
71
,
72
,
7
5
,
7
8
,
80
,
81
,
8
4
,
8
4
7
3
,
7
6
,
79
,
81
,
8
2
,
8
5
,
85
}
;
static
yyconst
flex_int32_t
yy_ec
[
256
]
=
...
...
@@ -420,54 +420,54 @@ static yyconst flex_int32_t yy_meta[23] =
3
,
3
}
;
static
yyconst
flex_int16_t
yy_base
[
4
8
]
=
static
yyconst
flex_int16_t
yy_base
[
4
9
]
=
{
0
,
0
,
0
,
8
2
,
8
3
,
21
,
24
,
6
8
,
0
,
8
3
,
18
,
31
,
67
,
66
,
65
,
26
,
32
,
50
,
39
,
47
,
8
3
,
0
,
0
,
8
3
,
47
,
0
,
0
,
53
,
83
,
8
3
,
8
3
,
48
,
8
3
,
56
,
65
,
22
,
46
,
64
,
21
,
54
,
52
,
48
,
50
,
8
3
,
24
,
8
3
,
71
,
41
0
,
0
,
8
3
,
8
4
,
21
,
24
,
6
9
,
0
,
8
4
,
18
,
31
,
68
,
67
,
66
,
26
,
32
,
50
,
39
,
47
,
8
4
,
0
,
0
,
8
4
,
47
,
0
,
0
,
53
,
64
,
8
4
,
8
4
,
48
,
8
4
,
56
,
65
,
22
,
46
,
64
,
21
,
54
,
84
,
52
,
48
,
50
,
8
4
,
24
,
8
4
,
71
,
41
}
;
static
yyconst
flex_int16_t
yy_def
[
4
8
]
=
static
yyconst
flex_int16_t
yy_def
[
4
9
]
=
{
0
,
4
5
,
1
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
6
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
7
,
4
7
,
4
7
,
4
7
,
4
5
,
4
5
,
4
6
,
10
,
4
5
,
4
5
,
10
,
11
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
18
,
4
5
,
17
,
18
,
4
5
,
4
5
,
4
5
,
18
,
18
,
18
,
45
,
18
,
0
,
4
5
,
4
5
4
6
,
1
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
7
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
8
,
4
8
,
4
8
,
4
8
,
4
6
,
4
6
,
4
7
,
10
,
4
6
,
4
6
,
10
,
11
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
18
,
4
6
,
17
,
18
,
4
6
,
4
6
,
4
6
,
46
,
18
,
18
,
18
,
46
,
18
,
0
,
4
6
,
4
6
}
;
static
yyconst
flex_int16_t
yy_nxt
[
10
6
]
=
static
yyconst
flex_int16_t
yy_nxt
[
10
7
]
=
{
0
,
4
,
5
,
6
,
5
,
7
,
8
,
9
,
9
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
15
,
18
,
15
,
15
,
17
,
19
,
19
,
19
,
19
,
19
,
19
,
22
,
31
,
4
5
,
38
,
32
,
23
,
24
,
31
,
23
,
4
0
,
32
,
24
,
4
6
,
38
,
32
,
23
,
24
,
31
,
23
,
4
1
,
32
,
24
,
25
,
26
,
31
,
33
,
33
,
32
,
23
,
27
,
19
,
19
,
19
,
31
,
27
,
31
,
32
,
37
,
32
,
38
,
34
,
36
,
35
,
34
,
4
1
,
39
,
39
,
4
2
,
33
,
4
4
,
33
,
4
3
,
33
,
21
,
33
,
21
,
38
,
39
,
33
,
30
,
29
,
28
,
2
0
,
45
,
3
,
45
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
35
,
34
,
4
2
,
39
,
39
,
4
3
,
33
,
4
5
,
33
,
4
4
,
33
,
21
,
33
,
21
,
38
,
39
,
33
,
40
,
30
,
29
,
2
8
,
20
,
46
,
3
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
46
}
;
static
yyconst
flex_int16_t
yy_chk
[
10
6
]
=
static
yyconst
flex_int16_t
yy_chk
[
10
7
]
=
{
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
5
,
5
,
5
,
6
,
6
,
6
,
10
,
15
,
35
,
38
,
15
,
10
,
10
,
16
,
38
,
35
,
16
,
10
,
11
,
11
,
18
,
4
7
,
4
4
,
18
,
11
,
11
,
19
,
19
,
11
,
11
,
18
,
4
8
,
4
5
,
18
,
11
,
11
,
19
,
19
,
19
,
31
,
11
,
17
,
31
,
24
,
17
,
24
,
17
,
18
,
17
,
27
,
36
,
27
,
39
,
36
,
36
,
4
2
,
4
1
,
39
,
4
2
,
4
6
,
4
0
,
4
6
,
37
,
34
,
33
,
14
,
13
,
12
,
7
,
3
,
4
5
,
45
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
,
17
,
27
,
36
,
27
,
39
,
36
,
36
,
4
3
,
4
2
,
39
,
4
3
,
4
7
,
4
1
,
4
7
,
37
,
34
,
33
,
28
,
14
,
13
,
12
,
7
,
3
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
5
,
4
5
,
4
5
,
4
5
,
4
5
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
46
}
;
#define YY_TRAILING_MASK 0x2000
...
...
@@ -487,7 +487,7 @@ goto find_rule; \
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
#line 1 "expr_lex.l"
/* flex -
-outfile=
expr_lex.c expr_lex.l */
/* flex -
o
expr_lex.c expr_lex.l */
#line 3 "expr_lex.l"
#include
<string.h>
#include
<stdlib.h>
...
...
@@ -820,14 +820,14 @@ yy_match:
while
(
yy_chk
[
yy_base
[
yy_current_state
]
+
yy_c
]
!=
yy_current_state
)
{
yy_current_state
=
(
int
)
yy_def
[
yy_current_state
];
if
(
yy_current_state
>=
4
6
)
if
(
yy_current_state
>=
4
7
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
*
yyg
->
yy_state_ptr
++
=
yy_current_state
;
++
yy_cp
;
}
while
(
yy_base
[
yy_current_state
]
!=
8
3
);
while
(
yy_base
[
yy_current_state
]
!=
8
4
);
yy_find_action:
yy_current_state
=
*--
yyg
->
yy_state_ptr
;
...
...
@@ -933,40 +933,45 @@ YY_RULE_SETUP
case
8
:
YY_RULE_SETUP
#line 76 "expr_lex.l"
return
G
E
;
return
LE
G
;
YY_BREAK
case
9
:
YY_RULE_SETUP
#line 77 "expr_lex.l"
return
L
E
;
return
G
E
;
YY_BREAK
case
10
:
YY_RULE_SETUP
#line 78 "expr_lex.l"
return
E
Q
;
return
L
E
;
YY_BREAK
case
11
:
YY_RULE_SETUP
#line 79 "expr_lex.l"
return
N
E
;
return
E
Q
;
YY_BREAK
case
12
:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 8
1
"expr_lex.l"
;
/* ignore whitespace */
#line 8
0
"expr_lex.l"
return
NE
;
YY_BREAK
case
13
:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 8
3
"expr_lex.l"
yyerror
(
NULL
,
NULL
,
"Unknown character"
);
#line 8
2
"expr_lex.l"
;
/* ignore whitespace */
YY_BREAK
case
14
:
YY_RULE_SETUP
#line 84 "expr_lex.l"
yyerror
(
NULL
,
NULL
,
"Unknown character"
);
YY_BREAK
case
15
:
YY_RULE_SETUP
#line 85 "expr_lex.l"
ECHO
;
YY_BREAK
#line 97
0
"expr_lex.c"
#line 97
5
"expr_lex.c"
case
YY_STATE_EOF
(
INITIAL
):
yyterminate
();
...
...
@@ -1229,7 +1234,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while
(
yy_chk
[
yy_base
[
yy_current_state
]
+
yy_c
]
!=
yy_current_state
)
{
yy_current_state
=
(
int
)
yy_def
[
yy_current_state
];
if
(
yy_current_state
>=
4
6
)
if
(
yy_current_state
>=
4
7
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
...
...
@@ -1253,11 +1258,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while
(
yy_chk
[
yy_base
[
yy_current_state
]
+
yy_c
]
!=
yy_current_state
)
{
yy_current_state
=
(
int
)
yy_def
[
yy_current_state
];
if
(
yy_current_state
>=
4
6
)
if
(
yy_current_state
>=
4
7
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
yy_is_jam
=
(
yy_current_state
==
4
5
);
yy_is_jam
=
(
yy_current_state
==
4
6
);
if
(
!
yy_is_jam
)
*
yyg
->
yy_state_ptr
++
=
yy_current_state
;
...
...
@@ -2066,7 +2071,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
#line 8
4
"expr_lex.l"
#line 8
5
"expr_lex.l"
src/expr_lex.l
View file @
009c922d
/* flex -
-outfile=
expr_lex.c expr_lex.l */
/* flex -
o
expr_lex.c expr_lex.l */
%{
#include <string.h>
#include <stdlib.h>
...
...
@@ -73,6 +73,7 @@ M_E {
return *yytext;
}
"<=>" return LEG;
">=" return GE;
"<=" return LE;
"==" return EQ;
...
...
src/expr_yacc.c
View file @
009c922d
...
...
@@ -106,7 +106,10 @@ int expr_run(nodeType *p, parse_parm_t *parse_arg);
# define YYERROR_VERBOSE 0
#endif
/* In a future release of Bison, this section will be replaced
by #include "expr_yacc.h". */
#ifndef YY_YY_EXPR_YACC_H_INCLUDED
# define YY_YY_EXPR_YACC_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
...
...
@@ -123,13 +126,24 @@ extern int yydebug;
CONSTANT
=
258
,
VARIABLE
=
259
,
FUNCTION
=
260
,
GE
=
261
,
LE
=
262
,
EQ
=
263
,
NE
=
264
,
UMINUS
=
265
LEG
=
261
,
GE
=
262
,
LE
=
263
,
EQ
=
264
,
NE
=
265
,
UMINUS
=
266
};
#endif
/* Tokens. */
#define CONSTANT 258
#define VARIABLE 259
#define FUNCTION 260
#define LEG 261
#define GE 262
#define LE 263
#define EQ 264
#define NE 265
#define UMINUS 266
/* Value type. */
...
...
@@ -137,11 +151,11 @@ extern int yydebug;
int
yyparse
(
parse_parm_t
*
parse_arg
,
void
*
scanner
);
#endif
/* !YY_YY_EXPR_YACC_H_INCLUDED */
/* Copy the second part of user declarations. */
#line 1
4
5 "expr_yacc.c"
/* yacc.c:358 */
#line 15
9
"expr_yacc.c"
/* yacc.c:358 */
#ifdef short
# undef short
...
...
@@ -383,21 +397,21 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 11
7
#define YYLAST 11
9
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 2
4
#define YYNTOKENS 2
5
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 6
/* YYNRULES -- Number of rules. */
#define YYNRULES 2
7
#define YYNRULES 2
8
/* YYNSTATES -- Number of states. */
#define YYNSTATES 5
1
#define YYNSTATES 5
3
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 26
5
#define YYMAXUTOK 26
6
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
...
...
@@ -410,15 +424,15 @@ static const yytype_uint8 yytranslate[] =
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
2
,
2
3
,
1
5
,
1
3
,
2
,
1
4
,
2
,
1
6
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
19
,
1
1
,
1
2
,
1
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
3
,
2
4
,
1
6
,
1
4
,
2
,
1
5
,
2
,
1
7
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
20
,
1
2
,
1
3
,
1
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
7
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
8
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
0
,
2
,
2
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
1
,
2
,
2
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
...
...
@@ -432,7 +446,7 @@ static const yytype_uint8 yytranslate[] =
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
1
8
5
,
6
,
7
,
8
,
9
,
1
0
,
19
};
#if YYDEBUG
...
...
@@ -441,7 +455,7 @@ static const yytype_uint8 yyrline[] =
{
0
,
50
,
50
,
54
,
55
,
59
,
60
,
61
,
62
,
63
,
67
,
68
,
72
,
73
,
74
,
75
,
76
,
77
,
78
,
79
,
80
,
81
,
82
,
83
,
84
,
85
,
86
,
87
80
,
81
,
82
,
83
,
84
,
85
,
86
,
87
,
88
};
#endif
...
...
@@ -450,10 +464,10 @@ static const yytype_uint8 yyrline[] =
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static
const
char
*
const
yytname
[]
=
{
"$end"
,
"error"
,
"$undefined"
,
"CONSTANT"
,
"VARIABLE"
,
"FUNCTION"
,
"GE"
,
"LE"
,
"EQ"
,
"NE"
,
"'>'"
,
"'<'"
,
"'='"
,
"'+'"
,
"'-'"
,
"'*'"
,
"'/'"
,
"'^'"
,
"UMINUS"
,
"';'"
,
"'{'"
,
"'}'"
,
"'('"
,
"')'"
,
"$accept"
,
"program"
,
"function"
,
"stmt"
,
"stmt_list"
,
"expr"
,
YY_NULLPTR
"$end"
,
"error"
,
"$undefined"
,
"CONSTANT"
,
"VARIABLE"
,
"FUNCTION"
,
"LEG"
,
"GE"
,
"LE"
,
"EQ"
,
"NE"
,
"'>'"
,
"'<'"
,
"'='"
,
"'+'"
,
"'-'"
,
"'*'"
,
"'/'"
,
"'^'"
,
"UMINUS"
,
"';'"
,
"'{'"
,
"'}'"
,
"'('"
,
"')'"
,
"$accept"
,
"program"
,
"function"
,
"stmt"
,
"stmt_list"
,
"expr"
,
YY_NULLPTR
};
#endif
...
...
@@ -463,15 +477,15 @@ static const char *const yytname[] =
static
const
yytype_uint16
yytoknum
[]
=
{
0
,
256
,
257
,
258
,
259
,
260
,
261
,
262
,
263
,
264
,
62
,
60
,
61
,
43
,
45
,
42
,
47
,
94
,
26
5
,
59
,
123
,
125
,
40
,
41
265
,
62
,
60
,
61
,
43
,
45
,
42
,
47
,
94
,
26
6
,
59
,
123
,
125
,
40
,
41
};
# endif
#define YYPACT_NINF -1
8
#define YYPACT_NINF -1
9
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-1
8
)))
(!!((Yystate) == (-1
9
)))
#define YYTABLE_NINF -1
...
...
@@ -482,12 +496,12 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static
const
yytype_int8
yypact
[]
=
{
-
1
8
,
4
,
2
6
,
-
1
8
,
-
1
8
,
-
1
0
,
-
1
7
,
4
6
,
-
1
8
,
2
6
,
4
6
,
-
1
8
,
84
,
4
6
,
-
1
8
,
4
6
,
-
1
8
,
-
1
8
,
-
1
8
,
2
2
,
4
8
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
4
6
,
-
1
8
,
9
8
,
6
6
,
-
1
8
,
-
1
8
,
-
1
8
,
71
,
7
1
,
7
1
,
7
1
,
7
1
,
7
1
,
1
7
,
1
7
,
-
5
,
-
5
,
-
5
,
-
18
,
-
18
-
1
9
,
4
,
2
7
,
-
1
9
,
-
1
9
,
-
1
1
,
-
1
8
,
3
6
,
-
1
9
,
2
7
,
3
6
,
-
1
9
,
84
,
3
6
,
-
1
9
,
3
6
,
-
1
9
,
-
1
9
,
-
1
9
,
2
3
,
4
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
3
6
,
36
,
3
6
,
-
1
9
,
9
9
,
6
5
,
-
1
9
,
-
1
9
,
-
1
9
,
1
9
,
1
9
,
1
9
,
1
9
,
1
9
,
1
9
,
1
9
,
49
,
49
,
-
6
,
-
6
,
-
6
,
-
19
,
-
19
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
...
...
@@ -498,15 +512,15 @@ static const yytype_uint8 yydefact[] =
4
,
0
,
2
,
1
,
12
,
13
,
0
,
0
,
5
,
0
,
0
,
3
,
0
,
0
,
8
,
0
,
13
,
14
,
10
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
6
,
0
,
0
,
9
,
11
,
2
6
,
2
2
,
23
,
25
,
24
,
20
,
19
,
15
,
16
,
17
,
18
,
21
,
7
,
2
7
0
,
0
,
0
,
6
,
0
,
0
,
9
,
11
,
2
7
,
2
6
,
22
,
23
,
25
,
24
,
20
,
19
,
15
,
16
,
17
,
18
,
2
1
,
7
,
28
};
/* YYPGOTO[NTERM-NUM]. */
static
const
yytype_int8
yypgoto
[]
=
{
-
1
8
,
-
1
8
,
-
1
8
,
-
8
,
-
1
8
,
-
7
-
1
9
,
-
1
9
,
-
1
9
,
-
8
,
-
1
9
,
-
7
};
/* YYDEFGOTO[NTERM-NUM]. */
...
...
@@ -520,54 +534,54 @@ static const yytype_int8 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static
const
yytype_uint8
yytable
[]
=
{
17
,
18
,
13
,
20
,
3
,
15
,
3
3
,
0
,
3
4
,
14
,
0
,
3
6
,
3
1
,
0
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
4
,
5
,
6
,
0
,
4
,
5
,
6
,
2
9
,
30
,
31
,
0
,
7
,
0
,
0
,
0
,
7
,
8
,
9
,
3
5
,
10
,
8
,
9
,
0
,
10
,
4
,
1
6
,
6
,
0
,
0
,
21
,
22
,
23
,
24
,
25
,
26
,
7
,
2
7
,
28
,
29
,
3
0
,
3
1
,
0
,
0
,
1
0
,
0
,
0
,
37
,
21
,
22
,
23
,
24
,
25
,
26
,
0
,
2
7
,
28
,
29
,
30
,
31
,
2
7
,
28
,
29
,
3
0
,
31
,
5
0
,
21
,
22
,
23
,
24
,
25
,
26
,
0
,
27
,
28
,
29
,
30
,
31
,
0
,
3
2
,
21
,
22
,
23
,
24
,
25
,
26
,
0
,
27
,
28
,
29
,
30
,
31
,
0
,
49
17
,
18
,
13
,
20
,
3
,
15
,
3
4
,
0
,
3
5
,
14
,
0
,
3
7
,
3
2
,
0
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
4
,
5
,
6
,
0
,
4
,
5
,
6
,
2
8
,
29
,
3
0
,
31
,
32
,
7
,
4
,
16
,
6
,
7
,
8
,
9
,
3
6
,
10
,
8
,
9
,
0
,
10
,
7
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
10
,
28
,
2
9
,
30
,
31
,
3
2
,
3
0
,
31
,
32
,
0
,
0
,
38
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
0
,
2
8
,
29
,
30
,
31
,
3
2
,
0
,
0
,
0
,
0
,
0
,
5
2
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
0
,
28
,
29
,
30
,
31
,
32
,
0
,
3
3
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
0
,
28
,
29
,
30
,
31
,
32
,
0
,
51
};
static
const
yytype_int8
yycheck
[]
=
{
7
,
9
,
1
2
,
10
,
0
,
2
2
,
13
,
-
1
,
15
,
19
,
-
1
,
19
,
1
7
,
-
1
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
3
,
4
,
5
,
-
1
,
3
,
4
,
5
,
1
5
,
16
,
1
7
,
-
1
,
1
4
,
-
1
,
-
1
,
-
1
,
1
4
,
19
,
20
,
21
,
22
,
19
,
20
,
-
1
,
2
2
,
3
,
4
,
5
,
-
1
,
-
1
,
6
,
7
,
8
,
9
,
10
,
11
,
14
,
13
,
14
,
15
,
16
,
17
,
-
1
,
-
1
,
22
,
-
1
,
-
1
,
23
,
6
,
7
,
8
,
9
,
10
,
11
,
-
1
,
1
3
,
14
,
15
,
16
,
17
,
1
3
,
1
4
,
1
5
,
1
6
,
1
7
,
2
3
,
6
,
7
,
8
,
9
,
10
,
11
,
-
1
,
1
3
,
14
,
15
,
16
,
17
,
-
1
,
19
,
6
,
7
,
8
,
9
,
10
,
11
,
-
1
,
1
3
,
14
,
15
,
16
,
17
,
-
1
,
19
7
,
9
,
1
3
,
10
,
0
,
2
3
,
13
,
-
1
,
15
,
20
,
-
1
,
19
,
1
8
,
-
1
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
3
,
4
,
5
,
-
1
,
3
,
4
,
5
,
1
4
,
1
5
,
1
6
,
1
7
,
1
8
,
1
5
,
3
,
4
,
5
,
15
,
20
,
21
,
22
,
23
,
20
,
2
1
,
-
1
,
23
,