<commit_before>/*!
  \copyright (c) RDO-Team, 2011
  \file      simulator/compiler/parser/context/stack.h
  \author      (<EMAIL>)
  \date      06.06.2010
  \brief     
  \indent    4T
*/

#ifndef _RDOPARSER_CONTEXT_STACK_H_
#define _RDOPARSER_CONTEXT_STACK_H_

// ----------------------------------------------------------------------- INCLUDES
#include <list>
// ----------------------------------------------------------------------- SYNOPSIS
#include "utils/smart_ptr/intrusive_ptr.h"
#include "simulator/compiler/parser/namespace.h"
// --------------------------------------------------------------------------------

OPEN_RDO_PARSER_NAMESPACE

// --------------------------------------------------------------------------------
// -------------------- ContextStack
// --------------------------------------------------------------------------------
PREDECLARE_POINTER(Context);

OBJECT(ContextStack)
{
DECLARE_FACTORY(ContextStack);
public:
	void                     push(LPContext pContext);
	template <class T> void  pop ()
	{
		ASSERT(top().object_dynamic_cast<T>());
		pop_not_safed();
	}

	LPContext top   () const;
	LPContext global() const;
	LPContext prev  (CREF(LPContext) pContext) const;

private:
	ContextStack();
	virtual ~ContextStack();

	typedef std::list<LPContext> Container;

	Container m_container;

	void pop_not_safed();
};<commit_msg> - метод перенесён в паблик<commit_after>/*!
  \copyright (c) RDO-Team, 2011
  \file      simulator/compiler/parser/context/stack.h
  \author      (<EMAIL>)
  \date      06.06.2010
  \brief     
  \indent    4T
*/

#ifndef _RDOPARSER_CONTEXT_STACK_H_
#define _RDOPARSER_CONTEXT_STACK_H_

// ----------------------------------------------------------------------- INCLUDES
#include <list>
// ----------------------------------------------------------------------- SYNOPSIS
#include "utils/smart_ptr/intrusive_ptr.h"
#include "simulator/compiler/parser/namespace.h"
// --------------------------------------------------------------------------------

OPEN_RDO_PARSER_NAMESPACE

// --------------------------------------------------------------------------------
// -------------------- ContextStack
// --------------------------------------------------------------------------------
PREDECLARE_POINTER(Context);

OBJECT(ContextStack)
{
DECLARE_FACTORY(ContextStack);
public:
	void                     push(LPContext pContext);
	template <class T> void  pop ()
	{
		ASSERT(top().object_dynamic_cast<T>());
		pop_not_safed();
	}

	LPContext top   () const;
	LPContext global() const;
	LPContext prev  (CREF(LPContext) pContext) const;

	void pop_not_safed();

private:
	ContextStack();
	virtual ~ContextStack();

	typedef std::list<LPContext> Container;

	Container m_container;
};
{'fraction_non_alphanumeric': 0.3821167883211679, 'fraction_numerical': 0.00948905109489051, 'mean_word_length': 1.2522596548890714, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315928', 'n_tokens_mistral': 756, 'n_tokens_neox': 731, 'n_words': 132}