PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::InstantiationSemantic Class Reference

#include <InstantiationSemantic.h>

+ Inheritance diagram for Puma::InstantiationSemantic:

Public Member Functions

 InstantiationSemantic (InstantiationSyntax &, InstantiationBuilder &)
 
void parse_delayed (bool(CCSyntax::*rule)(), CTree *tree)
 
CTreenon_type_param_without_init ()
 
CTreeintroduce_function ()
 
CTreeintroduce_class ()
 
CTreeintroduce_object (CTree *=0)
 
bool is_class_name ()
 
bool is_enum_name ()
 
bool is_typedef_name ()
 
bool is_template_name ()
 
bool is_class_template_name ()
 
bool is_namespace_name ()
 
bool is_this_specialization ()
 
bool is_this_instance ()
 
void set_this_instance ()
 
- Public Member Functions inherited from Puma::CCSemantic
 CCSemantic (CCSyntax &, CCBuilder &)
 
void init (CSemDatabase &, Unit &)
 Initialize the semantic analysis.
 
void init (CSemDatabase &, Unit &, CStructure *, bool, bool, CCInstantiation *)
 
CCInstantiationInstantiation () const
 
virtual CTreeaccess_spec ()
 
virtual CTreetypedef_name ()
 
virtual CTreeclass_name ()
 
virtual CTreeenum_name ()
 
virtual CTreecondition ()
 
virtual CTreecolon_colon ()
 
virtual CTreedecl_spec_seq1 ()
 
virtual CTreenested_name_spec ()
 
virtual CTreenested_name_spec1 ()
 
virtual CTreevalid_id_expr ()
 
virtual CTreepostfix_expr1 ()
 
virtual CTreepostfix_expr2 ()
 
virtual CTreepseudo_dtor_name ()
 
virtual CTreesimple_type_spec ()
 
virtual CTreedirect_new_declarator ()
 
virtual CTreeclass_spec_err ()
 
virtual CTreemember_decl1 ()
 
virtual CTreemember_declarator_err ()
 
virtual void declarator_id (bool)
 
virtual CTreefinish_init_declarator ()
 
virtual CTreeobj_decl (CTree *)
 
virtual bool implicit_int ()
 
virtual CTreeinit_declarator ()
 
virtual CTreeconst_expr ()
 
virtual CTreeenumerator_def ()
 
virtual CTreepure_spec ()
 
virtual CTreeconst_init ()
 
virtual CTreetemplate_param ()
 
virtual CTreeclass_spec ()
 
virtual CTreector_init ()
 
virtual CTreehandler ()
 
virtual CTreeexception_spec ()
 
virtual CTreeintroduce_orig_ns ()
 
virtual CTreeintroduce_ns_extension ()
 
virtual CTreeintroduce_unnamed_ns ()
 
virtual CTreeintroduce_ns_alias ()
 
virtual CTreenamespace_def ()
 
virtual CTreeoriginal_ns_name ()
 
virtual CTreenamespace_alias ()
 
virtual CTreeusing_directive ()
 
virtual CTreeusing_decl ()
 
virtual CTreeaccess_decl (CTree *=0)
 
virtual CTreeintroduce_type_param ()
 
virtual CTreeintroduce_non_type_param ()
 
virtual CTreeintroduce_template_instance ()
 
virtual CTreetemplate_param_list ()
 
virtual CTreetemplate_decl ()
 
virtual CTreetemplate_name (bool class_only=false)
 
virtual CTreetemplate_key ()
 
virtual CTreeexplicit_instantiation ()
 
virtual CTreeexplicit_specialization ()
 
virtual CTreeintroduce_enum ()
 
virtual CTreeintroduce_enumerator ()
 
virtual CTreeintroduce_named_type ()
 
virtual CTreeintroduce_parameter ()
 
virtual CTreeintroduce_member ()
 
virtual CTreeintroduce_tag ()
 
virtual CTreeintroduce_exception ()
 
void enter_param_decl_clause ()
 Enter a function parameter declaration clause.
 
void enter_template_param_list (Syntax::State)
 
void enter_base_spec ()
 
void enter_class_def ()
 
void enter_template_decl ()
 
void enter_member_access (MemberAccessOperator)
 
void enter_postfix_expr ()
 
void enter_exception_spec ()
 
void enter_template_arg_list (Syntax::State)
 
void enter_conv_type_id ()
 
void enter_entity_name (bool v=true)
 
void enter_nested_name ()
 
bool enter_expr ()
 
void enter_extern_decl (bool block_decl)
 
void leave_param_decl_clause ()
 Leave a function parameter declaration clause.
 
void leave_template_param_list ()
 
void leave_base_spec ()
 
void leave_class_def (bool reject=false)
 
void leave_member_access ()
 
void leave_postfix_expr ()
 
void leave_exception_spec ()
 
void leave_template_arg_list ()
 
void leave_conv_type_id ()
 
void leave_entity_name ()
 
void leave_nested_name ()
 
bool leave_expr ()
 
void leave_extern_decl ()
 
bool in_base_spec () const
 
bool in_class_def () const
 
bool in_conv_type_id () const
 
bool in_nested_name () const
 
bool in_expr () const
 
bool in_extern_decl () const
 
bool is_entity_name () const
 
Syntax::State in_template_param_list () const
 
Syntax::State in_template_arg_list () const
 
virtual CProtection::Type protection () const
 
bool non_project_loc ()
 
bool non_primary_loc ()
 
bool skip_tpl_fct_bodies () const
 
bool reset_search_scope (bool=false)
 
CStructurearray_delim (CStructure *=0)
 
CStructureconv_fct_id (CStructure *=0)
 
CTreepostfix_expr ()
 
virtual CTreeadd_base_classes ()
 
- Public Member Functions inherited from Puma::CSemantic
 CSemantic (CSyntax &, CBuilder &)
 
void configure (Config &)
 Configure the semantic analysis.
 
virtual CTreeid_expr ()
 
virtual CTreeabst_declarator ()
 
virtual CTreedirect_abst_declarator ()
 
virtual CTreeparam_decl_clause ()
 
virtual CTreefinish_fct_def ()
 
virtual CTreearg_decl_seq ()
 
virtual CTreedecl_spec_seq_err ()
 
virtual CTreedeclare_parameter ()
 
virtual CTreeidentifier_list ()
 
virtual bool finish_param_check (bool)
 
virtual CTreebegin_decl ()
 
virtual CTreearray_delim ()
 
virtual CTreetrans_unit ()
 
virtual CTreecmpd_stmt ()
 
virtual CTreeselect_stmt ()
 
virtual CTreeiter_stmt ()
 
virtual void introduce_label (CTree *&)
 
void enter_arg_decl_seq ()
 
void leave_arg_decl_seq ()
 
void begin_param_check ()
 
bool in_arg_decl_seq () const
 
bool decl_spec_seq ()
 
bool empty_decl_spec_seq ()
 
void reenter_class_scope ()
 
void enter_scope (CStructure *scp)
 Enter the given scope.
 
void reenter_scope (CStructure *scp)
 Reenter the given scope.
 
void leave_scopes ()
 Leave all scopes entered up to the current scope.
 
- Public Member Functions inherited from Puma::Semantic
void error_sink (ErrorSink &e)
 Set the error output stream object.
 
void undo (CTree *tree)
 Undo the declaration analysis of the given syntax tree node.
 
CTreePrivateName ()
 Create a new anonymous (private) name.
 
void save_state ()
 Save the current semantic analysis state.
 
void forget_state ()
 Discard the saved semantic analysis state.
 
void restore_state ()
 Restore the saved semantic analysis state.
 
CFileInfogetFile ()
 Get the root node of the semantic tree.
 
void enter_local_scope ()
 Enter a local scope.
 
bool in_param_decl_clause ()
 Check if in the declaration of a function parameter clause.
 
void finish_decl ()
 Finish the analysis of the current declaration.
 
void finish_declarator ()
 Finish the analysis of the current declarator.
 
- Public Member Functions inherited from Puma::PtrStack< CObjectInfo >
 PtrStack (long size=8192, long incr=8192)
 Construct a new layered stack.
 
virtual ~PtrStack ()
 Destructor.
 
void Push (const CObjectInfo *item)
 Add a new item on the top of the current layer.
 
void Pop ()
 Remove the top item from the current layer.
 
CObjectInfoTop () const
 Get the top item from the current layer.
 
long Length () const
 Get the number of items added to the current layer.
 
CObjectInfoGet (long n) const
 Get the n-th item on the current layer.
 
void New ()
 Create a new layer.
 
void Forget ()
 Remove the top layer and add its items to the underlying layer.
 
void Reject ()
 Remove the top layer.
 
void Destroy ()
 Remove the top layer and delete its items.
 
long Stacks () const
 Get the number of layers.
 
void Reset ()
 Remove all layers.
 

Protected Member Functions

virtual InstantiationBuilderbuilder () const
 
virtual InstantiationSyntaxsyntax () const
 
- Protected Member Functions inherited from Puma::CCSemantic
virtual void Delete ()
 Delete the top item on the semantic stack.
 
CTreecreateDelayedParse (bool(CCSyntax::*)(), CTree *)
 
void parseDelayed ()
 
void instantiateDelayed (CT_DelayedParse *, CTree *)
 
void enter_scope (CStructure *)
 Enter the given scope.
 
void deleteContainer (int)
 
void setQualName (CObjectInfo *, CObjectInfo *) const
 
CStructuregetQualifiedScope (CStructure *scope) const
 
CTypeInforesolveExpr (CTree *, CTree *=(CTree *) 0) const
 
void calculateAddress (CTree *) const
 
CObjectInfogetLastResolvedName (CT_SimpleName *) const
 
CStructuregetNameScope (CT_SimpleName *, bool=true) const
 
CStructuregetScope (CObjectInfo *obj) const
 
CStructuregetFriendScope (bool skip_tpl_scope=false) const
 
CStructuregetNonTplScope (bool consider_instance_scope=false) const
 
CClassInfogetOutermostIncompleteParsedRecord ()
 
TokengetCloseCurly ()
 
void qualifiedScopeName (CT_SimpleName *, std::ostringstream &) const
 
bool isQualName (CT_SimpleName *) const
 
bool realTypedef (CObjectInfo *) const
 
bool equalType (CTypeInfo *, CTypeInfo *, bool=true) const
 
void lookupName (const Token *, CStructure *, bool)
 
bool isClassOrEnum (CObjectInfo *) const
 
bool inTemplateDecl (CScopeInfo *scope) const
 
void introduceTemplate (CObjectInfo *, CTemplateInfo *, bool is_friend=false)
 
void setTemplateScope (CCNameLookup &, CObjectInfo *, CTypeInfo *, CTemplateInfo *, bool)
 
bool isSpecialization (CTree *) const
 
void setSpecializationName (CTree *, CTemplateInfo *) const
 
bool matchArguments (CT_TemplateName *n1, CT_TemplateName *n2) const
 
CLinkage::Type determine_linkage (CSemDeclSpecs *, SemObjType, CObjectInfo *=(CObjectInfo *) 0) const
 
CStorage::Type determine_storage_class (CSemDeclSpecs *) const
 
void setLanguage (CObjectInfo *) const
 
void setProtection (CObjectInfo *) const
 
void linkFctDecls (CCNameLookup &, CObjectInfo *) const
 
void linkCtorDecls (CObjectInfo *) const
 
void addImplicitThisObject (CFunctionInfo *, CTypeInfo *, CTree *)
 
void declareNamespaceStd ()
 
void declareImplicitFcts ()
 
void declareSpecialMembers ()
 
CFunctionInfocreateMethod (const char *, CRecord *, CTypeInfo *)
 
bool isRefToClass (CTypeInfo *, CRecord *) const
 
bool isBaseClass (CClassInfo *, CClassInfo *) const
 
void addBaseClasses (CClassInfo *, CT_ClassDef *)
 
void addBaseClass (CClassInfo *, CT_BaseSpec *)
 
virtual bool check_function_lookup (CCNameLookup &, CStructure *, CSemDeclSpecs *, CCSemDeclarator &, CTree *, bool)
 
virtual bool check_member_lookup (CCNameLookup &, CStructure *, CSemDeclSpecs *, CCSemDeclarator &, CTree *, bool &, bool)
 
virtual bool check_object_lookup (CCNameLookup &, CStructure *, CSemDeclSpecs *, CCSemDeclarator &, CTree *, bool &, CObjectInfo *&)
 
- Protected Member Functions inherited from Puma::CSemantic
void declareImplicitFcts ()
 
CObjectInfolookup (const char *, SemObjType, bool=false) const
 
CObjectInfolookup (CT_SimpleName *, SemObjType, bool=false) const
 
CObjectInfolookup (const char *, CStructure *, SemObjType, bool) const
 
CObjectInfolookupBuiltin (const char *name) const
 
CLinkage::Type determine_linkage (CSemDeclSpecs *, SemObjType, CObjectInfo *=(CObjectInfo *) 0) const
 
CStorage::Type determine_storage_class (CSemDeclSpecs *, SemObjType, CLinkage::Type) const
 
bool typeMatch (CTypeInfo *, CTypeInfo *) const
 
CStructurefindParent () const
 
void setSpecifiers (CObjectInfo *, CSemDeclSpecs *) const
 
bool isRedefiningTypedef (CObjectInfo *, int obj_type) const
 
bool isRedefinedFunction (CFunctionInfo *) const
 
CAttributeInfocreateAttribute (const char *, CStructure *, CTypeInfo *, bool=false)
 
CTypedefInfocreateTypedef (const char *, CStructure *, CTypeInfo *)
 
void createParameter (CFunctionInfo *, CTypeInfo *)
 
CFunctionInfocreateFunction (const char *, CStructure *, CTypeInfo *)
 
CTypeInforesolveExpr (CTree *expr, CTree *base) const
 
- Protected Member Functions inherited from Puma::Semantic
 Semantic ()
 Constructor.
 
virtual ~Semantic ()
 Destructor.
 
void common_settings (CObjectInfo *info, CTree *tree)
 Apply command settings on the given semantic object.
 
void common_settings (CObjectInfo *info, CTree *tree, CSemDeclarator *d)
 Apply command settings on the given semantic object.
 
void Push (CObjectInfo *info)
 Push the given semantic information object on the semantic stack.
 
bool in_decl () const
 Check if currently analysing a declaration.
 
void decl_begin (CSemDeclSpecs *ds)
 Begin analysing a declaration.
 
void decl_end ()
 Finish analysing a declaration.
 
void decl_specs_begin (CT_DeclSpecSeq *dss)
 Begin analysing a declaration specifier sequence.
 
void decl_specs_end ()
 Finish analysing a declaration specifier sequence.
 
CSemDeclSpecssem_decl_specs () const
 Get the semantic information for the currently analysed declaration specifier sequence.
 
CT_DeclSpecSeqdecl_specs () const
 Get the currently analysed declaration specifier sequence.
 
- Protected Member Functions inherited from Puma::PtrStack< CObjectInfo >
virtual void Remove ()
 Remove the top item of the current layer.
 

Additional Inherited Members

- Public Types inherited from Puma::CCSemantic
enum  MemberAccessOperator {
  MAO_NONE = 0 ,
  MAO_PTS ,
  MAO_DOT
}
 
- Public Attributes inherited from Puma::CCSemantic
CStructuresearch_scope
 
CStructurelast_search_scope
 
CStructurelast_scope
 
bool dep_nested_name
 
- Protected Types inherited from Puma::CSemantic
enum  SemObjType {
  CLASS ,
  UNION ,
  ENUM ,
  TYPEDEF ,
  FCT ,
  ATTRIB ,
  ARG ,
  TAG ,
  NON_TAG ,
  ANY
}
 
- Protected Attributes inherited from Puma::CCSemantic
CRecord_outermost_class_def
 
Stack< bool > _in_base_spec
 
Stack< bool > _in_nested_name
 
Stack< bool > _in_conv_type_id
 
Stack< const char * > _in_extern_decl
 
Stack< CProtection::Type_protection
 
CCNameLookup shared_nl
 
struct { 
 
   const Token *   tok 
 
   CStructure *   scope 
 
   bool   nested 
 
   bool   nested_name 
 
   bool   base_spec 
 
last_token_nl 
 
Stack< Syntax::State_in_template_arg_list
 
Stack< Syntax::State_in_template_param_list
 
Stack< bool > parsing_entity_name
 
Stack< bool > _in_expr
 
Stack< CTree * > _postfix_expr
 
Stack< MemberAccessOperator_in_memb_access_expr
 
bool expect_template
 
bool parsing_fct_inst
 
bool parsing_class_inst
 
bool real_inst
 
CCInstantiationtpl_inst
 
Unit_last_unit
 
bool _last_body_skipped
 
- Protected Attributes inherited from Puma::CSemantic
bool in_arg_decl
 
bool _in_arg_decl_seq
 
bool is_type_name
 
bool support_implicit_int
 
PtrStack< CStructurenon_record_scopes
 
- Protected Attributes inherited from Puma::Semantic
CSemDatabase_db
 Database of all semantic objects of the semantic tree.
 
CFileInfo_file
 Top level semantic object representing the file scope.
 
ErrorSink_err
 Error output stream.
 
long _Anonymous
 Counter for generating anonymous (private) names.
 
CEnumInfocurrent_enum
 The current enumeration, if inside the definition of an enumeration.
 
CStructurecurrent_fct
 The current function, if inside the definition of a function.
 
CStructurecurrent_scope
 The current scope.
 
BCStack< CSemDeclSpecs *, 256 > _sem_decl_specs
 Stack for the type analysis of declarations.
 
BCStack< CT_DeclSpecSeq *, 256 > _decl_specs
 Stack for collecting declaration specifiers.
 
BCStack< bool, 256 > _in_param_decl_clause
 Stack for the state of analysing a function parameter list.
 
BCStack< bool, 256 > _in_decl
 Stack for the state of analysing a declaration.
 

Constructor & Destructor Documentation

◆ InstantiationSemantic()

Puma::InstantiationSemantic::InstantiationSemantic ( InstantiationSyntax & s,
InstantiationBuilder & b )
inline

Member Function Documentation

◆ builder()

InstantiationBuilder & Puma::InstantiationSemantic::builder ( ) const
inlineprotectedvirtual

Reimplemented from Puma::CCSemantic.

◆ introduce_class()

CTree * Puma::InstantiationSemantic::introduce_class ( )
virtual

Reimplemented from Puma::CCSemantic.

◆ introduce_function()

CTree * Puma::InstantiationSemantic::introduce_function ( )
virtual

Reimplemented from Puma::CCSemantic.

◆ introduce_object()

CTree * Puma::InstantiationSemantic::introduce_object ( CTree * = 0)
virtual

Reimplemented from Puma::CCSemantic.

◆ is_class_name()

bool Puma::InstantiationSemantic::is_class_name ( )

◆ is_class_template_name()

bool Puma::InstantiationSemantic::is_class_template_name ( )

◆ is_enum_name()

bool Puma::InstantiationSemantic::is_enum_name ( )

◆ is_namespace_name()

bool Puma::InstantiationSemantic::is_namespace_name ( )

◆ is_template_name()

bool Puma::InstantiationSemantic::is_template_name ( )

◆ is_this_instance()

bool Puma::InstantiationSemantic::is_this_instance ( )

◆ is_this_specialization()

bool Puma::InstantiationSemantic::is_this_specialization ( )

◆ is_typedef_name()

bool Puma::InstantiationSemantic::is_typedef_name ( )

◆ non_type_param_without_init()

CTree * Puma::InstantiationSemantic::non_type_param_without_init ( )

◆ parse_delayed()

void Puma::InstantiationSemantic::parse_delayed ( bool(CCSyntax::*)() rule,
CTree * tree )
virtual

Reimplemented from Puma::CCSemantic.

◆ set_this_instance()

void Puma::InstantiationSemantic::set_this_instance ( )

◆ syntax()

InstantiationSyntax & Puma::InstantiationSemantic::syntax ( ) const
inlineprotectedvirtual

Reimplemented from Puma::CCSemantic.