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

Environment Class Reference

#include <env.h>

Collaboration diagram for Environment:

Collaboration graph
[legend]
List of all members.

Public Methods

 Environment (Walker *w)
 Environment (Environment *e)
 Environment (Environment *e, Walker *w)
bool IsEmpty ()
Environment * GetOuterEnvironment ()
Environment * GetBottom ()
void AddBaseclassEnv (Environment *e)
WalkerGetWalker ()
void SetWalker (Walker *w)
ClassLookupClassMetaobject (Ptree *name)
bool LookupType (const char *name, int len, Bind *&t)
bool Lookup (Ptree *name, bool &is_type_name, TypeInfo &t)
bool Lookup (Ptree *name, TypeInfo &t)
bool Lookup (Ptree *, Bind *&)
bool LookupTop (Ptree *, Bind *&)
bool LookupTop (const char *name, int len, Bind *&t)
bool LookupAll (const char *name, int len, Bind *&t)
bool RecordVariable (char *name, Class *c)
bool RecordPointerVariable (char *name, Class *c)
int AddEntry (char *, int, Bind *)
int AddDupEntry (char *, int, Bind *)
void RecordNamespace (Environment *, Ptree *)
Environment * LookupNamespace (const char *name, int len)
Environment * LookupNamespace0 (Ptree *)
void RecordUsing (Ptree *name)
void RecordUsingNamespace (Ptree *name)
void RecordTypedefName (Ptree *)
void RecordEnumName (Ptree *)
void RecordClassName (char *, Class *)
void RecordTemplateClass (Ptree *, Class *)
Environment * RecordTemplateFunction (Ptree *, Ptree *)
Environment * RecordDeclarator (Ptree *)
Environment * DontRecordDeclarator (Ptree *)
void RecordMetaclassName (Ptree *)
PtreeLookupMetaclass (Ptree *)
void SetMetaobject (Class *m)
ClassIsClassEnvironment ()
PtreeIsNamespace ()
ClassLookupThis ()
Environment * IsMember (Ptree *)
void Dump ()
void Dump (int)
PtreeGetLineNumber (Ptree *, int &)

Static Public Methods

bool RecordClasskeyword (char *, char *)
PtreeLookupClasskeyword (Ptree *)

Private Methods

Environment * LookupNamespace0 (const char *, int)

Static Private Methods

bool SearchBaseOrUsing (Environment *this_env, bool(Environment::*func)(const char *, int, Bind *&), const char *name, int len, Bind *&t)

Private Attributes

Environment * next
HashTablehtable
Classmetaobject
Walkerwalker
PtreeArray metaclasses
Array baseclasses_or_using
Array namespaces
Ptreenamespace_name

Static Private Attributes

PtreeArrayclasskeywords = 0

Constructor & Destructor Documentation

Environment::Environment Walker   w
 

Definition at line 32 of file env.cc.

References htable, metaobject, namespace_name, next, and walker.

Environment::Environment Environment *    e
 

Definition at line 42 of file env.cc.

References htable, metaobject, namespace_name, next, and walker.

Environment::Environment Environment *    e,
Walker   w
 

Definition at line 52 of file env.cc.

References htable, metaobject, namespace_name, next, and walker.


Member Function Documentation

void Environment::AddBaseclassEnv Environment *    e [inline]
 

Definition at line 39 of file env.h.

Referenced by Walker::RecordBaseclassEnv(), and RecordUsingNamespace().

int Environment::AddDupEntry char *   ,
int   ,
Bind  
 

Definition at line 285 of file env.cc.

References HashTable::AddDupEntry(), and htable.

Referenced by RecordDeclarator().

int Environment::AddEntry char *   ,
int   ,
Bind  
 

Definition at line 281 of file env.cc.

References HashTable::AddEntry(), and htable.

Referenced by RecordClassName(), RecordEnumName(), RecordTemplateClass(), RecordTemplateFunction(), and RecordTypedefName().

Environment * Environment::DontRecordDeclarator Ptree  
 

Definition at line 503 of file env.cc.

References Encoding::GetBaseName(), Ptree::GetEncodedName(), ntDeclarator, and Ptree::What().

Referenced by ClassWalker::ConstructMember(), and ClassBodyWalker::TranslateFunctionImplementation().

void Environment::Dump int   
 

Definition at line 614 of file env.cc.

References Dump(), and next.

void Environment::Dump  
 

Definition at line 608 of file env.cc.

References HashTable::Dump(), and htable.

Referenced by Dump().

Environment * Environment::GetBottom  
 

Definition at line 67 of file env.cc.

References next.

Referenced by Encoding::GetBaseName().

Ptree * Environment::GetLineNumber Ptree  ,
int &   
 

Definition at line 628 of file env.cc.

References Walker::GetParser(), Ptree::GetPosition(), Parser::LineNumber(), and walker.

Environment* Environment::GetOuterEnvironment   [inline]
 

Definition at line 37 of file env.h.

Referenced by Walker::ExitScope(), and TypeInfo::GetQualifiedName2().

Walker* Environment::GetWalker   [inline]
 

Definition at line 40 of file env.h.

Referenced by Class::AppendAfterStatement(), Class::AppendAfterToplevel(), Walker::ChangeScope(), Class::ErrorMessage(), Class::InsertBeforeStatement(), Class::InsertBeforeToplevel(), Class::InsertDeclaration(), Class::LookupClientData(), Class::TranslateArguments(), Class::TranslateExpression(), Class::TranslateFunctionBody(), Class::TranslateNewType(), and Class::WarningMessage().

Class* Environment::IsClassEnvironment   [inline]
 

Definition at line 79 of file env.h.

Referenced by TypeInfo::GetQualifiedName2(), RecordUsingNamespace(), ClassWalker::TranslateAssign(), ClassWalker::TranslateFuncall(), ClassWalker::TranslateFunctionImplementation(), ClassBodyWalker::TranslateFunctionImplementation(), ClassWalker::TranslatePostfix(), ClassWalker::TranslateTemplateFunction(), ClassWalker::TranslateUnary(), and ClassWalker::TranslateVariable().

bool Environment::IsEmpty  
 

Definition at line 62 of file env.cc.

References htable, and HashTable::IsEmpty().

Environment * Environment::IsMember Ptree  
 

Definition at line 578 of file env.cc.

References Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::IsLeaf(), Bind::IsType(), LookupTop(), metaobject, and next.

Referenced by ClassWalker::TranslateAssign(), ClassWalker::TranslateFuncall(), ClassWalker::TranslatePostfix(), ClassWalker::TranslateUnary(), and ClassWalker::TranslateVariable().

Ptree* Environment::IsNamespace   [inline]
 

Definition at line 80 of file env.h.

bool Environment::Lookup Ptree  ,
Bind *&   
 

Definition at line 184 of file env.cc.

References FALSE, Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetLength(), Ptree::GetPosition(), Ptree::IsLeaf(), LookupAll(), and MopErrorMessage().

bool Environment::Lookup Ptree   name,
TypeInfo   t
 

Definition at line 155 of file env.cc.

References FALSE, Bind::GetType(), Lookup(), TRUE, and TypeInfo::Unknown().

bool Environment::Lookup Ptree   name,
bool &    is_type_name,
TypeInfo   t
 

Definition at line 169 of file env.cc.

References FALSE, Bind::GetType(), Bind::IsType(), TRUE, and TypeInfo::Unknown().

Referenced by Lookup(), Class::LookupMemberType(), Walker::MakeTemplateInstantiationMetaobject(), TypeInfo::SetMember(), ClassWalker::TranslateAssignInitializer(), ClassWalker::TranslateInitializeArgs(), ClassWalker::TranslateStaticUserStatement(), and Walker::TypeofVariable().

bool Environment::LookupAll const char *    name,
int    len,
Bind *&    t
 

Definition at line 252 of file env.cc.

References FALSE, HashValue, htable, HashTable::Lookup(), LookupAll(), next, SearchBaseOrUsing(), and TRUE.

Referenced by Lookup(), LookupAll(), RecordClassName(), RecordTemplateClass(), and RecordUsing().

Ptree * Environment::LookupClasskeyword Ptree   [static]
 

Definition at line 550 of file env.cc.

References classkeywords, Ptree::Eq(), PtreeArray::Number(), PtreeArray::Ref(), and uint.

Referenced by Walker::LookupMetaclass(), and RecordClasskeyword().

Class * Environment::LookupClassMetaobject Ptree   name
 

Definition at line 76 of file env.cc.

References TypeInfo::ClassMetaobject(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetLength(), Ptree::GetPosition(), Bind::GetType(), Ptree::IsLeaf(), LookupType(), and MopErrorMessage().

Referenced by MemberList::AppendBaseClass(), TypeInfo::GetQualifiedName(), Class::IsSubclassOf(), Walker::LookupBaseMetaclass(), Class::NthBaseClass(), and Walker::RecordBaseclassEnv().

Ptree * Environment::LookupMetaclass Ptree  
 

Definition at line 524 of file env.cc.

References Ptree::Eq(), metaclasses, PtreeArray::Number(), Ptree::Third(), and uint.

Referenced by Walker::LookupMetaclass().

Environment * Environment::LookupNamespace const char *    name,
int    len
 

Definition at line 297 of file env.cc.

References baseclasses_or_using, LookupNamespace0(), next, Environment::Array::Number(), Environment::Array::Ref(), and uint.

Referenced by RecordUsingNamespace(), and Encoding::ResolveTypedefName().

Environment * Environment::LookupNamespace0 const char *   ,
int   
[private]
 

Definition at line 330 of file env.cc.

References Ptree::Eq(), namespace_name, namespaces, Environment::Array::Number(), and Environment::Array::Ref().

Environment * Environment::LookupNamespace0 Ptree  
 

Definition at line 322 of file env.cc.

References Ptree::GetLength(), and Ptree::GetPosition().

Referenced by LookupNamespace(), and Walker::TranslateNamespaceSpec().

Class * Environment::LookupThis  
 

Definition at line 565 of file env.cc.

References metaobject, and next.

Referenced by ClassBodyWalker::TranslateDeclarator(), and Walker::TypeofThis().

bool Environment::LookupTop const char *    name,
int    len,
Bind *&    t
 

Definition at line 242 of file env.cc.

References HashValue, htable, HashTable::Lookup(), LookupTop(), SearchBaseOrUsing(), and TRUE.

bool Environment::LookupTop Ptree  ,
Bind *&   
 

Definition at line 212 of file env.cc.

References FALSE, Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetLength(), Ptree::GetPosition(), Ptree::IsLeaf(), and MopErrorMessage().

Referenced by IsMember(), and LookupTop().

bool Environment::LookupType const char *    name,
int    len,
Bind *&    t
 

Definition at line 113 of file env.cc.

References FALSE, HashValue, htable, Bind::isTemplateFunction, Bind::isVarName, HashTable::LookupEntries(), LookupType(), next, SearchBaseOrUsing(), TRUE, and Bind::What().

Referenced by Encoding::GetBaseNameIfTemplate(), TypeInfo::IsEnum(), LookupClassMetaobject(), LookupType(), TypeInfo::ResolveTypedef(), Encoding::ResolveTypedefName(), and TypeInfo::SkipCv().

bool Environment::RecordClasskeyword char *   ,
char *   
[static]
 

Definition at line 536 of file env.cc.

References PtreeArray::Append(), classkeywords, FALSE, LookupClasskeyword(), and TRUE.

Referenced by Class::RegisterMetaclass().

void Environment::RecordClassName char *   ,
Class  
 

Definition at line 419 of file env.cc.

References AddEntry(), Encoding::GetBaseName(), Bind::isClassName, LookupAll(), Bind::SetClassMetaobject(), and Bind::What().

Referenced by Walker::TranslateClassSpec().

Environment * Environment::RecordDeclarator Ptree  
 

Definition at line 482 of file env.cc.

References AddDupEntry(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetEncodedType(), ntDeclarator, and Ptree::What().

Referenced by ClassWalker::RecordMemberDeclaration(), Walker::TranslateArgDeclList2(), Walker::TranslateDeclarators(), Walker::TranslateFunctionImplementation(), and ClassWalker::TranslateFunctionImplementation().

void Environment::RecordEnumName Ptree  
 

Definition at line 403 of file env.cc.

References AddEntry(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetLength(), Ptree::GetPosition(), Ptree::IsLeaf(), and Ptree::Second().

Referenced by Walker::TranslateEnumSpec().

void Environment::RecordMetaclassName Ptree  
 

Definition at line 518 of file env.cc.

References PtreeArray::Append(), metaclasses, and Ptree::Third().

Referenced by ClassWalker::RecordMembers(), Walker::TranslateMetaclassDecl(), and ClassWalker::TranslateMetaclassDecl().

void Environment::RecordNamespace Environment *   ,
Ptree  
 

Definition at line 289 of file env.cc.

References Environment::Array::Append(), namespace_name, and namespaces.

Referenced by Walker::TranslateNamespaceSpec().

bool Environment::RecordPointerVariable char *    name,
Class   c
 

Definition at line 273 of file env.cc.

References HashTable::AddEntry(), Encoding::Get(), htable, Class::Name(), Encoding::PtrOperator(), and Encoding::SimpleName().

void Environment::RecordTemplateClass Ptree  ,
Class  
 

Definition at line 441 of file env.cc.

References AddEntry(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Bind::isTemplateClass, LookupAll(), Bind::SetClassMetaobject(), and Bind::What().

Referenced by Walker::TranslateTemplateClass().

Environment * Environment::RecordTemplateFunction Ptree  ,
Ptree  
 

Definition at line 463 of file env.cc.

References AddEntry(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::IsA(), ntDeclarator, and Ptree::Third().

Referenced by Walker::TranslateTemplateFunction(), and ClassWalker::TranslateTemplateFunction().

void Environment::RecordTypedefName Ptree  
 

Definition at line 383 of file env.cc.

References AddEntry(), Ptree::Car(), Encoding::GetBaseName(), Ptree::GetEncodedName(), Ptree::GetEncodedType(), Ptree::ListTail(), ntDeclarator, and Ptree::What().

Referenced by ClassWalker::RecordMembers(), and Walker::TranslateTypedef().

void Environment::RecordUsing Ptree   name
 

Definition at line 347 of file env.cc.

References HashTable::AddEntry(), Encoding::GetBaseName(), Ptree::GetEncodedName(), htable, and LookupAll().

Referenced by Walker::TranslateUsing().

void Environment::RecordUsingNamespace Ptree   name
 

Definition at line 366 of file env.cc.

References AddBaseclassEnv(), Encoding::GetBaseName(), Ptree::GetEncodedName(), IsClassEnvironment(), and LookupNamespace().

Referenced by Walker::TranslateUsing().

bool Environment::RecordVariable char *    name,
Class   c
 

Definition at line 266 of file env.cc.

References HashTable::AddEntry(), Encoding::Get(), htable, Class::Name(), and Encoding::SimpleName().

bool Environment::SearchBaseOrUsing Environment *    this_env,
bool(Environment::*    func)(const char *, int, Bind *&),
const char *    name,
int    len,
Bind *&    t
[static, private]
 

Definition at line 137 of file env.cc.

References baseclasses_or_using, FALSE, next, Environment::Array::Number(), Environment::Array::Ref(), TRUE, and uint.

Referenced by LookupAll(), LookupTop(), and LookupType().

void Environment::SetMetaobject Class   m [inline]
 

Definition at line 78 of file env.h.

Referenced by Class::SetEnvironment().

void Environment::SetWalker Walker   w [inline]
 

Definition at line 41 of file env.h.

Referenced by Walker::ChangeScope(), and Walker::RestoreScope().


Member Data Documentation

Array Environment::baseclasses_or_using [private]
 

Definition at line 114 of file env.h.

Referenced by LookupNamespace(), and SearchBaseOrUsing().

PtreeArray * Environment::classkeywords = 0 [static, private]
 

Definition at line 30 of file env.cc.

Referenced by LookupClasskeyword(), and RecordClasskeyword().

HashTable* Environment::htable [private]
 

Definition at line 109 of file env.h.

Referenced by AddDupEntry(), AddEntry(), Dump(), Environment(), IsEmpty(), LookupAll(), LookupTop(), LookupType(), RecordPointerVariable(), RecordUsing(), and RecordVariable().

PtreeArray Environment::metaclasses [private]
 

Definition at line 112 of file env.h.

Referenced by LookupMetaclass(), and RecordMetaclassName().

Class* Environment::metaobject [private]
 

Definition at line 110 of file env.h.

Referenced by Environment(), IsMember(), and LookupThis().

Ptree* Environment::namespace_name [private]
 

Definition at line 117 of file env.h.

Referenced by Environment(), LookupNamespace0(), and RecordNamespace().

Array Environment::namespaces [private]
 

Definition at line 116 of file env.h.

Referenced by LookupNamespace0(), and RecordNamespace().

Environment* Environment::next [private]
 

Definition at line 108 of file env.h.

Referenced by Dump(), Environment(), GetBottom(), IsMember(), LookupAll(), LookupNamespace(), LookupThis(), LookupType(), and SearchBaseOrUsing().

Walker* Environment::walker [private]
 

Definition at line 111 of file env.h.

Referenced by Environment(), and GetLineNumber().


The documentation for this class was generated from the following files:
Generated on Mon Feb 10 17:35:31 2003 for VFiasco Semantics Compiler by doxygen1.2.15