Qore Programming Language  0.8.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreNothingNode.h
Go to the documentation of this file.
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreNothingNode.h
4 
5  Qore Programming Language
6 
7  Copyright 2003 - 2013 David Nichols
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23 
24 #ifndef _QORE_QORENOTHINGNODE_H
25 
26 #define _QORE_QORENOTHINGNODE_H
27 
28 #include <qore/AbstractQoreNode.h>
29 
34 
35 
44 protected:
46 
49  DLLLOCAL AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
50 
51 public:
52  DLLEXPORT QoreNothingNode();
53 
54  DLLEXPORT virtual ~QoreNothingNode();
55 
57 
63  DLLEXPORT virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const;
64 
66 
73  DLLEXPORT virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) const;
74 
76 
80  DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const;
81 
83 
87  DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const;
88 
90  DLLEXPORT virtual const char *getTypeName() const;
91 
93  DLLLOCAL virtual AbstractQoreNode *parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
94 
96  DLLLOCAL static const char *getStaticTypeName() {
97  return "nothing";
98  }
99 
101  DLLLOCAL static qore_type_t getStaticTypeCode() {
102  return NT_NOTHING;
103  }
104 };
105 
107 DLLEXPORT extern QoreNothingNode Nothing;
108 
110 static inline QoreNothingNode *nothing() {
111  return &Nothing;
112 }
113 
114 #endif