blob: 596090cff51bc0102d5c3727f29b3e03e654ceea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
\section{Finding {\tt yacc} definitions}
<<*>>=
procedure rcsinfo ()
return "$Id: yaccdefs.nw,v 1.18 2008/10/06 01:03:05 nr Exp nr $" ||
"$Name: v2_12 $"
end
procedure main(args)
go()
end
procedure postpass(name, arg)
static kind
case name of {
"begin" : arg ? kind := tab(upto(' ')|0)
"text" : if kind == "code" then arg ?
if id := tab(many(&letters)) then {
tab(many(' \t'))
if =":" & any(&letters ++ ' ([{') then writedefn(id)
}
}
return
end
procedure prepass(name, arg)
if name == "end" then writedefn(&null) # force newline
end
|