Consider the following class dictionary, behavior file, input and output. Find the UNKNOWNs. // Neven-xpath.pdf import edu.neu.ccs.demeter.dj.*; import java.util.*; XPath = List(Exp). Exp : Simple | BinaryCompound | UnaryCompound. Simple : ElementTest | WildCard. BinaryCompound = "(" BOp Exp Exp ")". UnaryCompound = "{-{" UOp Exp "}-}". BOp : Disjunction | Child | Descendant | Filter. UOp : Chi | Des. Chi = "/". Des = "desc". Disjunction = "|". Child = "/". Descendant = "desc" . Filter = "filt". ElementTest = Name. WildCard = "*". Name = Ident. Main = String. List(S) ~ "(" {S} ")". CountingVisitor = int extends Visitor . Behavior file: ================================================= Main { public static void main(String args[]) throws Exception {{ XPath m = XPath.parse(System.in); // m.display(); ClassGraph cgfull = new ClassGraph(true, false); ClassGraph cg = new ClassGraph(cgfull, "from XPath bypassing -> *,tail,* to *"); Visitor countingVis = new CountingVisitor(); Integer i1 = (Integer) cg.traverse(m, "from XPath via BinaryCompound to Disjunction", countingVis); System.out.println(i1.intValue() + " disjunction in binary "); System.out.println(); Integer i2 = (Integer) cg.traverse(m, "from XPath to Disjunction", countingVis); System.out.println(i2.intValue() + " disjunctions "); System.out.println(); List v; v = cg.gather( m, "from XPath via UnaryCompound to Disjunction"); System.out.println(v.size() + " list length disjunction in unary "); v = cg.gather( m, "from XPath via BinaryCompound to Chi"); System.out.println(v.size() + " list length Chi in binary "); v = cg.gather( m, "from XPath bypassing BinaryCompound to UnaryCompound"); System.out.println(v.size() + " list length Unary bypassing Binary"); System.out.println("done"); }} } CountingVisitor { {{ public void start() {c = 0; } // public void before(UnaryCompound host){ // System.out.println(host + " UnaryCompound visited"); // } public void before(Disjunction host){ // System.out.println(c + " Disjunction value of c"); c++; } public Object getReturnValue() { return new Integer(c);} }} } XPath { void display() to * (DisplayVisitor); } input: ================================================== ( a * {-{/ {-{ /x }-} }-} (| (/ p q) {-{ /y }-}) {-{/ (| x y)}-} (/ a (| b c)) (/ a (desc b (filt c {-{desc (| x (| y x))}-}) ) ) {-{ / t }-} ) output: ================================================== Reading project file program.prj... Running the test... 5 disjunction in binary 5 disjunctions 3 list length disjunction in unary 1 list length Chi in binary 4 list length Unary bypassing Binary done