#if !defined(_INLINE)
static char cvsid[] = "@(#)$Id$";
static char debugFileId[] = __FILE__;
#endif
#include "containers/lists/List.hpp"
#include "algorithms/parse/TokenAdapter.hpp"
#include "algorithms/enumerations/EnumerationAlgorithms.hpp"
#include "algorithms/parse/SimpleWordParser.hpp"
#include "UCSChar.hpp"
#include "OGuard.hpp"
#include "Debug.hpp"
SimpleWordParser::SimpleWordParser( CharEnumeration *aSource, String aDelimiters ) :
WordParser( aSource ),
delimiters( aDelimiters )
{
TokenAdapter *space;
TokenAdapter *word;
List *spaces;
space = new TokenAdapter();
OGuard _space( space, this );
word = new TokenAdapter();
OGuard _word( word, this );
space -> setTag( new String( " " ) );
word -> setTag( new String( "w" ) );
spaces = new List();
OGuard _spaces( spaces, this );
for( int i = 0 ; i < delimiters.length() ; ++i )
{
spaces -> append( new UCSChar( delimiters.getUNIChars()[ i ] ) );
}
addSyntaxEntry( spaces, space );
addDefaultEntry( word );
}
String SimpleWordParser::getClassName() const
{
return "SimpleWordParser";
}
#if defined(_INLINE)
#include "../src/Debug.ipp"
#endif