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

type_record Class Reference

Record elements are ordered the way they appear in the record. More...

#include <type.h>

Inheritance diagram for type_record:

Inheritance graph
[legend]
Collaboration diagram for type_record:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 type_record ()
void dealloc ()
const uint get_rec_size (void)
void put_rec_size (uint s)
pSym find_elem (STRING name)
void add_elem (pSym sym)
const uint get_ty_kind (void)

Private Attributes

uint size
FIFO_LIST< pSymelem_list

Detailed Description

Record elements are ordered the way they appear in the record.

Note that this means that when the type is created, the elements must be added in correct order.

The record elements are represented by symbol objects. Note, however, that these objects are _not_ entered in the symbol table. A record element can only be accessed via its base base, so these names exist only in the scope of the base name.

Definition at line 496 of file type.h.


Constructor & Destructor Documentation

type_record::type_record  )  [inline]
 

Definition at line 503 of file type.h.

References size.

00503                   : type()
00504     {
00505         size = 0;
00506     } // type_record constructor


Member Function Documentation

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

Reimplemented from type.

Definition at line 527 of file type.h.

References FIFO_LIST< pSym >::add(), and elem_list.

00528     {
00529         elem_list.add( sym );
00530     }

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

Reimplemented from type.

Definition at line 509 of file type.h.

References FIFO_LIST< pSym >::dealloc(), and elem_list.

00510     {
00511         // deallocate the list
00512         elem_list.dealloc();
00513     }

pSym type_record::find_elem STRING  name  )  [virtual]
 

Reimplemented from type.

Definition at line 5 of file type.C.

References elem_list, FIFO_LIST< pSym >::first(), FIFO_LIST< pSym >::get_item(), sym::get_name(), STRING::GetText(), FIFO_LIST< pSym >::next(), and NULL.

00006 {
00007   FIFO_LIST<pSym>::handle h;
00008   pSym elem_sym;
00009   pSym tmp;
00010         
00011   elem_sym = NULL;
00012   for (h = elem_list.first(); h != NULL; h = elem_list.next( h )) {
00013     tmp = elem_list.get_item( h );
00014     if (tmp->get_name().GetText() == name.GetText()) {
00015       elem_sym = tmp;
00016       break;
00017     }
00018   }
00019   return elem_sym;
00020 } // find_elem

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

Reimplemented from type.

Definition at line 515 of file type.h.

References size, and uint.

00516     { 
00517         return size; 
00518     }

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

Reimplemented from type.

Definition at line 532 of file type.h.

References ty_record, and uint.

00533     {
00534         return ty_record;
00535     }

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

Reimplemented from type.

Definition at line 519 of file type.h.

References size.

00520     {
00521         size = s;
00522     }


Member Data Documentation

FIFO_LIST<pSym> type_record::elem_list [private]
 

Definition at line 500 of file type.h.

Referenced by add_elem(), dealloc(), and find_elem().

uint type_record::size [private]
 

Definition at line 499 of file type.h.

Referenced by get_rec_size(), put_rec_size(), and type_record().


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