Commit fc07c575 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

expr: improve ternary operator, no brackets needed anymore.

parent 9823c656
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* Using CDI library version 1.9.0 * Using CDI library version 1.9.0
* Version 1.9.0 release * Version 1.9.0 release
2017-06-28 Uwe Schulzweida
* expr: improve ternary operator, no brackets needed anymore.
2017-06-27 Uwe Schulzweida 2017-06-27 Uwe Schulzweida
* expr: added support for clev in ifthenelse (bug fix). * expr: added support for clev in ifthenelse (bug fix).
......
...@@ -347,8 +347,8 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner ); ...@@ -347,8 +347,8 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp; yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 23 #define YY_NUM_RULES 25
#define YY_END_OF_BUFFER 24 #define YY_END_OF_BUFFER 26
/* This struct is not used in this scanner, /* This struct is not used in this scanner,
but its presence is necessary. */ but its presence is necessary. */
struct yy_trans_info struct yy_trans_info
...@@ -356,37 +356,38 @@ struct yy_trans_info ...@@ -356,37 +356,38 @@ struct yy_trans_info
flex_int32_t yy_verify; flex_int32_t yy_verify;
flex_int32_t yy_nxt; flex_int32_t yy_nxt;
}; };
static yyconst flex_int16_t yy_acclist[158] = static yyconst flex_int16_t yy_acclist[164] =
{ 0, { 0,
4, 4, 24, 22, 23, 21, 22, 23, 21, 23, 4, 4, 26, 24, 25, 23, 24, 25, 23, 25,
22, 23, 1, 22, 23, 22, 23, 11, 22, 23, 24, 25, 1, 24, 25, 24, 25, 11, 24, 25,
4, 11, 22, 23, 4, 22, 23, 16, 22, 23, 4, 11, 24, 25, 4, 24, 25, 22, 24, 25,
11, 22, 23, 15, 22, 23, 9, 10, 22, 23, 16, 24, 25, 11, 24, 25, 15, 24, 25, 21,
16391, 4, 9, 10, 22, 23,16391, 9, 10, 22, 24, 25, 9, 10, 24, 25,16391, 4, 9, 10,
23,16391, 9, 10, 22, 23,16391, 9, 10, 22, 24, 25,16391, 9, 10, 24, 25,16391, 9, 10,
23,16391, 9, 10, 22, 23,16391, 22, 23, 21, 24, 25,16391, 9, 10, 24, 25,16391, 9, 10,
18, 1, 19, 4, 4, 4, 4, 10, 4, 10, 24, 25,16391, 24, 25, 23, 18, 1, 19, 4,
10, 14, 17, 13, 8199, 8, 9, 10,16391, 9, 4, 4, 4, 10, 4, 10, 10, 14, 17, 13,
10,16391, 4, 9, 10,16391, 9, 10,16391, 9, 8199, 8, 9, 10,16391, 9, 10,16391, 4, 9,
10,16391, 9, 10,16391, 20, 4, 10, 10, 4,
10, 12, 8, 4, 4, 9, 10,16391, 3, 9,
10,16391, 9, 10,16391, 9, 10,16391, 9, 10, 10,16391, 9, 10,16391, 9, 10,16391, 9, 10,
16391, 4, 10, 4, 2, 9, 10,16391, 9, 10, 16391, 20, 4, 10, 10, 4, 10, 12, 8, 4,
16391, 9, 10,16391, 9, 10,16391, 9, 10,16391, 4, 9, 10,16391, 3, 9, 10,16391, 9, 10,
6, 8199, 9, 10,16391, 5, 8199 16391, 9, 10,16391, 9, 10,16391, 4, 10, 4,
2, 9, 10,16391, 9, 10,16391, 9, 10,16391,
9, 10,16391, 9, 10,16391, 6, 8199, 9, 10,
16391, 5, 8199
} ; } ;
static yyconst flex_int16_t yy_accept[74] = static yyconst flex_int16_t yy_accept[76] =
{ 0, { 0,
1, 2, 3, 4, 6, 9, 11, 13, 16, 18, 1, 2, 3, 4, 6, 9, 11, 13, 16, 18,
21, 25, 28, 31, 34, 37, 42, 48, 53, 58, 21, 25, 28, 31, 34, 37, 40, 43, 48, 54,
63, 68, 70, 71, 72, 73, 74, 75, 76, 76, 59, 64, 69, 74, 76, 77, 78, 79, 80, 81,
77, 78, 79, 81, 82, 83, 84, 85, 85, 86, 82, 82, 83, 84, 85, 87, 88, 89, 90, 91,
87, 90, 93, 93, 97, 100, 103, 106, 107, 107, 91, 92, 93, 96, 99, 99, 103, 106, 109, 112,
108, 109, 110, 112, 113, 114, 115, 119, 123, 126, 113, 113, 114, 115, 116, 118, 119, 120, 121, 125,
129, 132, 134, 135, 139, 142, 145, 148, 151, 153, 129, 132, 135, 138, 140, 141, 145, 148, 151, 154,
156, 158, 158 157, 159, 162, 164, 164
} ; } ;
static yyconst YY_CHAR yy_ec[256] = static yyconst YY_CHAR yy_ec[256] =
...@@ -396,15 +397,15 @@ static yyconst YY_CHAR yy_ec[256] = ...@@ -396,15 +397,15 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 5, 1, 6, 1, 1, 7, 1, 8, 1, 4, 5, 1, 6, 1, 1, 7, 1, 8,
9, 9, 10, 9, 10, 11, 9, 12, 12, 12, 9, 9, 10, 9, 10, 11, 9, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 9, 9, 13, 12, 12, 12, 12, 12, 12, 12, 13, 9, 14,
14, 15, 9, 1, 16, 16, 16, 17, 18, 16, 15, 16, 17, 1, 18, 18, 18, 19, 20, 18,
16, 16, 19, 16, 16, 17, 20, 16, 16, 21, 18, 18, 21, 18, 18, 19, 22, 18, 18, 23,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1, 1, 1, 9, 22, 1, 16, 16, 16, 17, 1, 1, 1, 9, 24, 1, 18, 18, 18, 19,
23, 16, 16, 16, 24, 16, 16, 17, 25, 26, 25, 18, 18, 18, 26, 18, 18, 19, 27, 28,
27, 28, 16, 29, 16, 30, 16, 31, 16, 16, 29, 30, 18, 31, 18, 32, 18, 33, 18, 18,
16, 16, 9, 32, 9, 1, 1, 1, 1, 1, 18, 18, 9, 34, 9, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
...@@ -421,80 +422,80 @@ static yyconst YY_CHAR yy_ec[256] = ...@@ -421,80 +422,80 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst YY_CHAR yy_meta[33] = static yyconst YY_CHAR yy_meta[35] =
{ 0, { 0,
1, 1, 2, 3, 1, 1, 1, 3, 1, 1, 1, 1, 2, 3, 1, 1, 1, 3, 1, 1,
4, 5, 1, 1, 1, 6, 6, 6, 6, 6, 4, 5, 1, 1, 1, 1, 1, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 1 6, 6, 6, 1
} ; } ;
static yyconst flex_uint16_t yy_base[78] = static yyconst flex_uint16_t yy_base[80] =
{ 0, { 0,
0, 0, 132, 133, 31, 34, 117, 0, 123, 133, 0, 0, 134, 135, 33, 36, 118, 0, 125, 135,
27, 40, 115, 114, 113, 56, 58, 30, 104, 96, 29, 31, 135, 116, 115, 114, 135, 49, 51, 34,
101, 91, 44, 133, 0, 133, 59, 133, 31, 61, 104, 96, 101, 91, 62, 135, 0, 135, 55, 135,
74, 110, 109, 43, 105, 133, 133, 57, 133, 0, 35, 57, 59, 112, 111, 71, 106, 135, 135, 64,
0, 0, 107, 37, 38, 94, 92, 133, 104, 63, 135, 0, 0, 0, 109, 73, 66, 94, 92, 135,
103, 102, 71, 133, 0, 77, 0, 0, 94, 73, 106, 75, 105, 104, 76, 135, 0, 78, 0, 0,
69, 83, 133, 0, 63, 59, 79, 58, 133, 66, 94, 86, 84, 87, 135, 0, 64, 60, 83, 48,
133, 133, 97, 100, 104, 106, 66 135, 50, 135, 135, 97, 100, 104, 106, 46
} ; } ;
static yyconst flex_int16_t yy_def[78] = static yyconst flex_int16_t yy_def[80] =
{ 0, { 0,
72, 1, 72, 72, 72, 72, 72, 73, 72, 72, 74, 1, 74, 74, 74, 74, 74, 75, 74, 74,
72, 74, 72, 72, 72, 75, 75, 17, 17, 17, 74, 76, 74, 74, 74, 74, 74, 77, 77, 19,
17, 72, 72, 72, 73, 72, 72, 72, 72, 72, 19, 19, 19, 74, 74, 74, 75, 74, 74, 74,
74, 76, 76, 76, 72, 72, 72, 72, 72, 77, 74, 74, 76, 78, 78, 78, 74, 74, 74, 74,
17, 17, 72, 17, 17, 17, 17, 72, 72, 72, 74, 79, 19, 19, 74, 19, 19, 19, 19, 74,
76, 76, 76, 72, 77, 72, 17, 17, 17, 17, 74, 74, 78, 78, 78, 74, 79, 74, 19, 19,
17, 76, 72, 17, 17, 17, 17, 17, 72, 17, 19, 19, 19, 78, 74, 19, 19, 19, 19, 19,
72, 0, 72, 72, 72, 72, 72 74, 19, 74, 0, 74, 74, 74, 74, 74
} ; } ;
static yyconst flex_uint16_t yy_nxt[166] = static yyconst flex_uint16_t yy_nxt[170] =
{ 0, { 0,
4, 5, 6, 5, 7, 8, 9, 10, 10, 10, 4, 5, 6, 5, 7, 8, 9, 10, 10, 10,
11, 12, 13, 14, 15, 16, 17, 18, 16, 19, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
16, 16, 18, 16, 16, 16, 16, 20, 21, 16, 18, 21, 18, 18, 20, 18, 18, 18, 18, 22,
16, 22, 23, 23, 23, 23, 23, 23, 27, 43, 23, 18, 18, 24, 25, 25, 25, 25, 25, 25,
49, 44, 50, 28, 29, 23, 23, 23, 44, 29, 29, 32, 33, 45, 51, 46, 52, 30, 31, 35,
30, 31, 43, 57, 53, 58, 33, 34, 59, 38, 36, 57, 40, 31, 40, 36, 41, 73, 41, 42,
38, 38, 34, 39, 39, 39, 40, 41, 40, 41, 43, 42, 43, 25, 25, 25, 29, 40, 29, 32,
27, 55, 27, 71, 50, 28, 29, 28, 29, 28, 33, 41, 72, 30, 31, 30, 31, 35, 36, 31,
70, 29, 53, 29, 30, 31, 69, 62, 56, 68, 45, 31, 55, 36, 46, 60, 52, 55, 61, 58,
33, 34, 67, 63, 51, 66, 34, 25, 65, 25, 71, 59, 70, 30, 64, 69, 65, 27, 53, 27,
25, 25, 25, 32, 32, 32, 42, 42, 42, 42, 27, 27, 27, 34, 34, 34, 44, 44, 44, 44,
52, 52, 64, 51, 51, 50, 61, 60, 56, 54, 54, 54, 68, 67, 66, 53, 53, 52, 63, 62,
51, 51, 48, 47, 46, 45, 37, 36, 35, 26, 58, 56, 53, 53, 50, 49, 48, 47, 39, 38,
24, 72, 3, 72, 72, 72, 72, 72, 72, 72, 37, 28, 26, 74, 3, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72 74, 74, 74, 74, 74, 74, 74, 74, 74
} ; } ;
static yyconst flex_int16_t yy_chk[166] = static yyconst flex_int16_t yy_chk[170] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 11, 18, 1, 1, 1, 1, 5, 5, 5, 6, 6, 6,
29, 18, 29, 11, 11, 23, 23, 23, 44, 11, 11, 12, 12, 20, 31, 20, 31, 11, 11, 12,
12, 12, 34, 44, 34, 45, 12, 12, 45, 16, 12, 79, 18, 11, 19, 12, 18, 72, 19, 18,
38, 17, 12, 16, 38, 17, 16, 16, 17, 17, 18, 19, 19, 25, 25, 25, 29, 40, 32, 33,
27, 77, 30, 70, 50, 27, 27, 30, 30, 50, 33, 40, 70, 29, 29, 32, 32, 33, 33, 29,
68, 27, 53, 30, 31, 31, 67, 53, 56, 66, 36, 32, 36, 33, 46, 47, 52, 55, 47, 58,
31, 31, 65, 56, 62, 61, 31, 73, 60, 73, 69, 46, 68, 52, 55, 67, 58, 75, 64, 75,
73, 73, 73, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 77, 77, 77, 77,
76, 76, 59, 52, 51, 49, 47, 46, 43, 35, 78, 78, 63, 62, 61, 54, 53, 51, 49, 48,
33, 32, 22, 21, 20, 19, 15, 14, 13, 9, 45, 37, 35, 34, 24, 23, 22, 21, 16, 15,
7, 3, 72, 72, 72, 72, 72, 72, 72, 72, 14, 9, 7, 3, 74, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
72, 72, 72, 72, 72 74, 74, 74, 74, 74, 74, 74, 74, 74
} ; } ;
#define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_MASK 0x2000
...@@ -538,7 +539,7 @@ goto find_rule; \ ...@@ -538,7 +539,7 @@ goto find_rule; \
LPH [A-Za-z_] Alphabetic character LPH [A-Za-z_] Alphabetic character
LPHDGT [A-Za-z0-9_] Alphanumeric character LPHDGT [A-Za-z0-9_] Alphanumeric character
XPN [eE][+-]?[0-9]+ Real number Exponent */ XPN [eE][+-]?[0-9]+ Real number Exponent */
#line 542 "expr_lex.cc" #line 543 "expr_lex.cc"
#define INITIAL 0 #define INITIAL 0
...@@ -831,7 +832,7 @@ YY_DECL ...@@ -831,7 +832,7 @@ YY_DECL
#line 36 "expr_lex.l" #line 36 "expr_lex.l"
#line 835 "expr_lex.cc" #line 836 "expr_lex.cc"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{ {
...@@ -857,14 +858,14 @@ yy_match: ...@@ -857,14 +858,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 73 ) if ( yy_current_state >= 75 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
*yyg->yy_state_ptr++ = yy_current_state; *yyg->yy_state_ptr++ = yy_current_state;
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 133 ); while ( yy_base[yy_current_state] != 135 );
yy_find_action: yy_find_action:
yy_current_state = *--yyg->yy_state_ptr; yy_current_state = *--yyg->yy_state_ptr;
...@@ -1040,22 +1041,32 @@ YY_RULE_SETUP ...@@ -1040,22 +1041,32 @@ YY_RULE_SETUP
return OR; return OR;
YY_BREAK YY_BREAK
case 21: case 21:
/* rule 21 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 99 "expr_lex.l" #line 98 "expr_lex.l"
; /* ignore whitespace */ return QUESTION;
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 99 "expr_lex.l"
return COLON;
YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 101 "expr_lex.l" #line 101 "expr_lex.l"
; /* ignore whitespace */
YY_BREAK
case 24:
YY_RULE_SETUP
#line 103 "expr_lex.l"
yyerror(NULL, NULL, "Unknown character"); yyerror(NULL, NULL, "Unknown character");
YY_BREAK YY_BREAK
case 23: case 25:
YY_RULE_SETUP YY_RULE_SETUP
#line 102 "expr_lex.l" #line 104 "expr_lex.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1059 "expr_lex.cc" #line 1070 "expr_lex.cc"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
...@@ -1319,7 +1330,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) ...@@ -1319,7 +1330,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 73 ) if ( yy_current_state >= 75 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
...@@ -1343,11 +1354,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) ...@@ -1343,11 +1354,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 73 ) if ( yy_current_state >= 75 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
yy_is_jam = (yy_current_state == 72); yy_is_jam = (yy_current_state == 74);
if ( ! yy_is_jam ) if ( ! yy_is_jam )
*yyg->yy_state_ptr++ = yy_current_state; *yyg->yy_state_ptr++ = yy_current_state;
...@@ -2172,7 +2183,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) ...@@ -2172,7 +2183,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 102 "expr_lex.l" #line 104 "expr_lex.l"
...@@ -82,7 +82,7 @@ M_E { ...@@ -82,7 +82,7 @@ M_E {
} }
[-()=+*/;,{}^.?:] { [-()=+*/;,{}^.] {
return *yytext; return *yytext;
} }
...@@ -95,6 +95,8 @@ M_E { ...@@ -95,6 +95,8 @@ M_E {
"!=" return NE; "!=" return NE;
"&&" return AND; "&&" return AND;
"||" return OR; "||" return OR;
"?" return QUESTION;
":" return COLON;
[ \t\n\r]+ ; /* ignore whitespace */ [ \t\n\r]+ ; /* ignore whitespace */
......
This diff is collapsed.
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_YY_EXPR_YACC_H_INCLUDED #ifndef YY_YY_EXPR_YACC_HH_INCLUDED
# define YY_YY_EXPR_YACC_H_INCLUDED # define YY_YY_EXPR_YACC_HH_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
...@@ -48,36 +48,40 @@ extern int yydebug; ...@@ -48,36 +48,40 @@ extern int yydebug;
CONSTANT = 258, CONSTANT = 258,
VARIABLE = 259, VARIABLE = 259,
FUNCTION = 260, FUNCTION = 260,
REMOVE = 261, QUESTION = 261,
PRINT = 262, COLON = 262,
AND = 263, REMOVE = 263,
OR = 264, PRINT = 264,
LEG = 265, AND = 265,
GE = 266, OR = 266,
LE = 267, LEG = 267,
EQ = 268, GE = 268,
NE = 269, LE = 269,
GT = 270, EQ = 270,
LT = 271, NE = 271,
UMINUS = 272 GT = 272,
LT = 273,
UMINUS = 274
}; };
#endif #endif
/* Tokens. */ /* Tokens. */
#define CONSTANT 258 #define CONSTANT 258
#define VARIABLE 259 #define VARIABLE 259
#define FUNCTION 260 #define FUNCTION 260
#define REMOVE 261 #define QUESTION 261
#define PRINT 262 #define COLON 262
#define AND 263 #define REMOVE 263
#define OR 264 #define PRINT 264
#define LEG 265 #define AND 265
#define GE 266 #define OR 266
#define LE 267 #define LEG 267
#define EQ 268 #define GE 268
#define NE 269 #define LE 269
#define GT 270 #define EQ 270
#define LT 271 #define NE 271
#define UMINUS 272 #define GT 272
#define LT 273
#define UMINUS 274
/* Value type. */ /* Value type. */
...@@ -85,4 +89,4 @@ extern int yydebug; ...@@ -85,4 +89,4 @@ extern int yydebug;
int yyparse (parse_param_t *parse_arg, void *scanner); int yyparse (parse_param_t *parse_arg, void *scanner);
#endif /* !YY_YY_EXPR_YACC_H_INCLUDED */ #endif /* !YY_YY_EXPR_YACC_HH_INCLUDED */
/* http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf */
/* bison -y -o expr_yacc.c -d expr_yacc.y */ /* bison -y -o expr_yacc.c -d expr_yacc.y */
%{ %{
#include <stdio.h>