Exemplo n.º 1
0
  SubstituteSymbolTable(SymbolTable original, int version, int maxId) {
    assert original.isSharedTable() && !original.isSystemTable();
    assert (original.getVersion() != version || original.getMaxId() != maxId);

    myOriginalSymTab = original;
    myName = original.getName();
    myVersion = version;
    myMaxId = maxId;
  }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 public Iterator<String> iterateDeclaredSymbolNames() {
   Iterator<String> originalIterator;
   if (myOriginalSymTab != null) {
     originalIterator = myOriginalSymTab.iterateDeclaredSymbolNames();
   } else {
     originalIterator = Collections.EMPTY_LIST.iterator();
   }
   return new SymbolIterator(originalIterator);
 }
Exemplo n.º 3
0
 public int findSymbol(String text) {
   int sid = UNKNOWN_SYMBOL_ID;
   if (myOriginalSymTab != null) {
     sid = myOriginalSymTab.findSymbol(text);
     if (sid > myMaxId) {
       sid = UNKNOWN_SYMBOL_ID;
     }
   }
   return sid;
 }
Exemplo n.º 4
0
 public SymbolToken find(String text) {
   SymbolToken tok = null;
   if (myOriginalSymTab != null) {
     tok = myOriginalSymTab.find(text);
     // If symbol token is found but its sid is beyond the correct max
     // id of the substitute, then return null, as it should not be
     // found at all.
     if (tok != null && tok.getSid() > myMaxId) {
       tok = null;
     }
   }
   return tok;
 }
Exemplo n.º 5
0
 public String findKnownSymbol(int id) {
   if (id > myMaxId || myOriginalSymTab == null) {
     return null;
   }
   return myOriginalSymTab.findKnownSymbol(id);
 }