// inherit.beh -- Inheritance backlinks construction // $Id: inherit.beh,v 1.3 2003/01/17 13:02:43 dougo Exp $ ClassGraph { /** Set inheritance links for alternates of an alternation class. */ void setInheritanceLinks() to Subclass { {{ ClassGraph cg; ClassName parent_name; }} before ClassGraph {{ cg = host; }} before ClassDef {{ parent_name = host.get_classname(); }} before Subclass {{ ClassName clname = host.get_classname(); ClassDef def = cg.findClassDef(clname); if (def == null) { throw new RuntimeException("Error: found alternation edge " + "=> " + parent_name + "," + clname + ", " + "but " + clname + " is not defined."); } else { def.set_parent(parent_name); } }} } } ClassDef { /** Set or add a parent to a class or interface. */ void set_parent(ClassName parent_name) {{ addSuperclass(Superclass.parse(parent_name.toString())); }} }