Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

type Class Reference

Represent VHDL types. More...

#include <type.h>

Inheritance diagram for type:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 type (void)
void * operator new (unsigned int num_bytes)
void * operator new (unsigned int num_bytes, pool *mem_pool)
void operator delete (void *addr)
const uint get_width (void)
void set_width (uint w)
virtual const uint get_ty_kind (void)
virtual void set_unit (uint unit)
virtual uint get_unit (void)
virtual void set_lhs (int l)
virtual const int get_lhs (void)
virtual void set_rhs (int r)
const int get_rhs (void)
virtual void set_dir (uint dir)
virtual const uint get_dir (void)
virtual void set_range (int l, int r, uint dir)
virtual void set_box (void)
virtual void unset_box (void)
virtual const Boolean is_box (void)
virtual const uchar get_num_dims (void)
virtual void set_num_dims (uint ndim)
virtual const uint get_array_size (void)
virtual void set_array_size (uint s)
virtual const pTypeRange get_array_range (void)
virtual void set_array_range (pTypeRange r)
virtual const pType get_array_base_type (void)
virtual void set_array_base_type (pType tBase)
virtual void dealloc ()
virtual const uint get_rec_size (void)
virtual void put_rec_size (uint s)
virtual pSym find_elem (STRING name)
virtual void add_elem (pSym sym)
virtual const pType get_file_base_type (void)
virtual void set_file_base_type (pType tBase)

Private Attributes

uint width
 if its an array, this width is the elem width


Detailed Description

Represent VHDL types.

VHDL types come in two forms: named and unnamed. A named type has the form

type short_range is range 0..15;
Named types are entered into the symbol table like any other type.

An unnamed type is created in a variable declartion. For example,

variable short_val : array short_range of BIT;
A named type is simply a symbol that points to an unnamed type. Unnamed types are stored in an unnamed type pool. Variables that share the same named type (e.g., INTEGER or NATURAL) will point to the same type in the type pool. It should also be possible for two variables, declared with the same nunamed type to share the same type, but this is not done currently. For example, the declarations for high_word and low_word could share the same type.
variable high_word : array (0 to 31) of BIT; variable low_word : array (0 to 31) of BIT;

Memory Allocation

New for symbols is only called from the symbol table. New for types is only called from the type table. If new compilers are not available, this localized code will have to be modified.

Definition at line 70 of file type.h.


Constructor & Destructor Documentation

type::type void   )  [inline]
 

Definition at line 76 of file type.h.

References width.

00077     {
00078         width = 0;
00079     }


Member Function Documentation

virtual void type::add_elem pSym  sym  )  [inline, virtual]
 

Reimplemented in type_record.

Definition at line 243 of file type.h.

References FALSE.

00244     {
00245         assert( FALSE );
00246     }

virtual void type::dealloc void   )  [inline, virtual]
 

Reimplemented in type_record.

Definition at line 223 of file type.h.

References FALSE.

00224     {
00225         assert( FALSE );
00226     }

virtual pSym type::find_elem STRING  name  )  [inline, virtual]
 

Reimplemented in type_record.

Definition at line 238 of file type.h.

References FALSE, and NULL.

00239     {
00240         assert( FALSE );
00241         return NULL;
00242     }

virtual const pType type::get_array_base_type void   )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 211 of file type.h.

References FALSE, and NULL.

00212     {
00213         assert( FALSE );
00214         return NULL;
00215     }

virtual const pTypeRange type::get_array_range void   )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 202 of file type.h.

References FALSE, and NULL.

00203     {
00204         assert( FALSE );
00205         return NULL;
00206     }

virtual const uint type::get_array_size void   )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 193 of file type.h.

References FALSE, and uint.

00194     {
00195         assert( FALSE );
00196         return 0;
00197     }

virtual const uint type::get_dir void   )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 157 of file type.h.

References FALSE, and uint.

00158     { 
00159         assert( FALSE );
00160         return 0; 
00161     }

virtual const pType type::get_file_base_type void   )  [inline, virtual]
 

Reimplemented in type_file.

Definition at line 250 of file type.h.

References FALSE, and NULL.

00251     {
00252         assert( FALSE );
00253         return NULL;
00254     } // get_base_type

virtual const int type::get_lhs void   )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 137 of file type.h.

References FALSE.

00138     { 
00139         assert( FALSE );
00140         return 0; 
00141     }

virtual const uchar type::get_num_dims void   )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 184 of file type.h.

References FALSE, and uchar.

00185     { 
00186         assert( FALSE );
00187         return 0; 
00188     }

virtual const uint type::get_rec_size void   )  [inline, virtual]
 

Reimplemented in type_record.

Definition at line 228 of file type.h.

References FALSE, and uint.

00229     { 
00230         assert( FALSE );
00231         return 0;
00232     }

const int type::get_rhs void   )  [inline]
 

Reimplemented in type_range.

Definition at line 147 of file type.h.

References FALSE.

00148     { 
00149         assert( FALSE );
00150         return 0; 
00151     }

virtual const uint type::get_ty_kind void   )  [inline, virtual]
 

Reimplemented in type_time, type_range, type_real, type_array, type_record, and type_file.

Definition at line 112 of file type.h.

References bad_type, and uint.

00113     {
00114         return bad_type;
00115     }

virtual uint type::get_unit void   )  [inline, virtual]
 

Reimplemented in type_time.

Definition at line 125 of file type.h.

References FALSE, and uint.

00126     {
00127         assert( FALSE );
00128         return 0;
00129     }

const uint type::get_width void   )  [inline]
 

Definition at line 99 of file type.h.

References uint, and width.

00100     { 
00101         return width; 
00102     } // get_width

virtual const Boolean type::is_box void   )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 176 of file type.h.

References Boolean, and FALSE.

00177     { 
00178         assert( FALSE );
00179         return FALSE; 
00180     }

void type::operator delete void *  addr  )  [inline]
 

Definition at line 97 of file type.h.

00097 {/* do nothing */}

void* type::operator new unsigned int  num_bytes,
pool mem_pool
[inline]
 

Definition at line 90 of file type.h.

References pool::GetMem().

00091     {
00092         return mem_pool->GetMem( num_bytes );
00093     }

void* type::operator new unsigned int  num_bytes  )  [inline]
 

Definition at line 84 of file type.h.

References FALSE, and NULL.

00085     {
00086         assert( FALSE );
00087         return NULL;
00088     }

virtual void type::put_rec_size uint  s  )  [inline, virtual]
 

Reimplemented in type_record.

Definition at line 233 of file type.h.

References FALSE.

00234     {
00235         assert( FALSE );
00236     }

virtual void type::set_array_base_type pType  tBase  )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 216 of file type.h.

References FALSE.

00217     {
00218         assert( FALSE );
00219     }

virtual void type::set_array_range pTypeRange  r  )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 207 of file type.h.

References FALSE.

00208     {
00209         assert( FALSE );
00210     }

virtual void type::set_array_size uint  s  )  [inline, virtual]
 

Definition at line 198 of file type.h.

References FALSE.

00199     {
00200         assert( FALSE );
00201     }

virtual void type::set_box void   )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 168 of file type.h.

References FALSE.

00169     { 
00170         assert( FALSE );
00171     }

virtual void type::set_dir uint  dir  )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 153 of file type.h.

References FALSE.

00154     { 
00155         assert( FALSE );
00156     }

virtual void type::set_file_base_type pType  tBase  )  [inline, virtual]
 

Reimplemented in type_file.

Definition at line 255 of file type.h.

References FALSE.

00256     {
00257         assert( FALSE );
00258     } // set_base_type

virtual void type::set_lhs int  l  )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 133 of file type.h.

References FALSE.

00134     { 
00135         assert( FALSE );
00136     }

virtual void type::set_num_dims uint  ndim  )  [inline, virtual]
 

Reimplemented in type_array.

Definition at line 189 of file type.h.

References FALSE.

00190     { 
00191         assert( FALSE );
00192     }

virtual void type::set_range int  l,
int  r,
uint  dir
[inline, virtual]
 

Reimplemented in type_range.

Definition at line 163 of file type.h.

References FALSE.

00164     {
00165         assert( FALSE );
00166     }

virtual void type::set_rhs int  r  )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 143 of file type.h.

References FALSE.

00144     { 
00145         assert( FALSE );
00146     }

virtual void type::set_unit uint  unit  )  [inline, virtual]
 

Reimplemented in type_time.

Definition at line 121 of file type.h.

References FALSE.

00122     {
00123         assert( FALSE );
00124     }

void type::set_width uint  w  )  [inline]
 

Definition at line 104 of file type.h.

References width.

00105     { 
00106         width = w; 
00107     } // set_width

virtual void type::unset_box void   )  [inline, virtual]
 

Reimplemented in type_range.

Definition at line 172 of file type.h.

References FALSE.

00173     { 
00174         assert( FALSE );
00175     }


Member Data Documentation

uint type::width [private]
 

if its an array, this width is the elem width

Definition at line 73 of file type.h.

Referenced by get_width(), set_width(), and type().


The documentation for this class was generated from the following file:
Generated on Wed Mar 31 21:16:13 2004 for Data Structures for a VHDL Compiler by doxygen 1.3.3