00001 00002 /* 00003 | Author: Michael Schmidt; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00035 #ifndef STREAMPREPROCESSOR_H 00036 #define STREAMPREPROCESSOR_H 00037 00038 #include "buffer.h" 00039 #include "streamtracker.h" 00040 #include "streammanager.h" 00041 #include "parseexception.h" 00042 00047 extern FILE *yyxmlin; 00048 00054 extern int saxparse(); 00055 00061 extern void destroyLexer(); 00062 00078 class StreamPreProcessor { 00079 00080 public: 00090 static void initInstance(Buffer * _buffer, ProjectionDFA * _pdfa); 00091 00100 static StreamPreProcessor *getInstance(); 00101 00105 virtual ~ StreamPreProcessor(); 00106 00115 inline void processOpeningTag(const char *tag) { 00116 st.processOpeningTag(tag); 00117 } inline void processBachelorTag(const char *tag) { 00126 st.processBachelorTag(tag); 00127 } 00128 00129 00130 #ifdef VALIDATION 00131 00139 inline void processClosingTag(const char *tag) { 00140 st.processClosingTag(tag); 00141 } 00142 #else 00143 00150 inline void processClosingTag() { 00151 st.processClosingTag(); 00152 } 00153 #endif // #ifdef VALIDATION 00154 00162 inline void processPCData(const char *data) { 00163 st.processPCData(data); 00164 } 00165 00173 void readNext(); 00174 00184 void readAll(); 00185 00186 private: 00191 static StreamPreProcessor *instance; 00192 00198 StreamPreProcessor(Buffer * _buffer, ProjectionDFA * _pdfa); 00199 00204 TagMap *tagmap; 00205 00211 TAG tag; 00212 00219 StreamTracker st; 00220 }; 00221 00222 #endif // STREAMPREPROCESSOR_H