#include <cppExpression.h>
Inheritance diagram for CPPExpression:
Public Types | |
enum | ResultType { RT_integer, RT_real, RT_pointer, RT_error } |
enum | Type { T_integer, T_real, T_string, T_variable, T_function, T_unknown_ident, T_typecast, T_construct, T_default_construct, T_new, T_default_new, T_sizeof, T_unary_operation, T_binary_operation, T_trinary_operation } |
typedef map< CPPDeclaration *, CPPDeclaration * > | SubstDecl |
typedef set< CPPDeclaration * > | Instantiations |
enum | SubType { ST_instance, ST_typedef, ST_type_declaration, ST_expression, ST_type, ST_namespace, ST_using, ST_simple, ST_pointer, ST_reference, ST_array, ST_const, ST_function, ST_function_group, ST_extension, ST_struct, ST_enum, ST_class_template_parameter, ST_tbd, ST_type_proxy } |
Public Member Functions | |
CPPExpression (int value) | |
CPPExpression (const string &value) | |
CPPExpression (double value) | |
CPPExpression (CPPIdentifier *ident, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) | |
CPPExpression (int unary_operator, CPPExpression *op1) | |
CPPExpression (int binary_operator, CPPExpression *op1, CPPExpression *op2) | |
CPPExpression (int trinary_operator, CPPExpression *op1, CPPExpression *op2, CPPExpression *op3) | |
~CPPExpression () | |
Result | evaluate () const |
CPPType * | determine_type () const |
Returns the type of the expression, if it is known, or NULL if the type cannot be determined. | |
bool | is_tbd () const |
Returns true if any type within the expression list is a CPPTBDType and thus isn't fully determined right now. | |
virtual CPPDeclaration * | substitute_decl (SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) |
virtual void | output (ostream &out, int indent_level, CPPScope *scope, bool complete) const |
virtual SubType | get_subtype () const |
virtual CPPExpression * | as_expression () |
bool | operator== (const CPPDeclaration &other) const |
bool | operator!= (const CPPDeclaration &other) const |
bool | operator< (const CPPDeclaration &other) const |
bool | is_template () const |
Returns true if this is a template declaration of some kind: a template function or a template class, typically. | |
CPPTemplateScope * | get_template_scope () const |
If is_template(), above, returns true, this returns the CPPTemplateScope in which this particular template declaration is defined. | |
virtual bool | is_fully_specified () const |
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated. | |
virtual CPPDeclaration * | instantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
virtual CPPDeclaration * | substitute_decl (SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) |
virtual CPPInstance * | as_instance () |
virtual CPPClassTemplateParameter * | as_class_template_parameter () |
virtual CPPTypedef * | as_typedef () |
virtual CPPTypeDeclaration * | as_type_declaration () |
virtual CPPType * | as_type () |
virtual CPPNamespace * | as_namespace () |
virtual CPPUsing * | as_using () |
virtual CPPSimpleType * | as_simple_type () |
virtual CPPPointerType * | as_pointer_type () |
virtual CPPReferenceType * | as_reference_type () |
virtual CPPArrayType * | as_array_type () |
virtual CPPConstType * | as_const_type () |
virtual CPPFunctionType * | as_function_type () |
virtual CPPFunctionGroup * | as_function_group () |
virtual CPPExtensionType * | as_extension_type () |
virtual CPPStructType * | as_struct_type () |
virtual CPPEnumType * | as_enum_type () |
virtual CPPTBDType * | as_tbd_type () |
virtual CPPTypeProxy * | as_type_proxy () |
Static Public Member Functions | |
CPPExpression | typecast_op (CPPType *type, CPPExpression *op1) |
Creates an expression that represents a typecast operation. | |
CPPExpression | construct_op (CPPType *type, CPPExpression *op1) |
Creates an expression that represents a constructor call. | |
CPPExpression | new_op (CPPType *type, CPPExpression *op1=NULL) |
Creates an expression that represents a use of the new operator. | |
CPPExpression | sizeof_func (CPPType *type) |
Public Attributes | |
Type | _type |
string | _str |
union { | |
int _integer | |
double _real | |
CPPInstance * _variable | |
CPPFunctionGroup * _fgroup | |
CPPIdentifier * _ident | |
class { | |
CPPType * _to | |
CPPExpression * _op1 | |
} _typecast | |
class { | |
int _operator | |
CPPExpression * _op1 | |
CPPExpression * _op2 | |
CPPExpression * _op3 | |
} _op | |
} | _u |
Instantiations | _instantiations |
CPPVisibility | _vis |
CPPTemplateScope * | _template_scope |
CPPFile | _file |
CPPCommentBlock * | _leading_comment |
Protected Member Functions | |
virtual bool | is_equal (const CPPDeclaration *other) const |
Called by CPPDeclaration to determine whether this expr is equivalent to another expr. | |
virtual bool | is_less (const CPPDeclaration *other) const |
Called by CPPDeclaration to determine whether this expr should be ordered before another expr of the same type, in an arbitrary but fixed ordering. | |
Static Protected Member Functions | |
CPPType * | elevate_type (CPPType *t1, CPPType *t2) |
Returns the most general of the two given types. |
|
Reimplemented in CPPInstance. Definition at line 118 of file cppDeclaration.h. |
|
Definition at line 113 of file cppDeclaration.h. Referenced by CPPScope::is_fully_specified(). |
|
Definition at line 58 of file cppExpression.h. |
|
Definition at line 71 of file cppDeclaration.h. Referenced by CPPUsing::output(), CPPFunctionGroup::output(), CPPClassTemplateParameter::output(), and CPPFunctionType::output_instance(). |
|
Definition at line 101 of file cppExpression.h. |
|
Definition at line 208 of file cppExpression.cxx. |
|
Definition at line 238 of file cppExpression.cxx. |
|
Definition at line 223 of file cppExpression.cxx. References _type, _u, CPPDeclaration::as_instance(), current_scope, CPPIdentifier::find_symbol(), global_scope, NULL, and T_variable. |
|
Definition at line 253 of file cppExpression.cxx. References _type, _u, NULL, and T_unary_operation. |
|
Definition at line 287 of file cppExpression.cxx. References _type, _u, and T_trinary_operation. |
|
Definition at line 305 of file cppExpression.cxx. References _type, _u, and T_typecast. |
|
Definition at line 323 of file cppExpression.cxx. References _type, _u, NULL, T_construct, and T_default_construct. |
|
Definition at line 431 of file cppExpression.cxx. References _u, T_binary_operation, T_default_construct, T_default_new, T_new, and T_sizeof. |
|
Reimplemented in CPPArrayType, and CPPTypeProxy. Definition at line 339 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(). |
|
Reimplemented in CPPClassTemplateParameter. Definition at line 219 of file cppDeclaration.cxx. References NULL. |
|
|
Reimplemented in CPPEnumType, and CPPTypeProxy. Definition at line 411 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_reference_type(). |
|
Reimplemented from CPPDeclaration. Definition at line 1291 of file cppExpression.cxx. References _type. Referenced by get_subtype(). |
|
Reimplemented in CPPExtensionType, and CPPTypeProxy. Definition at line 387 of file cppDeclaration.cxx. Referenced by TypeManager::is_simple(). |
|
Reimplemented in CPPFunctionGroup. Definition at line 375 of file cppDeclaration.cxx. |
|
Reimplemented in CPPFunctionType, and CPPTypeProxy. Definition at line 363 of file cppDeclaration.cxx. Referenced by CPPStructType::check_virtual(), CPPInstanceIdentifier::get_scope(), CPPInstance::get_simple_name(), InterrogateBuilder::in_noinclude(), TypeManager::is_const_pointer_to_base(), CPPPointerType::output(), TypeManager::unwrap(), TypeManager::wrap_const_reference(), and CPPFunctionGroup::~CPPFunctionGroup(). |
|
Reimplemented in CPPInstance. Definition at line 207 of file cppDeclaration.cxx. References NULL. Referenced by CPPExpression(), and CPPTypedef::CPPTypedef(). |
|
Reimplemented in CPPNamespace. Definition at line 279 of file cppDeclaration.cxx. References NULL. |
|
Reimplemented in CPPPointerType, and CPPTypeProxy. Definition at line 315 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(), TypeManager::is_const_ref_to_simple(), and CPPTypeProxy::output_instance(). |
|
Reimplemented in CPPReferenceType, and CPPTypeProxy. Definition at line 327 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(), TypeManager::involves_unpublished(), TypeManager::is_const_ref_to_enum(), TypeManager::is_reference_count(), and CPPTypeProxy::output(). |
|
Reimplemented in CPPSimpleType, and CPPTypeProxy. Definition at line 303 of file cppDeclaration.cxx. References NULL. Referenced by TypeManager::is_basic_string_char(), TypeManager::is_char_pointer(), TypeManager::is_const_basic_string_char(), and TypeManager::is_const_simple(). |
|
Reimplemented in CPPStructType, and CPPTypeProxy. Definition at line 399 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_pointer_type(), CPPScope::find_scope(), InterrogateBuilder::get_getter(), and TypeManager::wrap_const_pointer(). |
|
Reimplemented in CPPTBDType, and CPPTypeProxy. Definition at line 423 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_array_type(). |
|
Reimplemented in CPPType, and CPPTypeProxy. Definition at line 267 of file cppDeclaration.cxx. References NULL. Referenced by CPPIdentifier::get_scope(), CPPTemplateParameterList::get_string(), CPPReferenceType::is_fully_specified(), CPPPointerType::is_fully_specified(), CPPConstType::is_fully_specified(), CPPArrayType::is_tbd(), and CPPScope::write(). |
|
Reimplemented in CPPTypeDeclaration. Definition at line 243 of file cppDeclaration.cxx. References NULL. |
|
Reimplemented in CPPTypeProxy. Definition at line 435 of file cppDeclaration.cxx. |
|
Reimplemented in CPPTypedef. Definition at line 231 of file cppDeclaration.cxx. Referenced by CPPTypedef::CPPTypedef(). |
|
Reimplemented in CPPUsing. Definition at line 291 of file cppDeclaration.cxx. |
|
Creates an expression that represents a constructor call.
Definition at line 364 of file cppExpression.cxx. |
|
Returns the type of the expression, if it is known, or NULL if the type cannot be determined.
Definition at line 691 of file cppExpression.cxx. References _u, NULL, T_binary_operation, T_sizeof, T_trinary_operation, and T_unary_operation. |
|
Returns the most general of the two given types.
Definition at line 1304 of file cppExpression.cxx. References _type, _u, T_binary_operation, T_construct, T_default_construct, T_default_new, T_function, T_new, T_sizeof, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable. |
|
Definition at line 442 of file cppExpression.cxx. |
|
Implements CPPDeclaration. Definition at line 1279 of file cppExpression.cxx. References as_expression(), and NULL. |
|
If is_template(), above, returns true, this returns the CPPTemplateScope in which this particular template declaration is defined. This scope includes the information about the template parameters. Definition at line 143 of file cppDeclaration.cxx. References NULL, and CPPPreprocessor::warning(). |
|
Reimplemented in CPPInstance, and CPPStructType. Definition at line 174 of file cppDeclaration.cxx. References NULL. |
|
Called by CPPDeclaration to determine whether this expr is equivalent to another expr.
Reimplemented from CPPDeclaration. Definition at line 1362 of file cppExpression.cxx. References _str, _u, T_construct, T_function, T_new, T_real, T_string, T_typecast, T_unknown_ident, and T_variable. |
|
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.
Reimplemented in CPPArrayType, CPPClassTemplateParameter, CPPConstType, CPPFunctionType, CPPInstance, CPPPointerType, CPPReferenceType, and CPPStructType. Definition at line 162 of file cppDeclaration.cxx. References NULL. Referenced by CPPConstType::CPPConstType(), CPPPointerType::CPPPointerType(), CPPReferenceType::CPPReferenceType(), CPPInstance::instantiate(), and CPPFunctionType::operator=(). |
|
Called by CPPDeclaration to determine whether this expr should be ordered before another expr of the same type, in an arbitrary but fixed ordering.
Reimplemented from CPPDeclaration. Definition at line 1431 of file cppExpression.cxx. |
|
Returns true if any type within the expression list is a CPPTBDType and thus isn't fully determined right now.
Definition at line 953 of file cppExpression.cxx. |
|
Returns true if this is a template declaration of some kind: a template function or a template class, typically.
Definition at line 124 of file cppDeclaration.cxx. Referenced by InterrogateBuilder::remap_indices(), and InterrogateBuilder::scan_function(). |
|
Creates an expression that represents a use of the new operator.
Definition at line 391 of file cppExpression.cxx. References CPPExpression::Result::_type, _u, NULL, RT_error, T_function, T_integer, T_real, T_string, T_typecast, T_unknown_ident, and T_variable. |
|
Definition at line 92 of file cppDeclaration.cxx. |
|
Definition at line 104 of file cppDeclaration.cxx. References CPPDeclaration::_template_scope, and NULL. |
|
Definition at line 77 of file cppDeclaration.cxx. |
|
Implements CPPDeclaration. Definition at line 997 of file cppExpression.cxx. References _u, T_construct, T_default_construct, T_default_new, T_new, T_sizeof, and T_unary_operation. Referenced by CPPParameterList::resolve_type(). |
|
Definition at line 415 of file cppExpression.cxx. References _u, NULL, and CPPSimpleType::T_int. |
|
Definition at line 191 of file cppDeclaration.cxx. Referenced by CPPReferenceType::is_fully_specified(), CPPPointerType::is_fully_specified(), CPPConstType::is_fully_specified(), CPPArrayType::is_tbd(), and CPPScope::write(). |
|
Definition at line 859 of file cppExpression.cxx. References _u, and T_unary_operation. Referenced by CPPArrayType::is_tbd(). |
|
Creates an expression that represents a typecast operation.
Definition at line 345 of file cppExpression.cxx. References _type, _u, NULL, T_default_new, and T_new. |
|
Definition at line 125 of file cppExpression.h. |
|
Definition at line 149 of file cppDeclaration.h. Referenced by InterrogateBuilder::remap_indices(), InterrogateBuilder::scan_function(), and CPPScope::write(). |
|
Definition at line 126 of file cppExpression.h. |
|
Reimplemented in CPPInstance. Definition at line 119 of file cppDeclaration.h. |
|
Definition at line 122 of file cppExpression.h. |
|
Definition at line 150 of file cppDeclaration.h. Referenced by CPPDeclaration::CPPDeclaration(), and CPPScope::set_current_vis(). |
|
|
|
Definition at line 137 of file cppExpression.h. |
|
Definition at line 130 of file cppExpression.h. |
|
Definition at line 138 of file cppExpression.h. |
|
Definition at line 139 of file cppExpression.h. |
|
Definition at line 136 of file cppExpression.h. |
|
Definition at line 123 of file cppExpression.h. |
|
Definition at line 120 of file cppExpression.h. Referenced by CPPExpression(), and is_equal(). |
|
Definition at line 148 of file cppDeclaration.h. Referenced by CPPTemplateScope::add_declaration(), CPPTemplateScope::add_enum_value(), CPPTemplateScope::CPPTemplateScope(), and CPPDeclaration::operator<(). |
|
Definition at line 129 of file cppExpression.h. |
|
Definition at line 119 of file cppExpression.h. Referenced by as_expression(), construct_op(), CPPExpression(), elevate_type(), CPPParameterList::resolve_type(), and typecast_op(). |
|
|
|
Referenced by construct_op(), CPPExpression(), determine_type(), elevate_type(), evaluate(), is_equal(), new_op(), output(), sizeof_func(), substitute_decl(), typecast_op(), and ~CPPExpression(). |
|
Definition at line 124 of file cppExpression.h. |
|
Definition at line 147 of file cppDeclaration.h. Referenced by CPPScope::get_local_name(), TypeManager::is_pointer_to_base(), InterrogateBuilder::remap_indices(), InterrogateBuilder::scan_function(), and TypeManager::wrap_const_reference(). |