1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 #include <libxml/parser.h>
16 #include <comphelper/syntaxhighlight.hxx>
18 class LibXmlTreeWalker
;
24 xmlDocPtr m_pDocument
;
25 std::vector
<xmlNodePtr
> m_BasicCodeContainerTags
;
26 std::unique_ptr
<LibXmlTreeWalker
> m_pXmlTreeWalker
;
27 SyntaxHighlighter m_Highlighter
;
28 bool m_bTaggingCompleted
;
29 void tagParagraph( xmlNodePtr paragraph
);
30 static xmlChar
* getTypeString( TokenType tokenType
);
31 void getBasicCodeContainerNodes();
32 void tagBasCodeParagraphs();
35 enum TaggerException
{ NULL_DOCUMENT
, EMPTY_DOCUMENT
};
36 BasicCodeTagger( xmlDocPtr rootDoc
);
41 //================LibXmlTreeWalker===========================================================
43 class LibXmlTreeWalker
46 xmlNodePtr m_pCurrentNode
;
47 std::deque
<xmlNodePtr
> m_Queue
; //!Queue for breath-first search
50 LibXmlTreeWalker( xmlDocPtr doc
);
52 xmlNodePtr
currentNode() { return m_pCurrentNode
;}
54 void ignoreCurrNodesChildren();
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */