1 #ifndef __pform_types_H
2 #define __pform_types_H
4 * Copyright (c) 2007 Stephen Williams (steve@icarus.com)
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 #ident "$Id: pform_types.h,v 1.2 2007/06/04 02:19:07 steve Exp $"
25 // This for the perm_string type.
26 # include "StringHeap.h"
34 struct index_component_t
{
35 enum ctype_t
{ SEL_NONE
, SEL_BIT
, SEL_PART
, SEL_IDX_UP
, SEL_IDX_DO
};
37 index_component_t() : sel(SEL_NONE
), msb(0), lsb(0) { };
38 ~index_component_t() { }
45 struct name_component_t
{
46 explicit name_component_t(perm_string n
) : name(n
) { }
47 ~name_component_t() { }
50 std::list
<index_component_t
>index
;
53 extern bool operator < (const name_component_t
&lef
, const name_component_t
&rig
);
56 * The pform_name_t is the general form for a heirarchical identifier.
58 typedef std::list
<name_component_t
> pform_name_t
;
60 inline perm_string
peek_head_name(const pform_name_t
&that
)
62 return that
.front().name
;
65 inline perm_string
peek_tail_name(const pform_name_t
&that
)
67 return that
.back().name
;
70 extern std::ostream
& operator<< (std::ostream
&out
, const pform_name_t
&);
71 extern std::ostream
& operator<< (std::ostream
&out
, const name_component_t
&that
);
72 extern std::ostream
& operator<< (std::ostream
&out
, const index_component_t
&that
);