/** Find or create a buffer for the input BufferSymbol */ public BufferScope getBufferForReference(TableBuffer symbol) { BufferScope buffer = getBufferScope(symbol, BufferScope.Strength.REFERENCE); if (buffer == null) buffer = getBufferForReferenceSub(symbol); // Yes, add reference to outer blocks, even if we got this buffer from // an outer block. Might have blocks in between which need the reference // to be added. addBufferScopeReferences(buffer); return buffer; } // getBufferForReference
/** * Create a "weak" buffer scope. This is called within a FOR or PRESELECT statement. * * @param symbol The RECORD_NAME node. It must already have the BufferSymbol linked to it. */ public BufferScope addWeakBufferScope(TableBuffer symbol) { BufferScope buff = getBufferScope(symbol, BufferScope.Strength.WEAK); if (buff == null) buff = new BufferScope(this, symbol, BufferScope.Strength.WEAK); // Yes, add reference to outer blocks, even if we got this buffer from // an outer block. Might have blocks in between which need the reference // to be added. addBufferScopeReferences(buff); bufferScopes.add(buff); // necessary in case this is DO..PRESELECT block return buff; } // addWeakBufferScope
/** Find or create a buffer for the input BufferSymbol */ public BufferScope getBufferForReference(TableBuffer symbol) { BufferScope buffer = getBufferScope(symbol, BufferScope.Strength.REFERENCE); if (buffer == null) buffer = getBufferForReferenceSub(symbol); // Yes, add reference to outer blocks, even if we got this buffer from // an outer block. Might have blocks in between which need the reference // to be added. addBufferScopeReferences(buffer); return buffer; } // getBufferForReference
/** * Create a "weak" buffer scope. This is called within a FOR or PRESELECT statement. * * @param symbol The RECORD_NAME node. It must already have the BufferSymbol linked to it. */ public BufferScope addWeakBufferScope(TableBuffer symbol) { BufferScope buff = getBufferScope(symbol, BufferScope.Strength.WEAK); if (buff == null) buff = new BufferScope(this, symbol, BufferScope.Strength.WEAK); // Yes, add reference to outer blocks, even if we got this buffer from // an outer block. Might have blocks in between which need the reference // to be added. addBufferScopeReferences(buff); bufferScopes.add(buff); // necessary in case this is DO..PRESELECT block return buff; } // addWeakBufferScope
/** * Create a "strong" buffer scope. This is called within a DO FOR or REPEAT FOR statement. A STRONG scope prevents the * scope from being raised to an enclosing block. Note that the compiler performs additional checks here that we * don't. * * @param node The RECORD_NAME node. It must already have the BufferSymbol linked to it. */ public void addStrongBufferScope(RecordNameNode node) { TableBuffer symbol = node.getTableBuffer(); BufferScope buff = new BufferScope(this, symbol, BufferScope.Strength.STRONG); bufferScopes.add(buff); addBufferScopeReferences(buff); node.setBufferScope(buff); } // addStrongBufferScope
/** * Create a "strong" buffer scope. This is called within a DO FOR or REPEAT FOR statement. A STRONG scope prevents the * scope from being raised to an enclosing block. Note that the compiler performs additional checks here that we * don't. * * @param node The RECORD_NAME node. It must already have the BufferSymbol linked to it. */ public void addStrongBufferScope(RecordNameNode node) { TableBuffer symbol = node.getTableBuffer(); BufferScope buff = new BufferScope(this, symbol, BufferScope.Strength.STRONG); bufferScopes.add(buff); addBufferScopeReferences(buff); node.setBufferScope(buff); } // addStrongBufferScope
/** * 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); } }