Files
quickbook/detail/template_stack.cpp
Daniel James 07ff92c619 Merge several changes to boostbook and quickbook.
Fixes #1399

Merged revisions 49231,49459,49988,50068,50084,50091,50109,50125,50142,50159,50163,50175,50193,50207,50210-50213,50215,50222,50246,50513 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r49231 | danieljames | 2008-10-09 23:14:14 +0100 (Thu, 09 Oct 2008) | 4 lines
  
  Work around the problems with window newlines in position_iterator. (I'm
  about to fix them, but this will get quickbook working immediately).
........
  r49459 | eric_niebler | 2008-10-26 20:24:59 +0000 (Sun, 26 Oct 2008) | 1 line
  
  give data members with <purpose> in synopses the same treatment as functions and typedefs
........
  r49988 | danieljames | 2008-11-28 15:05:21 +0000 (Fri, 28 Nov 2008) | 1 line
  
  When processing template arguments, deal with the case when there's no content after the last space or there are more arguments than expected.
........
  r50068 | johnmaddock | 2008-12-02 13:13:57 +0000 (Tue, 02 Dec 2008) | 1 line
  
  Fix Jamfile by adding <preserve-test-targets>on to test requirements.
........
  r50084 | johnmaddock | 2008-12-03 09:42:52 +0000 (Wed, 03 Dec 2008) | 1 line
  
  Added quickbook-fail-test rule and two tests that make use of it: note that these currently fail.
........
  r50091 | danieljames | 2008-12-03 19:14:42 +0000 (Wed, 03 Dec 2008) | 2 lines
  
  Keep a count of errors in quickbook, and return an error code when appropriate.
........
  r50109 | johnmaddock | 2008-12-04 10:14:19 +0000 (Thu, 04 Dec 2008) | 1 line
  
  Added dependency to the test file.
........
  r50125 | djowel | 2008-12-05 02:13:59 +0000 (Fri, 05 Dec 2008) | 1 line
  
  updated to use "classic" spirit includes and namespace
........
  r50142 | danieljames | 2008-12-05 19:03:19 +0000 (Fri, 05 Dec 2008) | 1 line
  
  Defined BOOST_CYGWIN_PATH when building quickbook on cygwin.
........
  r50159 | danieljames | 2008-12-06 14:07:35 +0000 (Sat, 06 Dec 2008) | 1 line
  
  Copy boostbook.dtd into the correct position for the 1.1 uri. I'm not sure what should be done with the existing location.
........
  r50163 | danieljames | 2008-12-06 19:22:32 +0000 (Sat, 06 Dec 2008) | 1 line
  
  Revert my change to the quickbook jamfile, it isn't adequately tested.
........
  r50175 | danieljames | 2008-12-07 12:37:07 +0000 (Sun, 07 Dec 2008) | 1 line
  
  Fix processing of unmatched escape characters in code - and issue a warning for unexpected characters.
........
  r50193 | danieljames | 2008-12-08 16:17:13 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Use new include paths for classic spirit in quickbook text_diff utility.
........
  r50207 | danieljames | 2008-12-08 21:51:56 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Fail on a mismatched '' in the python and c++ syntax highlighters. And then ignore the rest of the code block to avoid further errors and warnings.
........
  r50210 | danieljames | 2008-12-08 23:14:23 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Hard fail on quickbook post process errors.
........
  r50211 | danieljames | 2008-12-08 23:20:26 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Since I accidently added a quickbook fail tests to the Jamfile in the last checkin, I might as well add them.
........
  r50212 | danieljames | 2008-12-08 23:35:08 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Remove an unused variable in order to avoid a gcc warning.
........
  r50213 | danieljames | 2008-12-08 23:35:20 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Run the docbook chunker quietly, unless boostbook.verbose is set.
........
  r50215 | danieljames | 2008-12-08 23:38:29 +0000 (Mon, 08 Dec 2008) | 1 line
  
  Put the markup strings in their own cpp file to avoid gcc warnings.
........
  r50222 | danieljames | 2008-12-09 13:52:07 +0000 (Tue, 09 Dec 2008) | 1 line
  
  Fix some xsl type errors.
........
  r50246 | speedsnail | 2008-12-12 15:06:44 +0000 (Fri, 12 Dec 2008) | 1 line
  
  Make doxygen command "\throw" work with boostbook.
........
  r50513 | danieljames | 2009-01-08 12:01:50 +0000 (Thu, 08 Jan 2009) | 1 line
  
  Support both windows and cygwin paths in cygwin quickbook.
........


[SVN r51281]
2009-02-17 00:01:03 +00:00

63 lines
1.7 KiB
C++

/*=============================================================================
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)
#endif
namespace 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::classic::find(*i, symbol.c_str()))
return ts;
}
return 0;
}
template_symbol* template_stack::find_top_scope(std::string const& symbol) const
{
return boost::spirit::classic::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::classic::add(scopes.front(), symbol.c_str(), ts);
}
void template_stack::push()
{
scopes.push_front(template_symbols());
}
void template_stack::pop()
{
scopes.pop_front();
}
}