www.mooseframework.org
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
ExpressionBuilder::EBUnaryOpTermNode Class Reference

Node representing a unary operator. More...

#include <ExpressionBuilder.h>

Inheritance diagram for ExpressionBuilder::EBUnaryOpTermNode:
[legend]

Public Types

enum  NodeType { NEG, LOGICNOT }
 

Public Member Functions

 EBUnaryOpTermNode (EBTermNode *subnode, NodeType type)
 
virtual EBUnaryOpTermNodeclone () const
 
virtual std::string stringify () const
 
virtual int precedence () const
 
virtual unsigned int substitute (const EBSubstitutionRuleList &rule)
 
const EBTermNodegetSubnode () const
 

Public Attributes

enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type
 

Protected Attributes

EBTermNode_subnode
 

Detailed Description

Node representing a unary operator.

Definition at line 162 of file ExpressionBuilder.h.

Member Enumeration Documentation

Enumerator
NEG 
LOGICNOT 

Definition at line 165 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

ExpressionBuilder::EBUnaryOpTermNode::EBUnaryOpTermNode ( EBTermNode subnode,
NodeType  type 
)
inline

Definition at line 171 of file ExpressionBuilder.h.

172  : EBUnaryTermNode(subnode), _type(type){};
enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type

Member Function Documentation

virtual EBUnaryOpTermNode* ExpressionBuilder::EBUnaryOpTermNode::clone ( ) const
inlinevirtual

Implements ExpressionBuilder::EBTermNode.

Definition at line 173 of file ExpressionBuilder.h.

174  {
175  return new EBUnaryOpTermNode(_subnode->clone(), _type);
176  };
virtual EBTermNode * clone() const =0
enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type
EBUnaryOpTermNode(EBTermNode *subnode, NodeType type)
const EBTermNode* ExpressionBuilder::EBUnaryTermNode::getSubnode ( ) const
inlineinherited
virtual int ExpressionBuilder::EBUnaryOpTermNode::precedence ( ) const
inlinevirtual

Implements ExpressionBuilder::EBTermNode.

Definition at line 179 of file ExpressionBuilder.h.

179 { return 3; }
std::string ExpressionBuilder::EBUnaryOpTermNode::stringify ( ) const
virtual

Implements ExpressionBuilder::EBTermNode.

Definition at line 64 of file ExpressionBuilder.C.

65 {
66  const char * name[] = {"-", "!"};
67  std::ostringstream s;
68 
69  s << name[_type];
70 
71  if (_subnode->precedence() > precedence())
72  s << '(' << *_subnode << ')';
73  else
74  s << *_subnode;
75 
76  return s.str();
77 }
enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type
virtual int precedence() const =0
virtual unsigned int ExpressionBuilder::EBUnaryTermNode::substitute ( const EBSubstitutionRuleList rule)
virtualinherited

Reimplemented from ExpressionBuilder::EBTermNode.

Member Data Documentation

EBTermNode* ExpressionBuilder::EBUnaryTermNode::_subnode
protectedinherited

Definition at line 129 of file ExpressionBuilder.h.

enum ExpressionBuilder::EBUnaryOpTermNode::NodeType ExpressionBuilder::EBUnaryOpTermNode::_type

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