求用delpi编写计算器!!谢谢了!!
来源:百度知道 编辑:UC知道 时间:2024/06/08 21:41:38
unit untJCalc;
interface
uses
classes,sysutils;
type
TJStack=class
private
Lines:TStrings;
public
constructor Create;
destructor Destroy;
procedure init;
procedure push(s:string);
function GetTop:String;
function Pop:String;
end;
TJExpr=class
private
Expr:String;
Position:Integer;
Min,max:Integer;
Eof:Boolean;
public
constructor Create(pExpr:String);
function read:String;
procedure GoFirst;
end;
function CalcExpr(sExpr:String):String;
function CalcExprItem(sOptr,sA,sB:String):String;
function OptrIndex(w:string):Integer;
function GetParamCount(pFunc:String):Integer;
function ExecFunc(pFunc:String;pParam:Array of string;pParamCount:Integer