[Kst] branches/work/kst/portto4/kst/src/libkstmath
Barth Netterfield
netterfield at astro.utoronto.ca
Fri May 25 18:38:12 UTC 2012
SVN commit 1296680 by netterfield:
BUG: 288354
Fix the parser to recognise scientific notation of the form 3.0E3 in
addition to 3.0E+3
M +0 -1 enodes.cpp
M +16 -17 escan.cpp
M +1 -1 escan.l
--- branches/work/kst/portto4/kst/src/libkstmath/enodes.cpp #1296679:1296680
@@ -822,7 +822,6 @@
/////////////////////////////////////////////////////////////////
Number::Number(double n)
: Node(), _n(n) {
- //printf("%p: New Number: %lf\n", (void*)this, n);
}
--- branches/work/kst/portto4/kst/src/libkstmath/escan.cpp #1296679:1296680
@@ -432,11 +432,11 @@
static yyconst flex_int16_t yy_base[45] =
{ 0,
- 0, 0, 53, 52, 54, 57, 57, 57, 35, 57,
- 46, 57, 57, 57, 57, 57, 57, 57, 13, 22,
- 33, 32, 28, 7, 57, 57, 57, 11, 57, 57,
- 57, 14, 21, 0, 57, 57, 57, 19, 57, 26,
- 29, 33, 57, 31
+ 0, 0, 55, 54, 56, 59, 59, 59, 37, 59,
+ 48, 59, 59, 59, 59, 59, 59, 59, 13, 22,
+ 35, 34, 33, 7, 59, 59, 59, 11, 59, 59,
+ 59, 14, 34, 0, 59, 59, 59, 11, 59, 24,
+ 26, 32, 59, 32
} ;
static yyconst flex_int16_t yy_def[45] =
@@ -448,30 +448,30 @@
43, 43, 0, 43
} ;
-static yyconst flex_int16_t yy_nxt[83] =
+static yyconst flex_int16_t yy_nxt[85] =
{ 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 6, 18, 19, 20, 21, 22, 23, 24,
24, 25, 26, 27, 28, 32, 38, 38, 40, 40,
- 41, 29, 41, 33, 32, 39, 34, 34, 38, 38,
- 40, 40, 33, 42, 42, 37, 33, 42, 42, 36,
- 35, 31, 30, 43, 8, 8, 5, 43, 43, 43,
+ 38, 38, 29, 33, 32, 39, 34, 34, 40, 40,
+ 42, 42, 33, 41, 33, 41, 42, 42, 42, 42,
+ 37, 36, 35, 31, 30, 43, 8, 8, 5, 43,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43
+ 43, 43, 43, 43
} ;
-static yyconst flex_int16_t yy_chk[83] =
+static yyconst flex_int16_t yy_chk[85] =
{ 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, 19, 24, 24, 32, 32,
- 33, 44, 33, 19, 20, 28, 20, 20, 38, 38,
- 40, 40, 20, 41, 41, 23, 40, 42, 42, 22,
- 21, 11, 9, 5, 4, 3, 43, 43, 43, 43,
+ 38, 38, 44, 19, 20, 28, 20, 20, 40, 40,
+ 41, 41, 20, 33, 40, 33, 42, 42, 33, 33,
+ 23, 22, 21, 11, 9, 5, 4, 3, 43, 43,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43
+ 43, 43, 43, 43
} ;
static yy_state_type yy_last_accepting_state;
@@ -755,7 +755,7 @@
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 57 );
+ while ( yy_base[yy_current_state] != 59 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -784,7 +784,6 @@
#line 23 "escan.l"
{
yylval.number = atof(yytext);
- /*printf("Found a number %.15f\n", yylval.number);*/
return T_NUMBER;
}
YY_BREAK
--- branches/work/kst/portto4/kst/src/libkstmath/escan.l #1296679:1296680
@@ -15,7 +15,7 @@
%}
-Number (0|[1-9][0-9]*)([\.][0-9]+)?([eE][\+\-][0-9]+)?
+Number (0|[1-9][0-9]*)([\.][0-9]+)?([eE][\+\-]?[0-9]+)?
Id [A-Za-z]+
%%
More information about the Kst
mailing list