#ifndef STACK_H
#define STACK_H
// joycub V2 - an interpeter for the programming language Joy
// (c) 2004-2006 Sergey Zubkov 
// program.h -
// static char RCSID[] ="$Id: stack.h,v 1.4 2006/02/27 18:44:01 cubbi Exp $";

#include "reference.h"
#include "token_list.h"
#include "list.h"

class JC_Stack : public JC_list {
public:
	JC_Stack();
	JC_Stack(Token_list&);
	JC_Stack(JC_list&);
	virtual ~JC_Stack();

	template <class T>
			inline void push(T* z) { contents.push_back(new JC_objref(z)); }

	void pop_back(void);
	JC_objref* pop(void);
	void stack_dump(void) const;
	void assert_depth(int, const string key) const;
	JC_objref* back(void) const;
};
#endif // STACK_H
