parse.h
来自「Linux下编写的一个表达式解析器可以计算= - * / 与或非运算 经过测试并」· C头文件 代码 · 共 39 行
H
39 行
#ifndef _PARSE_H_
#define _PARSE_H_
#define _CHR_TYPE_INT_ 1#define _CHR_TYPE_FLOAT_ 2#define _CHR_TYPE_SHORT_ 3#define _CHR_TYPE_DOUBLE_ 4 typedef char *LPSTR, *PSTR;typedef const char *LPCSTR, *PCSTR;typedef LPCSTR LPCTSTR;
class Parse
{
public:
Parse ();
~Parse(); bool DetectionStr(const char *str,int Type,void * p);
char* GetErrorCode();
private:
char m_str1[256];
char * m_strErrorInfo;
int m_nNO;
char m_str[256] ;
int m_nLen;
private:
double CalculateNum(float num1, float num2, char op);
const char * FindLastOp(const char *str);
double StrHexToInt(char* strSource); double CalculateExp(const char *str); int CheckStr();
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?