|
From: Tiago C. <cog...@li...> - 2004-05-30 12:07:59
|
Hello all,
I've come across this nifty project just yesterday, and it is exactly
what i thought linux was missing. Congratulations for this very
interesting initiative.
My interest in this projects come in two ways: i want to learn how to
create a non-perl based parser. And then i want to play with Gtk+C or
pygtk with a simple frontend.
What i figured so far is that for creating a parser you create something
like:
<?xml version="1.0"?>
<parser uid="runlevels" type="normal">
<name>Runlevels</name>
<readcommand type="perl"><![CDATA[
use CFGXML::Runlevels;
my $parser = CFGXML::Runlevels->new;
my $doc = $parser->get;
my $xml_pi = $doc->createXMLDecl('1.0');
print $xml_pi->toString;
print $doc->toString;
]]></readcommand>
<writecommand type="perl"><![CDATA[
use CFGXML::Parser::Ini;
my $parser = CFGXML::Parser::Ini->new;
$parser->run("unparse");
]]></writecommand>
<default-configfile>/etc/samba/smb.conf</default-configfile>
</parser>
This seems very clear to me on how it works. But if i want to implement
the parser in another language/method then perl, how do i do it?
Which is the type attribute?
What if it does not a configuration file, is it enforced to use that
tag?
How does the parser speak with the middle layer?
Do you prefer people to write parsers in perl?
Thank you for your time :)
Tiago Cogumbreiro
|