// CodeGear C++Builder
// Copyright (c) 1995, 2012 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'SMIPars.pas' rev: 24.00 (Win32)

#ifndef SmiparsHPP
#define SmiparsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.Classes.hpp>	// Pascal unit
#include <System.SysUtils.hpp>	// Pascal unit
#include <System.Variants.hpp>	// Pascal unit

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

namespace Smipars
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS ESMIParseException;
#pragma pack(push,4)
class PASCALIMPLEMENTATION ESMIParseException : public System::Sysutils::Exception
{
	typedef System::Sysutils::Exception inherited;
	
public:
	/* Exception.Create */ inline __fastcall ESMIParseException(const System::UnicodeString Msg) : System::Sysutils::Exception(Msg) { }
	/* Exception.CreateFmt */ inline __fastcall ESMIParseException(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size) : System::Sysutils::Exception(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ inline __fastcall ESMIParseException(NativeUInt Ident)/* overload */ : System::Sysutils::Exception(Ident) { }
	/* Exception.CreateRes */ inline __fastcall ESMIParseException(System::PResStringRec ResStringRec)/* overload */ : System::Sysutils::Exception(ResStringRec) { }
	/* Exception.CreateResFmt */ inline __fastcall ESMIParseException(NativeUInt Ident, System::TVarRec const *Args, const int Args_Size)/* overload */ : System::Sysutils::Exception(Ident, Args, Args_Size) { }
	/* Exception.CreateResFmt */ inline __fastcall ESMIParseException(System::PResStringRec ResStringRec, System::TVarRec const *Args, const int Args_Size)/* overload */ : System::Sysutils::Exception(ResStringRec, Args, Args_Size) { }
	/* Exception.CreateHelp */ inline __fastcall ESMIParseException(const System::UnicodeString Msg, int AHelpContext) : System::Sysutils::Exception(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ inline __fastcall ESMIParseException(const System::UnicodeString Msg, System::TVarRec const *Args, const int Args_Size, int AHelpContext) : System::Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	/* Exception.CreateResHelp */ inline __fastcall ESMIParseException(NativeUInt Ident, int AHelpContext)/* overload */ : System::Sysutils::Exception(Ident, AHelpContext) { }
	/* Exception.CreateResHelp */ inline __fastcall ESMIParseException(System::PResStringRec ResStringRec, int AHelpContext)/* overload */ : System::Sysutils::Exception(ResStringRec, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ inline __fastcall ESMIParseException(System::PResStringRec ResStringRec, System::TVarRec const *Args, const int Args_Size, int AHelpContext)/* overload */ : System::Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ inline __fastcall ESMIParseException(NativeUInt Ident, System::TVarRec const *Args, const int Args_Size, int AHelpContext)/* overload */ : System::Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
	/* Exception.Destroy */ inline __fastcall virtual ~ESMIParseException(void) { }
	
};

#pragma pack(pop)

enum TTokenType : unsigned char { ttNone, ttString, ttNumeric, ttDateTime, ttParenthesis, ttOperation, ttParamDelimitor };

typedef void __fastcall (__closure *TOnEvaluate)(System::TObject* Sender, System::UnicodeString Eval, System::Variant *Args, const int Args_Size, int ArgCount, bool IsChild, System::Variant &Value, bool &Done);

class DELPHICLASS TExpToken;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TExpToken : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::UnicodeString FText;
	TTokenType FTokenType;
	
public:
	__property System::UnicodeString Text = {read=FText};
	__property TTokenType TokenType = {read=FTokenType, nodefault};
public:
	/* TObject.Create */ inline __fastcall TExpToken(void) : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TExpToken(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TExpParser;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TExpParser : public System::TObject
{
	typedef System::TObject inherited;
	
protected:
	System::UnicodeString FExpression;
	System::Classes::TList* FTokens;
	int FPos;
	
private:
	void __fastcall Clear(void);
	TExpToken* __fastcall GetToken(int Index);
	void __fastcall SetExpression(const System::UnicodeString Value);
	
public:
	__fastcall TExpParser(void);
	__fastcall virtual ~TExpParser(void);
	TExpToken* __fastcall ReadFirstToken(void);
	TExpToken* __fastcall ReadNextToken(void);
	int __fastcall TokenCount(void);
	__property TExpToken* Tokens[int Index] = {read=GetToken};
	__property System::Classes::TList* TokenList = {read=FTokens};
	__property System::UnicodeString Expression = {read=FExpression, write=SetExpression};
};

#pragma pack(pop)

class DELPHICLASS TExpNode;
class PASCALIMPLEMENTATION TExpNode : public System::TObject
{
	typedef System::TObject inherited;
	
protected:
	System::TObject* FOwner;
	TExpNode* FParent;
	System::Classes::TList* FChildren;
	System::Classes::TList* FTokens;
	int FLevel;
	TExpToken* FToken;
	TOnEvaluate FOnEvaluate;
	
private:
	TExpToken* __fastcall GetToken(int Index);
	TExpNode* __fastcall GetChildren(int Index);
	int __fastcall FindLSOTI(void);
	bool __fastcall ParseFunction(void);
	void __fastcall RemoveSorroundingParenthesis(void);
	void __fastcall SplitToChildren(int TokenIndex);
	System::Variant __fastcall Evaluate(void);
	__property TExpNode* Children[int Index] = {read=GetChildren};
	
public:
	__fastcall TExpNode(System::TObject* AOwner, TExpNode* AParent, System::Classes::TList* Tokens);
	__fastcall virtual ~TExpNode(void);
	void __fastcall Build(void);
	int __fastcall TokenCount(void);
	System::Variant __fastcall Calculate(void);
	__property TExpToken* Tokens[int Index] = {read=GetToken};
	__property TExpNode* Parent = {read=FParent};
	__property int Level = {read=FLevel, nodefault};
	__property TOnEvaluate OnEvaluate = {read=FOnEvaluate, write=FOnEvaluate};
};


class DELPHICLASS TSMIParser;
class PASCALIMPLEMENTATION TSMIParser : public System::Classes::TComponent
{
	typedef System::Classes::TComponent inherited;
	
private:
	bool FProcessBeforeEvent;
	System::UnicodeString FText;
	TOnEvaluate FOnEvaluate;
	System::Variant FValue;
	
protected:
	void __fastcall Compile(bool ToCalculate);
	System::Variant __fastcall GetValue(void);
	void __fastcall Evaluate(System::UnicodeString Eval, System::Variant *Args, const int Args_Size, bool IsChild, System::Variant &Value);
	
public:
	__fastcall virtual TSMIParser(System::Classes::TComponent* AOwner);
	void __fastcall Validate(void);
	__property System::Variant Value = {read=GetValue};
	
__published:
	__property bool ProcessBeforeEvent = {read=FProcessBeforeEvent, write=FProcessBeforeEvent, nodefault};
	__property System::UnicodeString Text = {read=FText, write=FText};
	__property TOnEvaluate OnEvaluate = {read=FOnEvaluate, write=FOnEvaluate};
public:
	/* TComponent.Destroy */ inline __fastcall virtual ~TSMIParser(void) { }
	
};


class DELPHICLASS TSMIParserFunction;
class PASCALIMPLEMENTATION TSMIParserFunction : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	typedef System::StaticArray<System::Variant, 11> _TSMIParserFunction__1;
	
	
protected:
	System::UnicodeString FAsString;
	System::UnicodeString FName;
	System::UnicodeString FFunction;
	System::UnicodeString FDescription;
	System::UnicodeString FHint;
	System::TObject* FOwner;
	int FArgCount;
	System::Classes::TStringList* FArgs;
	_TSMIParserFunction__1 FValues;
	System::UnicodeString FCategory;
	System::UnicodeString FSubCategory;
	
private:
	void __fastcall SetAsString(const System::UnicodeString Value);
	void __fastcall EvalArgs(System::TObject* Sender, System::UnicodeString Eval, System::Variant *Args, const int Args_Size, int ArgCount, System::Variant &Value);
	
protected:
	void __fastcall ApplyArguments(System::Variant *Values, const int Values_Size);
	
public:
	__fastcall TSMIParserFunction(System::TObject* AOwner);
	__fastcall virtual ~TSMIParserFunction(void);
	virtual System::Variant __fastcall Calculate(void);
	__property System::UnicodeString AsString = {read=FAsString, write=SetAsString};
	__property System::UnicodeString Name = {read=FName};
	__property int ArgCount = {read=FArgCount, nodefault};
	__property System::Classes::TStringList* Args = {read=FArgs};
	__property System::UnicodeString Description = {read=FDescription, write=FDescription};
	__property System::UnicodeString Hint = {read=FHint, write=FHint};
	__property System::UnicodeString Category = {read=FCategory, write=FCategory};
	__property System::UnicodeString SubCategory = {read=FSubCategory, write=FSubCategory};
};


class DELPHICLASS TSMIParserFunctions;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TSMIParserFunctions : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	__fastcall virtual ~TSMIParserFunctions(void);
	TSMIParserFunction* __fastcall AddFunction(const System::UnicodeString Value);
	HIDESBASE void __fastcall Remove(int Index);
	TSMIParserFunction* __fastcall GetFunction(int Index);
	TSMIParserFunction* __fastcall FunctionByName(System::UnicodeString FuncName);
public:
	/* TObject.Create */ inline __fastcall TSMIParserFunctions(void) : System::Classes::TList() { }
	
};

#pragma pack(pop)

enum TSMIParameterEditor : unsigned char { ipeEdit, ipeMemo, ipeCheckBox, ipeCombobox, ipeListBox };

enum TSMIParameterMode : unsigned char { ipmCalculate, ipmCalculateAndAsk, ipmAsk };

class DELPHICLASS TSMIParameter;
class PASCALIMPLEMENTATION TSMIParameter : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	System::UnicodeString FName;
	System::UnicodeString FCaption;
	System::UnicodeString FDescription;
	System::UnicodeString FExpression;
	TSMIParameterEditor FParameterEditor;
	TSMIParameterMode FParameterMode;
	System::Classes::TStrings* FParamPromptValues;
	bool FRequired;
	void __fastcall SetParamPromptValues(System::Classes::TStrings* Value);
	void __fastcall SetName(System::UnicodeString Value);
	
public:
	System::Variant Value;
	__fastcall virtual TSMIParameter(System::Classes::TCollection* Collection);
	__fastcall virtual ~TSMIParameter(void);
	virtual void __fastcall Assign(System::Classes::TPersistent* Source);
	
__published:
	__property System::UnicodeString Caption = {read=FCaption, write=FCaption};
	__property System::UnicodeString Name = {read=FName, write=SetName};
	__property System::UnicodeString Expression = {read=FExpression, write=FExpression};
	__property System::UnicodeString Description = {read=FDescription, write=FDescription};
	__property System::Classes::TStrings* ParamPromptValues = {read=FParamPromptValues, write=SetParamPromptValues};
	__property TSMIParameterEditor ParameterEditor = {read=FParameterEditor, write=FParameterEditor, default=0};
	__property TSMIParameterMode ParameterMode = {read=FParameterMode, write=FParameterMode, default=1};
	__property bool Required = {read=FRequired, write=FRequired, default=0};
};


class DELPHICLASS TSMIParameters;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TSMIParameters : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TSMIParameter* operator[](int Index) { return Items[Index]; }
	
private:
	System::Classes::TComponent* FSMIControl;
	TSMIParameter* __fastcall GetParameter(int Index);
	void __fastcall SetParameter(int Index, TSMIParameter* Value);
	
protected:
	DYNAMIC System::Classes::TPersistent* __fastcall GetOwner(void);
	
public:
	__fastcall TSMIParameters(System::Classes::TComponent* SMICntrl);
	HIDESBASE TSMIParameter* __fastcall Add(void);
	TSMIParameter* __fastcall ParamByName(const System::UnicodeString Value);
	__property System::Classes::TComponent* SMIControl = {read=FSMIControl};
	__property TSMIParameter* Items[int Index] = {read=GetParameter, write=SetParameter/*, default*/};
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TSMIParameters(void) { }
	
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
static const System::Int8 MAXPARAMCOUNT = System::Int8(0xa);
extern PACKAGE TSMIParserFunctions* lstSMIRegFunctions;
extern PACKAGE System::TDateTime __fastcall GetDTByMask(System::UnicodeString AValue, System::UnicodeString AFormat, System::WideChar ADateSeparator, System::WideChar ATimeSeparator);
extern PACKAGE System::UnicodeString __fastcall GetNextItem(System::WideChar chSeparator, System::UnicodeString &s, bool IsVal, bool IsLastToken);
extern PACKAGE bool __fastcall StringIsNumeric(System::UnicodeString Value);
extern PACKAGE System::UnicodeString __fastcall ReplaceStr(System::UnicodeString s, System::UnicodeString oldPattern, System::UnicodeString newPattern, bool IgnoreCase, bool ReplaceAll);
extern PACKAGE System::WideString __fastcall ReplaceWideStr(System::WideString s, System::WideString oldPattern, System::WideString newPattern, bool IgnoreCase, bool ReplaceAll);
extern PACKAGE bool __fastcall IsNumeric(System::UnicodeString s);
extern PACKAGE bool __fastcall IsAlpha(System::UnicodeString strStr);
}	/* namespace Smipars */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SMIPARS)
using namespace Smipars;
#endif
#pragma pack(pop)
#pragma option pop

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