IDL compiler front-end library
src
include
AST
BasicType.h
Go to the documentation of this file.
1
/*
3
* Nirvana IDL front-end library.
4
*
5
* This is a part of the Nirvana project.
6
*
7
* Author: Igor Popov
8
*
9
* Copyright (c) 2021 Igor Popov.
10
*
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation; either version 3 of the License, or
14
* (at your option) any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU Lesser General Public
22
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
*
24
* Send comments and/or bug reports to:
25
* popov.nirvana@gmail.com
26
*/
27
#ifndef IDLFE_AST_BASICTYPE_H_
28
#define IDLFE_AST_BASICTYPE_H_
29
#pragma once
30
31
namespace
AST
{
32
34
enum class
BasicType
35
{
36
BOOLEAN
,
37
OCTET
,
38
CHAR
,
39
WCHAR
,
40
USHORT
,
41
ULONG
,
42
ULONGLONG
,
43
SHORT
,
44
LONG
,
45
LONGLONG
,
46
FLOAT
,
47
DOUBLE
,
48
LONGDOUBLE
,
49
OBJECT
,
50
VALUE_BASE
,
51
ANY
52
};
53
55
inline
56
bool
is_integral
(
BasicType
bt) noexcept
57
{
58
return
BasicType::BOOLEAN
<= bt && bt <=
BasicType::LONGLONG
;
59
}
60
62
inline
63
bool
is_signed
(
BasicType
bt) noexcept
64
{
65
return
BasicType::SHORT
<= bt && bt <=
BasicType::LONGDOUBLE
;
66
}
67
68
inline
69
bool
is_floating_point (
BasicType
bt) noexcept
70
{
71
return
BasicType::FLOAT
<= bt && bt <=
BasicType::LONGDOUBLE
;
72
}
73
74
}
75
76
#endif
AST
Abstract Syntax Tree namespace.
Definition:
Array.h:34
AST::is_integral
bool is_integral(BasicType bt) noexcept
Definition:
BasicType.h:56
AST::BasicType
BasicType
CORBA basic type enumeration.
Definition:
BasicType.h:35
AST::BasicType::CHAR
@ CHAR
char
AST::BasicType::OCTET
@ OCTET
octet
AST::BasicType::ULONG
@ ULONG
unsigned long
AST::BasicType::ANY
@ ANY
any
AST::BasicType::OBJECT
@ OBJECT
Object
AST::BasicType::ULONGLONG
@ ULONGLONG
unsigned long long
AST::BasicType::SHORT
@ SHORT
short
AST::BasicType::LONGDOUBLE
@ LONGDOUBLE
long double
AST::BasicType::USHORT
@ USHORT
unsigned short
AST::BasicType::VALUE_BASE
@ VALUE_BASE
ValueBase
AST::BasicType::LONG
@ LONG
long
AST::BasicType::BOOLEAN
@ BOOLEAN
boolean
AST::BasicType::WCHAR
@ WCHAR
wchar
AST::BasicType::LONGLONG
@ LONGLONG
long long
AST::BasicType::FLOAT
@ FLOAT
float
AST::BasicType::DOUBLE
@ DOUBLE
double
AST::is_signed
bool is_signed(BasicType bt) noexcept
Definition:
BasicType.h:63
Generated by
1.9.1