Tanl Linguistic Pipeline |
00001 /* 00002 ** IXE 00003 ** conf/PatternList.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2003 Giuseppe Attardi (attardi@di.unipi.it). 00006 ** ---------------------------------------------------------------------- 00007 ** 00008 ** This file is part of IXE. 00009 ** 00010 ** IXE is free software; you can redistribute it and/or modify it 00011 ** under the terms of the GNU General Public License, version 3, 00012 ** as published by the Free Software Foundation. 00013 ** 00014 ** IXE is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 ** GNU General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU General Public License 00020 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 ** ---------------------------------------------------------------------- 00022 */ 00023 00024 #ifndef IXE_PatternList_H 00025 #define IXE_PatternList_H 00026 00027 // local 00028 #include "conf/conf.h" 00029 #include "conf/PatternSet.h" 00030 #include "text/strings.h" // next_token_line() 00031 00032 using namespace IXE::Text; 00033 00034 namespace IXE { 00035 00042 class PatternList : public Var<PatternSet> { 00043 public: 00044 PatternList(char const* name) : Var<value_type>(name) { } 00045 00046 protected: 00047 virtual void parseValue(char const*& line) { 00048 register char const *s; 00049 while (s = next_token_line(line, " \r\t")) 00050 value.insert(strndup(s, line -s), false); 00051 } 00052 virtual void reset() { value.clear(); } 00053 }; 00054 00055 } // namespace IXE 00056 00057 #endif /* IXE_PatternList_H */