dramguy has asked for the wisdom of the Perl Monks concerning the following question:
dbSetCellPortTypes "/opt/mylib/95nm6M" "*" '( ("gnd!" "Inout" "Ground" ) ("vint!" "Inout" "Power" ) ) #f
Here is what I have so far:
use strict; use Parse::RecDescent; use Data::Dumper; $::RD_ERRORS = 1; $::RD_WARN = 1; $::RD_HINT = 1; $::RD_TRACE = 1; my $grammar = <<'_EOGRAMMAR_'; <autotree> QUOTED_STRING : /"/ <skip:""> quoted_char(s?) /"/ { " " . join "", @{$item[3]} # leading space flags a str +ing } quoted_char : /[^\\"]+/ | /\\n/ { "\n" } | /\\"/ { "\"" } portDefinition: "dbSetCellPortTypes" QUOTED_STRING QUOTED_STRIN +G portLists QUOTED_STRING portLists: "'" "(" list(s?) ")" list: "(" QUOTED_STRING ")" _EOGRAMMAR_ my $parse = Parse::RecDescent->new($grammar) or die "bad grammar"; undef $/; my $text = <<EOT; dbSetCellPortTypes "/opt/mylib/s956M" "*" '( ("gnd!" "Inout" "Ground" ) ("vint!" "Inout" "Power" ) ) #f EOT my $net = $parse->portDefinition($text) or die "bad netlist"; print Dumper[$net];
I am getting a bad netlist error and don't know how to debug from here. Any help is appreciated. Thanks, Frank
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with Parse::RecDescent grammar
by philcrow (Priest) on Dec 12, 2006 at 16:17 UTC | |
by dramguy (Novice) on Dec 12, 2006 at 16:27 UTC | |
by ikegami (Patriarch) on Dec 12, 2006 at 16:58 UTC | |
by dramguy (Novice) on Dec 12, 2006 at 17:43 UTC | |
by ikegami (Patriarch) on Dec 12, 2006 at 20:20 UTC | |
| |
by philcrow (Priest) on Dec 12, 2006 at 16:53 UTC |