Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
adf05b84
Commit
adf05b84
authored
Jan 18, 2018
by
Uwe Schulzweida
Browse files
Renamed parse_param_t to parseParamType.
parent
1069e013
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/Exprf.cc
View file @
adf05b84
...
...
@@ -209,7 +209,7 @@ paramType *params_new(int vlistID)
}
static
void
params_add_coord
(
parse
_p
aram
_t
*
parse_arg
,
int
coord
,
int
cdiID
,
size_t
size
,
const
char
*
units
,
const
char
*
longname
)
void
params_add_coord
(
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
int
coord
,
int
cdiID
)
int
params_get_coordID
(
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
)
void
params_add_coordinates
(
int
vlistID
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
)
int
params_add_ts
(
parse
P
aram
Type
*
parse_arg
)
{
int
varID
=
-
1
;
paramType
*
params
=
parse_arg
->
params
;
...
...
@@ -320,7 +320,7 @@ void *Expr(void *argument)
{
cdoInitialize
(
argument
);
parse
_p
aram
_t
parse_arg
;
parse
P
aram
Type
parse_arg
;
void
*
scanner
;
int
yy_scan_string
(
const
char
*
str
,
void
*
scanner
);
...
...
src/expr.cc
View file @
adf05b84
...
...
@@ -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
_p
aram
_t
*
parse_arg
)
nodeType
*
fun1c
(
int
init
,
int
funcID
,
nodeType
*
p1
,
double
value
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
)
nodeType
*
coord_fun
(
int
init
,
int
funcID
,
nodeType
*
p1
,
parse
P
aram
Type
*
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
_p
aram
_t
*parse_arg)
int exNode(nodeType *p, parse
P
aram
Type
*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
_p
aram
_t
*
parse_arg
)
nodeType
*
expr_run
(
nodeType
*
p
,
parse
P
aram
Type
*
parse_arg
)
{
pointID
=
parse_arg
->
pointID
;
surfaceID
=
parse_arg
->
surfaceID
;
...
...
src/expr.h
View file @
adf05b84
...
...
@@ -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
_p
aram
_t
;
}
parse
P
aram
Type
;
typedef
union
{
...
...
@@ -137,22 +136,22 @@ typedef union{
char
*
varnm
;
// variable name
char
*
fname
;
// function name
nodeType
*
nPtr
;
// node pointer
}
st
ype
_t
;
}
yysT
ype
;
#define YYSTYPE
st
ype
_t
#define YY_EXTRA_TYPE parse
_p
aram
_t
*
#define YYSTYPE
yysT
ype
#define YY_EXTRA_TYPE parse
P
aram
Type
*
#define YY_DECL int yylex(YYSTYPE *yylval_param, parse
_p
aram
_t
*parse_arg, void *yyscanner)
#define YY_DECL int yylex(YYSTYPE *yylval_param, parse
P
aram
Type
*parse_arg, void *yyscanner)
YY_DECL
;
int
yyparse
(
parse
_p
aram
_t
*
parse_arg
,
void
*
);
int
yyparse
(
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
);
int
params_get_coordID
(
parse
_p
aram
_t
*
parse_arg
,
int
coord
,
int
cdiID
);
nodeType
*
expr_run
(
nodeType
*
p
,
parse
P
aram
Type
*
parse_arg
);
int
params_get_coordID
(
parse
P
aram
Type
*
parse_arg
,
int
coord
,
int
cdiID
);
src/expr_yacc.cc
View file @
adf05b84
...
...
@@ -76,7 +76,7 @@
/* Bison manual p. 60 describes how to call yyparse() with arguments */
/* #define YYPARSE_PARAM parse_arg */
/* #define YYLEX_PARAM ((parse
_p
aram
_t
*) parse_arg, void *yyscanner) */
/* #define YYLEX_PARAM ((parse
P
aram
Type
*) parse_arg, void *yyscanner) */
/* #define YYPURE 1 *//* ??? */
...
...
@@ -171,7 +171,7 @@ extern int yydebug;
int
yyparse
(
parse
_p
aram
_t
*
parse_arg
,
void
*
scanner
);
int
yyparse
(
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
void
*
scanner
)
yy_symbol_value_print
(
FILE
*
yyoutput
,
int
yytype
,
YYSTYPE
const
*
const
yyvaluep
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
void
*
scanner
)
yy_symbol_print
(
FILE
*
yyoutput
,
int
yytype
,
YYSTYPE
const
*
const
yyvaluep
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
void
*
scanner
)
yy_reduce_print
(
yytype_int16
*
yyssp
,
YYSTYPE
*
yyvsp
,
int
yyrule
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
void
*
scanner
)
yydestruct
(
const
char
*
yymsg
,
int
yytype
,
YYSTYPE
*
yyvaluep
,
parse
P
aram
Type
*
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
_p
aram
_t
*
parse_arg
,
void
*
scanner
)
yyparse
(
parse
P
aram
Type
*
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
_p
aram
_t
*
)
parse_arg
);
freeNode
((
yyvsp
[
0
].
nPtr
));
}
{
expr_run
((
yyvsp
[
0
].
nPtr
),
(
parse
P
aram
Type
*
)
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
_p
aram
_t
parse_arg;
parse
P
aram
Type
parse_arg;
printf("%s\n", fexpr);
...
...
src/expr_yacc.h
View file @
adf05b84
...
...
@@ -89,6 +89,6 @@ extern int yydebug;
int
yyparse
(
parse
_p
aram
_t
*
parse_arg
,
void
*
scanner
);
int
yyparse
(
parse
P
aram
Type
*
parse_arg
,
void
*
scanner
);
#endif
/* !YY_YY_EXPR_YACC_HH_INCLUDED */
src/expr_yacc.y
View file @
adf05b84
...
...
@@ -14,7 +14,7 @@
/* Bison manual p. 60 describes how to call yyparse() with arguments */
/* #define YYPARSE_PARAM parse_arg */
/* #define YYLEX_PARAM ((parse
_p
aram
_t
*) parse_arg, void *yyscanner) */
/* #define YYLEX_PARAM ((parse
P
aram
Type
*) parse_arg, void *yyscanner) */
/* #define YYPURE 1 *//* ??? */
...
...
@@ -33,9 +33,9 @@ void freeNode(nodeType *p);
%pure-parser
%define parse.error verbose
%parse-param {parse
_p
aram
_t
*parse_arg}
%parse-param {parse
P
aram
Type
*parse_arg}
%parse-param {void *scanner}
%lex-param {parse
_p
aram
_t
*parse_arg}
%lex-param {parse
P
aram
Type
*parse_arg}
%lex-param {yyscan_t *scanner}
...
...
@@ -62,7 +62,7 @@ program:
;
function:
function stmt { expr_run($2, (parse
_p
aram
_t
*) parse_arg); freeNode($2); }
function stmt { expr_run($2, (parse
P
aram
Type
*) parse_arg); freeNode($2); }
| /* NULL */
;
...
...
@@ -260,7 +260,7 @@ int main(void)
void *scanner;
int yy_scan_string(const char *str, void *scanner);
parse
_p
aram
_t
parse_arg;
parse
P
aram
Type
parse_arg;
printf("%s\n", fexpr);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment