IDL compiler front-end library
Loading...
Searching...
No Matches
Include.h
Go to the documentation of this file.
1
2/*
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_INCLUDE_H_
28#define IDLFE_AST_INCLUDE_H_
29#pragma once
30
31#include "Item.h"
32#include "Location.h"
33#include <filesystem>
34
35namespace AST {
36
41class Include :
42 public Item,
43 public Location
44{
45public:
47 const std::filesystem::path& file () const noexcept
48 {
49 return file_;
50 }
51
53 bool system () const noexcept
54 {
55 return system_;
56 }
57
58private:
59 template <class T> friend class Ptr;
60
61 Include (std::filesystem::path&& file, bool system, const Location& loc) :
62 Item (Kind::INCLUDE),
63 Location (loc),
64 file_ (std::move (file)),
65 system_ (system)
66 {}
67
68private:
69 std::filesystem::path file_;
70 bool system_;
71};
72
73}
74
75#endif
#include file.
Definition Include.h:44
const std::filesystem::path & file() const noexcept
Returns the name of included IDL file.
Definition Include.h:47
bool system() const noexcept
Definition Include.h:53
An AST item.
Definition Item.h:41
Kind
The kind of item.
Definition Item.h:45
@ INCLUDE
class Include
Stores the location information.
Definition Location.h:43
AST item smart pointer.
Definition Item.h:134
Abstract Syntax Tree namespace.
Definition Array.h:34