001 package AST; 002 003 import java.util.HashSet; 004 import java.io.File; 005 import java.util.*; 006 import beaver.*; 007 import java.util.ArrayList; 008 import java.util.zip.*; 009 import java.io.*; 010 import java.io.FileNotFoundException; 011 import java.util.Collection; 012 013 /** 014 * @ast class 015 * 016 */ 017 public class NameType extends java.lang.Object { 018 019 private NameType() { 020 super(); 021 } 022 023 024 public static final NameType NO_NAME = new NameType(); 025 026 027 public static final NameType PACKAGE_NAME = new NameType() { 028 public Access reclassify(String name, int start, int end) { return new PackageAccess(name, start, end); } 029 }; 030 031 032 public static final NameType TYPE_NAME = new NameType() { 033 public Access reclassify(String name, int start, int end) { return new TypeAccess(name, start, end); } 034 }; 035 036 037 public static final NameType PACKAGE_OR_TYPE_NAME = new NameType() { 038 public Access reclassify(String name, int start, int end) { return new PackageOrTypeAccess(name, start, end); } 039 }; 040 041 042 public static final NameType AMBIGUOUS_NAME = new NameType() { 043 public Access reclassify(String name, int start, int end) { return new AmbiguousAccess(name, start, end); } 044 }; 045 046 047 public static final NameType METHOD_NAME = new NameType(); 048 049 050 public static final NameType ARRAY_TYPE_NAME = new NameType(); 051 052 053 public static final NameType ARRAY_READ_NAME = new NameType(); 054 055 056 public static final NameType EXPRESSION_NAME = new NameType() { 057 public Access reclassify(String name, int start, int end) { return new VarAccess(name, start, end); } 058 }; 059 060 061 062 public Access reclassify(String name, int start, int end) { 063 throw new Error("Can not reclassify ParseName node " + name); 064 } 065 066 067 }