Synopsis - Synopsis::SymbolFactory

namespace Synopsis
class SymbolFactory
File: ../Synopsis/SymbolFactory.hh

SymbolFactory populates a symbol table.

Public Enums Summary:
Language NONE, C99, CXX
Public Member functions Summary:
constructor SymbolFactory(Language = CXX)

Create a symbol lookup table for the given language.

SymbolLookup::Scope* current_scope()
void enter_scope(const PTree::NamespaceSpec*)
void enter_scope(const PTree::ClassSpec*)
void enter_scope(const PTree::Node*)
void enter_scope(const PTree::FunctionDefinition*)
void enter_scope(const PTree::TemplateDecl*)
void enter_scope(const PTree::Block*)
void leave_scope()
void declare(const PTree::Declaration*)
void declare(const PTree::Typedef*)
void declare(const PTree::EnumSpec*)

declare the enumeration as a new TYPE as well as all the enumerators as CONST

void declare(const PTree::NamespaceSpec*)

declare the namespace as a new NAMESPACE

void declare(const PTree::ClassSpec*)

declare the class as a new TYPE

void declare(const PTree::TemplateDecl*)
void declare(const PTree::TypeParameter*)
void declare(const PTree::UsingDirective*)
void declare(const PTree::ParameterDeclaration*)
void declare(const PTree::UsingDeclaration*)
Private Typedefs Summary:
std::stack<SymbolLookup::Scope*> Scopes
Private Member functions Summary:
SymbolLookup::Scope* lookup_scope_of_qname(PTree::Encoding&, const PTree::Node*)

Lookup the scope of a qualified name.

Private Data members Summary:
Language my_language
Scopes my_scopes
SymbolLookup::PrototypeScope* my_prototype

When parsing a function definition the declarator is seen first, and thus a prototype is created to hold the parameters.

SymbolLookup::TemplateParameterScope* my_template_parameters

When parsing a class or function template the template-parameter-list is seen first.

Enumerators Summary:
NONE
C99
CXX
Public Member functions Details:
constructor SymbolFactory(Language = CXX)

Create a symbol lookup table for the given language. Right now only CXX is supported.

void declare(const PTree::EnumSpec*)

declare the enumeration as a new TYPE as well as all the enumerators as CONST

void declare(const PTree::NamespaceSpec*)

declare the namespace as a new NAMESPACE

void declare(const PTree::ClassSpec*)

declare the class as a new TYPE

Private Member functions Details:
SymbolLookup::Scope* lookup_scope_of_qname(PTree::Encoding&, const PTree::Node*)

Lookup the scope of a qualified name. The encoded name is modified in place to refer to the unqualified name.

Private Data members Details:
SymbolLookup::PrototypeScope* my_prototype

When parsing a function definition the declarator is seen first, and thus a prototype is created to hold the parameters. Later, when the function definition proper is seen, the symbols are transfered and the prototype is deleted.

SymbolLookup::TemplateParameterScope* my_template_parameters

When parsing a class or function template the template-parameter-list is seen first. Since ClassSpec and Declarator don't know they are part of a template declaration, we cache it here so it gets consumed when the Class or PrototypeScope are created.

Generated on Thu Apr 16 16:27:41 2009 by
synopsis (version devel)