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