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
BarewordNode.h
1
/* -*- mode: c++; indent-tabs-mode: nil -*- */
2
/*
3
BarewordNode.h
4
5
Qore Programming Language
6
7
Copyright (C) 2003 - 2018 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_BAREWORDNODE_H
33
34
#define _QORE_BAREWORDNODE_H
35
36
class
BarewordNode :
public
ParseNoEvalNode {
37
public
:
38
char
*str;
39
40
// object takes over ownership of str
41
DLLLOCAL BarewordNode(
const
QoreProgramLocation* loc,
char
*c_str);
42
43
DLLLOCAL
virtual
~BarewordNode();
44
45
// get string representation (for %n and %N), foff is for multi-line formatting offset, -1 = no line breaks
46
// the ExceptionSink is only needed for QoreObject where a method may be executed
47
// use the QoreNodeAsStringHelper class (defined in QoreStringNode.h) instead of using these functions directly
48
// returns -1 for exception raised, 0 = OK
49
DLLLOCAL
virtual
int
getAsString(
QoreString
&str,
int
foff,
ExceptionSink
*xsink)
const
;
50
51
// if del is true, then the returned QoreString * should be deleted, if false, then it must not be
52
DLLLOCAL
virtual
QoreString
*getAsString(
bool
&del,
int
foff,
ExceptionSink
*xsink)
const
;
53
54
// returns the data type
55
DLLLOCAL
virtual
qore_type_t
getType()
const
;
56
57
// returns the type name as a c string
58
DLLLOCAL
virtual
const
char
*getTypeName()
const
;
59
60
// takes the string and returns a QoreStringNode, gives the memory to the new QoreStringNode
61
DLLLOCAL
QoreStringNode
*makeQoreStringNode();
62
63
// returns the string, caller now owns the memory
64
DLLLOCAL
char
*takeString();
65
66
DLLLOCAL
bool
isFinalized()
const
{
67
return
finalized;
68
}
69
70
DLLLOCAL
void
setFinalized() {
71
finalized =
true
;
72
}
73
74
protected
:
75
// if true it means the node was given in parentheses
76
bool
finalized;
77
78
DLLLOCAL
void
parseInitImpl(
QoreValue
& val, LocalVar* oflag,
int
pflag,
int
& lvids,
const
QoreTypeInfo*& typeInfo);
79
80
DLLLOCAL
virtual
const
QoreTypeInfo *getTypeInfo()
const
{
81
return
0;
82
}
83
};
84
85
#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
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition:
ExceptionSink.h:48
QoreStringNode
Qore's string value type, reference counted, dynamically-allocated only.
Definition:
QoreStringNode.h:50
qore_type_t
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition:
common.h:70