1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.codegen;
13 public class CaseLabel extends Label {
14 public int instructionPosition = POS_NOT_SET;
16 public int backwardsBranch = POS_NOT_SET;
18 * CaseLabel constructor comment.
21 * net.sourceforge.phpdt.internal.compiler.codegen.CodeStream
23 // public CaseLabel(CodeStream codeStream) {
27 * Put down a refernece to the array at the location in the codestream.
30 // if (position == POS_NOT_SET) {
31 // addForwardReference(codeStream.position);
32 // // Leave 4 bytes free to generate the jump offset afterwards
33 // codeStream.position += 4;
34 // codeStream.classFileOffset += 4;
35 // } else { //Position is set. Write it!
36 // codeStream.writeSignedWord(position - codeStream.position + 1);
40 // * Put down a refernece to the array at the location in the codestream.
42 // void branchWide() {
43 // if (position == POS_NOT_SET) {
44 // addForwardReference(codeStream.position);
45 // // Leave 4 bytes free to generate the jump offset afterwards
46 // codeStream.position += 4;
47 // } else { //Position is set. Write it!
48 // codeStream.writeSignedWord(position - codeStream.position + 1);
51 // public boolean isStandardLabel(){
55 // * Put down a reference to the array at the location in the codestream.
57 // public void place() {
58 // position = codeStream.position;
59 // if (instructionPosition == POS_NOT_SET)
60 // backwardsBranch = position;
62 // int offset = position - instructionPosition;
63 // for (int i = 0; i < forwardReferenceCount; i++) {
64 // codeStream.writeSignedWord(forwardReferences[i], offset);
66 // // add the label int the codeStream labels collection
67 // codeStream.addLabel(this);
71 * Put down a refernece to the array at the location in the codestream.
73 // void placeInstruction() {
74 // if (instructionPosition == POS_NOT_SET) {
75 // instructionPosition = codeStream.position;
76 // if (backwardsBranch != POS_NOT_SET) {
77 // int offset = backwardsBranch - instructionPosition;
78 // for (int i = 0; i < forwardReferenceCount; i++)
79 // codeStream.writeSignedWord(forwardReferences[i], offset);
80 // backwardsBranch = POS_NOT_SET;