📄 labelinstr.java
字号:
// $Id: LabelInstr.java,v 1.5 1999/11/12 17:58:18 deberg Exp $package java6035.tools.IR;/** * The LabelInstr class captures a label, as a branch target. */public class LabelInstr extends Instruction{ protected String label; /** * Creates a label instruction with the given suffix as the suffix of the * label. */ public LabelInstr(String suffix) { label = LabelInstr.getUniqueLabel(suffix); } public void setLabel(String label) { this.label = label; } private static int counter = 0; /** * Returns a unique string label. */ protected static String getUniqueLabel(String suffix) { counter++; return new String("_L"+(counter-1)+"_"+suffix); } /** * Returns the label for this label instruction. */ public String getLabel() { return label; } /** * Returns the type of the instruction. */ protected int tnkind() { return LABEL_INSTR; } /** * Walkable: returns the name of the node. */ public String getNodeName() { return "label "+label; } /** * Walkable: returns 0. */ public int getNeighborCount() { return 0; } /** * Walkable: returns null. */ public Object getNeighbor(int index) { return null; } public String PPrint(int indent, boolean recursive) { String output = new String(); for(int i=0;i<indent;i++) output += " "; output += "(label_instruction "+label+")\n"; return output; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -