@SuppressWarnings("unchecked") public T compute(Node<?, ?> language) { assert language != null; getWorkList().clear(); begin(); T accumulator; // Visit a grammar if (language.tag == Node.Tag.ID) { getWorkList().todo((Node<String, Void>) language); accumulator = bottom(); for (Node<String, Void> identifier : getWorkList()) { accumulator = reduce(accumulator, g.acceptRule(this, identifier)); if (done(accumulator)) { return end(accumulator); } } } // Visit a regex else { accumulator = Node.accept(this, language); } return end(accumulator); }