Qore Programming Language
0.9.16
Main Page
Related Pages
Modules
Namespaces
Namespace List
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
~
Variables
b
c
d
e
f
i
k
l
m
n
o
p
s
t
v
x
Files
File List
File Members
All
_
a
c
d
f
g
h
i
m
n
p
q
r
s
t
Functions
c
d
f
g
i
m
n
p
q
r
s
t
Variables
d
m
n
q
t
Typedefs
a
i
m
n
q
s
t
Enumerations
Enumerator
Macros
_
d
h
n
p
q
t
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
QoreDotEvalOperatorNode.h
1
/* -*- mode: c++; indent-tabs-mode: nil -*- */
2
/*
3
QoreDotEvalOperatorNode.h
4
5
Qore Programming Language
6
7
Copyright (C) 2003 - 2019 Qore Technologies, s.r.o.
8
9
Permission is hereby granted, free of charge, to any person obtaining a
10
copy of this software and associated documentation files (the "Software"),
11
to deal in the Software without restriction, including without limitation
12
the rights to use, copy, modify, merge, publish, distribute, sublicense,
13
and/or sell copies of the Software, and to permit persons to whom the
14
Software is furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
DEALINGS IN THE SOFTWARE.
26
27
Note that the Qore library is released under a choice of three open-source
28
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
29
information.
30
*/
31
32
#ifndef _QORE_QOREDOTEVALOPERATORNODE_H
33
34
#define _QORE_QOREDOTEVALOPERATORNODE_H
35
36
class
QoreDotEvalOperatorNode :
public
QoreOperatorNode {
37
protected
:
38
static
QoreString
name;
39
40
QoreValue
left;
41
MethodCallNode *m;
42
43
const
QoreTypeInfo *returnTypeInfo;
44
45
DLLLOCAL
virtual
QoreValue
evalImpl(
bool
& needs_deref,
ExceptionSink
* xsink)
const
;
46
47
DLLLOCAL
virtual
void
parseInitImpl(
QoreValue
& val, LocalVar *oflag,
int
pflag,
int
&lvids,
const
QoreTypeInfo *&typeInfo);
48
49
DLLLOCAL
virtual
const
QoreTypeInfo *getTypeInfo()
const
{
50
return
returnTypeInfo;
51
}
52
53
public
:
54
DLLLOCAL QoreDotEvalOperatorNode(
const
QoreProgramLocation* loc,
QoreValue
n_left, MethodCallNode* n_m) : QoreOperatorNode(loc), left(n_left), m(n_m), returnTypeInfo(nullptr) {
55
}
56
57
DLLLOCAL ~QoreDotEvalOperatorNode() {
58
left.
discard
(
nullptr
);
59
if
(m)
60
m->deref(
nullptr
);
61
}
62
63
DLLLOCAL
QoreValue
getExpression()
const
{
64
return
left;
65
}
66
67
DLLLOCAL
void
replaceExpression(
QoreValue
n_left) {
68
left.
discard
(
nullptr
);
69
left = n_left;
70
}
71
72
DLLLOCAL
AbstractQoreNode
*makeCallReference();
73
74
// if del is true, then the returned QoreString * should be removed, if false, then it must not be
75
DLLLOCAL
virtual
QoreString
*getAsString(
bool
&del,
int
foff,
ExceptionSink
*xsink)
const
{
76
del =
false
;
77
return
&name;
78
}
79
80
DLLLOCAL
virtual
int
getAsString(
QoreString
&str,
int
foff,
ExceptionSink
*xsink)
const
{
81
str.
concat
(&name);
82
return
0;
83
}
84
85
// returns the type name as a c string
86
DLLLOCAL
virtual
const
char
* getTypeName()
const
{
87
return
name.
getBuffer
();
88
}
89
90
DLLLOCAL
virtual
bool
hasEffect()
const
{
91
return
true
;
92
}
93
94
DLLLOCAL
virtual
bool
hasEffectAsRoot()
const
{
95
return
true
;
96
}
97
98
DLLLOCAL
virtual
QoreOperatorNode* copyBackground(
ExceptionSink
* xsink)
const
;
99
};
100
101
#endif
QoreValue
The main value class in Qore, designed to be passed by value.
Definition:
QoreValue.h:262
QoreString
Qore's string type supported by the QoreEncoding class.
Definition:
QoreString.h:81
QoreValue::discard
DLLEXPORT void discard(ExceptionSink *xsink)
dereferences any contained AbstractQoreNode pointer and sets to 0; does not modify other values
QoreString::getBuffer
const DLLEXPORT char * getBuffer() const
returns the string's buffer; this data should not be changed
QoreString::concat
DLLEXPORT void concat(const QoreString *str, ExceptionSink *xsink)
concatenates a string and converts encodings if necessary
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition:
ExceptionSink.h:48
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition:
AbstractQoreNode.h:54