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

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

#ifndef UXlsEncodeFormulaHPP
#define UXlsEncodeFormulaHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <UXlsRowColEntries.hpp>	// Pascal unit
#include <UXlsBaseRecordLists.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <UXlsStrings.hpp>	// Pascal unit
#include <UFlxStack.hpp>	// Pascal unit
#include <UXlsFormulaParser.hpp>	// Pascal unit
#include <XlsMessages.hpp>	// Pascal unit
#include <XlsFormulaMessages.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Uxlsencodeformula
{
//-- type declarations -------------------------------------------------------
typedef DynamicArray<Byte >  UXlsEncodeFormula__2;

typedef DynamicArray<Byte >  UXlsEncodeFormula__3;

class DELPHICLASS TParseString;
class PASCALIMPLEMENTATION TParseString : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	int ParsePos;
	WideString Fw;
	DynamicArray<Byte >  FParsedData;
	DynamicArray<Byte >  FParsedArrayData;
	int MaxErrorLen;
	Uxlsbaserecordlists::TNameRecordList* FNameTable;
	Uxlsrowcolentries::TCellList* FCellList;
	Uflxstack::TWhiteSpaceStack* StackWs;
	Xlsformulamessages::TFmReturnType RefMode;
	int RefModeNesting;
	bool __fastcall IsNumber(const wchar_t c);
	bool __fastcall IsAlpha(const wchar_t c);
	bool __fastcall IsAZ(const wchar_t c);
	int __fastcall ATo1(const wchar_t c);
	bool __fastcall NextChar(void);
	bool __fastcall PeekChar(wchar_t &c);
	bool __fastcall Peek2Char(wchar_t &c);
	bool __fastcall PeekCharWs(wchar_t &c);
	void __fastcall GetNumber(void);
	void __fastcall GetString(void);
	void __fastcall GetAlpha(void);
	void __fastcall GetArray(void);
	void __fastcall GetFormulaArgs(const int Index, int &ArgCount);
	void __fastcall GetFormula(const AnsiString s);
	bool __fastcall GetBool(const AnsiString s);
	bool __fastcall IsErrorCode(const WideString s, Byte &b);
	void __fastcall GetError(void);
	void __fastcall GetOneReference(bool &RowAbs, bool &ColAbs, int &Row, int &Col);
	bool __fastcall GetReference(void);
	void __fastcall Factor(void);
	void __fastcall RefTerm(void);
	void __fastcall NegTerm(void);
	void __fastcall PerTerm(void);
	void __fastcall ExpTerm(void);
	void __fastcall MulTerm(void);
	void __fastcall AddTerm(void);
	void __fastcall AndTerm(void);
	void __fastcall ComTerm(void);
	void __fastcall Expression(void);
	void __fastcall SkipWhiteSpace(void);
	void __fastcall UndoSkipWhiteSpace(const int SaveParsePos);
	void __fastcall PopWhiteSpace(void);
	void __fastcall AddParsed(const Byte * s, const int s_Size, const bool PopWs);
	void __fastcall AddParsedArray(const Byte * s, const int s_Size);
	bool __fastcall FindComTerm(Byte &Ptg);
	void __fastcall GetGeneric3dRef(const WideString ExternSheet);
	void __fastcall GetQuotedRef3d(void);
	void __fastcall GetRef3d(const WideString s);
	Word __fastcall GetExternSheet(const WideString ExternSheet);
	
public:
	__fastcall TParseString(const WideString aw, const Uxlsbaserecordlists::TNameRecordList* aNameTable
		, const Uxlsrowcolentries::TCellList* aCellList);
	__fastcall virtual ~TParseString(void);
	void __fastcall Parse(void);
	int __fastcall TotalSize(void);
	void __fastcall CopyToPtr(const Xlsmessages::PArrayOfByte Ptr, const int aPos);
};


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

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

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