1 #ifndef IVL_parse_types_H
2 #define IVL_parse_types_H
3 /*
4  * Copyright (c) 2011-2015 Stephen Williams (steve@icarus.com)
5  * Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
6  *
7  *    This source code is free software; you can redistribute it
8  *    and/or modify it in source code form under the terms of the GNU
9  *    General Public License as published by the Free Software
10  *    Foundation; either version 2 of the License, or (at your option)
11  *    any later version.
12  *
13  *    This program is distributed in the hope that it will be useful,
14  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *    GNU General Public License for more details.
17  *
18  *    You should have received a copy of the GNU General Public License
19  *    along with this program; if not, write to the Free Software
20  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 # include  "StringHeap.h"
24 # include  "expression.h"
25 
26 class named_expr_t {
27 
28     public:
named_expr_t(perm_string n,Expression * e)29       named_expr_t(perm_string n, Expression*e) : name_(n), expr_(e) { }
~named_expr_t()30       ~named_expr_t() { delete expr_; }
31 
name()32       perm_string name() const { return name_; }
expr()33       Expression* expr() const { return expr_; }
34       void dump(ostream&out, int indent) const;
35     private:
36       perm_string name_;
37       Expression* expr_;
38 
39     private: // Not implemented
40       named_expr_t(const named_expr_t&);
41       named_expr_t& operator = (const named_expr_t&);
42 };
43 
44 class entity_aspect_t {
45     public:
46       typedef enum { ENTITY = 0, CONFIGURATION, OPEN } entity_aspect_type_t;
47 
entity_aspect_t(entity_aspect_type_t t,ExpName * n)48       entity_aspect_t(entity_aspect_type_t t, ExpName* n) : type_(t), name_(n) {}
~entity_aspect_t()49       ~entity_aspect_t() { delete name_; }
50 
name()51       ExpName* name() const { return name_; }
type()52       entity_aspect_type_t type() const {return type_; }
53 
54       entity_aspect_type_t type_;
55       ExpName* name_;
56 };
57 
58 class instant_list_t {
59     public:
60       typedef enum { ALL = 0, OTHERS, NONE } application_domain_t;
61 
instant_list_t(application_domain_t d,std::list<perm_string> * l)62       instant_list_t(application_domain_t d, std::list<perm_string>* l) : domain_(d), labels_(l) {}
~instant_list_t()63       ~instant_list_t() { delete labels_; }
64 
labels()65       std::list<perm_string>* labels() const { return labels_; }
domain()66       application_domain_t domain() const { return domain_; }
67 
68       application_domain_t domain_;
69       std::list<perm_string>* labels_;
70 };
71 
72 struct adding_term {
73       ExpArithmetic::fun_t op;
74       Expression*term;
75 };
76 
77 // Stores information for file declarations containing a file name and open mode
78 // (VHDL-2008 6.4.2.5)
79 class file_open_info_t {
80     public:
81       file_open_info_t(ExpString*filename__, ExpName*kind__ = NULL)
kind_(kind__)82         : kind_(kind__), filename_(filename__) {
83           // By default files are opened in read-only mode
84           if(!kind_) kind_ = new ExpName(perm_string::literal("read_mode"));
85       }
~file_open_info_t()86       ~file_open_info_t() { delete kind_; delete filename_; }
87 
kind()88       ExpName*kind() { return kind_; }
filename()89       ExpString*filename() { return filename_; }
90 
91     private:
92       ExpName*kind_;
93       ExpString*filename_;
94 };
95 
96 #endif /* IVL_parse_types_H */
97