1 #ifndef AMREX_PARSER_EXE_H_
2 #define AMREX_PARSER_EXE_H_
3 #include <AMReX_Config.H>
11 #ifndef AMREX_PARSER_STACK_SIZE
12 #define AMREX_PARSER_STACK_SIZE 16
15 #define AMREX_PARSER_LOCAL_IDX0 1000
16 #define AMREX_PARSER_GET_DATA(i) ((i)<1000) ? x[i] : pstack[(i)-1000]
246 double b = pstack.
top();
254 double b = pstack.
top();
262 double b = pstack.
top();
264 pstack.
top() =
b - pstack.
top();
270 double b = pstack.
top();
278 double v = pstack.
top();
286 double v = pstack.
top();
288 pstack.
top() = v / pstack.
top();
300 double v = pstack.
top();
308 double v = pstack.
top();
441 pstack.
top() = d / pstack.
top();
448 double& d = pstack.
top();
455 double& d = pstack.
top();
482 double cond = pstack.
top();
504 int& max_stack_size,
int& stack_size, Vector<char const*>& local_variables);
511 std::size_t exe_size = 0;
516 stack_size -=
static_cast<int>(local_variables.
size())+1;
520 inline Vector<char const*>
523 std::size_t exe_size = 0;
524 int max_stack_size = 0;
529 return local_variables;
#define AMREX_ALWAYS_ASSERT_WITH_MESSAGE(EX, MSG)
Definition: AMReX_BLassert.H:49
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Array4< int const > offset
Definition: AMReX_HypreMLABecLap.cpp:1089
#define AMREX_PARSER_GET_DATA(i)
Definition: AMReX_Parser_Exe.H:16
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
Long size() const noexcept
Definition: AMReX_Vector.H:50
@ max
Definition: AMReX_ParallelReduce.H:17
Definition: AMReX_Amr.cpp:49
parser_f2_t
Definition: AMReX_Parser_Y.H:81
parser_exe_t
Definition: AMReX_Parser_Exe.H:24
@ PARSER_EXE_SUB_VP
Definition: AMReX_Parser_Exe.H:38
@ PARSER_EXE_POWI
Definition: AMReX_Parser_Exe.H:54
@ PARSER_EXE_ADD_VN
Definition: AMReX_Parser_Exe.H:45
@ PARSER_EXE_NUMBER
Definition: AMReX_Parser_Exe.H:26
@ PARSER_EXE_SYMBOL
Definition: AMReX_Parser_Exe.H:27
@ PARSER_EXE_DIV_B
Definition: AMReX_Parser_Exe.H:33
@ PARSER_EXE_DIV_VN
Definition: AMReX_Parser_Exe.H:48
@ PARSER_EXE_F2_B
Definition: AMReX_Parser_Exe.H:36
@ PARSER_EXE_SUB_F
Definition: AMReX_Parser_Exe.H:29
@ PARSER_EXE_SUB_VN
Definition: AMReX_Parser_Exe.H:46
@ PARSER_EXE_SQUARE
Definition: AMReX_Parser_Exe.H:53
@ PARSER_EXE_F2_F
Definition: AMReX_Parser_Exe.H:35
@ PARSER_EXE_ADD
Definition: AMReX_Parser_Exe.H:28
@ PARSER_EXE_DIV_PN
Definition: AMReX_Parser_Exe.H:52
@ PARSER_EXE_ADD_VP
Definition: AMReX_Parser_Exe.H:37
@ PARSER_EXE_MUL_PP
Definition: AMReX_Parser_Exe.H:43
@ PARSER_EXE_SUB_PN
Definition: AMReX_Parser_Exe.H:50
@ PARSER_EXE_MUL_VN
Definition: AMReX_Parser_Exe.H:47
@ PARSER_EXE_ADD_PN
Definition: AMReX_Parser_Exe.H:49
@ PARSER_EXE_JUMP
Definition: AMReX_Parser_Exe.H:56
@ PARSER_EXE_ADD_PP
Definition: AMReX_Parser_Exe.H:41
@ PARSER_EXE_MUL_PN
Definition: AMReX_Parser_Exe.H:51
@ PARSER_EXE_MUL
Definition: AMReX_Parser_Exe.H:31
@ PARSER_EXE_MUL_VP
Definition: AMReX_Parser_Exe.H:39
@ PARSER_EXE_SUB_B
Definition: AMReX_Parser_Exe.H:30
@ PARSER_EXE_NULL
Definition: AMReX_Parser_Exe.H:25
@ PARSER_EXE_F1
Definition: AMReX_Parser_Exe.H:34
@ PARSER_EXE_DIV_F
Definition: AMReX_Parser_Exe.H:32
@ PARSER_EXE_IF
Definition: AMReX_Parser_Exe.H:55
@ PARSER_EXE_DIV_VP
Definition: AMReX_Parser_Exe.H:40
@ PARSER_EXE_SUB_PP
Definition: AMReX_Parser_Exe.H:42
@ PARSER_EXE_DIV_PP
Definition: AMReX_Parser_Exe.H:44
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE double parser_call_f1(enum parser_f1_t type, double a)
Definition: AMReX_Parser_Y.H:421
void parser_ast_sort(struct parser_node *node)
Definition: AMReX_Parser_Y.cpp:1456
parser_f1_t
Definition: AMReX_Parser_Y.H:24
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE double parser_call_f2(enum parser_f2_t type, double a, double b)
Definition: AMReX_Parser_Y.H:453
void parser_compile_exe_size(struct parser_node *node, char *&p, std::size_t &exe_size, int &max_stack_size, int &stack_size, Vector< char const * > &local_variables)
Definition: AMReX_Parser_Exe.cpp:7
std::size_t parser_exe_size(struct amrex_parser *parser, int &max_stack_size, int &stack_size)
Definition: AMReX_Parser_Exe.H:507
void parser_exe_print(char const *p, Vector< std::string > const &vars, Vector< char const * > const &locals)
Definition: AMReX_Parser_Exe.cpp:641
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE double parser_exe_eval(const char *p, double const *x)
Definition: AMReX_Parser_Exe.H:222
Vector< char const * > parser_compile(struct amrex_parser *parser, char *p)
Definition: AMReX_Parser_Exe.H:521
Definition: AMReX_Parser_Exe.H:180
int i
Definition: AMReX_Parser_Exe.H:182
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:181
Definition: AMReX_Parser_Exe.H:136
int i1
Definition: AMReX_Parser_Exe.H:138
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:137
int i2
Definition: AMReX_Parser_Exe.H:139
Definition: AMReX_Parser_Exe.H:160
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:161
double v
Definition: AMReX_Parser_Exe.H:162
Definition: AMReX_Parser_Exe.H:112
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:113
double v
Definition: AMReX_Parser_Exe.H:115
int i
Definition: AMReX_Parser_Exe.H:114
Definition: AMReX_Parser_Exe.H:73
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:74
Definition: AMReX_Parser_Exe.H:93
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:94
Definition: AMReX_Parser_Exe.H:89
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:90
Definition: AMReX_Parser_Exe.H:196
bool reverse
Definition: AMReX_Parser_Exe.H:199
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:197
int i
Definition: AMReX_Parser_Exe.H:198
Definition: AMReX_Parser_Exe.H:154
int i2
Definition: AMReX_Parser_Exe.H:157
int i1
Definition: AMReX_Parser_Exe.H:156
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:155
Definition: AMReX_Parser_Exe.H:175
double v
Definition: AMReX_Parser_Exe.H:177
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:176
Definition: AMReX_Parser_Exe.H:130
double v
Definition: AMReX_Parser_Exe.H:133
int i
Definition: AMReX_Parser_Exe.H:132
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:131
Definition: AMReX_Parser_Exe.H:97
parser_f1_t ftype
Definition: AMReX_Parser_Exe.H:99
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:98
Definition: AMReX_Parser_Exe.H:107
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:108
parser_f2_t ftype
Definition: AMReX_Parser_Exe.H:109
Definition: AMReX_Parser_Exe.H:102
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:103
parser_f2_t ftype
Definition: AMReX_Parser_Exe.H:104
Definition: AMReX_Parser_Exe.H:211
int offset
Definition: AMReX_Parser_Exe.H:213
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:212
Definition: AMReX_Parser_Exe.H:216
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:217
int offset
Definition: AMReX_Parser_Exe.H:218
Definition: AMReX_Parser_Exe.H:191
int i
Definition: AMReX_Parser_Exe.H:193
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:192
Definition: AMReX_Parser_Exe.H:148
int i1
Definition: AMReX_Parser_Exe.H:150
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:149
int i2
Definition: AMReX_Parser_Exe.H:151
Definition: AMReX_Parser_Exe.H:170
double v
Definition: AMReX_Parser_Exe.H:172
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:171
Definition: AMReX_Parser_Exe.H:124
double v
Definition: AMReX_Parser_Exe.H:127
int i
Definition: AMReX_Parser_Exe.H:126
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:125
Definition: AMReX_Parser_Exe.H:85
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:86
Definition: AMReX_Parser_Exe.H:59
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:60
Definition: AMReX_Parser_Exe.H:63
double v
Definition: AMReX_Parser_Exe.H:65
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:64
Definition: AMReX_Parser_Exe.H:206
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:207
int i
Definition: AMReX_Parser_Exe.H:208
Definition: AMReX_Parser_Exe.H:81
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:82
Definition: AMReX_Parser_Exe.H:77
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:78
Definition: AMReX_Parser_Exe.H:185
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:186
double sign
Definition: AMReX_Parser_Exe.H:188
int i
Definition: AMReX_Parser_Exe.H:187
Definition: AMReX_Parser_Exe.H:142
int i1
Definition: AMReX_Parser_Exe.H:144
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:143
int i2
Definition: AMReX_Parser_Exe.H:145
Definition: AMReX_Parser_Exe.H:165
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:166
double v
Definition: AMReX_Parser_Exe.H:167
Definition: AMReX_Parser_Exe.H:118
double v
Definition: AMReX_Parser_Exe.H:121
int i
Definition: AMReX_Parser_Exe.H:120
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:119
Definition: AMReX_Parser_Exe.H:202
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:203
Definition: AMReX_Parser_Exe.H:68
enum parser_exe_t type
Definition: AMReX_Parser_Exe.H:69
int i
Definition: AMReX_Parser_Exe.H:70
Definition: AMReX_Stack.H:8
constexpr void push(T v)
Definition: AMReX_Stack.H:10
constexpr void pop()
Definition: AMReX_Stack.H:11
constexpr T const & top() const
Definition: AMReX_Stack.H:14
Definition: AMReX_Parser_Y.H:257
struct parser_node * ast
Definition: AMReX_Parser_Y.H:260