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

Renamed parse_param_t to parseParamType.

parent 1069e013
......@@ -209,7 +209,7 @@ paramType *params_new(int vlistID)
}
static
void params_add_coord(parse_param_t *parse_arg, int coord, int cdiID, size_t size, const char *units, const char *longname)
void params_add_coord(parseParamType *parse_arg, int coord, int cdiID, size_t size, const char *units, const char *longname)
{
int ncoords = parse_arg->ncoords;
if ( ncoords >= parse_arg->maxcoords )
......@@ -229,7 +229,7 @@ void params_add_coord(parse_param_t *parse_arg, int coord, int cdiID, size_t siz
}
int params_get_coordID(parse_param_t *parse_arg, int coord, int cdiID)
int params_get_coordID(parseParamType *parse_arg, int coord, int cdiID)
{
int ncoords = parse_arg->ncoords;
for ( int coordID = 0; coordID < ncoords; ++coordID )
......@@ -245,7 +245,7 @@ int params_get_coordID(parse_param_t *parse_arg, int coord, int cdiID)
}
static
void params_add_coordinates(int vlistID, parse_param_t *parse_arg)
void params_add_coordinates(int vlistID, parseParamType *parse_arg)
{
char longname[CDI_MAX_NAME];
char units[CDI_MAX_NAME];
......@@ -276,7 +276,7 @@ void params_add_coordinates(int vlistID, parse_param_t *parse_arg)
}
static
int params_add_ts(parse_param_t *parse_arg)
int params_add_ts(parseParamType *parse_arg)
{
int varID = -1;
paramType *params = parse_arg->params;
......@@ -320,7 +320,7 @@ void *Expr(void *argument)
{
cdoInitialize(argument);
parse_param_t parse_arg;
parseParamType parse_arg;
void *scanner;
int yy_scan_string(const char *str, void *scanner);
......
......@@ -59,16 +59,16 @@ enum {FT_STD, FT_CONST, FT_FLD, FT_VERT, FT_COORD, FT_1C, FT_0};
#define MVCOMPAND(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPAND(x,y))
#define MVCOMPOR(x,y) (DBL_IS_EQUAL((x),missval1) ? missval1 : COMPOR(x,y))
static double f_float(double x) { return (float)(x); }
static double f_int(double x) { return (int)(x); }
static double f_nint(double x) { return round(x); }
static double f_sqr(double x) { return x*x; }
static double f_rad(double x) { return x*M_PI/180.; }
static double f_deg(double x) { return x*180./M_PI; }
static double pt_ngp(paramType *p) { return p->ngp; }
static double pt_nlev(paramType *p) { return p->nlev; }
static double pt_size(paramType *p) { return p->ngp*p->nlev; }
static double pt_missval(paramType *p) { return p->missval; }
static double f_float(double x) { return (float)(x); }
static double f_int(double x) { return (int)(x); }
static double f_nint(double x) { return round(x); }
static double f_sqr(double x) { return x*x; }
static double f_rad(double x) { return x*M_PI/180.; }
static double f_deg(double x) { return x*180./M_PI; }
static double pt_ngp(paramType *p) { return p->ngp; }
static double pt_nlev(paramType *p) { return p->nlev; }
static double pt_size(paramType *p) { return p->ngp*p->nlev; }
static double pt_missval(paramType *p) { return p->missval; }
static double ts_ctimestep(double *data) { return lround(data[0]); }
static double ts_cdate(double *data) { return lround(data[1]); }
static double ts_ctime(double *data) { return lround(data[2]); }
......@@ -980,7 +980,7 @@ size_t get_levidx(size_t nlev, const double *data, double value, const char *fun
}
static
nodeType *fun1c(int init, int funcID, nodeType *p1, double value, parse_param_t *parse_arg)
nodeType *fun1c(int init, int funcID, nodeType *p1, double value, parseParamType *parse_arg)
{
const char *funcname = fun_sym_tbl[funcID].name;
if ( p1->type != typeVar ) cdoAbort("Parameter of function %s() needs to be a variable!", funcname);
......@@ -1066,7 +1066,7 @@ nodeType *fun1c(int init, int funcID, nodeType *p1, double value, parse_param_t
}
static
nodeType *coord_fun(int init, int funcID, nodeType *p1, parse_param_t *parse_arg)
nodeType *coord_fun(int init, int funcID, nodeType *p1, parseParamType *parse_arg)
{
const char *funcname = fun_sym_tbl[funcID].name;
if ( p1->type != typeVar ) cdoAbort("Parameter of function %s() needs to be a variable!", funcname);
......@@ -1423,7 +1423,7 @@ nodeType *ex_ifelse(int init, nodeType *p1, nodeType *p2, nodeType *p3)
}
/*
static
int exNode(nodeType *p, parse_param_t *parse_arg)
int exNode(nodeType *p, parseParamType *parse_arg)
{
if ( ! p ) return 0;
......@@ -1457,7 +1457,7 @@ int param_search_name(int nparam, paramType *params, const char *name)
}
nodeType *expr_run(nodeType *p, parse_param_t *parse_arg)
nodeType *expr_run(nodeType *p, parseParamType *parse_arg)
{
pointID = parse_arg->pointID;
surfaceID = parse_arg->surfaceID;
......
......@@ -24,7 +24,6 @@ int fileno(FILE *stream);
extern int CDO_parser_errorno;
typedef enum { typeCon, typeVar, typeFun, typeFun1c, typeOpr, typeCom } nodeEnum;
// commands
......@@ -129,7 +128,7 @@ typedef struct {
int surfaceID;
coordType *coords;
paramType *params;
} parse_param_t;
} parseParamType;
typedef union{
......@@ -137,22 +136,22 @@ typedef union{
char *varnm; // variable name
char *fname; // function name
nodeType *nPtr; // node pointer
} stype_t;
} yysType;
#define YYSTYPE stype_t
#define YY_EXTRA_TYPE parse_param_t *
#define YYSTYPE yysType
#define YY_EXTRA_TYPE parseParamType *
#define YY_DECL int yylex(YYSTYPE *yylval_param, parse_param_t *parse_arg, void *yyscanner)
#define YY_DECL int yylex(YYSTYPE *yylval_param, parseParamType *parse_arg, void *yyscanner)
YY_DECL;
int yyparse(parse_param_t *parse_arg, void*);
int yyparse(parseParamType *parse_arg, void*);
void yyerror(void *parse_arg, void *scanner, const char *errstr);
int yylex_init(void **);
int yylex_destroy(void *);
void yyset_extra(YY_EXTRA_TYPE, void *);
nodeType *expr_run(nodeType *p, parse_param_t *parse_arg);
int params_get_coordID(parse_param_t *parse_arg, int coord, int cdiID);
nodeType *expr_run(nodeType *p, parseParamType *parse_arg);
int params_get_coordID(parseParamType *parse_arg, int coord, int cdiID);
......@@ -76,7 +76,7 @@
/* Bison manual p. 60 describes how to call yyparse() with arguments */
/* #define YYPARSE_PARAM parse_arg */
/* #define YYLEX_PARAM ((parse_param_t *) parse_arg, void *yyscanner) */
/* #define YYLEX_PARAM ((parseParamType *) parse_arg, void *yyscanner) */
/* #define YYPURE 1 *//* ??? */
......@@ -171,7 +171,7 @@ extern int yydebug;
int yyparse (parse_param_t *parse_arg, void *scanner);
int yyparse (parseParamType *parse_arg, void *scanner);
#endif /* !YY_YY_EXPR_YACC_HH_INCLUDED */
......@@ -724,7 +724,7 @@ do { \
`----------------------------------------*/
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parse_param_t *parse_arg, void *scanner)
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parseParamType *parse_arg, void *scanner)
{
FILE *yyo = yyoutput;
YYUSE (yyo);
......@@ -745,7 +745,7 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue
`--------------------------------*/
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parse_param_t *parse_arg, void *scanner)
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parseParamType *parse_arg, void *scanner)
{
YYFPRINTF (yyoutput, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
......@@ -783,7 +783,7 @@ do { \
`------------------------------------------------*/
static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parse_param_t *parse_arg, void *scanner)
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parseParamType *parse_arg, void *scanner)
{
unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
......@@ -1063,7 +1063,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
`-----------------------------------------------*/
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parse_param_t *parse_arg, void *scanner)
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parseParamType *parse_arg, void *scanner)
{
YYUSE (yyvaluep);
YYUSE (parse_arg);
......@@ -1085,7 +1085,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parse_param_t *par
`----------*/
int
yyparse (parse_param_t *parse_arg, void *scanner)
yyparse (parseParamType *parse_arg, void *scanner)
{
/* The lookahead symbol. */
int yychar;
......@@ -1340,7 +1340,7 @@ yyreduce:
case 3:
#line 65 "expr_yacc.y" /* yacc.c:1646 */
{ expr_run((yyvsp[0].nPtr), (parse_param_t *) parse_arg); freeNode((yyvsp[0].nPtr)); }
{ expr_run((yyvsp[0].nPtr), (parseParamType *) parse_arg); freeNode((yyvsp[0].nPtr)); }
#line 1345 "expr_yacc.cc" /* yacc.c:1646 */
break;
......@@ -1932,7 +1932,7 @@ int main(void)
void *scanner;
int yy_scan_string(const char *str, void *scanner);
parse_param_t parse_arg;
parseParamType parse_arg;
printf("%s\n", fexpr);
......
......@@ -89,6 +89,6 @@ extern int yydebug;
int yyparse (parse_param_t *parse_arg, void *scanner);
int yyparse (parseParamType *parse_arg, void *scanner);
#endif /* !YY_YY_EXPR_YACC_HH_INCLUDED */
......@@ -14,7 +14,7 @@
/* Bison manual p. 60 describes how to call yyparse() with arguments */
/* #define YYPARSE_PARAM parse_arg */
/* #define YYLEX_PARAM ((parse_param_t *) parse_arg, void *yyscanner) */
/* #define YYLEX_PARAM ((parseParamType *) parse_arg, void *yyscanner) */
/* #define YYPURE 1 *//* ??? */
......@@ -33,9 +33,9 @@ void freeNode(nodeType *p);
%pure-parser
%define parse.error verbose
%parse-param {parse_param_t *parse_arg}
%parse-param {parseParamType *parse_arg}
%parse-param {void *scanner}
%lex-param {parse_param_t *parse_arg}
%lex-param {parseParamType *parse_arg}
%lex-param {yyscan_t *scanner}
......@@ -62,7 +62,7 @@ program:
;
function:
function stmt { expr_run($2, (parse_param_t *) parse_arg); freeNode($2); }
function stmt { expr_run($2, (parseParamType *) parse_arg); freeNode($2); }
| /* NULL */
;
......@@ -260,7 +260,7 @@ int main(void)
void *scanner;
int yy_scan_string(const char *str, void *scanner);
parse_param_t parse_arg;
parseParamType parse_arg;
printf("%s\n", fexpr);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment