"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend/gsl/parser.y" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

parser.y  (labplot-2.8.1):parser.y  (labplot-2.8.2)
skipping to change at line 105 skipping to change at line 105
; ;
expr: NUM { $$ = $1; } expr: NUM { $$ = $1; }
| VAR { $$ = $1->value.var; } | VAR { $$ = $1->value.var; }
| VAR '=' expr { $$ = $3; $1->value.var = $3; } | VAR '=' expr { $$ = $3; $1->value.var = $3; }
| FNCT '(' ')' { $$ = (*($1->value.fnctptr))(); } | FNCT '(' ')' { $$ = (*($1->value.fnctptr))(); }
| FNCT '(' expr ')' { $$ = (*((func_t1)($1->value.fnctptr)))($3); } | FNCT '(' expr ')' { $$ = (*((func_t1)($1->value.fnctptr)))($3); }
| FNCT '(' expr ',' expr ')' { $$ = (*((func_t2)($1->value.fnctptr)))($3,$5); } | FNCT '(' expr ',' expr ')' { $$ = (*((func_t2)($1->value.fnctptr)))($3,$5); }
| FNCT '(' expr ',' expr ','expr ')' { $$ = (*((func_t3)($1->value.fnctptr)))($ 3,$5,$7); } | FNCT '(' expr ',' expr ','expr ')' { $$ = (*((func_t3)($1->value.fnctptr)))($ 3,$5,$7); }
| FNCT '(' expr ',' expr ',' expr ','expr ')' { $$ = (*((func_t4)($1->value.fnc tptr)))($3,$5,$7,$9); } | FNCT '(' expr ',' expr ',' expr ','expr ')' { $$ = (*((func_t4)($1->value.fnc tptr)))($3,$5,$7,$9); }
| FNCT '(' expr ';' expr ')' { $$ = (*((func_t2)($1->value.fnctptr)))($3,$5); }
| FNCT '(' expr ';' expr ';'expr ')' { $$ = (*((func_t3)($1->value.fnctptr)))($
3,$5,$7); }
| FNCT '(' expr ';' expr ';' expr ';'expr ')' { $$ = (*((func_t4)($1->value.fnc
tptr)))($3,$5,$7,$9); }
| expr '+' expr { $$ = $1 + $3; } | expr '+' expr { $$ = $1 + $3; }
| expr '-' expr { $$ = $1 - $3; } | expr '-' expr { $$ = $1 - $3; }
| expr '*' expr { $$ = $1 * $3; } | expr '*' expr { $$ = $1 * $3; }
| expr '/' expr { $$ = $1 / $3; } | expr '/' expr { $$ = $1 / $3; }
| expr '%' expr { $$ = (int)($1) % (int)($3); } | expr '%' expr { $$ = (int)($1) % (int)($3); }
| '-' expr %prec NEG{ $$ = -$2; } | '-' expr %prec NEG{ $$ = -$2; }
| expr '^' expr { $$ = pow($1, $3); } | expr '^' expr { $$ = pow($1, $3); }
| expr '*' '*' expr { $$ = pow($1, $4); } | expr '*' '*' expr { $$ = pow($1, $4); }
| '(' expr ')' { $$ = $2; } | '(' expr ')' { $$ = $2; }
| '|' expr '|' { $$ = fabs($2); } | '|' expr '|' { $$ = fabs($2); }
skipping to change at line 301 skipping to change at line 304
return 0.; return 0.;
} }
strcpy(p.string, string); strcpy(p.string, string);
p.string[strlen(string)] = '\n'; // end for parsing p.string[strlen(string)] = '\n'; // end for parsing
p.string[strlen(string)+1] = '\0'; // end of string p.string[strlen(string)+1] = '\0'; // end of string
/* pdebug("PARSER: Call yyparse() for \"%s\" (len = %d)\n", p.string, (in t)strlen(p.string)); */ /* pdebug("PARSER: Call yyparse() for \"%s\" (len = %d)\n", p.string, (in t)strlen(p.string)); */
/* parameter for yylex */ /* parameter for yylex */
res = NAN; /* default value */ res = NAN; /* default value */
yynerrs = 0; /* reset error count */
yyparse(&p); yyparse(&p);
pdebug("PARSER: parse() DONE (result = %g, errors = %d)\n**************** ***************\n", res, parse_errors()); pdebug("PARSER: parse() DONE (result = %g, errors = %d)\n**************** ***************\n", res, parse_errors());
free(p.string); free(p.string);
p.string = 0; p.string = 0;
return res; return res;
} }
double parse_with_vars(const char *str, const parser_var *vars, int nvars, const char* locale) { double parse_with_vars(const char *str, const parser_var *vars, int nvars, const char* locale) {
 End of changes. 2 change blocks. 
0 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)