private MethodCallExpression createBlockListenerCall(Block block, MethodNode blockListenerMethod) {
    if (block.getBlockMetaDataIndex() < 0) throw new SpockException("Block metadata index not set: " + block);
    return createDirectMethodCall(
      new ClassExpression(nodeCache.SpockRuntime),
      blockListenerMethod,
      new ArgumentListExpression(
        VariableExpression.THIS_EXPRESSION,
        new ConstantExpression(block.getBlockMetaDataIndex(), true)
      ));
  }
A Spec visitor responsible for most of the rewriting of a Spec's AST.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java