32 #ifndef _QORE_QOREFOLDLOPERATORNODE_H
34 #define _QORE_QOREFOLDLOPERATORNODE_H
36 #include "qore/intern/AbstractIteratorHelper.h"
37 #include "qore/intern/FunctionalOperator.h"
38 #include "qore/intern/FunctionalOperatorInterface.h"
40 class QoreFoldlOperatorNode :
public QoreBinaryOperatorNode<> {
42 const QoreTypeInfo* returnTypeInfo;
43 FunctionalOperator* iterator_func;
51 DLLLOCAL
virtual ~QoreFoldlOperatorNode() {
54 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context);
56 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
57 return returnTypeInfo;
62 DLLLOCAL FunctionalOperatorInterface* getFunctionalIterator(FunctionalOperator::FunctionalValueType& value_type,
bool fwd,
ExceptionSink* xsink)
const;
65 DLLLOCAL QoreFoldlOperatorNode(
const QoreProgramLocation* loc,
QoreValue l,
QoreValue r) : QoreBinaryOperatorNode<>(loc, l, r), returnTypeInfo(nullptr), iterator_func(nullptr) {
72 DLLLOCAL
virtual const char* getTypeName()
const {
73 return foldl_str.getBuffer();
76 DLLLOCAL
virtual QoreOperatorNode* copyBackground(
ExceptionSink *xsink)
const {
77 QoreFoldlOperatorNode* rv = copyBackgroundExplicit<QoreFoldlOperatorNode>(xsink);
79 rv->iterator_func =
dynamic_cast<FunctionalOperator*
>(rv->right.getInternalNode());
84 class QoreFoldrOperatorNode :
public QoreFoldlOperatorNode {
91 DLLLOCAL QoreFoldrOperatorNode(
const QoreProgramLocation* loc,
QoreValue l,
QoreValue r) : QoreFoldlOperatorNode(loc, l, r) {
98 DLLLOCAL
virtual const char* getTypeName()
const {
99 return foldr_str.c_str();
102 DLLLOCAL
virtual QoreOperatorNode* copyBackground(
ExceptionSink *xsink)
const {
103 QoreFoldrOperatorNode* rv = copyBackgroundExplicit<QoreFoldrOperatorNode>(xsink);
105 rv->iterator_func =
dynamic_cast<FunctionalOperator*
>(rv->right.getInternalNode());
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
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275