Public Member Functions | Private Attributes | List of all members
ExprAstUnary Class Reference
Inheritance diagram for ExprAstUnary:
ExprAst

Public Member Functions

 ExprAstUnary (Operator::Type op, ExprAst *exp)
 
 ~ExprAstUnary ()
 
virtual TemplateVariant resolve (TemplateContext *c)
 
- Public Member Functions inherited from ExprAst
virtual ~ExprAst ()
 

Private Attributes

Operator::Type m_operator
 
ExprAstm_exp
 

Detailed Description

Definition at line 1506 of file template.cpp.

Constructor & Destructor Documentation

ExprAstUnary::ExprAstUnary ( Operator::Type  op,
ExprAst exp 
)
inline

Definition at line 1509 of file template.cpp.

1509  : m_operator(op), m_exp(exp)
1510  { TRACE(("ExprAstUnary %s\n",Operator::toString(op))); }
static const char * toString(Type op)
Definition: template.cpp:451
ExprAst * m_exp
Definition: template.cpp:1525
Operator::Type m_operator
Definition: template.cpp:1524
#define TRACE(x)
Definition: template.cpp:43
ExprAstUnary::~ExprAstUnary ( )
inline

Definition at line 1511 of file template.cpp.

1511 { delete m_exp; }
ExprAst * m_exp
Definition: template.cpp:1525

Member Function Documentation

virtual TemplateVariant ExprAstUnary::resolve ( TemplateContext c)
inlinevirtual

Reimplemented from ExprAst.

Definition at line 1512 of file template.cpp.

1513  {
1514  TemplateVariant exp = m_exp->resolve(c);
1515  switch (m_operator)
1516  {
1517  case Operator::Minus:
1518  return -exp.toInt();
1519  default:
1520  return TemplateVariant();
1521  }
1522  }
ExprAst * m_exp
Definition: template.cpp:1525
Operator::Type m_operator
Definition: template.cpp:1524
int toInt() const
Definition: template.cpp:222
virtual TemplateVariant resolve(TemplateContext *)
Definition: template.cpp:1368
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90

Member Data Documentation

ExprAst* ExprAstUnary::m_exp
private

Definition at line 1525 of file template.cpp.

Operator::Type ExprAstUnary::m_operator
private

Definition at line 1524 of file template.cpp.


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