BCGSoft Professional Editor for MFC
XML Format for Outline Parser

This article describes format of XML files to be used with CBCGPOutlineParser and auto-outlining feature of the edit control. The XML parser is invoked by calling to CBCGPEditCtrl::LoadOutlineParserXMLSettings.

The structure used for the outline parser is following:

1 <SETTINGS>
2  <OUTLINE_DATA>
3  <IgnoreOneLineBlocks></IgnoreOneLineBlocks>
4  <EscapeSequences>
5  <EscapeSequence></EscapeSequence>
6  </EscapeSequences>
7 
8  <BLOCKS>
9  <BLOCK>
10  <Start></Start>
11  <End></End>
12  <ReplaceString></ReplaceString>
13  <AllowNestedBlocks></AllowNestedBlocks>
14  <Ignore></Ignore>
15  </BLOCK>
16  </BLOCKS>
17  </OUTLINE_DATA>
18 </SETTINGS>

There are no mandatory tags except the main "SETTINGS" tag.

"OUTLINE_DATA" tag defines general outline parser settings.

  • "IgnoreOneLineBlocks" tag defines whether the edit control should consider one line blocks as collapsible or not. "False" by default
  • "EscapeSequences" tag defines a list of escape sequences.
  • "EscapeSequence" tag represents a single escape sequence.
  • "BLOCKS" tag is intended for syntax definitions of the language. Each block specifies the rule how the outline parser found the outline collapsible region. It's usable when you need to define a set of automatic outlining regions of the same language syntax block. For each block the XML parser will call CBCGPOutlineParser::AddBlockType.
  • "BLOCK" tag represents a single block.

Default XML settings for C++:

1 <SETTINGS>
2  <OUTLINE_DATA>
3  <IgnoreOneLineBlocks>True</IgnoreOneLineBlocks>
4  <IncludeSpaceLines>True</IncludeSpaceLines>
5  <EscapeSequences>
6  <EscapeSequence>\\\"</EscapeSequence>
7  </EscapeSequences>
8  <BLOCKS>
9  <BLOCK>
10  <Start>\\\"</Start>
11  <End></End>
12  <ReplaceString></ReplaceString>
13  <AllowNestedBlocks>False</AllowNestedBlocks>
14  <Ignore>True</Ignore>
15  </BLOCK>
16 
17  <BLOCK>
18  <Start>\"</Start>
19  <End>\"</End>
20  <ReplaceString>\"\"</ReplaceString>
21  <AllowNestedBlocks>False</AllowNestedBlocks>
22  <Ignore>True</Ignore>
23  </BLOCK>
24 
25  <BLOCK>
26  <Start>{</Start>
27  <End>}</End>
28  <ReplaceString>..</ReplaceString>
29  <KEYWORDS>
30  <Keyword>else</Keyword>
31  <Keyword>struct</Keyword>
32  <Keyword>enum</Keyword>
33  <Keyword>switch</Keyword>
34  <Keyword>catch</Keyword>
35  <Keyword>try</Keyword>
36  <Keyword>for</Keyword>
37  <Keyword>operator</Keyword>
38  <Keyword>class</Keyword>
39  <Keyword>if</Keyword>
40  <Keyword>union</Keyword>
41  <Keyword>do</Keyword>
42  <Keyword>while</Keyword>
43  <Keyword>namespace</Keyword>
44  </KEYWORDS>
45  </BLOCK>
46 
47  <BLOCK>
48  <Start>{</Start>
49  <End>}</End>
50  <ReplaceString>...</ReplaceString>
51  </BLOCK>
52 
53  <BLOCK>
54  <Start>//</Start>
55  <End>\n</End>
56  <ReplaceString>/**/</ReplaceString>
57  <AllowNestedBlocks>False</AllowNestedBlocks>
58  </BLOCK>
59 
60  <BLOCK>
61  <Start>/*</Start>
62  <End>*/</End>
63  <ReplaceString>/**/</ReplaceString>
64  <AllowNestedBlocks>False</AllowNestedBlocks>
65  </BLOCK>
66  </BLOCKS>
67  </OUTLINE_DATA>
68 </SETTINGS>