ClassGraph { (@ void check_repetition() { SimpleChecker sc = new SimpleChecker(); this.t(sc); } @) traversal t(SimpleChecker sc) { bypassing ConstOrAltClass to RepetitionClass ; } } RepetitionClass{ (@ void GoDeeper(){ DeeperVisitor dv = new DeeperVisitor(null); this.t2(dv); } @) traversal t2(DeeperVisitor dv) {to ClassName; } } Main { (@ static public void main(String args[]) throws Exception { ClassGraph a = ClassGraph.parse(System.in); a.check_repetition(); System.out.println("done"); } @) } DeeperVisitor { before ClassName(@ if (carried == null) carried = host; else { if (!carried.get_name().toString().equals(host.get_name().toString())) System.out.println("J-Sem-Check: Error: Not identical class instances (" + carried.get_name() + " and " + host.get_name() + ") on left hand side of repetition production." ); } @) } SimpleChecker { before ClassGraph(@ System.out.println("Checking that two class names on the right " + "hand side of every repetition production " + "are identical..."); @) before RepetitionClass (@ host.GoDeeper(); @) }