/*
** SellaNMS
** $Id: term.h,v 1.5 2006/01/24 07:08:10 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef __TERM_H__
#define __TERM_H__

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

#include "clause.h"
#include "from.h"
#include "then.h"

class Term: public Clause {
	public:
		Term();
		Term(Term const &src);
		virtual ~Term();
		virtual Term const& operator=(Term const &src);

		RESULT setName(const string &name);
		string getName();

		virtual ACTION evaluate(variable_binding_t &input);
		virtual RESULT compile(ConfigNode *config);

		virtual RESULT clear();
		virtual RESULT print(unsigned long depth = 0);


	protected:
		RESULT setFrom(From *from);
		RESULT setThen(Then *then);

		virtual From *getNewFromClause() const;
		virtual Then *getNewThenClause() const;

		From		*from;
		Then		*then;

	private:
		string	name;
};

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim:
** vim: noet ts=3 sw=3 sts=3
*/
