32 #ifndef _QORE_INTERN_NEWCOMPLEXTYPENODE_H
34 #define _QORE_INTERN_NEWCOMPLEXTYPENODE_H
36 #include "qore/intern/FunctionCallNode.h"
38 class ParseNewComplexTypeNode :
public ParseNoEvalNode {
40 DLLLOCAL ParseNewComplexTypeNode(
const QoreProgramLocation* loc, QoreParseTypeInfo* pti, QoreParseListNode* a)
44 DLLLOCAL ~ParseNewComplexTypeNode() {
51 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
56 str.
sprintf(
"new complex type operator expression ('%s')", QoreParseTypeInfo::getName(pti));
64 getAsString(*rv, foff, xsink);
68 DLLLOCAL
virtual const char* getTypeName()
const {
69 return "new complex type operator expression";
73 QoreParseTypeInfo* pti;
74 QoreParseListNode* args;
76 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context);
83 DLLLOCAL QoreParseListNode* takeArgs() {
84 QoreParseListNode* rv = args;
90 class NewHashDeclNode :
public ParseNode {
94 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) {
98 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
99 return hd ? hd->getTypeInfo() : hashTypeInfo;
104 QoreParseListNode* args;
107 DLLLOCAL NewHashDeclNode(
const QoreProgramLocation* loc,
const TypedHashDecl* hd, QoreParseListNode* a,
108 bool runtime_check) : ParseNode(loc,
NT_SCOPE_REF), hd(hd), args(a), runtime_check(runtime_check) {
111 DLLLOCAL
virtual ~NewHashDeclNode() {
113 args->deref(
nullptr);
117 str.
sprintf(
"new hashdecl operator expression (hashdecl '%s')", hd->
getName());
125 getAsString(*rv, foff, xsink);
129 DLLLOCAL
virtual const char* getTypeName()
const {
130 return "new hashdecl operator expression";
134 class NewComplexHashNode :
public ParseNode {
138 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) {
142 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
147 const QoreTypeInfo* typeInfo;
148 QoreParseListNode* args;
150 DLLLOCAL NewComplexHashNode(
const QoreProgramLocation* loc,
const QoreTypeInfo* typeInfo, QoreParseListNode* a)
151 : ParseNode(loc,
NT_SCOPE_REF), typeInfo(typeInfo), args(a) {
152 assert(QoreTypeInfo::getUniqueReturnComplexHash(typeInfo));
155 DLLLOCAL
virtual ~NewComplexHashNode() {
157 args->deref(
nullptr);
161 str.
sprintf(
"new complex hash operator expression ('%s')", QoreTypeInfo::getName(typeInfo));
169 getAsString(*rv, foff, xsink);
173 DLLLOCAL
virtual const char* getTypeName()
const {
174 return "new complex hash operator expression";
178 class NewComplexListNode :
public ParseNode {
182 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context) {
186 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
191 const QoreTypeInfo* typeInfo;
194 DLLLOCAL NewComplexListNode(
const QoreProgramLocation* loc,
const QoreTypeInfo* typeInfo,
QoreValue a)
195 : ParseNode(loc,
NT_SCOPE_REF), typeInfo(typeInfo), args(a) {
196 assert(QoreTypeInfo::getUniqueReturnComplexList(typeInfo));
199 DLLLOCAL
virtual ~NewComplexListNode() {
204 str.
sprintf(
"new complex list operator expression ('%s')", QoreTypeInfo::getName(typeInfo));
212 getAsString(*rv, foff, xsink);
216 DLLLOCAL
virtual const char* getTypeName()
const {
217 return "new complex list operator expression";
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
DLLEXPORT int sprintf(const char *fmt,...)
this will concatentate a formatted string to the existing string according to the format string and t...
typed hash declaration
Definition: TypedHashDecl.h:44
DLLEXPORT const char * getName() const
returns the name of the typed hash
const qore_type_t NT_SCOPE_REF
type value for ScopedObjectCallNode
Definition: node_types.h:61
const qore_type_t NT_PARSE_NEW_COMPLEX_TYPE
type value for ParseNewComplexTypeNode
Definition: node_types.h:85
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275
DLLEXPORT void discard(ExceptionSink *xsink)
dereferences any contained AbstractQoreNode pointer and sets to 0; does not modify other values