Class dictionary: ====================================== Department = "department" Computer. Computer = "computer" Integer. Behavior file: ====================================== SummingVisitor = Integer. Main = . SummingVisitor { before Computer (@ total = new Integer(total.intValue() + host.get_localMem().intValue()); @) } Department { traversal allComputers(SummingVisitor s) { to Computer; } (@ int computeMemory() throws Exception { SummingVisitor s = SummingVisitor.parse("0"); this.allComputers(s); return s.get_total().intValue(); } @) } Main { (@ static public void main(String args[]) throws Exception { Department dep = Department.parse(System.in); int r = dep.computeMemory(); if (r != 20) System.out.println("FAILURE"); else System.out.println("SUCCESS"); System.out.println("Total memory: " + r); } @) } Input: ====================================== department computer 20