Polaris: Namelist Class Reference

Namelist Class Reference

Object which represents the NAMELIST statement. More...

#include <Namelist.h>

Inheritance diagram for Namelist:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Namelist (const char *name)
 Creates an empty namelist with the given name.
 Namelist (const char *name, const BinRep &binstr, const Symtab &symtab)
 Constructor from binstr.
 Namelist (const Namelist &other)
Namelistoperator= (const Namelist &other)
virtual ~Namelist ()
const char * name_ref () const
 Return the name of the data group.
BinRepoverflow_ref () const
 Return data found in the overflow field.
int entries () const
 Returns the number of variables in this object.
const List< Expression > & iolist () const
List< Expression > & iolist ()
 Returns a reference to the member list of named data objects in the form of identifier expressions.
Iterator< Symboliterator () const
 Return an iterator over the symbols of the members of this namelist.
void del (Symbol &symbol)
 Delete a variable from the members list.
void ins (Symbol &symbol, int index)
 Insert a variable into the members list at position 'index'.
virtual void print (ostream &o) const
 print onto stream
virtual Definitiondefinition_clone () const
virtual int structures_OK () const
 Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.
virtual void relink_dptrs (ProgramUnit &p)
 Change the pointers found in a Namelist element to be pointers into the given ProgramUnit.

Protected Attributes

RefList< Symbol_body
List< Expression_iolist
BinRep_overflow

Friends

class VariableSymbol
ostream & operator<< (ostream &o, const Namelist &namelist)

Detailed Description

Object which represents the NAMELIST statement.

Polaris C++ VDL

See also:
Namelist.h

Namelist.cc

Description

Namelist is simply the representation of a Fortran Namelist statement which allows a group of named data objects to be referred to by a single name.

Bugs

Perhaps the destructor for the Namelist class should automatically call del() on each of its members so that the pointers in the Symtab are all set to null when this is deleted.

See Also

NamelistDict

Definition at line 48 of file Namelist.h.


Constructor & Destructor Documentation

Namelist::Namelist const char *  name  ) 
 

Creates an empty namelist with the given name.

... int len = strlen(name);

Definition at line 33 of file Namelist.cc.

References register_instance().

Referenced by definition_clone().

Namelist::Namelist const char *  name,
const BinRep binstr,
const Symtab symtab
 

Constructor from binstr.

... int len = strlen(name);

... Notice that the symbol itself should not be deleted ... if ever this entry is deleted from the _body list

... Here we expect a tuple of variable names

... Notice that the symbol itself should not be deleted ... if ever this entry is deleted from the _body list

... Unrecognized -- add to overflow

Definition at line 67 of file Namelist.cc.

References _body, _iolist, _overflow, BinRep::find_ref(), BinRep::ins(), List< T >::ins_last(), RefList< T >::ins_last(), BinRep::put_set(), register_instance(), BinRep::to_string(), BinRep::to_tuple(), List< T >::valid(), and warn_overflow_map().

Namelist::Namelist const Namelist other  ) 
 

Definition at line 43 of file Namelist.cc.

References _overflow, and register_instance().

Namelist::~Namelist  )  [virtual]
 

Definition at line 154 of file Namelist.cc.

References _overflow, and unregister_instance().


Member Function Documentation

Namelist & Namelist::operator= const Namelist other  ) 
 

Definition at line 55 of file Namelist.cc.

References _body, and _overflow.

const char * Namelist::name_ref  )  const
 

Return the name of the data group.

Definition at line 254 of file Namelist.cc.

Referenced by ProgramUnit::create_program_unit(), NamelistDict::exchange_convert(), and NamelistDict::write().

BinRep * Namelist::overflow_ref  )  const
 

Return data found in the overflow field.

Definition at line 260 of file Namelist.cc.

References _overflow.

int Namelist::entries  )  const
 

Returns the number of variables in this object.

Definition at line 266 of file Namelist.cc.

References _body, and RefList< T >::entries().

Referenced by NamelistDict::write().

const List< Expression > & Namelist::iolist  )  const
 

Definition at line 279 of file Namelist.cc.

References _iolist.

Referenced by IOStmt::build_refs().

List< Expression > & Namelist::iolist  ) 
 

Returns a reference to the member list of named data objects in the form of identifier expressions.

Definition at line 285 of file Namelist.cc.

References _iolist.

Iterator< Symbol > Namelist::iterator  )  const
 

Return an iterator over the symbols of the members of this namelist.

Definition at line 272 of file Namelist.cc.

References _body.

Referenced by NamelistDict::exchange_convert().

void Namelist::del Symbol symbol  ) 
 

Delete a variable from the members list.

Definition at line 165 of file Namelist.cc.

References _body, _iolist, List< T >::del(), RefList< T >::index(), and symbol().

void Namelist::ins Symbol symbol,
int  index
 

Insert a variable into the members list at position 'index'.

Definition at line 175 of file Namelist.cc.

References _body, _iolist, List< T >::ins(), RefList< T >::ins(), and symbol().

void Namelist::print ostream &  o  )  const [virtual]
 

print onto stream

... _body field

... _iolist field

... _overflow field

Implements Definition.

Definition at line 189 of file Namelist.cc.

References _body, _iolist, _overflow, Iterator< T >::current(), Symbol::name_ref(), and Iterator< T >::valid().

Definition * Namelist::definition_clone  )  const [virtual]
 

Implements Definition.

Definition at line 240 of file Namelist.cc.

References Namelist().

int Namelist::structures_OK  )  const [virtual]
 

Check the structure of the data for errors or inconsistency Return 0 and print error message if problems found, otherwise return 1 without message.

Implements Definition.

Definition at line 246 of file Namelist.cc.

void Namelist::relink_dptrs ProgramUnit p  )  [virtual]
 

Change the pointers found in a Namelist element to be pointers into the given ProgramUnit.

Implements RelinkableDef.

Definition at line 294 of file Namelist.cc.

References _iolist, List< T >::modify(), and List< T >::valid().


Friends And Related Function Documentation

friend class VariableSymbol [friend]
 

Definition at line 50 of file Namelist.h.

ostream& operator<< ostream &  o,
const Namelist namelist
[friend]
 

Definition at line 182 of file Namelist.cc.


Member Data Documentation

RefList<Symbol> Namelist::_body [protected]
 

Definition at line 53 of file Namelist.h.

Referenced by del(), entries(), ins(), iterator(), Namelist(), operator=(), and print().

List<Expression> Namelist::_iolist [protected]
 

Definition at line 54 of file Namelist.h.

Referenced by del(), ins(), iolist(), Namelist(), print(), and relink_dptrs().

BinRep* Namelist::_overflow [protected]
 

Definition at line 55 of file Namelist.h.

Referenced by Namelist(), operator=(), overflow_ref(), print(), and ~Namelist().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:49 2005