[Pyparsing] Parsing DNS bind file
Brought to you by:
ptmcg
From: Michele P. <mic...@un...> - 2005-04-28 12:29:57
|
I want to modify bind parsing example because it don't parse this data: controls { inet 127.0.0.1 allow { any; } keys { "key";}; }; If I remove these three lines, the example work well. I add the these two lines to try to parse the new data: simple_val = Group(value + '{' + OneOrMore(value + ';') + '}') only4ctrls = Group('controls' + value + value + OneOrMore(simple_val) + "}" + ";") and modified this: toplevel << OneOrMore(simple | statement | only4ctrls) but pyparsing stop when it found my new data. Can someone help me? Thanks, Michele A complete data can be this: key "key" { algorithm hmac-md5; secret "abcde1abcde2abcde3abcde4"; }; controls { inet 127.0.0.1 allow { any; } keys { "key";}; }; options { pid-file "/var/run/named/named.pid"; directory "/var/named"; forwarders { 62.94.0.1; 62.94.0.2; }; notify no; }; zone "." { type hint; file "named.ca"; }; |