Source:
private void turnIntoSimpleParameterization(List<Expression> column) throws InvalidSpecCompileException { VariableExpression varExpr = ObjectUtil.asInstance(column.get(0), VariableExpression.class); if (varExpr == null) throw new InvalidSpecCompileException(column.get(0), "Header of data table may only contain variable names"); if (AstUtil.isWildcardRef(varExpr)) { return; } ListExpression listExpr = new ListExpression(); List<String> previousVariables = getPreviousDataTableVariables(dataProcessorVars.size()); if (previousVariables.size() == 0) { column.stream().skip(1).forEach(listExpr::addExpression); } else { for (int row = 0, rows = column.size() - 1; row < rows; row++) { List<Statement> statements = new ArrayList<>(); for (String previousVariable : previousVariables) { statements.add(new ExpressionStatement( new DeclarationExpression( new VariableExpression(previousVariable), Token.newSymbol(Types.ASSIGN, -1, -1), createGetAtMethod(new VariableExpression(getDataTableParameterName(previousVariable)), row)))); } ExpressionStatement providerStatement = new ExpressionStatement(column.get(row + 1)); new DataProviderInternalsVerifier().visitExpressionStatement(providerStatement); statements.add(providerStatement); ClosureExpression closureExpression = new ClosureExpression( Parameter.EMPTY_ARRAY, new BlockStatement(statements, null)); listExpr.addExpression(new MethodCallExpression( closureExpression, "call", ArgumentListExpression.EMPTY_ARGUMENTS)); } } BinaryExpression binExpr = new BinaryExpression(varExpr, Token.newSymbol(Types.LEFT_SHIFT, -1, -1), listExpr); dataTableVars.add(new VariableExpression(varExpr.getName(), varExpr.getType())); rewriteSimpleParameterization(binExpr, varExpr, true); }

Target:
private void turnIntoSimpleParameterization(List<Expression> column) throws InvalidSpecCompileException { VariableExpression varExpr = ObjectUtil.asInstance(column.get(0), VariableExpression.class); if (varExpr == null) throw dataTableHeaderMayOnlyContainVariableNames(column.get(0)); if (AstUtil.isWildcardRef(varExpr)) { return; } ListExpression listExpr = new ListExpression(); List<String> previousVariables = getPreviousDataTableVariables(dataProcessorVars.size()); if (previousVariables.isEmpty()) { column.stream().skip(1).forEach(listExpr::addExpression); } else { for (int row = 0, rows = column.size() - 1; row < rows; row++) { Expression providerExpression = column.get(row + 1); providerExpression.visit(new DataProviderInternalsVerifier()); List<String> referencedPreviousVariables = getReferencedPreviousVariables(previousVariables, providerExpression); if (referencedPreviousVariables.isEmpty()) { listExpr.addExpression(providerExpression); continue; } List<Statement> statements = new ArrayList<>(); generatePreviousColumnExtractorStatements(referencedPreviousVariables, row, statements); ReturnStatement providerStatement = new ReturnStatement(providerExpression); providerStatement.setSourcePosition(providerExpression); statements.add(providerStatement); ClosureExpression closureExpression = new ClosureExpression( Parameter.EMPTY_ARRAY, new BlockStatement(statements, null)); listExpr.addExpression(new MethodCallExpression( closureExpression, "call", ArgumentListExpression.EMPTY_ARGUMENTS)); } } BinaryExpression binExpr = new BinaryExpression(varExpr, Token.newSymbol(Types.LEFT_SHIFT, -1, -1), listExpr); dataTableVars.add(new VariableExpression(varExpr.getName(), varExpr.getType())); rewriteSimpleParameterization(binExpr, varExpr, true); }