// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ParseExpr.pas' rev: 5.00

#ifndef ParseExprHPP
#define ParseExprHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ParseClass.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <OObjects.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Parseexpr
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TExpressionParser;
class PASCALIMPLEMENTATION TExpressionParser : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	Oobjects::TSortedCollection* WordsList;
	Oobjects::TOCollection* ConstantsList;
	Classes::TStringList* Expressions;
	Parseclass::TExpressionRec *LastRec;
	Parseclass::TExpressionRec *CurrentRec;
	AnsiString FCurrentExpression;
	Parseclass::TExprCollection* __fastcall ParseString(AnsiString anExpression);
	Parseclass::PExpressionRec __fastcall MakeTree(Parseclass::TExprCollection* &Expr);
	Parseclass::PExpressionRec __fastcall MakeRec(void);
	Parseclass::PDouble __fastcall MakeLinkedList(Parseclass::PExpressionRec ExprRec);
	int __fastcall CompileExpression(AnsiString anExpression);
	double __fastcall GetResults(int aIndex);
	AnsiString __fastcall GetAsString(int aIndex);
	bool __fastcall isBoolean(void);
	bool __fastcall GetAsBoolean(int aIndex);
	void __fastcall Check(Parseclass::TExprCollection* anExprList);
	bool __fastcall CheckArguments(Parseclass::PExpressionRec ExprRec);
	void __fastcall DisposeTree(Parseclass::PExpressionRec ExprRec);
	
protected:
	virtual void __fastcall FillExpressList(void);
	
public:
	__fastcall TExpressionParser(void);
	__fastcall virtual ~TExpressionParser(void);
	double __fastcall EvaluateCurrent(void);
	void __fastcall DefineVariable(AnsiString aVarName, Parseclass::PDouble aValue);
	void __fastcall DefineStringVariable(AnsiString aVarName, Parseclass::PString aValue);
	void __fastcall DefineFunction(AnsiString aFunctName, Parseclass::TDoubleFunc aFuncAddress, int nArguments
		);
	double __fastcall Evaluate(AnsiString anExpression);
	int __fastcall AddExpression(AnsiString anExpression);
	void __fastcall ClearExpressions(void);
	void __fastcall GetGeneratedVars(Classes::TList* aList);
	__property AnsiString CurrentExpression = {read=FCurrentExpression};
	__property double AsFloat[int aIndex] = {read=GetResults};
	__property AnsiString AsString[int aIndex] = {read=GetAsString};
	__property bool AsBoolean[int aIndex] = {read=GetAsBoolean};
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Parseexpr */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Parseexpr;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ParseExpr
