⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irobject.java

📁 用Java实现的编译器。把源代码编译成SPARC汇编程序
💻 JAVA
字号:
// $Id: IRObject.java,v 1.6 1999/09/27 20:01:28 deberg Exp $package java6035.tools.IR;import java.util.*;/** * IRObject represents an object in the IR.   *  * All IRObject instances are annotatable. An annotation is an <int,Object> * tuple, and can be placed on an IRObject using the annotate method. */public abstract class IRObject implements Annotatable{    protected Hashtable annotations;     public IRObject()    {        annotations = new Hashtable();    }        /**     * Attach an annotation specified by the tag to the object. Remove     * existing annotation with the same tag first.      */    public void annotate(int tag, Object data)    {        annotations.remove(new Integer(tag));	annotations.put(new Integer(tag), data);    }    /**     * Searches for a particular annotation, given an annotation tag. Returns     * the object if found, null otherwise.     */    public Object getAnnotation(int tag)    {	return annotations.get(new Integer(tag));    }    /**     * Removes an annotation. Returns the object if annotation is found, null     * otherwise.     */    public Object removeAnnotation(int tag)    {	return annotations.remove(new Integer(tag));    }    public Enumeration listTags()    {        return annotations.keys();    }    public Enumeration listAnnotations()    {        return annotations.elements();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -