Tiago Cogumbreiro | 30 May 2004 14:09
Picon

Writing non-perl Parsers

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>
(Continue reading)


Gmane