cfront::Environment Class Reference

#include <Environment.hpp>

Collaboration diagram for cfront::Environment:

Collaboration graph
[legend]

Public Member Functions

 Environment (Environment *outer=NULL)
EnvironmentgetOuterEnv () const
bool addOrdinaryName (const std::string &name, Type *type, NameDescription::StorageClassSpecTag storageSpec, NameDescription::DeclarationLocation loc, NameDescription **nd)
EnvironmentlookupOrdinaryName (const std::string &name, NameDescription **nd)
bool addTagName (const std::string &name, Type *type, NameDescription::DeclarationLocation loc)
EnvironmentlookupTagName (const std::string &name, NameDescription **nd)

Private Attributes

Environmentouter_
OrdinaryNames ordinaryNames_
TagNames tagNames_

Detailed Description

This class store the names related to the scope.

Definition at line 66 of file Environment.hpp.


Constructor & Destructor Documentation

cfront::Environment::Environment ( Environment outer = NULL  )  [inline]

Definition at line 68 of file Environment.hpp.


Member Function Documentation

Environment* cfront::Environment::getOuterEnv (  )  const [inline]

Definition at line 73 of file Environment.hpp.

References outer_.

Referenced by cfront::CAnalyzer::removeEnv().

bool cfront::Environment::addOrdinaryName ( const std::string &  name,
Type type,
NameDescription::StorageClassSpecTag  storageSpec,
NameDescription::DeclarationLocation  loc,
NameDescription **  nd 
) [inline]

Add the ordinary name to this environment.

Parameters:
[in] name 
[in] type 
[in] storageSpec 
[out] nd 
[in] loc 
Returns:
false if failed to add the name.

Definition at line 88 of file Environment.hpp.

References cfront::NameDescription::getType(), ordinaryNames_, and cfront::NameDescription::setType().

Referenced by cfront::CAnalyzer::addNameAndType().

Environment* cfront::Environment::lookupOrdinaryName ( const std::string &  name,
NameDescription **  nd 
) [inline]

Look up the ordinary name from this and the outer environments.

Parameters:
[in] name 
[out] nd The NameDescription of the found name. If the name not found, this value is not to set.
Returns:
An environment that found the name, or NULL if the name is not found.

Definition at line 124 of file Environment.hpp.

References lookupOrdinaryName(), ordinaryNames_, and outer_.

Referenced by cfront::CAnalyzer::evalConstExpr(), cfront::CAnalyzer::isTypedefName(), lookupOrdinaryName(), and cfront::CAnalyzer::typeExpr().

bool cfront::Environment::addTagName ( const std::string &  name,
Type type,
NameDescription::DeclarationLocation  loc 
) [inline]

Environment* cfront::Environment::lookupTagName ( const std::string &  name,
NameDescription **  nd 
) [inline]

Look up the tag name from this and the outer environments.

Parameters:
[in] name 
[out] nd The NameDescription of the found name. If the name not found, this value is not to set.
Returns:
An environment that found the name, or NULL if the name is not found.

Definition at line 175 of file Environment.hpp.

References lookupTagName(), outer_, and tagNames_.

Referenced by cfront::CAnalyzer::checkStructOrUnionDefinition(), and lookupTagName().


Field Documentation

Definition at line 209 of file Environment.hpp.

Referenced by addTagName(), getOuterEnv(), lookupOrdinaryName(), and lookupTagName().

Definition at line 211 of file Environment.hpp.

Referenced by addOrdinaryName(), and lookupOrdinaryName().

Definition at line 212 of file Environment.hpp.

Referenced by addTagName(), and lookupTagName().


The documentation for this class was generated from the following file:

Generated on Tue Mar 31 20:19:53 2009 for ctrump by  doxygen 1.5.6