protected void write(EObject grammarElement, String value) {
   if (grammarElement instanceof AbstractElement) {
     Event first = queue.pollFirst();
     AbstractElement firstGrammarElement = first.grammarElement;
     CrossReference ref = GrammarUtil.containingCrossReference(firstGrammarElement);
     if (ref != null) firstGrammarElement = ref;
     if (firstGrammarElement == grammarElement && first.token.equals(value)) {
       // System.out.println("OK!");
     } else {
       GrammarElementTitleSwitch f =
           new GrammarElementTitleSwitch().showQualified().showAssignments();
       System.out.println(
           f.apply(firstGrammarElement)
               + "<>"
               + f.apply((AbstractElement) grammarElement)
               + "; "
               + first.token
               + "<>"
               + value);
     }
     delegate.accept(first.sementicElement, first.grammarElement, value, false);
   } else {
     delegate.accept(null, grammarElement, value, true);
   }
 }