Beispiel #1
0
 private void verifyInput(final List<AbstractNode> initialGrammar) throws InterruptedException {
   for (AbstractNode node : initialGrammar) {
     if (Thread.interrupted()) {
       throw new InterruptedException();
     }
     if (!NodeType.ELEMENT.equals(node.getType())) {
       final StringBuilder sb = new StringBuilder("Initial grammar contains rule with ");
       sb.append(node.getType().toString());
       sb.append(" as left side.");
       throw new IllegalArgumentException(sb.toString());
     }
     if (node == null) {
       throw new IllegalArgumentException("Got null as left side in grammar.");
     }
   }
 }