2015-03-03 03:21:41 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pgbench.h
|
|
|
|
*
|
2015-03-30 01:06:59 +08:00
|
|
|
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
|
2015-03-03 03:21:41 +08:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PGBENCH_H
|
|
|
|
#define PGBENCH_H
|
|
|
|
|
|
|
|
typedef enum PgBenchExprType
|
|
|
|
{
|
|
|
|
ENODE_INTEGER_CONSTANT,
|
|
|
|
ENODE_VARIABLE,
|
|
|
|
ENODE_OPERATOR
|
|
|
|
} PgBenchExprType;
|
|
|
|
|
|
|
|
typedef struct PgBenchExpr PgBenchExpr;
|
|
|
|
|
|
|
|
struct PgBenchExpr
|
|
|
|
{
|
|
|
|
PgBenchExprType etype;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int64 ival;
|
|
|
|
} integer_constant;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char *varname;
|
|
|
|
} variable;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char operator;
|
|
|
|
PgBenchExpr *lexpr;
|
|
|
|
PgBenchExpr *rexpr;
|
|
|
|
} operator;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern PgBenchExpr *expr_parse_result;
|
|
|
|
|
|
|
|
extern int expr_yyparse(void);
|
|
|
|
extern int expr_yylex(void);
|
|
|
|
extern void expr_yyerror(const char *str);
|
2015-04-03 04:26:49 +08:00
|
|
|
extern void expr_scanner_init(const char *str, const char *source,
|
|
|
|
const int lineno, const char *line,
|
|
|
|
const char *cmd, const int ecol);
|
|
|
|
extern void syntax_error(const char* source, const int lineno, const char* line,
|
|
|
|
const char* cmd, const char* msg, const char* more,
|
|
|
|
const int col);
|
2015-03-03 03:21:41 +08:00
|
|
|
extern void expr_scanner_finish(void);
|
|
|
|
|
|
|
|
extern int64 strtoint64(const char *str);
|
|
|
|
|
2015-03-30 01:06:59 +08:00
|
|
|
#endif /* PGBENCH_H */
|