if ( fc.getBind() != null ) { if ( pattern.getDeclaration( fc.getBind() ) != null ) { context.addError(new DescrBuildError(context.getParentDescr(), accumDescr, null, "Duplicate declaration for variable '" + fc.getBind() + "' in the rule '" + context.getRule().getName() + "'")); } else { createResultBind( pattern,
if ( func.getBind() != null ) { if ( pattern.getDeclaration( func.getBind() ) != null ) { context.addError(new DescrBuildError(context.getParentDescr(), accumDescr, null, "Duplicate declaration for variable '" + func.getBind() + "' in the rule '" + context.getRule().getName() + "'")); } else { createResultBind( pattern,
private void createResultBind( final Pattern pattern, int index, InternalReadAccessor arrayReader, AccumulateFunctionCallDescr fc, AccumulateFunction function ) { // bind function result on the result pattern Declaration declr = pattern.addDeclaration( fc.getBind() ); Class< ? > type = function instanceof TypedAccumulateFunction ? ((TypedAccumulateFunction) function).getResultType() : Object.class; // this bit is different, notice its the ArrayElementReader that we wire up to, not the declaration. ArrayElementReader reader = new ArrayElementReader( arrayReader, index, type ); declr.setReadAccessor( reader ); }
private void createResultBind( final Pattern pattern, int index, InternalReadAccessor arrayReader, AccumulateFunctionCallDescr fc, AccumulateFunction function ) { // bind function result on the result pattern Declaration declr = pattern.addDeclaration( fc.getBind() ); Class< ? > type = function instanceof TypedAccumulateFunction ? ((TypedAccumulateFunction) function).getResultType() : Object.class; // this bit is different, notice its the ArrayElementReader that we wire up to, not the declaration. ArrayElementReader reader = new ArrayElementReader( arrayReader, index, type ); declr.setReadAccessor( reader ); }