Polaris: SubroutineSymbol Class Reference

SubroutineSymbol Class Reference

a Symbol of class SUBROUTINE_CLASS More...

#include <SubroutineSymbol.h>

Inheritance diagram for SubroutineSymbol:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SubroutineSymbol (const char *name, EXTERNAL_BOOL external, INTRINSIC_BOOL intrinsic, FORMAL_BOOL formal, Statement *entry=0)
 Constructor.
 SubroutineSymbol (const SubroutineSymbol &rsym)
SubroutineSymboloperator= (const SubroutineSymbol &rsym)
virtual Symbolclone () const
 Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.
virtual Symbolclone_all () const
 Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.
virtual ~SubroutineSymbol ()
virtual EXTERNAL_BOOL external () const
virtual void external (EXTERNAL_BOOL ourbool)
virtual INTRINSIC_BOOL intrinsic () const
virtual void intrinsic (INTRINSIC_BOOL ourbool)
virtual FORMAL_BOOL formal () const
virtual void formal (FORMAL_BOOL ourbool)
virtual const Statemententry_ref () const
virtual Statemententry_ref ()
virtual void entry (Statement *entry)
virtual const Typetype () const
 (aborts if called for a symbol that doesn't use a type)
virtual int is_entry ()
 Returns 1 if this is an alternate entry.
virtual void print (ostream &o) const
 Print onto stream 'o'.
virtual void fill_in (const BinRep &binstr, ExprTable &exprs, const Dictionary< VoidPtrDef > &stmts, const Dictionary< VoidPtrDef > &commons, const Dictionary< VoidPtrDef > &equivalences)
 Fill in all relevant info from a binstr object.
virtual int structures_OK () const
 Check the structure of the data for errors or inconsistency Abort with error message if problems found, else continue without message.
virtual void exchange_convert (VDL &vdl)
 Convert the Symbol into the exchange format.
virtual void relink_dptrs (ProgramUnit &p)
 Change all pointers found in a SubroutineSymbol element to point into the given ProgramUnit.

Protected Attributes

unsigned _external:1
unsigned _intrinsic:1
unsigned _formal:1
 if both _external and _intrinsic are zero, it is the routine or program itself or an alternate ENTRY
Statement_entry
 == 0 if none

Detailed Description

a Symbol of class SUBROUTINE_CLASS

Polaris C++ VDL

See also:
Symbol.h

Symbol.h

SubroutineSymbol.h

Symbol.cc

Description

A SubroutineSymbol is a Symbol representing the identifier for a program unit which begins with the Fortran keyword SUBROUTINE or an alternate entry of it.

The additional fields it adds to Symbol's fields are the entry, external, intrinsic and formal fields.

The entry field is a pointer to the entry statement for this symbol.

The external field indicates whether or not this symbol was declared EXTERNAL.

The intrinsic field indicates whether or not this symbol was recognized as or declared INTRINSIC.

The formal field indicates whether or not this symbol is a formal parameter (i.e. dummy procedure) of a function or subroutine.

The only virtual methods inherited from Symbol which are valid for this class (which will not give errors messages, with the exception of Symbol::is_array()) are those which are explicitly overridden here.

See Symbol for more information.

Note: The FunctionSymbol and SubroutineSymbol classes are both represented by the single ISETL SUBROUTINE class data structure.

Definition at line 56 of file SubroutineSymbol.h.


Constructor & Destructor Documentation

SubroutineSymbol::SubroutineSymbol const char *  name,
EXTERNAL_BOOL  external,
INTRINSIC_BOOL  intrinsic,
FORMAL_BOOL  formal,
Statement entry = 0
 

Constructor.

entry should normally be 0 if external or intrinsic is true.

Referenced by clone(), and clone_all().

SubroutineSymbol::SubroutineSymbol const SubroutineSymbol rsym  ) 
 

Definition at line 1215 of file Symbol.cc.

References SUBROUTINE_CLASS.

SubroutineSymbol::~SubroutineSymbol  )  [virtual]
 

... nothing to do (_entry should NOT be deleted)

Definition at line 1221 of file Symbol.cc.


Member Function Documentation

SubroutineSymbol & SubroutineSymbol::operator= const SubroutineSymbol rsym  ) 
 

Definition at line 1227 of file Symbol.cc.

References _entry, _external, _formal, and _intrinsic.

Symbol * SubroutineSymbol::clone  )  const [virtual]
 

Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.

Implements Symbol.

Definition at line 1253 of file Symbol.cc.

References SubroutineSymbol().

Symbol * SubroutineSymbol::clone_all  )  const [virtual]
 

Clone constructor -- returns base pointer to a new clone of the correct derived class of this Symbol.

Implements Symbol.

Definition at line 1259 of file Symbol.cc.

References SubroutineSymbol().

EXTERNAL_BOOL SubroutineSymbol::external  )  const [virtual]
 

Reimplemented from Symbol.

Definition at line 1265 of file Symbol.cc.

References _external.

void SubroutineSymbol::external EXTERNAL_BOOL  ourbool  )  [virtual]
 

Reimplemented from Symbol.

Definition at line 1271 of file Symbol.cc.

References _external.

INTRINSIC_BOOL SubroutineSymbol::intrinsic  )  const [virtual]
 

Reimplemented from Symbol.

Definition at line 1277 of file Symbol.cc.

References _intrinsic.

void SubroutineSymbol::intrinsic INTRINSIC_BOOL  ourbool  )  [virtual]
 

Reimplemented from Symbol.

Definition at line 1283 of file Symbol.cc.

References _intrinsic.

FORMAL_BOOL SubroutineSymbol::formal  )  const [virtual]
 

Reimplemented from Symbol.

Definition at line 1289 of file Symbol.cc.

References _formal.

void SubroutineSymbol::formal FORMAL_BOOL  ourbool  )  [virtual]
 

Reimplemented from Symbol.

Definition at line 1295 of file Symbol.cc.

References _formal.

const Statement * SubroutineSymbol::entry_ref  )  const [virtual]
 

Reimplemented from Symbol.

Definition at line 1301 of file Symbol.cc.

References _entry.

Statement * SubroutineSymbol::entry_ref  )  [virtual]
 

Reimplemented from Symbol.

Definition at line 1307 of file Symbol.cc.

References _entry.

void SubroutineSymbol::entry Statement entry  )  [virtual]
 

Reimplemented from Symbol.

Definition at line 1313 of file Symbol.cc.

References _entry, and entry().

Referenced by entry().

const Type & SubroutineSymbol::type  )  const [virtual]
 

(aborts if called for a symbol that doesn't use a type)

Reimplemented from Symbol.

Definition at line 1246 of file Symbol.cc.

References make_type(), and VOID_TYPE.

int SubroutineSymbol::is_entry  )  [virtual]
 

Returns 1 if this is an alternate entry.

Reimplemented from Symbol.

Definition at line 1319 of file Symbol.cc.

References _external, and _intrinsic.

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

Print onto stream 'o'.

... the _intrinsic field

... the _external field

... the _formal field

... the _entry field

... the _overflow field

Implements Symbol.

Definition at line 1325 of file Symbol.cc.

References _entry, _external, _formal, _intrinsic, and Statement::tag().

virtual void SubroutineSymbol::fill_in const BinRep binstr,
ExprTable exprs,
const Dictionary< VoidPtrDef > &  stmts,
const Dictionary< VoidPtrDef > &  commons,
const Dictionary< VoidPtrDef > &  equivalences
[virtual]
 

Fill in all relevant info from a binstr object.

Implements Symbol.

int SubroutineSymbol::structures_OK  )  const [virtual]
 

Check the structure of the data for errors or inconsistency Abort with error message if problems found, else continue without message.

Reimplemented from Symbol.

Definition at line 1430 of file Symbol.cc.

References _entry.

void SubroutineSymbol::exchange_convert VDL vdl  )  [virtual]
 

Convert the Symbol into the exchange format.

Reimplemented from Symbol.

Definition at line 1356 of file Symbol.cc.

References Symbol::exchange_convert(), BinRep::find_ref(), Set< T >::ins(), List< T >::ins_last(), Symbol::name_ref(), BinRep::to_set(), and BinRep::to_tuple().

void SubroutineSymbol::relink_dptrs ProgramUnit p  )  [virtual]
 

Change all pointers found in a SubroutineSymbol element to point into the given ProgramUnit.

Implements RelinkableDef.

Definition at line 1441 of file Symbol.cc.

References _entry, Statement::stmt_class(), Statement::tag(), Statement::tag_defined(), and UNDEFINED_STMT.


Member Data Documentation

unsigned SubroutineSymbol::_external [protected]
 

Definition at line 58 of file SubroutineSymbol.h.

Referenced by external(), is_entry(), operator=(), and print().

unsigned SubroutineSymbol::_intrinsic [protected]
 

Definition at line 58 of file SubroutineSymbol.h.

Referenced by intrinsic(), is_entry(), operator=(), and print().

unsigned SubroutineSymbol::_formal [protected]
 

if both _external and _intrinsic are zero, it is the routine or program itself or an alternate ENTRY

Definition at line 58 of file SubroutineSymbol.h.

Referenced by formal(), operator=(), and print().

Statement* SubroutineSymbol::_entry [protected]
 

== 0 if none

Definition at line 64 of file SubroutineSymbol.h.

Referenced by entry(), entry_ref(), operator=(), print(), relink_dptrs(), and structures_OK().


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:08:25 2005