📄 template_stack.cpp
字号:
/*============================================================================= Copyright (c) 2002 2004 2006 Joel de Guzman http://spirit.sourceforge.net/ Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)=============================================================================*/#include "./template_stack.hpp"#ifdef BOOST_MSVC#pragma warning(disable : 4355)#endifnamespace quickbook{ template_stack::template_stack() : scopes() , scope(template_stack::parser(*this)) { scopes.push_front(template_symbols()); } template_symbol* template_stack::find(std::string const& symbol) const { for (deque::const_iterator i = scopes.begin(); i != scopes.end(); ++i) { if (template_symbol* ts = boost::spirit::find(*i, symbol.c_str())) return ts; } return 0; } template_symbol* template_stack::find_top_scope(std::string const& symbol) const { return boost::spirit::find(scopes.front(), symbol.c_str()); } template_symbols const& template_stack::top() const { BOOST_ASSERT(!scopes.empty()); return scopes.front(); } void template_stack::add(std::string const& symbol, template_symbol const& ts) { BOOST_ASSERT(!scopes.empty()); boost::spirit::add(scopes.front(), symbol.c_str(), ts); } void template_stack::push() { scopes.push_front(template_symbols()); } void template_stack::pop() { scopes.pop_front(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -