解析库 [英] Parse library
问题描述
任何人都知道某个库将解析如下文件:
options {
directory" / etc" ;;
allow-query {any; }; //这是默认的
递归否;
listen-on {192.168.0.225; };
货运代理{4.2.2.2; };
};
-
William Stacey,MVP
Anyone know of some library that will parse files like following:
options {
directory "/etc";
allow-query { any; }; // This is the default
recursion no;
listen-on { 192.168.0.225; };
forwarders { 4.2.2.2; };
};
--
William Stacey, MVP
推荐答案
" William Stacey [MVP]" < ST *********** @ mvps.org>在留言中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
任何人都知道一些库将解析如下文件:
options {
目录" / etc" ;;
allow-query {any; }; //这是默认的
递归否;
listen-on {192.168.0.225;转发器{4.2.2.2;威廉·斯泰西,MVP
Anyone know of some library that will parse files like following:
options {
directory "/etc";
allow-query { any; }; // This is the default
recursion no;
listen-on { 192.168.0.225; };
forwarders { 4.2.2.2; };
};
--
William Stacey, MVP
libConfuse几乎可以满足您的需求:http://
};
http://www.nongnu.org/confuse/
这是纯粹的C,但它带有一个VS.NET项目预先烘焙,所以它不会太难了b / b
太难了转换/换行。
用Regex自己写一些东西可能需要更少的时间。
Erik
libConfuse pretty much does what you want:
http://www.nongnu.org/confuse/
It''s pure C, but it comes prebaked with a VS.NET project so it wouldn''t be
too hard to convert/wrap.
It might take you less time to write something yourself with Regex.
Erik
谢谢Erik。看完lib后,看起来更像是我想要进入的b $ b。也许我只会使用xml序列化器。我想
这些天大多数人都喜欢xml配置文件。干杯!
-
William Stacey,MVP
news:uC ************** @ TK2MSFTNGP09.phx.gbl ...
Thanks Erik. After looking at the lib, looks like more work then what I
want to get into. Maybe I will just use xml serializer instead. I guess
most folks may like xml config files these days. Cheers!
--
William Stacey, MVP
"Erik Frey" <er*******@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
" William Stacey [ MVP] QUOT; < ST *********** @ mvps.org>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
任何人都知道某些图书馆将解析如下文件:
options {
目录" / etc" ;;
allow-query {any; }; //这是默认的
递归否;
listen-on {192.168.0.225;转发器{4.2.2.2;威廉·斯泰西,MVP
Anyone know of some library that will parse files like following:
options {
directory "/etc";
allow-query { any; }; // This is the default
recursion no;
listen-on { 192.168.0.225; };
forwarders { 4.2.2.2; };
};
--
William Stacey, MVP
libConfuse几乎可以满足您的需求:
http://www.nongnu.org/confuse/ <这是纯粹的C,但是它带有一个VS.NET项目预先烘焙,所以它不会太难转换/包装。
您可能需要更少的时间用Regex自己写一些东西。
Erik
libConfuse pretty much does what you want:
http://www.nongnu.org/confuse/
It''s pure C, but it comes prebaked with a VS.NET project so it wouldn''t be
too hard to convert/wrap.
It might take you less time to write something yourself with Regex.
Erik
" William Stacey [MVP]" < ST *********** @ mvps.org>在消息中写道
新闻:大江************** @ tk2msftngp13.phx.gbl ...
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
谢谢Erik。看完lib后,看起来更像是我想要进入的工作。也许我只会使用xml序列化器。我想
这些天大多数人都喜欢xml配置文件。干杯!
就个人而言,我正在试图找到一种方法来摆脱它们,;)。一年之后
左右的xml太多了,我开始明白为什么当有人使用
xml作为人类可读的可写语言时,人们会大惊小怪。 br />
虽然我不知道一个可以解析它的库,但编写一个解析器不应该非常困难,也许是使用jay的一天工作,取决于
灵活性。
您是否对一组有限的关键字或开放式解析器感兴趣? -
William Stacey,MVP
Erik Frey < ER ******* @ hotmail.com>在消息中写道
新闻:uC ************** @ TK2MSFTNGP09.phx.gbl ...
Thanks Erik. After looking at the lib, looks like more work then what I
want to get into. Maybe I will just use xml serializer instead. I guess
most folks may like xml config files these days. Cheers!
Personally, I''m tryign to find a way to get away from them, ;). After a year
or so of too much xml, I''m starting to see why people fuss when someone uses
xml as a human readable\writeable language.
While I don''t know a library that will parse it, writing a parser shouldn''t
be terribly difficult, maybe a days work using jay, depending on the
flexibility.
Are you interested in a limited set of keywords or an open ended parser? --
William Stacey, MVP
"Erik Frey" <er*******@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
" William Stacey [MVP]" < ST *********** @ mvps.org>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
>任何人都知道一些库将解析如下文件:
>
>选项{
>目录" / etc";
> allow-query {any; }; //这是默认的
>递归否;
>听取{192.168.0.225; };
>货运代理人{4.2.2.2; };
> };
>
> -
> William Stacey,MVP
> Anyone know of some library that will parse files like following:
>
> options {
> directory "/etc";
> allow-query { any; }; // This is the default
> recursion no;
> listen-on { 192.168.0.225; };
> forwarders { 4.2.2.2; };
> };
>
> --
> William Stacey, MVP
libConfuse几乎可以做你想要的:
http://www.nongnu.org/confuse/
这是纯粹的C,但它预先带有VS. NET项目所以它不会太难转换/包装。
你可能需要更少的时间用Regex自己写东西。
Erik
libConfuse pretty much does what you want:
http://www.nongnu.org/confuse/
It''s pure C, but it comes prebaked with a VS.NET project so it wouldn''t
be
too hard to convert/wrap.
It might take you less time to write something yourself with Regex.
Erik
这篇关于解析库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!