expr.h

来自「数据结构与程序设计教材源码 数据结构与程序设计教材源码」· C头文件 代码 · 共 38 行

H
38
字号
 
typedef int Value;
 
enum Token_type {operand, unaryop, binaryop, end_expression};
 
struct Token {
   Token_type kind();
   Token();
   void clear();
   ~Token();
   char value[20];
};
 
class Expression {
public:
   Error_code evaluate_prefix(Value &result);
   Error_code get_token(Token &result);
   //  Add other methods.
 
   Error_code evaluate_postfix(Value &result);
   void read();
   Expression() { start = 0; count = 0; }
   void clear() { start = count = 0; }
   ~Expression() { clear(); }
 
private:
   //  Add data members to store an expression.
 
   char value[2000];
   int start, count;
 
};
 
typedef Value Node_entry;
#include "../../5/NODES/NODE.H"
typedef Value Stack_entry;
#include "../../5/LINKSTAC/STACK.H"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?