Piethon  1.0
A Python-like interpreter using flex and bison.
Public Member Functions | List of all members
Addition Class Reference

#include <expression.h>

Inheritance diagram for Addition:
Inheritance graph
Collaboration diagram for Addition:
Collaboration graph

Public Member Functions

 Addition (Expression *e1, Expression *e2)
 
virtual Number eval (const SymbolTable &, const FunctionTable &) const
 
- Public Member Functions inherited from BinaryExpression
 ~BinaryExpression ()
 
- Public Member Functions inherited from Expression
virtual ~Expression ()
 

Additional Inherited Members

- Protected Member Functions inherited from BinaryExpression
 BinaryExpression (Expression *e1, Expression *e2)
 
- Protected Member Functions inherited from Expression
 Expression ()
 
- Protected Attributes inherited from BinaryExpression
Expressionop1
 
Expressionop2
 

Detailed Description

Definition at line 87 of file expression.h.

Constructor & Destructor Documentation

◆ Addition()

Addition::Addition ( Expression e1,
Expression e2 
)
inline

Definition at line 89 of file expression.h.

89 : BinaryExpression(e1, e2) { }
BinaryExpression(Expression *e1, Expression *e2)
Definition: expression.h:81

Member Function Documentation

◆ eval()

Number Addition::eval ( const SymbolTable st,
const FunctionTable ft 
) const
virtual

Implements BinaryExpression.

Definition at line 35 of file expression.cpp.

35  {
36  return op1->eval(st, ft) + op2->eval(st, ft);
37 }
virtual Number eval(const SymbolTable &, const FunctionTable &) const =0
Expression * op2
Definition: expression.h:83
Expression * op1
Definition: expression.h:82

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