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 165 of file ExpressionBuilder.h.

Member Enumeration Documentation

◆ NodeType

Enumerator
NEG 
LOGICNOT 

Definition at line 168 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

◆ EBUnaryOpTermNode()

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

Definition at line 174 of file ExpressionBuilder.h.

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

Member Function Documentation

◆ clone()

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

Implements ExpressionBuilder::EBTermNode.

Definition at line 176 of file ExpressionBuilder.h.

177  {
178  return new EBUnaryOpTermNode(_subnode->clone(), _type);
179  };
virtual EBTermNode * clone() const =0
enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type
EBUnaryOpTermNode(EBTermNode *subnode, NodeType type)

◆ getSubnode()

const EBTermNode* ExpressionBuilder::EBUnaryTermNode::getSubnode ( ) const
inlineinherited

◆ precedence()

virtual int ExpressionBuilder::EBUnaryOpTermNode::precedence ( ) const
inlinevirtual

Implements ExpressionBuilder::EBTermNode.

Definition at line 182 of file ExpressionBuilder.h.

182 { return 3; }

◆ stringify()

std::string ExpressionBuilder::EBUnaryOpTermNode::stringify ( ) const
virtual

Implements ExpressionBuilder::EBTermNode.

Definition at line 67 of file ExpressionBuilder.C.

68 {
69  const char * name[] = {"-", "!"};
70  std::ostringstream s;
71 
72  s << name[_type];
73 
74  if (_subnode->precedence() > precedence())
75  s << '(' << *_subnode << ')';
76  else
77  s << *_subnode;
78 
79  return s.str();
80 }
virtual int precedence() const =0
enum ExpressionBuilder::EBUnaryOpTermNode::NodeType _type
const std::string name
Definition: Setup.h:22

◆ substitute()

virtual unsigned int ExpressionBuilder::EBUnaryTermNode::substitute ( const EBSubstitutionRuleList rule)
virtualinherited

Reimplemented from ExpressionBuilder::EBTermNode.

Member Data Documentation

◆ _subnode

EBTermNode* ExpressionBuilder::EBUnaryTermNode::_subnode
protectedinherited

Definition at line 132 of file ExpressionBuilder.h.

◆ _type

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

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