32#ifndef _QORE_PARSENODE_H
34#define _QORE_PARSENODE_H
36#include "qore/intern/WeakReferenceNode.h"
37#include "qore/intern/WeakHashReferenceNode.h"
38#include "qore/intern/WeakListReferenceNode.h"
42 const QoreProgramLocation* loc;
44 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval =
true)
45 :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_needs_eval), ref_rv(true),
47 effect_as_root = effect;
49 DLLLOCAL ParseNode(
const QoreProgramLocation* loc,
qore_type_t t,
bool n_needs_eval,
bool n_effect)
50 :
SimpleQoreNode(t, false, n_needs_eval), loc(loc), effect(n_effect), ref_rv(true), parse_init(false) {
51 effect_as_root = effect;
54 effect(old.effect), ref_rv(old.ref_rv), parse_init(false) {
55 effect_as_root = effect;
70 DLLLOCAL
void set_effect(
bool n_effect) {
73 DLLLOCAL
bool has_effect()
const {
76 DLLLOCAL
void set_effect_as_root(
bool n_effect) {
77 effect_as_root = n_effect;
79 DLLLOCAL
bool has_effect_as_root()
const {
80 return effect_as_root;
82 DLLLOCAL
void ignore_rv() {
85 DLLLOCAL
bool need_rv()
const {
89 DLLLOCAL
virtual int parseInit(
QoreValue& val, QoreParseContext& parse_context) {
91 parse_context.typeInfo = getTypeInfo();
95 return parseInitImpl(val, parse_context);
100 ParseNode&
operator=(
const ParseNode&) =
delete;
107 bool effect_as_root : 1;
115 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) = 0;
117 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
122class ParseNoEvalNode :
public ParseNode {
125 DLLLOCAL ParseNoEvalNode&
operator=(
const ParseNoEvalNode&);
127 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) = 0;
128 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const = 0;
137 DLLLOCAL ParseNoEvalNode(
const QoreProgramLocation* loc,
qore_type_t t) : ParseNode(loc, t, false) {
140 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:50
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:76
The main value class in Qore, designed to be passed by value.
Definition QoreValue.h:279