FunctionSymbol Class Referencea Symbol of class FUNCTION_CLASS
More...
#include <FunctionSymbol.h>
Inheritance diagram for FunctionSymbol:
[legend]List of all members.
|
Public Member Functions |
| | FunctionSymbol (const char *name, const Type &type, EXTERNAL_BOOL external, INTRINSIC_BOOL intrinsic, FORMAL_BOOL formal, Statement *entry=0) |
| | Constructor.
|
| | FunctionSymbol (const FunctionSymbol &fsym) |
| virtual Symbol * | clone () const |
| | Clone constructor -- returns base pointer to a new clone of this Symbol.
|
| virtual Symbol * | clone_all () const |
| | Clone constructor -- returns base pointer to a new clone of this Symbol.
|
| FunctionSymbol & | operator= (const FunctionSymbol &fsym) |
| virtual | ~FunctionSymbol () |
| 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 Statement * | entry_ref () const |
| virtual Statement * | entry_ref () |
| virtual void | entry (Statement *s) |
| virtual const Type & | type () const |
| | Returns the type of the symbol, or else returns type VOID_TYPE if the symbol does not use a type (such as a SubroutineSymbol).
|
| virtual void | type (const Type &type) |
| virtual Equivalence * | equivalence_ref () const |
| | Returns 0 if none.
|
| virtual void | equivalence (Equivalence &e, int byte_base) |
| virtual void | clear_equivalence () |
| 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 void | exchange_convert (VDL &vdl) |
| | Convert the Symbol into the exchange format.
|
| 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 all pointers found in a FunctionSymbol element to point into the given ProgramUnit.
|
Protected Attributes |
| Equivalence * | _equivalence |
| 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
|
| Type | _type |
Detailed Description
a Symbol of class FUNCTION_CLASS
Polaris C++ VDL - See also:
- Symbol.h
Symbol.h
FunctionSymbol.h
Symbol.cc
A FunctionSymbol is a Symbol representing the identifier for a program unit which begins with the Fortran keyword FUNCTION or an alternate entry of it.
The additional fields it adds to Symbol's fields are the entry, equivalence, external, intrinsic, formal and type fields.
The entry field is a pointer to the entry statement for this symbol.
The equivalence field is a pointer to an Equivalence class if this Symbol is associated with any equivalences. (For FunctionSymbol's, this may happen if there is an alternate entry for the function -- essentially, and explicitly in these data structures, the various entry names for a Fortran function are equivalenced -- if any are modified, they all are affected.
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 function) of a function or subroutine.
The type field is the type of the return value of this symbol.
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 71 of file FunctionSymbol.h.
Constructor & Destructor Documentation
|
|
Constructor.
entry should normally be 0 when external or intrinsic are true. If equivalence information is desired, this must be added separately via a call to the equivalence_ref(...) method. - Note:
- Normally, external and intrinsic should be mutually exclusive. That is, an external function would normally be declared as (IS_EXTERNAL, NOT_INTRINSIC, NOT_FORMAL or IS_FORMAL) and an intrinsic function would be declared as (NOT_EXTERNAL, IS_INTRINSIC, NOT_FORMAL). However, all possibilities are intentionally left open because of possible exceptions. For instance, some compilers may allow user-defined intrinsic functions. The correct declaration for may then be (IS_EXTERNAL, IS_INTRINSIC, NOT_FORMAL).
Referenced by clone(), and clone_all(). |
|
|
... nothing to do (_entry should NOT be deleted)
Definition at line 861 of file Symbol.cc. |
Member Function Documentation
| Symbol * FunctionSymbol::clone |
( |
|
) |
const [virtual] |
|
| Symbol * FunctionSymbol::clone_all |
( |
|
) |
const [virtual] |
|
| void FunctionSymbol::external |
( |
EXTERNAL_BOOL |
ourbool |
) |
[virtual] |
|
| void FunctionSymbol::formal |
( |
FORMAL_BOOL |
ourbool |
) |
[virtual] |
|
| const Statement * FunctionSymbol::entry_ref |
( |
|
) |
const [virtual] |
|
| Statement * FunctionSymbol::entry_ref |
( |
|
) |
[virtual] |
|
| void FunctionSymbol::entry |
( |
Statement * |
s |
) |
[virtual] |
|
| const Type & FunctionSymbol::type |
( |
|
) |
const [virtual] |
|
|
|
Returns the type of the symbol, or else returns type VOID_TYPE if the symbol does not use a type (such as a SubroutineSymbol).
... This call should never happen.
Reimplemented from Symbol.
Definition at line 959 of file Symbol.cc.
References _type.
Referenced by type(). |
| void FunctionSymbol::type |
( |
const Type & |
type |
) |
[virtual] |
|
| Equivalence * FunctionSymbol::equivalence_ref |
( |
|
) |
const [virtual] |
|
| void FunctionSymbol::equivalence |
( |
Equivalence & |
e, |
|
|
int |
byte_base |
|
) |
[virtual] |
|
|
|
... Return if no change to be made
... Delete from old equivalence if it was in one
... Add to new equivalence class ... Insert into equivalence's list
... Point to the equivalence
Reimplemented from Symbol.
Definition at line 977 of file Symbol.cc.
References _equivalence, clear_equivalence(), and e. |
| void FunctionSymbol::clear_equivalence |
( |
|
) |
[virtual] |
|
| int FunctionSymbol::is_entry |
( |
|
) |
[virtual] |
|
| void FunctionSymbol::print |
( |
ostream & |
o |
) |
const [virtual] |
|
|
|
Fill in all relevant info from a binstr object.
Implements Symbol. |
| void FunctionSymbol::exchange_convert |
( |
VDL & |
vdl |
) |
[virtual] |
|
| int FunctionSymbol::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.
Reimplemented from Symbol.
Definition at line 1178 of file Symbol.cc.
References _entry, _equivalence, and _type. |
| void FunctionSymbol::relink_dptrs |
( |
ProgramUnit & |
p |
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
|