开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 5167|回复: 0

BCGSoft Professional Editor帮助文档:Outline解析器的XML格式

[复制链接]

0

精华

8

贡献

1767

赞扬

特约版主

帖子
583
软币
4524
在线时间
275 小时
注册时间
2019-2-21
发表于 2021-3-31 09:57:54 | 显示全部楼层 |阅读模式

BCGSoft Professional Editor(BCGPEdit)是一款能让您将高级编辑控件合并到任何基于MFC的应用程序的MFC扩展库。这个编辑器支持各种类型的应用程序,从简单的客户端到复杂的开发工具都可以集成这款编辑控件。


本文介绍了与CBCGPOutlineParser一起使用的XML文件格式,以及编辑控件的自动概述功能,通过调用CBCGPEditCtrl::LoadOutlineParserXMLSettings来调用XML解析器。

用于大纲分析器的结构如下:

[XML] 纯文本查看 复制代码
<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”标记表示单个块

C ++的默认XML设置:

[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>


回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-3-19 22:01

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表