OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
t_scope Class Reference

#include <t_scope.h>

Public Member Functions

 t_scope ()
 
void add_type (std::string name, t_type *type)
 
t_typeget_type (std::string name)
 
void add_service (std::string name, t_service *service)
 
t_serviceget_service (std::string name)
 
void add_constant (std::string name, t_const *constant)
 
t_constget_constant (std::string name)
 
void print ()
 
void resolve_const_value (t_const_value *const_val, t_type *ttype)
 

Private Attributes

std::map< std::string, t_type * > types_
 
std::map< std::string, t_const * > constants_
 
std::map< std::string,
t_service * > 
services_
 

Detailed Description

This represents a variable scope used for looking up predefined types and services. Typically, a scope is associated with a t_program. Scopes are not used to determine code generation, but rather to resolve identifiers at parse time.

Definition at line 48 of file t_scope.h.

Constructor & Destructor Documentation

t_scope::t_scope ( )
inline

Definition at line 50 of file t_scope.h.

Member Function Documentation

void t_scope::add_constant ( std::string  name,
t_const constant 
)
inline

Definition at line 78 of file t_scope.h.

void t_scope::add_service ( std::string  name,
t_service service 
)
inline

Definition at line 60 of file t_scope.h.

void t_scope::add_type ( std::string  name,
t_type type 
)
inline

Definition at line 52 of file t_scope.h.

t_const* t_scope::get_constant ( std::string  name)
inline

Definition at line 86 of file t_scope.h.

t_service* t_scope::get_service ( std::string  name)
inline

Definition at line 64 of file t_scope.h.

t_type* t_scope::get_type ( std::string  name)
inline

Definition at line 56 of file t_scope.h.

void t_scope::print ( void  )
inline

Definition at line 90 of file t_scope.h.

void t_scope::resolve_const_value ( t_const_value const_val,
t_type ttype 
)
inline

Definition at line 99 of file t_scope.h.

Here is the call graph for this function:

Member Data Documentation

std::map<std::string, t_const*> t_scope::constants_
private

Definition at line 226 of file t_scope.h.

std::map<std::string, t_service*> t_scope::services_
private

Definition at line 229 of file t_scope.h.

std::map<std::string, t_type*> t_scope::types_
private

Definition at line 223 of file t_scope.h.


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