/** * A "hidden cursor" is a BufferScope which has no side-effects on surrounding blocks like strong, weak, and reference * scopes do. These are used within a CAN-FIND function. (2004.Sep:John: Maybe in triggers too? Haven't checked.) * * @param node The RECORD_NAME node. Must have the BufferSymbol linked to it already. */ public void addHiddenCursor(RecordNameNode node) { TableBuffer symbol = node.getTableBuffer(); BufferScope buff = new BufferScope(this, symbol, BufferScope.Strength.HIDDEN_CURSOR); bufferScopes.add(buff); // Note the difference compared to addStrong and addWeak - we don't add // BufferScope references to the enclosing blocks. node.setBufferScope(buff); }
private BufferScope getBufferForReferenceSub(TableBuffer symbol) { if (!canScopeBufferReference(symbol)) return parent.getBufferForReferenceSub(symbol); return new BufferScope(this, symbol, BufferScope.Strength.REFERENCE); }
/** * A "hidden cursor" is a BufferScope which has no side-effects on surrounding blocks like strong, weak, and reference * scopes do. These are used within a CAN-FIND function. (2004.Sep:John: Maybe in triggers too? Haven't checked.) * * @param node The RECORD_NAME node. Must have the BufferSymbol linked to it already. */ public void addHiddenCursor(RecordNameNode node) { TableBuffer symbol = node.getTableBuffer(); BufferScope buff = new BufferScope(this, symbol, BufferScope.Strength.HIDDEN_CURSOR); bufferScopes.add(buff); // Note the difference compared to addStrong and addWeak - we don't add // BufferScope references to the enclosing blocks. node.setBufferScope(buff); }
private BufferScope getBufferForReferenceSub(TableBuffer symbol) { if (!canScopeBufferReference(symbol)) return parent.getBufferForReferenceSub(symbol); return new BufferScope(this, symbol, BufferScope.Strength.REFERENCE); }
/** * 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 "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