[Debtags-commits] [svn] r1743 - in tagcoll/2.0: . tagcoll
tagcoll/input tagcoll/stream tagcoll/tagexpr tagcoll/tests
Enrico Zini
enrico at costa.debian.org
Tue May 9 01:34:19 UTC 2006
Author: enrico
Date: Tue May 9 01:34:14 2006
New Revision: 1743
Added:
tagcoll/2.0/tagcoll/expression.cc
tagcoll/2.0/tagcoll/expression.h
tagcoll/2.0/tagcoll/input/ (props changed)
tagcoll/2.0/tagcoll/input/base.cc
tagcoll/2.0/tagcoll/input/base.h
tagcoll/2.0/tagcoll/input/memory.cc
tagcoll/2.0/tagcoll/input/memory.h
tagcoll/2.0/tagcoll/input/stdio.cc
tagcoll/2.0/tagcoll/input/stdio.h
tagcoll/2.0/tagcoll/input/string.cc
tagcoll/2.0/tagcoll/input/string.h
Removed:
tagcoll/2.0/tagcoll/Expression.cc
tagcoll/2.0/tagcoll/Expression.h
tagcoll/2.0/tagcoll/MemParserInput.cc
tagcoll/2.0/tagcoll/MemParserInput.h
tagcoll/2.0/tagcoll/ParserBase.cc
tagcoll/2.0/tagcoll/ParserBase.h
tagcoll/2.0/tagcoll/StdioParserInput.cc
tagcoll/2.0/tagcoll/StdioParserInput.h
tagcoll/2.0/tagcoll/StringParserInput.cc
tagcoll/2.0/tagcoll/StringParserInput.h
Modified:
tagcoll/2.0/ (props changed)
tagcoll/2.0/tagcoll/DerivedTags.h
tagcoll/2.0/tagcoll/Makefile.am
tagcoll/2.0/tagcoll/TextFormat.cc
tagcoll/2.0/tagcoll/TextFormat.h
tagcoll/2.0/tagcoll/TextFormat.tcc
tagcoll/2.0/tagcoll/stream/expression.h
tagcoll/2.0/tagcoll/tagexpr/TagexprParser.h
tagcoll/2.0/tagcoll/test-utils.cc
tagcoll/2.0/tagcoll/tests/test-utils.h
Log:
r2666 at viaza: enrico | 2006-05-08 20:31:09 -0500
Moved ParserInput stuff into input/, and used saner names
Modified: tagcoll/2.0/tagcoll/DerivedTags.h
==============================================================================
--- tagcoll/2.0/tagcoll/DerivedTags.h (original)
+++ tagcoll/2.0/tagcoll/DerivedTags.h Tue May 9 01:34:14 2006
@@ -24,7 +24,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Expression.h>
+#include <tagcoll/expression.h>
#include <wibble/operators.h>
#include <wibble/mixin.h>
Modified: tagcoll/2.0/tagcoll/Makefile.am
==============================================================================
--- tagcoll/2.0/tagcoll/Makefile.am (original)
+++ tagcoll/2.0/tagcoll/Makefile.am Tue May 9 01:34:14 2006
@@ -7,10 +7,13 @@
# Include the .cc files that contain template definitions
tagcollinclude_HEADERS = \
utils/set.h \
- ParserBase.h \
- MemParserInput.h \
- StringParserInput.h \
- StdioParserInput.h \
+ \
+ input/base.h \
+ input/memory.h \
+ input/string.h \
+ input/stdio.h \
+ \
+ expression.h \
\
stream/sink.h \
stream/filters.h \
@@ -46,7 +49,6 @@
Implications.h \
Implications.cc \
\
- Expression.h \
DerivedTags.h \
\
CardinalityStore.h \
@@ -57,10 +59,12 @@
lib_LTLIBRARIES = libtagcoll.la
libtagcoll_la_SOURCES = \
- ParserBase.cc \
- MemParserInput.cc \
- StringParserInput.cc \
- StdioParserInput.cc \
+ input/base.cc \
+ input/memory.cc \
+ input/string.cc \
+ input/stdio.cc \
+ \
+ expression.cc \
\
stream/sink.cc \
stream/filters.cc \
@@ -80,7 +84,6 @@
\
Implications.cc \
\
- Expression.cc \
DerivedTags.cc \
\
test-utils.cc
Modified: tagcoll/2.0/tagcoll/TextFormat.cc
==============================================================================
--- tagcoll/2.0/tagcoll/TextFormat.cc (original)
+++ tagcoll/2.0/tagcoll/TextFormat.cc Tue May 9 01:34:14 2006
@@ -28,7 +28,7 @@
// Parse an element
// Return the trailing separating char, that can be:
-// ParserInput::Eof
+// input::Input::Eof
// '\n'
// ':'
// ','
@@ -37,19 +37,19 @@
// element: \s*[^ \t,:]\s*([.:])\s*
// or
// element: \s*[^ \t,:].*?[^ \t,:]\s*([.:])\s+
-int parseElement(ParserInput& in, string& item) throw (tagcoll::exception::Parser)
+int parseElement(input::Input& in, string& item) throw (tagcoll::exception::Parser)
{
item = string();
string sep;
int c;
char sepchar = 0;
enum {LSPACE, ITEM, ISPACE, ISEP, TSPACE} state = LSPACE;
- while ((c = in.nextChar()) != ParserInput::Eof)
+ while ((c = in.nextChar()) != input::Input::Eof)
{
if (c == '\n')
{
if (sepchar && sepchar != ':')
- throw tagcoll::exception::Parser("separator character ends the line");
+ throw tagcoll::exception::Input("separator character ends the line");
else
return '\n';
}
@@ -64,7 +64,7 @@
break;
case ':':
case ',':
- throw tagcoll::exception::Parser("element cannot start with a separation character");
+ throw tagcoll::exception::Input("element cannot start with a separation character");
break;
default:
item += c;
@@ -120,7 +120,7 @@
case ' ':
case '\t':
if (sep.size() > 1)
- throw tagcoll::exception::Parser("item is followed by more than one separator characters");
+ throw tagcoll::exception::Input("item is followed by more than one separator characters");
state = TSPACE;
break;
case ':':
@@ -149,7 +149,7 @@
break;
}
}
- return ParserInput::Eof;
+ return input::Input::Eof;
}
}
@@ -158,7 +158,7 @@
#ifdef COMPILE_TESTSUITE
#include <tests/test-utils.h>
-#include <tagcoll/StringParserInput.h>
+#include <tagcoll/input/string.h>
#include <tagcoll/Patches.h>
namespace wibble {
@@ -173,7 +173,7 @@
template<> template<>
void to::test<1>()
{
- StringParserInput coll(
+ input::String coll(
"a: b, c\n"
"b:\n"
"c: \n"
@@ -190,7 +190,7 @@
template<> template<>
void to::test<2>()
{
- StringParserInput coll(
+ input::String coll(
"a: +b, +c\n"
"b:\n"
"c: foo\n"
Modified: tagcoll/2.0/tagcoll/TextFormat.h
==============================================================================
--- tagcoll/2.0/tagcoll/TextFormat.h (original)
+++ tagcoll/2.0/tagcoll/TextFormat.h Tue May 9 01:34:14 2006
@@ -27,7 +27,7 @@
#include <wibble/singleton.h>
#include <tagcoll/Consumer.h>
#include <tagcoll/Serializer.h>
-#include <tagcoll/ParserBase.h>
+#include <tagcoll/input/base.h>
#include <stdio.h>
@@ -73,12 +73,12 @@
* The item found on input
* @return
* the trailing separating char, that can be:
- * \li ParserInput::Eof
+ * \li input::Input::Eof
* \li '\n'
* \li ':'
* \li ','
*/
-int parseElement(ParserInput& in, std::string& item) throw (tagcoll::exception::Parser);
+int parseElement(input::Input& in, std::string& item) throw (tagcoll::exception::Parser);
/**
@@ -98,7 +98,7 @@
* An output iterator accepting a std::pair<string, string>
*/
template<typename OUT>
-void parse(ParserInput& in, OUT out);
+void parse(input::Input& in, OUT out);
/**
* Parse a tagcoll patch
@@ -107,7 +107,7 @@
PatchList<ITEM, TAG> parsePatch(
Converter<std::string, ITEM>& itemconv,
Converter<std::string, TAG>& tagconv,
- ParserInput& in);
+ input::Input& in);
}
@@ -121,7 +121,7 @@
const Converter<TAG, std::string>& tagconv;
textformat::StdioWriter writer;
- static int parseElement(ParserInput& in, std::string& item) throw (tagcoll::exception::Parser);
+ static int parseElement(input::Input& in, std::string& item) throw (tagcoll::exception::Parser);
virtual void consumeItemUntagged(const ITEM& item)
{
Modified: tagcoll/2.0/tagcoll/TextFormat.tcc
==============================================================================
--- tagcoll/2.0/tagcoll/TextFormat.tcc (original)
+++ tagcoll/2.0/tagcoll/TextFormat.tcc Tue May 9 01:34:14 2006
@@ -85,7 +85,7 @@
//#define TRACE_PARSE
template<typename OUT>
-void parse(ParserInput& in, OUT out)
+void parse(input::Input& in, OUT out)
{
string item;
@@ -114,11 +114,11 @@
{
case '\n':
line++;
- case ParserInput::Eof:
+ case input::Input::Eof:
if (!(itemset.empty() && tagset.empty()))
{
if (itemset.empty())
- throw tagcoll::exception::Parser(line, "no elements before `:' separator");
+ throw tagcoll::exception::Input(line, "no elements before `:' separator");
if (tagset.empty())
*out = make_pair(itemset, wibble::Empty<std::string>());
else
@@ -131,13 +131,13 @@
break;
case ':':
if (state == TAGS)
- throw tagcoll::exception::Parser(line, "separator `:' appears twice");
+ throw tagcoll::exception::Input(line, "separator `:' appears twice");
state = TAGS;
break;
default:
break;
}
- } while (sep != ParserInput::Eof);
+ } while (sep != input::Input::Eof);
}
@@ -176,7 +176,7 @@
void TextFormat<ITEM, TAG>::parse(
Converter<std::string, ITEM>& itemconv,
Converter<std::string, TAG>& tagconv,
- ParserInput& in,
+ input::Input& in,
Consumer<ITEM, TAG>& consumer)
{
ConversionFilter<string, string, ITEM, TAG> conv(itemconv, tagconv, consumer);
@@ -253,7 +253,7 @@
PatchList<ITEM, TAG> parsePatch(
Converter<std::string, ITEM>& itemconv,
Converter<std::string, TAG>& tagconv,
- ParserInput& in)
+ input::Input& in)
{
PatchBuilder<ITEM, TAG> builder(itemconv, tagconv);
parse(in, consumer(builder));
Modified: tagcoll/2.0/tagcoll/stream/expression.h
==============================================================================
--- tagcoll/2.0/tagcoll/stream/expression.h (original)
+++ tagcoll/2.0/tagcoll/stream/expression.h Tue May 9 01:34:14 2006
@@ -24,7 +24,7 @@
*/
#include <wibble/mixin.h>
-#include <tagcoll/Expression.h>
+#include <tagcoll/expression.h>
#include <set>
#include <string>
Modified: tagcoll/2.0/tagcoll/tagexpr/TagexprParser.h
==============================================================================
--- tagcoll/2.0/tagcoll/tagexpr/TagexprParser.h (original)
+++ tagcoll/2.0/tagcoll/tagexpr/TagexprParser.h Tue May 9 01:34:14 2006
@@ -23,7 +23,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <tagcoll/Expression.h>
+#include <tagcoll/expression.h>
#include <string>
namespace tagcoll
Modified: tagcoll/2.0/tagcoll/test-utils.cc
==============================================================================
--- tagcoll/2.0/tagcoll/test-utils.cc (original)
+++ tagcoll/2.0/tagcoll/test-utils.cc Tue May 9 01:34:14 2006
@@ -21,7 +21,7 @@
#ifdef COMPILE_TESTSUITE
#include <tests/test-utils.h>
-#include <tagcoll/StringParserInput.h>
+#include <tagcoll/input/string.h>
#include <tagcoll/TextFormat.h>
#include <tagcoll/Patches.h>
#include <wibble/operators.h>
@@ -36,7 +36,7 @@
void outputCollection(const std::string& str, tagcoll::Consumer<string, string>& cons)
{
- StringParserInput input(str);
+ input::String input(str);
textformat::parse(input, consumer(cons));
}
Modified: tagcoll/2.0/tagcoll/tests/test-utils.h
==============================================================================
--- tagcoll/2.0/tagcoll/tests/test-utils.h (original)
+++ tagcoll/2.0/tagcoll/tests/test-utils.h Tue May 9 01:34:14 2006
@@ -13,7 +13,7 @@
#define TEST_TAGCOLL
#ifdef TEST_TAGCOLL
-#include <tagcoll/StringParserInput.h>
+#include <tagcoll/input/string.h>
#include <tagcoll/TextFormat.h>
#endif
@@ -46,7 +46,7 @@
template<typename OUT>
void parseCollection(const std::string& str, const OUT& out)
{
- StringParserInput input(str);
+ input::String input(str);
textformat::parse(input, out);
}
More information about the Debtags-commits
mailing list