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

Symbol Class Reference

A symbol. More...

#include <symbol_table.h>

Inheritance diagram for Symbol:

Inheritance graph
[legend]
List of all members.

Public Types

enum  Kind {
  k_Variable, k_Namespace, k_Typedef, k_Function,
  k_Enum, k_ClassOrStruct, k_Union, k_ClassTemplate
}
enum  Status { st_Undefined, st_Declared, st_Defined }

Public Methods

const std::string & get_name () const
void set_name (const std::string &n, std::string::size_type bl)
bool is_tagged () const
Status get_status () const
bool is_defined () const
bool is_declared () const
virtual Kind get_kind () const=0
 Symbol ()
virtual ~Symbol ()
virtual Abstract_scopeget_scope ()
 If this symbol names a scope, return that scope. More...

void set_status (Status st)
 Set status of this symbol. More...

std::string get_basename () const
virtual void dump (std::ostream &out)
 Dump symbol on /out/. More...


Static Public Methods

bool is_tagged (Kind k)

Private Attributes

std::string name
std::string::size_type base_len
Status status

Detailed Description

A symbol.

Definition at line 28 of file symbol_table.h.


Member Enumeration Documentation

enum Symbol::Kind
 

Enumeration values:
k_Variable 
k_Namespace 
k_Typedef 
k_Function 
k_Enum 
k_ClassOrStruct 
k_Union 
k_ClassTemplate 

Definition at line 37 of file symbol_table.h.

Referenced by Template_class_adder::add_class(), Default_class_adder::add_class(), is_tagged(), and parse_class().

enum Symbol::Status
 

Enumeration values:
st_Undefined 
st_Declared 
st_Defined 

Definition at line 50 of file symbol_table.h.

Referenced by get_status(), and Variable_symbol::Variable_symbol().


Constructor & Destructor Documentation

Symbol::Symbol   [inline]
 

Definition at line 164 of file symbol_table.h.

Symbol::~Symbol   [virtual]
 

Definition at line 129 of file symbol_table.cc.


Member Function Documentation

void Symbol::dump std::ostream &    out [virtual]
 

Dump symbol on /out/.

Derived classes can override this to add own information.

Reimplemented in Class_symbol, Function_signature, Function_symbol, Typedef_symbol, and Variable_symbol.

Definition at line 169 of file symbol_table.cc.

References get_kind(), is_declared(), and is_defined().

Referenced by Variable_symbol::dump(), Typedef_symbol::dump(), Function_signature::dump(), Function_symbol::dump(), and Class_symbol::dump().

std::string Symbol::get_basename   const
 

Definition at line 158 of file symbol_table.cc.

References base_len, Symbol_name::get_basename_from_symbol(), and name.

Referenced by Function_symbol::fill_in_mangled_names(), and Template_class_symbol::get_specialisation().

virtual Kind Symbol::get_kind   const [pure virtual]
 

Implemented in Class_symbol, Enum_symbol, Function_signature, Function_symbol, Namespace_symbol, Template_class_symbol, Typedef_symbol, and Variable_symbol.

Referenced by dump(), gen_builtin_conversions(), Type::get_promoted_integer(), Type::is_class_type(), Type::is_enum_type(), is_static(), is_tagged(), Symbol_name::lookup_symbol_in_scope(), parse_class(), parse_enum(), process_base_classes(), Type_reader::Type_reader(), Expr_annotator::visit_name(), and Annotator::visit_namespacespec().

const std::string& Symbol::get_name   const [inline]
 

Definition at line 32 of file symbol_table.h.

References name.

Referenced by Class_symbol::add_base_class(), Namespace_scope::add_variable(), Class_scope::add_variable(), Template_visitor::declare_class(), Expr_annotator::do_funcall(), enumerate_conversion_ops(), Function_symbol::fill_in_mangled_names(), get_composite_pointer_type(), Type_symbol::get_type(), Class_symbol::lookup_helper(), Init_handler::make_constructor_call(), make_declaration(), make_name(), Class_symbol::maybe_add_vbc(), parse_class(), print_annotated_tree(), Init_handler::process_brace(), process_initializers(), Expr_annotator::process_member_access(), Expr_annotator::process_pm_expr(), Symbol_table::set_peer(), and Expr_annotator::visit_assign().

Abstract_scope * Symbol::get_scope   [virtual]
 

If this symbol names a scope, return that scope.

Otherwise, return 0

Reimplemented in Class_symbol, and Namespace_symbol.

Definition at line 138 of file symbol_table.cc.

Referenced by Symbol_name::lookup_symbol_in_scope().

Status Symbol::get_status   const [inline]
 

Definition at line 64 of file symbol_table.h.

References status, and Status.

Referenced by Type::is_complete().

bool Symbol::is_declared   const [inline]
 

Definition at line 66 of file symbol_table.h.

References st_Declared, and status.

Referenced by Namespace_scope::add_function_decl(), Class_scope::add_function_decl(), Namespace_scope::add_variable(), dump(), gen_constructors(), parse_class(), and Function_signature::set_generated().

bool Symbol::is_defined   const [inline]
 

Definition at line 65 of file symbol_table.h.

References st_Defined, and status.

Referenced by Class_symbol::add_base_class(), Namespace_scope::add_variable(), Class_scope::add_variable(), Template_visitor::declare_class(), dump(), enumerate_conversion_ops(), gen_constructors(), Function_signature::get_body(), Function_signature::get_initializers(), parse_class(), parse_enum(), and Template_class_symbol::set_definition().

bool Symbol::is_tagged   const [inline]
 

Definition at line 62 of file symbol_table.h.

References get_kind().

bool Symbol::is_tagged Kind    k [inline, static]
 

Definition at line 61 of file symbol_table.h.

References k_Enum, and Kind.

Referenced by Symbol_table::add_symbol(), and Symbol_table::set_peer().

void Symbol::set_name const std::string &    n,
std::string::size_type    bl
[inline]
 

Definition at line 33 of file symbol_table.h.

References base_len, and name.

Referenced by Symbol_table::add_symbol(), and Function_signature::make_builtin().

void Symbol::set_status Status    st
 

Set status of this symbol.

Definition at line 147 of file symbol_table.cc.

References status.

Referenced by Template_class_adder::add_class(), Default_class_adder::add_class(), Namespace_scope::add_function_decl(), Class_scope::add_function_decl(), Namespace_scope::add_variable(), Variable_symbol::define_variable(), Enum_symbol::Enum_symbol(), Function_symbol::Function_symbol(), Namespace_symbol::Namespace_symbol(), parse_class(), Function_signature::set_body(), Type_symbol::set_defined(), Template_class_symbol::set_definition(), Function_signature::set_generated(), Template_class_symbol::Template_class_symbol(), Typedef_symbol::Typedef_symbol(), and Variable_symbol::Variable_symbol().


Member Data Documentation

std::string::size_type Symbol::base_len [private]
 

Definition at line 30 of file symbol_table.h.

Referenced by get_basename(), and set_name().

std::string Symbol::name [private]
 

Definition at line 29 of file symbol_table.h.

Referenced by get_basename(), get_name(), and set_name().

Status Symbol::status [private]
 

Definition at line 70 of file symbol_table.h.

Referenced by get_status(), is_declared(), is_defined(), and set_status().


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