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/.
10 #ifndef INCLUDED_HELPCOMPILER_INC_BASCODETAGGER_HXX
11 #define INCLUDED_HELPCOMPILER_INC_BASCODETAGGER_HXX
16 #include <libxml/parser.h>
17 #include <comphelper/syntaxhighlight.hxx>
19 class LibXmlTreeWalker
;
25 xmlDocPtr m_pDocument
;
26 std::vector
<xmlNodePtr
> m_BasicCodeContainerTags
;
27 std::unique_ptr
<LibXmlTreeWalker
> m_pXmlTreeWalker
;
28 SyntaxHighlighter m_Highlighter
;
29 bool m_bTaggingCompleted
;
30 void tagParagraph( xmlNodePtr paragraph
);
31 static xmlChar
* getTypeString( TokenType tokenType
);
32 void getBasicCodeContainerNodes();
33 void tagBasCodeParagraphs();
36 enum TaggerException
{ NULL_DOCUMENT
, EMPTY_DOCUMENT
};
37 BasicCodeTagger( xmlDocPtr rootDoc
);
42 //================LibXmlTreeWalker===========================================================
44 class LibXmlTreeWalker
47 xmlNodePtr m_pCurrentNode
;
48 std::deque
<xmlNodePtr
> m_Queue
; //!Queue for breath-first search
51 LibXmlTreeWalker( xmlDocPtr doc
);
53 xmlNodePtr
currentNode() { return m_pCurrentNode
;}
55 void ignoreCurrNodesChildren();
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */