// (c) 2000-2007 Electronic Arts Inc.

#ifndef MACRO_H
#define MACRO_H

#if defined(_MSC_VER)
#pragma once
#endif

using namespace std;
#include <string>
#include <map>

class macroinfo
{
	friend class Macro;
	bool   expanded;
	string expansion;
};

typedef map<string,macroinfo> StringMacroinfoMap;

class Macro
{
public:
	void	 clear();
	string	 get(const string& symbol); /* returns "" if symbol not found or error */
	void	 set(const string& symbol, const string& value);

private:
	bool ParseExpansion(string inputbuffer, string &outputbuffer);
	StringMacroinfoMap macros;
};

#endif // MACRO_H

