PUMA Library Reference Manual
|
#include <CSemantic.h>
Public Member Functions | |
CSemantic (CSyntax &, CBuilder &) | |
virtual void | init (CSemDatabase &, Unit &) |
Initialize the semantic analysis. | |
void | configure (Config &) |
Configure the semantic analysis. | |
virtual CTree * | id_expr () |
virtual CTree * | typedef_name () |
virtual CTree * | init_declarator () |
virtual CTree * | abst_declarator () |
virtual CTree * | direct_abst_declarator () |
virtual CTree * | param_decl_clause () |
virtual CTree * | finish_fct_def () |
virtual CTree * | arg_decl_seq () |
virtual CTree * | decl_spec_seq1 () |
virtual CTree * | decl_spec_seq_err () |
virtual CTree * | declare_parameter () |
virtual CTree * | identifier_list () |
virtual bool | finish_param_check (bool) |
virtual CTree * | begin_decl () |
virtual CTree * | array_delim () |
virtual CTree * | enumerator_def () |
virtual CTree * | trans_unit () |
virtual CTree * | class_spec () |
virtual CTree * | cmpd_stmt () |
virtual CTree * | select_stmt () |
virtual CTree * | iter_stmt () |
virtual void | introduce_label (CTree *&) |
virtual CTree * | introduce_object (CTree *=0) |
virtual CTree * | introduce_named_type () |
virtual CTree * | introduce_enum () |
virtual CTree * | introduce_enumerator () |
virtual CTree * | introduce_function () |
virtual CTree * | introduce_parameter () |
virtual CTree * | introduce_class () |
virtual CTree * | introduce_member () |
virtual CTree * | introduce_tag () |
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 () |
virtual bool | implicit_int () |
virtual CProtection::Type | protection () const |
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. | |
CTree * | PrivateName () |
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. | |
CFileInfo * | getFile () |
Get the root node of the semantic tree. | |
void | enter_local_scope () |
Enter a local scope. | |
virtual void | enter_param_decl_clause () |
Enter a function parameter declaration clause. | |
virtual void | leave_param_decl_clause () |
Leave a function parameter declaration clause. | |
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. | |
CObjectInfo * | Top () const |
Get the top item from the current layer. | |
long | Length () const |
Get the number of items added to the current layer. | |
CObjectInfo * | Get (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 Types | |
enum | SemObjType { CLASS , UNION , ENUM , TYPEDEF , FCT , ATTRIB , ARG , TAG , NON_TAG , ANY } |
Protected Member Functions | |
void | declareImplicitFcts () |
virtual CBuilder & | builder () const |
virtual CSyntax & | syntax () const |
virtual void | Delete () |
Delete the top item on the semantic stack. | |
CObjectInfo * | lookup (const char *, SemObjType, bool=false) const |
CObjectInfo * | lookup (CT_SimpleName *, SemObjType, bool=false) const |
CObjectInfo * | lookup (const char *, CStructure *, SemObjType, bool) const |
CObjectInfo * | lookupBuiltin (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 |
CStructure * | findParent () const |
void | setSpecifiers (CObjectInfo *, CSemDeclSpecs *) const |
bool | isRedefiningTypedef (CObjectInfo *, int obj_type) const |
bool | isRedefinedFunction (CFunctionInfo *) const |
CAttributeInfo * | createAttribute (const char *, CStructure *, CTypeInfo *, bool=false) |
CTypedefInfo * | createTypedef (const char *, CStructure *, CTypeInfo *) |
void | createParameter (CFunctionInfo *, CTypeInfo *) |
CFunctionInfo * | createFunction (const char *, CStructure *, CTypeInfo *) |
CTypeInfo * | resolveExpr (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. | |
CSemDeclSpecs * | sem_decl_specs () const |
Get the semantic information for the currently analysed declaration specifier sequence. | |
CT_DeclSpecSeq * | decl_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. | |
Protected Attributes | |
bool | in_arg_decl |
bool | _in_arg_decl_seq |
bool | is_type_name |
bool | support_implicit_int |
PtrStack< CStructure > | non_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. | |
CEnumInfo * | current_enum |
The current enumeration, if inside the definition of an enumeration. | |
CStructure * | current_fct |
The current function, if inside the definition of a function. | |
CStructure * | current_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. | |
|
protected |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
void Puma::CSemantic::begin_param_check | ( | ) |
|
inlineprotectedvirtual |
Reimplemented in Puma::CCSemantic, and Puma::InstantiationSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
|
virtual |
Configure the semantic analysis.
c | The configuration settings. |
Reimplemented from Puma::Semantic.
|
protected |
|
protected |
|
protected |
|
protected |
bool Puma::CSemantic::decl_spec_seq | ( | ) |
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
|
virtual |
|
inlineprotected |
|
protectedvirtual |
Delete the top item on the semantic stack.
To be implemented by derived classes.
Reimplemented from Puma::Semantic.
Reimplemented in Puma::CCSemantic.
|
protected |
|
protected |
|
virtual |
bool Puma::CSemantic::empty_decl_spec_seq | ( | ) |
|
inline |
|
virtual |
Enter the given scope.
Sets the parent of the entered scope to the current scope.
scope | The scope to enter. |
Reimplemented from Puma::Semantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
protected |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in Puma::CCSemantic.
|
inline |
|
virtual |
Initialize the semantic analysis.
db | The semantic object database. |
file | The input file. |
Reimplemented from Puma::Semantic.
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic, and Puma::InstantiationSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic, and Puma::InstantiationSemantic.
|
virtual |
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
Reimplemented in Puma::CCSemantic, and Puma::InstantiationSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
virtual |
Reimplemented in Puma::CCSemantic.
|
protected |
|
protected |
|
virtual |
|
inline |
|
virtual |
Leave all scopes entered up to the current scope.
Make the parent scope of the current scope to the current scope.
Reimplemented from Puma::Semantic.
|
protected |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
virtual |
|
inlinevirtual |
Reimplemented in Puma::CCSemantic.
void Puma::CSemantic::reenter_class_scope | ( | ) |
|
virtual |
Reenter the given scope.
Does not reset the parent of entered scope.
scope | The scope to reenter. |
Reimplemented from Puma::Semantic.
|
virtual |
|
protected |
|
inlineprotectedvirtual |
Reimplemented in Puma::CCSemantic, and Puma::InstantiationSemantic.
|
virtual |
|
virtual |
Reimplemented in Puma::CCSemantic.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |