32 #ifndef _QORE_PARSENODE_H 34 #define _QORE_PARSENODE_H 36 #include "qore/intern/WeakReferenceNode.h" 40 const QoreProgramLocation* loc;
44 ParseNode&
operator=(
const ParseNode&) =
delete;
51 bool effect_as_root : 1;
59 DLLLOCAL
virtual void parseInitImpl(
QoreValue& val, LocalVar* oflag,
int pflag,
int& lvids,
const QoreTypeInfo*& typeInfo) = 0;
61 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
64 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval =
true) :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_needs_eval), ref_rv(true), parse_init(false) {
65 effect_as_root = effect;
67 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval,
bool n_effect) :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_effect), ref_rv(true), parse_init(false) {
68 effect_as_root = effect;
70 DLLLOCAL ParseNode(
const ParseNode& old) :
SimpleQoreNode(old.
type, false, old.
needs_eval_flag), loc(old.loc), effect(old.effect), ref_rv(old.ref_rv), parse_init(false) {
71 effect_as_root = effect;
86 DLLLOCAL
void set_effect(
bool n_effect) {
89 DLLLOCAL
bool has_effect()
const {
92 DLLLOCAL
void set_effect_as_root(
bool n_effect) {
93 effect_as_root = n_effect;
95 DLLLOCAL
bool has_effect_as_root()
const {
96 return effect_as_root;
98 DLLLOCAL
void ignore_rv() {
101 DLLLOCAL
bool need_rv()
const {
105 DLLLOCAL
virtual void parseInit(
QoreValue& val, LocalVar* oflag,
int pflag,
int& lvids,
const QoreTypeInfo*& typeInfo) {
107 typeInfo = getTypeInfo();
111 parseInitImpl(val, oflag, pflag, lvids, typeInfo);
117 class ParseNoEvalNode :
public ParseNode {
120 DLLLOCAL ParseNoEvalNode& operator=(
const ParseNoEvalNode&);
122 DLLLOCAL
virtual void parseInitImpl(
QoreValue& val, LocalVar* oflag,
int pflag,
int& lvids,
const QoreTypeInfo*& typeInfo) = 0;
123 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
132 DLLLOCAL ParseNoEvalNode(
const QoreProgramLocation* loc,
qore_type_t t) : ParseNode(loc, t, false) {
135 DLLLOCAL ParseNoEvalNode(
const ParseNoEvalNode& old) : ParseNode(old) {
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:54
virtual DLLLOCAL void parseInit(QoreValue &val, LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
for use by parse types to initialize them for execution during stage 1 parsing; not exported in the l...
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const =0
tests for equality ("deep compare" including all contained values for container types) without type c...
bool needs_eval_flag
if this is true then the type can be evaluated
Definition: AbstractQoreNode.h:327
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:262
virtual DLLEXPORT AbstractQoreNode * realCopy() const =0
returns a copy of the object; the caller owns the reference count
The base class for all types in Qore expression trees that cannot throw an exception when deleted...
Definition: AbstractQoreNode.h:346
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:46
SimpleQoreNode & operator=(const SimpleQoreNode &)=delete
this function is not implemented
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:70
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const =0
tests for equality ("deep compare" including all contained values for container types) with possible ...
qore_type_t type
the type of the object
Definition: AbstractQoreNode.h:321