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 Wemm 2000-06-17 20:10:55 +00:00
parent 86e7756c4f
commit c46d792d58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61755
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") {