final JavaAnalysisResult initCodeAnalysis = (JavaAnalysisResult) context.getDialect().analyzeBlock( context,
accumDescr,
accumDescr.getInitCode(),
available );
final AnalysisResult actionCodeAnalysis = context.getDialect().analyzeBlock( context,
accumDescr,
accumDescr.getActionCode(),
available );
final AnalysisResult resultCodeAnalysis = context.getDialect().analyzeExpression( context,
accumDescr,
accumDescr.getResultCode(),
available );
final Set<String> requiredDeclarations = new HashSet<String>( initCodeAnalysis.getBoundIdentifiers().getDeclrClasses().keySet() );
requiredDeclarations.addAll( actionCodeAnalysis.getBoundIdentifiers().getDeclrClasses().keySet() );
requiredDeclarations.addAll( resultCodeAnalysis.getBoundIdentifiers().getDeclrClasses().keySet() );
final Map<String, Class< ? >> requiredGlobals = new HashMap<String, Class< ? >>( initCodeAnalysis.getBoundIdentifiers().getGlobals() );
requiredGlobals.putAll( actionCodeAnalysis.getBoundIdentifiers().getGlobals() );
requiredGlobals.putAll( resultCodeAnalysis.getBoundIdentifiers().getGlobals() );
if ( accumDescr.getReverseCode() != null ) {
final AnalysisResult reverseCodeAnalysis = context.getDialect().analyzeBlock( context,
accumDescr,
accumDescr.getActionCode(),
available );
requiredDeclarations.addAll( reverseCodeAnalysis.getBoundIdentifiers().getDeclrClasses().keySet() );
requiredGlobals.putAll( reverseCodeAnalysis.getBoundIdentifiers().getGlobals() );
}
final Declaration[] declarations = new Declaration[requiredDeclarations.size()];
int i = 0;
for ( Iterator<String> it = requiredDeclarations.iterator(); it.hasNext(); i++ ) {