#include "squid.h"
#include "debug/Stream.h"
#include "esi/Esi.h"
#include "esi/Expression.h"
#include <cerrno>
#include <cmath>
Go to the source code of this file.
Classes | |
struct | _stackmember |
union | _stackmember::Value |
Typedefs | |
typedef struct _stackmember | stackmember |
typedef int | evaluate(stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
Enumerations | |
enum | evaltype { ESI_EXPR_INVALID , ESI_EXPR_LITERAL , ESI_EXPR_OR , ESI_EXPR_AND , ESI_EXPR_NOT , ESI_EXPR_START , ESI_EXPR_END , ESI_EXPR_EQ , ESI_EXPR_NOTEQ , ESI_EXPR_LESS , ESI_EXPR_LESSEQ , ESI_EXPR_MORE , ESI_EXPR_MOREEQ , ESI_EXPR_EXPR } |
enum | literalhint { ESI_LITERAL_STRING , ESI_LITERAL_FLOAT , ESI_LITERAL_INT , ESI_LITERAL_BOOL , ESI_LITERAL_INVALID } |
Functions | |
static void | cleanmember (stackmember *) |
static void | stackpop (stackmember *s, int *depth) |
static void | stackpush (stackmember *stack, stackmember &item, int *depth) |
static void | dumpstack (stackmember *stack, int depth) |
static int | addmember (stackmember *stack, int *stackdepth, stackmember *candidate) |
static int | membercompare (stackmember a, stackmember b) |
static char const * | trim (char const *s) |
static stackmember | getsymbol (const char *s, char const **endptr) |
int | evalnegate (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalliteral (stackmember *, int *, int, stackmember *) |
int | evalexpr (stackmember *, int *, int, stackmember *) |
int | evalor (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evaland (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evallesseq (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evallessthan (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalmoreeq (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalmorethan (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalequals (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalnotequals (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalstartexpr (stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
int | evalendexpr (stackmember *, int *, int, stackmember *) |
static void | printLiteral (std::ostream &os, const stackmember &s) |
static std::ostream & | operator<< (std::ostream &os, const stackmember &s) |
Variables | |
static evaluate | evalnegate |
static evaluate | evalliteral |
static evaluate | evalor |
static evaluate | evaland |
static evaluate | evallesseq |
static evaluate | evallessthan |
static evaluate | evalmoreeq |
static evaluate | evalmorethan |
static evaluate | evalequals |
static evaluate | evalnotequals |
static evaluate | evalstartexpr |
static evaluate | evalendexpr |
static evaluate | evalexpr |
Typedef Documentation
◆ evaluate
typedef int evaluate(stackmember *stack, int *depth, int whereAmI, stackmember *candidate) |
Definition at line 37 of file Expression.cc.
◆ stackmember
typedef struct _stackmember stackmember |
Definition at line 35 of file Expression.cc.
Enumeration Type Documentation
◆ evaltype
enum evaltype |
Definition at line 40 of file Expression.cc.
◆ literalhint
enum literalhint |
Enumerator | |
---|---|
ESI_LITERAL_STRING | |
ESI_LITERAL_FLOAT | |
ESI_LITERAL_INT | |
ESI_LITERAL_BOOL | |
ESI_LITERAL_INVALID |
Definition at line 57 of file Expression.cc.
Function Documentation
◆ addmember()
|
static |
Definition at line 967 of file Expression.cc.
References cleanmember(), DBG_IMPORTANT, debugs, dumpstack(), Esi::Error(), ESI_EXPR_INVALID, ESI_EXPR_LITERAL, ESI_STACK_DEPTH_LIMIT, _stackmember::precedence, stackpush(), and _stackmember::valuetype.
Referenced by evaland(), evalequals(), evallesseq(), evallessthan(), evalmoreeq(), evalmorethan(), evalnotequals(), evalor(), and ESIExpression::Evaluate().
◆ cleanmember()
|
static |
Definition at line 82 of file Expression.cc.
References ESI_EXPR_LITERAL, ESI_LITERAL_STRING, safe_free, _stackmember::Value::string, _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
Referenced by addmember(), evalnegate(), evalstartexpr(), and stackpop().
◆ dumpstack()
|
static |
◆ evaland()
int evaland | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 311 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalendexpr()
int evalendexpr | ( | stackmember * | , |
int * | , | ||
int | , | ||
stackmember * | |||
) |
Definition at line 667 of file Expression.cc.
◆ evalequals()
int evalequals | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 550 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalexpr()
int evalexpr | ( | stackmember * | , |
int * | , | ||
int | , | ||
stackmember * | |||
) |
Definition at line 256 of file Expression.cc.
References DBG_IMPORTANT, and debugs.
◆ evallesseq()
int evallesseq | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 358 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evallessthan()
int evallessthan | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 406 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalliteral()
int evalliteral | ( | stackmember * | , |
int * | , | ||
int | , | ||
stackmember * | |||
) |
Definition at line 248 of file Expression.cc.
References DBG_IMPORTANT, and debugs.
◆ evalmoreeq()
int evalmoreeq | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 454 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalmorethan()
int evalmorethan | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 502 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalnegate()
int evalnegate | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 217 of file Expression.cc.
References cleanmember(), Esi::Error(), ESI_EXPR_EXPR, ESI_STACK_DEPTH_LIMIT, _stackmember::Value::integral, and _stackmember::value.
◆ evalnotequals()
int evalnotequals | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 598 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalexpr, _stackmember::Value::integral, membercompare(), _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalor()
int evalor | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 264 of file Expression.cc.
References addmember(), ESI_EXPR_EXPR, ESI_LITERAL_BOOL, _stackmember::eval, evalliteral, _stackmember::Value::integral, _stackmember::precedence, stackpop(), stackpush(), _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
◆ evalstartexpr()
int evalstartexpr | ( | stackmember * | stack, |
int * | depth, | ||
int | whereAmI, | ||
stackmember * | candidate | ||
) |
Definition at line 645 of file Expression.cc.
References cleanmember(), ESI_EXPR_END, and _stackmember::valuetype.
◆ getsymbol()
|
static |
Definition at line 683 of file Expression.cc.
References DBG_IMPORTANT, debugs, ESI_EXPR_AND, ESI_EXPR_END, ESI_EXPR_EQ, ESI_EXPR_EXPR, ESI_EXPR_INVALID, ESI_EXPR_LESS, ESI_EXPR_LESSEQ, ESI_EXPR_LITERAL, ESI_EXPR_MORE, ESI_EXPR_MOREEQ, ESI_EXPR_NOT, ESI_EXPR_NOTEQ, ESI_EXPR_OR, ESI_EXPR_START, ESI_LITERAL_BOOL, ESI_LITERAL_FLOAT, ESI_LITERAL_INT, ESI_LITERAL_INVALID, ESI_LITERAL_STRING, _stackmember::eval, evaland, evalendexpr, evalequals, evalexpr, evallesseq, evallessthan, evalliteral, evalmoreeq, evalmorethan, evalnegate, evalnotequals, evalor, evalstartexpr, _stackmember::Value::floating, _stackmember::Value::integral, _stackmember::precedence, _stackmember::Value::string, trim(), _stackmember::value, _stackmember::valuestored, _stackmember::valuetype, xcalloc(), and xstrndup().
Referenced by ESIExpression::Evaluate().
◆ membercompare()
|
static |
Definition at line 138 of file Expression.cc.
References DBG_IMPORTANT, debugs, ESI_EXPR_EXPR, ESI_EXPR_LITERAL, ESI_LITERAL_FLOAT, ESI_LITERAL_INT, ESI_LITERAL_INVALID, ESI_LITERAL_STRING, _stackmember::Value::floating, _stackmember::Value::integral, _stackmember::Value::string, _stackmember::value, _stackmember::valuestored, and _stackmember::valuetype.
Referenced by evalequals(), evallesseq(), evallessthan(), evalmoreeq(), evalmorethan(), and evalnotequals().
◆ operator<<()
|
static |
Definition at line 890 of file Expression.cc.
References ESI_EXPR_AND, ESI_EXPR_END, ESI_EXPR_EQ, ESI_EXPR_EXPR, ESI_EXPR_INVALID, ESI_EXPR_LESS, ESI_EXPR_LESSEQ, ESI_EXPR_LITERAL, ESI_EXPR_MORE, ESI_EXPR_MOREEQ, ESI_EXPR_NOT, ESI_EXPR_NOTEQ, ESI_EXPR_OR, ESI_EXPR_START, _stackmember::Value::integral, printLiteral(), _stackmember::value, and _stackmember::valuetype.
◆ printLiteral()
|
static |
Definition at line 865 of file Expression.cc.
References ESI_LITERAL_BOOL, ESI_LITERAL_FLOAT, ESI_LITERAL_INT, ESI_LITERAL_INVALID, ESI_LITERAL_STRING, _stackmember::Value::floating, _stackmember::Value::integral, _stackmember::Value::string, _stackmember::value, and _stackmember::valuestored.
Referenced by operator<<().
◆ stackpop()
|
static |
Definition at line 93 of file Expression.cc.
References cleanmember().
Referenced by evaland(), evalequals(), evallesseq(), evallessthan(), evalmoreeq(), evalmorethan(), evalnotequals(), and evalor().
◆ stackpush()
|
static |
Definition at line 102 of file Expression.cc.
References Esi::Error(), and ESI_STACK_DEPTH_LIMIT.
Referenced by addmember(), evaland(), evalequals(), evallesseq(), evallessthan(), evalmoreeq(), evalmorethan(), evalnotequals(), and evalor().
◆ trim()
|
static |
Definition at line 674 of file Expression.cc.
Referenced by ClpMap< Key, Value, MemoryUsedBy >::add(), getsymbol(), and ClpMap< Key, Value, MemoryUsedBy >::setMemLimit().
Variable Documentation
◆ evaland
|
static |
Definition at line 115 of file Expression.cc.
Referenced by getsymbol().
◆ evalendexpr
|
static |
Definition at line 123 of file Expression.cc.
Referenced by getsymbol().
◆ evalequals
|
static |
Definition at line 120 of file Expression.cc.
Referenced by getsymbol().
◆ evalexpr
|
static |
Definition at line 124 of file Expression.cc.
Referenced by evaland(), evalequals(), evallesseq(), evallessthan(), evalmoreeq(), evalmorethan(), evalnotequals(), and getsymbol().
◆ evallesseq
|
static |
Definition at line 116 of file Expression.cc.
Referenced by getsymbol().
◆ evallessthan
|
static |
Definition at line 117 of file Expression.cc.
Referenced by getsymbol().
◆ evalliteral
|
static |
Definition at line 113 of file Expression.cc.
Referenced by evalor(), and getsymbol().
◆ evalmoreeq
|
static |
Definition at line 118 of file Expression.cc.
Referenced by getsymbol().
◆ evalmorethan
|
static |
Definition at line 119 of file Expression.cc.
Referenced by getsymbol().
◆ evalnegate
|
static |
Definition at line 112 of file Expression.cc.
Referenced by getsymbol().
◆ evalnotequals
|
static |
Definition at line 121 of file Expression.cc.
Referenced by getsymbol().
◆ evalor
|
static |
Definition at line 114 of file Expression.cc.
Referenced by getsymbol().
◆ evalstartexpr
|
static |
Definition at line 122 of file Expression.cc.
Referenced by getsymbol().