// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Rvleexpr.pas' rev: 10.00

#ifndef RvleexprHPP
#define RvleexprHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Rvledefine.hpp>	// Pascal unit
#include <Rvleutil.hpp>	// Pascal unit
#include <Rvletype.hpp>	// Pascal unit
#include <Rvleid.hpp>	// Pascal unit
#include <Rvlemodule.hpp>	// Pascal unit
#include <Rvlecode.hpp>	// Pascal unit
#include <Rvutil.hpp>	// Pascal unit
#include <Rvclass.hpp>	// Pascal unit

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

namespace Rvleexpr
{
//-- type declarations -------------------------------------------------------
struct TCodeListItem;
typedef TCodeListItem *PCodeListItem;

#pragma pack(push,1)
struct TCodeListItem
{
	
public:
	Rvletype::TBaseType* FromType;
	Rvletype::TBaseType* ToType;
	Word TempSize;
	int TempLoc;
	int Line;
	Word Col;
	Rvledefine::TIDKind Kind;
	Rvledefine::TAddress Address;
	bool DefaultParam;
	bool FuncResult;
	Rvleid::TBaseID* VarID;
	Rvutil::TRaveStackList* OpList;
	Rvletype::TFuncType* FuncType;
	int FuncModule;
	Rvledefine::TCodeLabel *FuncCodeLabel;
	bool FuncMethod;
	Word NumParams;
	Rvledefine::TOpKind OpKind;
	AnsiString StringData;
	void *Data;
	Byte RefCount;
} ;
#pragma pack(pop)

struct TOpStackItem;
typedef TOpStackItem *POpStackItem;

#pragma pack(push,1)
struct TOpStackItem
{
	
public:
	Word Level;
	Byte Order;
	Rvledefine::TOpKind Kind;
	Rvletype::TFuncType* OSFuncType;
	Word OSFuncModule;
	Rvledefine::TCodeLabel *OSFuncCodeLabel;
	Word OSNumParams;
	int OpLine;
	Word OpCol;
	AnsiString OpToken;
	Byte RefCount;
} ;
#pragma pack(pop)

struct TFreeVar;
typedef TFreeVar *PFreeVar;

struct TFreeVar
{
	
public:
	Rvletype::TBaseType* BaseType;
	Rvledefine::TAddress Address;
} ;

class DELPHICLASS TExpression;
class PASCALIMPLEMENTATION TExpression : public System::TObject 
{
	typedef System::TObject inherited;
	
protected:
	Rvutil::TRaveStackList* FCodeList;
	Rvutil::TRaveStackList* FOpStack;
	TCodeListItem *FResultItem;
	bool FNeedResult;
	Rvutil::TRaveStackList* CalcStack;
	Word CurrLevel;
	Rvleutil::TRaveParser* Parser;
	Rvlecode::TCodeManager* CM;
	Rvlemodule::TRCPUModule* Module;
	bool __fastcall CalcOpResult(Rvledefine::TTypeKind &TK1, Rvledefine::TTypeKind &TK2, Rvledefine::TTypeKind &TK3, Rvledefine::TTypeKind &TK4, Rvledefine::TOpKind OpKind);
	Rvletype::TBaseType* __fastcall GetBaseType(Rvledefine::TTypeKind TypeKind);
	void __fastcall AddCodeList(PCodeListItem CodeListItem);
	void __fastcall ProcessOpStack(Rvledefine::TOpKind NewOpKind);
	bool __fastcall FoldConstant(POpStackItem OpStackItem, Rvledefine::TOpKind OpKind);
	void __fastcall FreeCodeListItem(PCodeListItem CLI);
	void __fastcall PushCLIStack(Rvutil::TRaveStackList* Stack, PCodeListItem CLI);
	void __fastcall PopCLIStack(Rvutil::TRaveStackList* Stack);
	void __fastcall PushOSIStack(Rvutil::TRaveStackList* Stack, POpStackItem OSI);
	void __fastcall PopOSIStack(Rvutil::TRaveStackList* Stack);
	
public:
	__fastcall TExpression(Rvlemodule::TRCPUModule* AModule, Rvleutil::TRaveParser* AParser, Rvlecode::TCodeManager* ACM);
	__fastcall virtual ~TExpression(void);
	void __fastcall CreateCodeList(AnsiString Terminators, bool LeaveResultOnStack);
	void __fastcall FreeCodeList(void);
	void __fastcall FreeType(const Rvledefine::TAddress &Addr, Rvletype::TBaseType* BaseType);
	void __fastcall CreateCode(int &TempMax, int TempStart);
	__property Rvutil::TRaveStackList* OpStack = {read=FOpStack, write=FOpStack};
	__property Rvutil::TRaveStackList* CodeList = {read=FCodeList, write=FCodeList};
	__property PCodeListItem ResultItem = {read=FResultItem};
	__property bool NeedResult = {read=FNeedResult, write=FNeedResult, nodefault};
};


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

}	/* namespace Rvleexpr */
using namespace Rvleexpr;
#pragma pack(pop)
#pragma option pop

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