Deal with quoted arguments. This hack parser uses whitespace to delimit

fields, not lex/yacc grammar so it is not an exact match but should be
close enough for most cases.
Deal with 'port?', 'irq?' style specifications.  These are parsed as
seperate values in lex/yacc in config(8) but tripped up this helper tool.
This commit is contained in:
peter 2000-06-17 20:10:55 +00:00
parent c953542e84
commit 61ad2eac93
3 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@ while (<>) {
chop;
s/#.*//;
next unless /^device/;
s/"//g;
($dev, $nameunit, $at, $where, @rest) = split;
next unless $at eq "at" && $where ne "";
$name = $nameunit;
@ -78,6 +79,10 @@ while (<>) {
}
next;
}
if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" ||
$key eq "iomem?" || $key eq "iosiz?") {
next;
}
if ($key eq "irq" || $key eq "drq" || $key eq "drive" ||
$key eq "iomem" || $key eq "iosiz" || $key eq "flags"||
$key eq "bus" || $key eq "target" || $key eq "unit") {

View File

@ -12,6 +12,7 @@ while (<>) {
chop;
s/#.*//;
next unless /^device/;
s/"//g;
($dev, $nameunit, $at, $where, @rest) = split;
next unless $at eq "at" && $where ne "";
$name = $nameunit;
@ -78,6 +79,10 @@ while (<>) {
}
next;
}
if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" ||
$key eq "iomem?" || $key eq "iosiz?") {
next;
}
if ($key eq "irq" || $key eq "drq" || $key eq "drive" ||
$key eq "iomem" || $key eq "iosiz" || $key eq "flags"||
$key eq "bus" || $key eq "target" || $key eq "unit") {

View File

@ -12,6 +12,7 @@ while (<>) {
chop;
s/#.*//;
next unless /^device/;
s/"//g;
($dev, $nameunit, $at, $where, @rest) = split;
next unless $at eq "at" && $where ne "";
$name = $nameunit;
@ -71,6 +72,10 @@ while (<>) {
}
next;
}
if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" ||
$key eq "iomem?" || $key eq "iosiz?") {
next;
}
if ($key eq "irq" || $key eq "drq" || $key eq "drive" ||
$key eq "iomem" || $key eq "iosiz" || $key eq "flags"||
$key eq "bus" || $key eq "target" || $key eq "unit") {