%parser %namespace RFC1157 %start Mib %symbol ObjectType { object attrs; public string help = ""; public ObjectType(object b) { attrs=b; } } %symbol Def { public static System.Collections.Hashtable defs = new System.Collections.Hashtable(); // string->Def Def parent = null; uint ix = 0; public string name; public string help = ""; protected System.Collections.Hashtable names = new System.Collections.Hashtable(); // string->Def public System.Collections.Hashtable nodes = new System.Collections.Hashtable(); // uint->Def public Def this[string s] { get { return (Def)names[s]; }} public Def this[uint k] { get { return (Def)nodes[k]; }} public uint[] path { get { System.Collections.ArrayList a = new System.Collections.ArrayList(); for (Def d=this;d!=null;d=d.parent) a.Add(d.ix); uint[] r = new uint[a.Count]; for (int j=0;j=u.Length) return s; Def m = this[u[p]]; if (m!=null) return s+"."+m.Lookup(u,p+1); while (p