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) {