Adds a forward reference to this label. This method must be called only for a true forward reference, i.e. only if this label is not resolved yet. For backward references, the offset of the reference can be, and must be, computed and stored directly. @param sourcePosition the position of the refere
(
final int sourcePosition,
final int referencePosition)
| 200 | */ |
| 201 | |
| 202 | private void addReference ( |
| 203 | final int sourcePosition, |
| 204 | final int referencePosition) |
| 205 | { |
| 206 | if (srcAndRefPositions == null) { |
| 207 | srcAndRefPositions = new int[6]; |
| 208 | } |
| 209 | if (referenceCount >= srcAndRefPositions.length) { |
| 210 | int[] a = new int[srcAndRefPositions.length + 6]; |
| 211 | System.arraycopy(srcAndRefPositions, 0, a, 0, srcAndRefPositions.length); |
| 212 | srcAndRefPositions = a; |
| 213 | } |
| 214 | srcAndRefPositions[referenceCount++] = sourcePosition; |
| 215 | srcAndRefPositions[referenceCount++] = referencePosition; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Resolves all forward references to this label. This method must be called |