文档半岛外围网上直营>>BCGControlBar 中文文档>>XML格式的大纲解析器
XML格式的大纲解析器
立即下载BCGControlBar Professional Edition for MFC
本文描述与CBCGPOutlineParser和编辑控件的自动概述特性一起使用的XML文件格式,XML解析器通过调用CBCGPEditCtrl::LoadOutlineParserXMLSettings来调用。
大纲解析器使用的结构如下:
<SETTINGS> <OUTLINE_DATA> <IgnoreOneLineBlocks></IgnoreOneLineBlocks> <EscapeSequences> <EscapeSequence></EscapeSequence> </EscapeSequences> <BLOCKS> <BLOCK> <Start></Start> <End></End> <ReplaceString></ReplaceString> <AllowNestedBlocks></AllowNestedBlocks> <Ignore></Ignore> </BLOCK> </BLOCKS> </OUTLINE_DATA> /SETTINGS>
除了主要的“SETTINGS”标签外,没有强制性标签。
"OUTLINE_DATA"标签定义一般大纲解析器设置。
- IgnoreOneLineBlocks”标签定义了编辑控件是否应该将一行块视为可折叠的,默认为False。
- "EscapeSequences"标签定义了一个转义序列列表。
- "EscapeSequence"标记表示单个转义序列。
- “BLOCKS”标记用于该语言的语法定义,每个块指定大纲解析器如何找到大纲可折叠区域的规则。当您需要定义一组相同语言语法块的自动概述区域时,它很有用,对于每个块,XML解析器将调用CBCGPOutlineParser::AddBlockType。
-
BLOCK”标签代表单个块
- "Start" - defines BlockType::m_strOpen
- "End" - defines BlockType::m_strClose
- "ReplaceString" - defines BlockType::m_strReplace, "..." by default
- "AllowNestedBlocks" - defines BlockType::m_bAllowNestedBlocks, "True" by default
- "Ignore" - defines BlockType::m_bIgnore, "False" by default
C++的默认XML设置:
<SETTINGS>
<OUTLINE_DATA>
<IgnoreOneLineBlocks>True</IgnoreOneLineBlocks>
<IncludeSpaceLines>True</IncludeSpaceLines>
<EscapeSequences>
<EscapeSequence>\\\"</EscapeSequence>
</EscapeSequences>
<BLOCKS>
<BLOCK>
<Start>\\\"</Start>
<End></End>
<ReplaceString></ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
<Ignore>True</Ignore>
</BLOCK>
<BLOCK>
<Start>\"</Start>
<End>\"</End>
<ReplaceString>\"\"</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
<Ignore>True</Ignore>
</BLOCK>
<BLOCK>
<Start>{</Start>
<End>}</End>
<ReplaceString>..</ReplaceString>
<KEYWORDS>
<Keyword>else</Keyword>
<Keyword>struct</Keyword>
<Keyword>enum</Keyword>
<Keyword>switch</Keyword>
<Keyword>catch</Keyword>
<Keyword>try</Keyword>
<Keyword>for</Keyword>
<Keyword>operator</Keyword>
<Keyword>class</Keyword>
<Keyword>if</Keyword>
<Keyword>union</Keyword>
<Keyword>do</Keyword>
<Keyword>while</Keyword>
<Keyword>namespace</Keyword>
</KEYWORDS>
</BLOCK>
<BLOCK>
<Start>{</Start>
<End>}</End>
<ReplaceString>...</ReplaceString>
</BLOCK>
<BLOCK>
<Start>//</Start>
<End>\n</End>
<ReplaceString>/**/</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
</BLOCK>
<BLOCK>
<Start>/*</Start>
<End>*/</End>
<ReplaceString>/**/</ReplaceString>
<AllowNestedBlocks>False</AllowNestedBlocks>
</BLOCK>
</BLOCKS>
</OUTLINE_DATA>
</SETTINGS>

QQ交谈
在线咨询

渝公网安备
50010702500608号

客服热线