IDL compiler front-end library
Loading...
Searching...
No Matches
Symbols.h
1/*
2* Nirvana IDL front-end library.
3*
4* This is a part of the Nirvana project.
5*
6* Author: Igor Popov
7*
8* Copyright (c) 2021 Igor Popov.
9*
10* This program is free software; you can redistribute it and/or modify
11* it under the terms of the GNU Lesser General Public License as published by
12* the Free Software Foundation; either version 3 of the License, or
13* (at your option) any later version.
14*
15* This program is distributed in the hope that it will be useful,
16* but WITHOUT ANY WARRANTY; without even the implied warranty of
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18* GNU General Public License for more details.
19*
20* You should have received a copy of the GNU Lesser General Public
21* License along with this library. If not, see <http://www.gnu.org/licenses/>.
22*
23* Send comments and/or bug reports to:
24* popov.nirvana@gmail.com
25*/
26#ifndef IDLFE_AST_SYMBOLS_H_
27#define IDLFE_AST_SYMBOLS_H_
28#pragma once
29
30#include "NamedItem.h"
31#include <set>
32
33namespace AST {
34
36class Symbols :
37 public std::set <Ptr <NamedItem>, std::less <> >
38{
39 typedef std::set <Ptr <NamedItem>, std::less <> > Base;
40
41public:
46 const NamedItem* find (const Identifier& name) const;
47
48 std::pair <iterator, bool> emplace (const NamedItem& item);
49
50 std::pair <iterator, bool> insert (const NamedItem& item)
51 {
52 return emplace (item);
53 }
54};
55
56}
57
58#endif
An identifier.
Definition Identifier.h:37
A named AST item.
Definition NamedItem.h:45
Set of the named items.
Definition Symbols.h:38
const NamedItem * find(const Identifier &name) const
Abstract Syntax Tree namespace.
Definition Array.h:34