// solving the capacity checking problem from hw 2 // without modifying the host // visitor has own stack to keep track of initial value // class dictionary (@ import java.util.*; @) Container = "(" List(Item) Capacity ")". Item : Container | Simple. List(S) ~ {S}. Simple = Ident Weight. Capacity = int. Weight = int. CheckingVisitor = InitialVisitor int. SummingVisitor = int. InitialVisitor = // takes care of computing initial value int // result for communication // with checking visitor Stack SummingVisitor. Main = .