summaryrefslogtreecommitdiff
path: root/web/noweb/src/icon/mmixdefs.nw
blob: abb7ceda31fd1de32e3875128827100374b2c1f5 (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
27
28
29
30
31
32
% -*- mode: Noweb; noweb-code-mode: icon-mode -*-
\section{Finding definitions in MMIX}
<<*>>=
procedure main(args)
  go()
end
<<*>>=
global idchars
procedure postpass(name, arg)
  static kind, lets
  initial { idchars := &letters ++ &digits ++ '_:' 
            lets := &letters ++ '_'
            kind := "bogus"
          }
  case name of {
    "begin" : arg ? kind := tab(upto(' ')|0)
    "text" : if kind == "code" then arg ?
               if (any(lets), t := tab(many(idchars)), any('\t ')) then
	         writedefn(t)
  }
  return
end

procedure prepass(name, arg)
  if name == "end" then writedefn(&null) # force newline
end
<<*>>=
procedure rcsinfo () 
  return "$Id: mmixdefs.nw,v 1.15 2008/10/06 01:03:05 nr Exp nr $" ||
         "$Name: v2_12 $"
end
@