Public Member Functions | Private Attributes | List of all members
ExprAstFilter Class Reference

Class representing a filter in the AST. More...

Inheritance diagram for ExprAstFilter:
ExprAst

Public Member Functions

 ExprAstFilter (const char *name, ExprAst *arg)
 
 ~ExprAstFilter ()
 
const QCStringname () const
 
TemplateVariant apply (const TemplateVariant &v, TemplateContext *c)
 
- Public Member Functions inherited from ExprAst
virtual ~ExprAst ()
 
virtual TemplateVariant resolve (TemplateContext *)
 

Private Attributes

QCString m_name
 
ExprAstm_arg
 

Detailed Description

Class representing a filter in the AST.

Definition at line 1437 of file template.cpp.

Constructor & Destructor Documentation

ExprAstFilter::ExprAstFilter ( const char *  name,
ExprAst arg 
)
inline

Definition at line 1440 of file template.cpp.

1440  : m_name(name), m_arg(arg)
1441  { TRACE(("ExprAstFilter(%s)\n",name)); }
ExprAst * m_arg
Definition: template.cpp:1461
QCString m_name
Definition: template.cpp:1460
const QCString & name() const
Definition: template.cpp:1443
#define TRACE(x)
Definition: template.cpp:43
ExprAstFilter::~ExprAstFilter ( )
inline

Definition at line 1442 of file template.cpp.

1442 { delete m_arg; }
ExprAst * m_arg
Definition: template.cpp:1461

Member Function Documentation

TemplateVariant ExprAstFilter::apply ( const TemplateVariant v,
TemplateContext c 
)
inline

Definition at line 1444 of file template.cpp.

1445  {
1446  TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
1447  if (ci==0) return v; // should not happen
1448  TRACE(("Applying filter '%s' to '%s' (type=%d)\n",m_name.data(),v.toString().data(),v.type()));
1449  TemplateVariant arg;
1450  if (m_arg) arg = m_arg->resolve(c);
1451  bool ok;
1453  if (!ok)
1454  {
1455  ci->warn(ci->templateName(),ci->line(),"unknown filter '%s'",m_name.data());
1456  }
1457  return result;
1458  }
static QCString result
Internal class representing the implementation of a template context.
Definition: template.cpp:511
int line() const
Definition: template.cpp:543
static TemplateFilterFactory * instance()
Definition: template.cpp:1297
ExprAst * m_arg
Definition: template.cpp:1461
QCString m_name
Definition: template.cpp:1460
QCString toString() const
Definition: template.h:232
virtual TemplateVariant resolve(TemplateContext *)
Definition: template.cpp:1368
const char * data() const
Definition: qcstring.h:207
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
TemplateVariant apply(const QCString &name, const TemplateVariant &v, const TemplateVariant &arg, bool &ok)
Definition: template.cpp:1304
void warn(const char *fileName, int line, const char *fmt,...) const
Definition: template.cpp:2431
Type type() const
Definition: template.h:142
#define TRACE(x)
Definition: template.cpp:43
QCString templateName() const
Definition: template.cpp:542
const QCString& ExprAstFilter::name ( ) const
inline

Definition at line 1443 of file template.cpp.

1443 { return m_name; }
QCString m_name
Definition: template.cpp:1460

Member Data Documentation

ExprAst* ExprAstFilter::m_arg
private

Definition at line 1461 of file template.cpp.

QCString ExprAstFilter::m_name
private

Definition at line 1460 of file template.cpp.


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