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

📄 scope.java

📁 检查Java程序漏洞
💻 JAVA
字号:
package net.sourceforge.pmd.cpd.cppast;import java.util.Hashtable;public class Scope{   /**    * Name of the scope (set only for class/function scopes).    */   String scopeName;   /**    * Indicates whether this is a class scope or not.    */   boolean type;     // Indicates if this is a type.   /**    * (partial) table of type symbols introduced in this scope.    */   Hashtable typeTable = new Hashtable();   /**    * Parent scope. (null if it is the global scope).    */   Scope parent;   /**    * Creates a scope object with a given name.    */   public Scope(String name, boolean isType, Scope p)   {      scopeName = name;      type = isType;      parent = p;   }   /**    * Creates an unnamed scope (like for compound statements).    */   public Scope(Scope p)   {      type = false;      parent = p;   }   /**    * Inserts a name into the table to say that it is the name of a type.    */   public void PutTypeName(String name)   {      typeTable.put(name, name);   }   /**    * A type with a scope (class/struct/union).    */   public void PutTypeName(String name, Scope sc)   {      typeTable.put(name, sc);   }   /**     * Checks if a given name is the name of a type in this scope.    */   public boolean IsTypeName(String name)   {      return typeTable.get(name) != null;   }   public Scope GetScope(String name)   {      Object sc = typeTable.get(name);      if (sc instanceof Scope || sc instanceof ClassScope)         return (Scope)sc;      return null;   }}

⌨️ 快捷键说明

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