32 #ifndef _QORE_QOREPARSELISTNODE_H
34 #define _QORE_QOREPARSELISTNODE_H
43 class QoreParseListNode :
public ParseNode {
45 typedef std::deque<QoreValue> nvec_t;
47 DLLLOCAL QoreParseListNode(
const QoreProgramLocation* loc) : ParseNode(loc,
NT_PARSE_LIST, true) {
50 DLLLOCAL QoreParseListNode(
const QoreParseListNode& old,
ExceptionSink* xsink) : ParseNode(old),
51 vtype(old.vtype), typeInfo(old.typeInfo), finalized(old.finalized), vlist(old.vlist) {
52 for (
unsigned i = 0; i < old.values.size(); ++i) {
53 add(copy_value_and_resolve_lvar_refs(old.values[i], xsink), old.lvec[i]);
59 DLLLOCAL ~QoreParseListNode() {
60 for (
auto& i : values)
64 DLLLOCAL
void add(
QoreValue v,
const QoreProgramLocation* loc) {
69 if (v.
hasNode() && v.hasEffect()) {
72 }
else if (has_effect() && !v.hasEffect()) {
81 assert(vtypes.empty());
89 assert(i < values.size());
93 DLLLOCAL
const QoreValue get(
size_t i)
const {
94 assert(i < values.size());
98 DLLLOCAL
QoreValue& getReference(
size_t i) {
99 assert(i < values.size());
103 DLLLOCAL
const QoreProgramLocation* getLocation(
size_t i)
const {
104 assert(i < lvec.size());
114 DLLLOCAL
size_t size()
const {
115 return values.size();
118 DLLLOCAL
bool empty()
const {
119 return values.empty();
122 DLLLOCAL
void setFinalized() {
127 DLLLOCAL
bool isFinalized()
const {
131 DLLLOCAL
bool isVariableList()
const {
135 DLLLOCAL
void setVariableList() {
140 DLLLOCAL
void finalizeBlock(
int start_line,
int end_line);
142 DLLLOCAL nvec_t& getValues() {
146 DLLLOCAL
const nvec_t& getValues()
const {
150 DLLLOCAL
const type_vec_t& getValueTypes()
const {
154 DLLLOCAL QoreParseListNode* listRefSelf()
const {
156 return const_cast<QoreParseListNode*
>(
this);
165 DLLLOCAL
virtual const char* getTypeName()
const {
169 DLLLOCAL QoreParseListNode* copyBlank()
const {
170 QoreParseListNode* n =
new QoreParseListNode(loc);
173 n->finalized = finalized;
178 DLLLOCAL
int parseInitIntern(
bool& needs_eval, QoreParseContext& parse_context);
181 typedef std::deque<const QoreProgramLocation*> lvec_t;
186 const QoreTypeInfo* vtype =
nullptr;
188 const QoreTypeInfo* typeInfo;
190 bool finalized =
false;
194 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
198 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context);
DLLEXPORT void ref() const
increments the reference count
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:251
const qore_type_t NT_PARSE_LIST
type value for QoreParseListNode
Definition: node_types.h:84
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275
DLLEXPORT bool hasNode() const
returns true if the object contains a non-null AbstractQoreNode pointer (ie type == QV_Node && v....