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

CPPExpression Class Reference

#include <cppExpression.h>

Inheritance diagram for CPPExpression:

CPPDeclaration List of all members.

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
}

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
CPPTypedetermine_type () const
bool is_tbd () const
virtual CPPDeclarationsubstitute_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 ()

Static Public Member Functions

CPPExpression typecast_op (CPPType *type, CPPExpression *op1)
CPPExpression construct_op (CPPType *type, CPPExpression *op1)
CPPExpression new_op (CPPType *type, CPPExpression *op1=NULL)
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

Protected Member Functions

virtual bool is_equal (const CPPDeclaration *other) const
virtual bool is_less (const CPPDeclaration *other) const

Static Protected Member Functions

CPPTypeelevate_type (CPPType *t1, CPPType *t2)

Member Enumeration Documentation

enum CPPExpression::ResultType
 

Enumeration values:
RT_integer 
RT_real 
RT_pointer 
RT_error 

Definition at line 53 of file cppExpression.h.

enum CPPExpression::Type
 

Enumeration values:
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 

Definition at line 96 of file cppExpression.h.


Constructor & Destructor Documentation

CPPExpression::CPPExpression int  value  ) 
 

Definition at line 187 of file cppExpression.cxx.

References _type, _u, and T_integer.

Referenced by substitute_decl().

CPPExpression::CPPExpression const string &  value  ) 
 

Definition at line 213 of file cppExpression.cxx.

References _str, _type, and T_string.

CPPExpression::CPPExpression double  value  ) 
 

Definition at line 200 of file cppExpression.cxx.

References _type, _u, and T_real.

CPPExpression::CPPExpression CPPIdentifier ident,
CPPScope current_scope,
CPPScope global_scope,
CPPPreprocessor error_sink = NULL
 

Definition at line 226 of file cppExpression.cxx.

References _type, _u, CPPDeclaration::as_function_group(), CPPDeclaration::as_instance(), current_scope, CPPIdentifier::find_symbol(), global_scope, NULL, T_function, T_unknown_ident, and T_variable.

CPPExpression::CPPExpression int  unary_operator,
CPPExpression *  op1
 

Definition at line 258 of file cppExpression.cxx.

References _type, _u, NULL, and T_unary_operation.

CPPExpression::CPPExpression int  binary_operator,
CPPExpression *  op1,
CPPExpression *  op2
 

Definition at line 274 of file cppExpression.cxx.

References _type, _u, NULL, and T_binary_operation.

CPPExpression::CPPExpression int  trinary_operator,
CPPExpression *  op1,
CPPExpression *  op2,
CPPExpression *  op3
 

Definition at line 290 of file cppExpression.cxx.

References _type, _u, and T_trinary_operation.

CPPExpression::~CPPExpression  ) 
 

Definition at line 382 of file cppExpression.cxx.


Member Function Documentation

CPPExpression * CPPExpression::as_expression  )  [virtual]
 

Reimplemented from CPPDeclaration.

Definition at line 1223 of file cppExpression.cxx.

CPPExpression CPPExpression::construct_op CPPType type,
CPPExpression *  op1
[static]
 

Definition at line 323 of file cppExpression.cxx.

References _type, _u, NULL, T_construct, T_default_construct, and type.

CPPType * CPPExpression::determine_type  )  const
 

Definition at line 636 of file cppExpression.cxx.

References CPPArrayType::_element_type, CPPPointerType::_pointing_at, CPPFunctionType::_return_type, _u, CPPDeclaration::as_array_type(), CPPDeclaration::as_function_type(), CPPDeclaration::as_pointer_type(), assert, elevate_type(), CPPType::new_type(), NULL, T_binary_operation, CPPSimpleType::T_bool, CPPSimpleType::T_char, T_construct, T_default_construct, T_default_new, CPPSimpleType::T_double, T_function, CPPSimpleType::T_int, T_integer, T_new, T_real, T_sizeof, T_string, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable.

Referenced by CPPManifest::determine_type().

CPPType * CPPExpression::elevate_type CPPType t1,
CPPType t2
[static, protected]
 

Definition at line 1233 of file cppExpression.cxx.

References CPPSimpleType::_flags, CPPSimpleType::_type, CPPDeclaration::as_simple_type(), CPPSimpleType::F_long, CPPSimpleType::F_longlong, CPPSimpleType::F_short, NULL, CPPSimpleType::T_bool, CPPSimpleType::T_double, CPPSimpleType::T_float, and CPPSimpleType::T_int.

Referenced by determine_type().

CPPExpression::Result CPPExpression::evaluate  )  const
 

Definition at line 391 of file cppExpression.cxx.

References CPPSimpleType::_type, CPPExpression::Result::_type, _u, CPPExpression::Result::as_integer(), CPPExpression::Result::as_pointer(), CPPExpression::Result::as_real(), assert, NULL, RT_error, RT_integer, RT_real, T_binary_operation, T_construct, T_default_construct, T_default_new, CPPSimpleType::T_double, CPPSimpleType::T_float, T_function, CPPSimpleType::T_int, T_integer, T_new, T_real, T_sizeof, T_string, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable.

Referenced by InterrogateBuilder::define_enum_type(), CPPPreprocessor::handle_if_directive(), and InterrogateBuilder::scan_manifest().

CPPDeclaration::SubType CPPExpression::get_subtype  )  const [virtual]
 

Implements CPPDeclaration.

Definition at line 1213 of file cppExpression.cxx.

References CPPDeclaration::ST_expression.

bool CPPExpression::is_equal const CPPDeclaration other  )  const [protected, virtual]
 

Reimplemented from CPPDeclaration.

Definition at line 1287 of file cppExpression.cxx.

References _str, _type, _u, assert, NULL, T_binary_operation, T_construct, T_default_construct, T_default_new, T_function, T_integer, T_new, T_real, T_sizeof, T_string, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable.

bool CPPExpression::is_less const CPPDeclaration other  )  const [protected, virtual]
 

Reimplemented from CPPDeclaration.

Definition at line 1351 of file cppExpression.cxx.

References _str, _type, _u, assert, NULL, T_binary_operation, T_construct, T_default_construct, T_default_new, T_function, T_integer, T_new, T_real, T_sizeof, T_string, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable.

bool CPPExpression::is_tbd  )  const
 

Definition at line 891 of file cppExpression.cxx.

References _u, T_binary_operation, T_construct, T_default_construct, T_default_new, T_new, T_sizeof, T_trinary_operation, T_typecast, T_unary_operation, and T_variable.

Referenced by CPPTemplateParameterList::is_tbd().

CPPExpression CPPExpression::new_op CPPType type,
CPPExpression *  op1 = NULL
[static]
 

Definition at line 346 of file cppExpression.cxx.

References _type, _u, NULL, T_default_new, T_new, and type.

void CPPExpression::output ostream out,
int  indent_level,
CPPScope scope,
bool  complete
const [virtual]
 

Implements CPPDeclaration.

Definition at line 933 of file cppExpression.cxx.

References _str, _type, _u, T_binary_operation, T_construct, T_default_construct, T_default_new, T_function, T_integer, T_new, T_real, T_sizeof, T_string, T_trinary_operation, T_typecast, T_unary_operation, T_unknown_ident, and T_variable.

Referenced by CPPParameterList::output().

CPPExpression CPPExpression::sizeof_func CPPType type  )  [static]
 

Definition at line 368 of file cppExpression.cxx.

References _type, _u, NULL, T_sizeof, and type.

CPPDeclaration * CPPExpression::substitute_decl SubstDecl subst,
CPPScope current_scope,
CPPScope global_scope
[virtual]
 

Definition at line 802 of file cppExpression.cxx.

References _u, CPPDeclaration::as_expression(), CPPDeclaration::as_instance(), CPPExpression(), current_scope, global_scope, CPPDeclaration::substitute_decl(), T_binary_operation, T_construct, T_default_construct, T_default_new, T_new, T_sizeof, T_trinary_operation, T_typecast, T_unary_operation, and T_variable.

Referenced by CPPTemplateParameterList::build_subst_decl(), CPPInstance::substitute_decl(), and CPPArrayType::substitute_decl().

CPPExpression CPPExpression::typecast_op CPPType type,
CPPExpression *  op1
[static]
 

Definition at line 308 of file cppExpression.cxx.

References _type, _u, T_typecast, and type.


Member Data Documentation

CPPFunctionGroup* CPPExpression::_fgroup
 

Definition at line 120 of file cppExpression.h.

CPPIdentifier* CPPExpression::_ident
 

Definition at line 121 of file cppExpression.h.

int CPPExpression::_integer
 

Definition at line 117 of file cppExpression.h.

class { ... } CPPExpression::_op
 

CPPExpression* CPPExpression::_op1
 

Definition at line 132 of file cppExpression.h.

CPPExpression* CPPExpression::_op1
 

Definition at line 125 of file cppExpression.h.

CPPExpression* CPPExpression::_op2
 

Definition at line 133 of file cppExpression.h.

CPPExpression* CPPExpression::_op3
 

Definition at line 134 of file cppExpression.h.

int CPPExpression::_operator
 

Definition at line 131 of file cppExpression.h.

double CPPExpression::_real
 

Definition at line 118 of file cppExpression.h.

string CPPExpression::_str
 

Definition at line 115 of file cppExpression.h.

Referenced by CPPExpression(), is_equal(), is_less(), and output().

CPPType* CPPExpression::_to
 

Definition at line 124 of file cppExpression.h.

Type CPPExpression::_type
 

Definition at line 114 of file cppExpression.h.

Referenced by construct_op(), CPPExpression(), is_equal(), is_less(), new_op(), CPPParameterList::output(), output(), sizeof_func(), and typecast_op().

class { ... } CPPExpression::_typecast
 

union { ... } CPPExpression::_u
 

Referenced by construct_op(), CPPExpression(), determine_type(), evaluate(), is_equal(), is_less(), is_tbd(), new_op(), output(), sizeof_func(), substitute_decl(), and typecast_op().

CPPInstance* CPPExpression::_variable
 

Definition at line 119 of file cppExpression.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:34:48 2003 for DTool by doxygen1.3