[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: Parsing and writing schematics with Perl



Hi all,

Is there a Perl interface to gschem I could use to:
- parse a given set of schematic (or symbol) pages and get a data  
structure of the full (flat) design
- write back schematic (or symbol) pages given the same and modified  
data structure (and do a backup first)

I already have something working that uses Parse::RecDescent (see  
http://search.cpan.org/~dconway/Parse-RecDescent-v1.95.1/, I wrote  
the grammar specification as an exercise based on http:// 
geda.seul.org/wiki/geda:file_format_spec), but I know it might be  
just Yet Another Gschem Parser... and was wondering if there was some  
*simple user-level* API to libgeda I should be using instead (and how?).

Below is an example of such data structure output using Data::Dumper

Thanks,
_jP

data = [
          {
            'fileName' => 'test-1.sch',
            'objects' => [
                           {
                             'type' => 'v',
                             'version' => '20031231',
                             'fileformat_version' => '1'
                           },
                           {
                             'type' => 'N',
                             'x1' => '44400',
                             'y1' => '59100',
                             'x2' => '46000',
                             'y2' => '59100',
                             'color' => '4',
                             'Attributes' => [
                                               {
                                                 'type' => 'T',
                                                 'x' => '44400',
                                                 'y' => '59200',
                                                 'color' => '5',
                                                 'size' => '10',
                                                 'visibility' => '1',
                                                 'show_name_value' =>  
'1',
                                                 'alignment' => '0',
                                                 'angle' => '0',
                                                 'num_lines' => '1',
                                                 'name' => 'netname',
                                                 'value' => 'DATA0'
                                               }
                                             ]
                           }
                         ]
          }
        ]




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user