32 #ifndef _QORE_PARSENODE_H
34 #define _QORE_PARSENODE_H
36 #include "qore/intern/WeakReferenceNode.h"
40 const QoreProgramLocation* loc;
42 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval =
true)
43 :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_needs_eval), ref_rv(true),
45 effect_as_root = effect;
47 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval,
bool n_effect)
48 :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_effect), ref_rv(true), parse_init(false) {
49 effect_as_root = effect;
52 effect(old.effect), ref_rv(old.ref_rv), parse_init(false) {
53 effect_as_root = effect;
68 DLLLOCAL
void set_effect(
bool n_effect) {
71 DLLLOCAL
bool has_effect()
const {
74 DLLLOCAL
void set_effect_as_root(
bool n_effect) {
75 effect_as_root = n_effect;
77 DLLLOCAL
bool has_effect_as_root()
const {
78 return effect_as_root;
80 DLLLOCAL
void ignore_rv() {
83 DLLLOCAL
bool need_rv()
const {
87 DLLLOCAL
virtual int parseInit(
QoreValue& val, QoreParseContext& parse_context) {
89 parse_context.typeInfo = getTypeInfo();
93 return parseInitImpl(val, parse_context);
98 ParseNode&
operator=(
const ParseNode&) =
delete;
105 bool effect_as_root : 1;
113 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) = 0;
115 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
120 class ParseNoEvalNode :
public ParseNode {
123 DLLLOCAL ParseNoEvalNode&
operator=(
const ParseNoEvalNode&);
125 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) = 0;
126 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
135 DLLLOCAL ParseNoEvalNode(
const QoreProgramLocation* loc,
qore_type_t t) : ParseNode(loc, t, false) {
138 DLLLOCAL ParseNoEvalNode(
const ParseNoEvalNode& old) : ParseNode(old) {
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:57
bool needs_eval_flag
if this is true then the type can be evaluated
Definition: AbstractQoreNode.h:333
qore_type_t type
the type of the object
Definition: AbstractQoreNode.h:327
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
The base class for all types in Qore expression trees that cannot throw an exception when deleted.
Definition: AbstractQoreNode.h:352
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
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275