Skip to content

SgNaryOp

This class represents the notion of an n‐ary operator.

Synopsis

Declared in <src/docs/mrdocs/ast_node_docs.h>

class SgNaryOp;

Description

This node is intended for use with Python. ‐ Internal: SgNaryOp represents n‐ary operations using two lists: one of SgExpressions (the operands) and another of variant enums that represent operations (V_SgAddOp, etc.). Therefore, the operator at index i in the operator list operates on the operands at indices i and i+1 in the operand list.

Data members

#### SgExpressionPtrList SgNaryOp::p_operands This is the list of operands associated with this n‐ary operator.

#### VariantTList SgNaryOp::p_operators This is the list of operators associated with this n‐ary operator.

Member functions

#### SgNaryOp::SgNaryOp ( SgExpression* first_operand ) This is the constructor. This constructor builds the SgNaryOp base class. ‐ Param first_operand: The first operand in the n‐ary operation.

#### SgNaryOp::~SgNaryOp() This is the destructor.

#### SgNaryOp::isSgNaryOp (SgNode *s) Cast function (from derived class to SgNaryOp pointer). This functions returns a SgNaryOp pointer for any input of a pointer to an object derived from a SgNaryOp. ‐ Return: Returns valid pointer to SgNaryOp if input is derived from a SgNaryOp.

#### SgNaryOp::isSgNaryOp (const SgNode *s) Cast function (from derived class to SgNaryOp pointer). This functions returns a SgNaryOp pointer for any input of a pointer to an object derived from a SgNaryOp. ‐ Return: Returns valid pointer to SgNaryOp if input is derived from a SgNaryOp.

#### SgNaryOp::append_operation(VariantT operator, SgExpression* operand) Adds a new operation to this n‐ary operator. ‐ Param operator: ‐ the VariantT of the corresponding operation node (V_SgAddOp, V_SgMinusOp, etc) ‐ Param operand: ‐ the next expression after the given operator. ‐ Return: Returns void.

Created with MrDocs