/** Get the buffers that are scoped to this block */ public TableBuffer[] getBlockBuffers() { // We can't just return bufferScopes, because it also contains // references to BufferScope objects which are scoped to child blocks. Set<TableBuffer> set = new HashSet<>(); for (BufferScope buff : bufferScopes) { if (buff.getBlock() == this) set.add(buff.getSymbol()); } return (TableBuffer[]) set.toArray(new TableBuffer[set.size()]); } // getBlockBuffers
/** Get the buffers that are scoped to this block */ public TableBuffer[] getBlockBuffers() { // We can't just return bufferScopes, because it also contains // references to BufferScope objects which are scoped to child blocks. Set<TableBuffer> set = new HashSet<>(); for (BufferScope buff : bufferScopes) { if (buff.getBlock() == this) set.add(buff.getSymbol()); } return (TableBuffer[]) set.toArray(new TableBuffer[set.size()]); } // getBlockBuffers
/** * Add a reference to a BufferScope to this and all outer blocks. These references are required for duplicating * Progress's scope and "raise scope" behaviours. BufferScope references are not added up past the symbol's scope. */ public void addBufferScopeReferences(BufferScope bufferScope) { // References do not get added to DO blocks. if (blockStatementNode.getNodeType() != ABLNodeType.DO) bufferScopes.add(bufferScope); if (parent != null && bufferScope.getSymbol().getScope().getRootBlock() != this) { parent.addBufferScopeReferences(bufferScope); } }
/** * Add a reference to a BufferScope to this and all outer blocks. These references are required for duplicating * Progress's scope and "raise scope" behaviours. BufferScope references are not added up past the symbol's scope. */ public void addBufferScopeReferences(BufferScope bufferScope) { // References do not get added to DO blocks. if (blockStatementNode.getNodeType() != ABLNodeType.DO) bufferScopes.add(bufferScope); if (parent != null && bufferScope.getSymbol().getScope().getRootBlock() != this) { parent.addBufferScopeReferences(bufferScope); } }
/** Find nearest BufferScope for a BufferSymbol, if any */ private BufferScope findBufferScope(TableBuffer symbol) { for (BufferScope buff : bufferScopes) { if (buff.getSymbol() != symbol) continue; if (buff.getBlock() == this) return buff; } if (parent != null && symbol.getScope().getRootBlock() != this) return parent.findBufferScope(symbol); return null; }
/** Find nearest BufferScope for a BufferSymbol, if any */ private BufferScope findBufferScope(TableBuffer symbol) { for (BufferScope buff : bufferScopes) { if (buff.getSymbol() != symbol) continue; if (buff.getBlock() == this) return buff; } if (parent != null && symbol.getScope().getRootBlock() != this) return parent.findBufferScope(symbol); return null; }