Zen
A cross-platform functional programming language

TernaryOpExpr Class Reference

AST Node for all ternary operators. More...

#include <Ast.hpp>

Inheritance diagram for TernaryOpExpr:
Expr Node

List of all members.

Public Member Functions

 TernaryOpExpr (const QualifiedType &type, const Expr &lhs, const z::string &op1, const Expr &rhs1, const z::string &op2, const Expr &rhs2)
 Default constructor.
const Expr & getLhs () const
 Returns the LHS of the expression.
const z::string & getOp1 () const
 Returns the first operator of the expression.
const Expr & getRhs1 () const
 Returns the first RHS of the expression.
const z::string & getOp2 () const
 Returns the second operator of the expression.
const Expr & getRhs2 () const
 Returns the second RHS of the expression.

Private Member Functions

virtual void visit (Visitor &visitor) const
 Abstract visitor function.

Private Attributes

const Expr & _lhs
 The LHS expression.
const z::string _op1
 The first operator.
const Expr & _rhs1
 The first RHS expression.
const z::string _op2
 The second operator.
const Expr & _rhs2
 The second RHS expression.

Detailed Description

AST Node for all ternary operators.

For example:

        local r = (x > 10)? x : y;

Constructor & Destructor Documentation

TernaryOpExpr ( const QualifiedType &  type,
const Expr &  lhs,
const z::string &  op1,
const Expr &  rhs1,
const z::string &  op2,
const Expr &  rhs2 
) [inline]

Default constructor.

Parameters:
typeExpression type
lhsThe LHS of the expression
op1The first operator of the expression
rhs1The first RHS of the expression
op2The second operator of the expression
rhs2The second RHS of the expression

Member Function Documentation

const Expr& getLhs ( ) const [inline]

Returns the LHS of the expression.

Returns:
The LHS expression
const z::string& getOp1 ( ) const [inline]

Returns the first operator of the expression.

Returns:
The first operator
const z::string& getOp2 ( ) const [inline]

Returns the second operator of the expression.

Returns:
The second operator
const Expr& getRhs1 ( ) const [inline]

Returns the first RHS of the expression.

Returns:
The first RHS expression
const Expr& getRhs2 ( ) const [inline]

Returns the second RHS of the expression.

Returns:
The second RHS expression
void visit ( Visitor &  visitor) const [private, virtual]

Abstract visitor function.

Parameters:
visitorThe visitor object.

Implements Expr.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines