@Test(expected=IllegalStateException.class) public void testAddSymbolToEmptyStack() { stack.addSymbol("foo", SymbolType.SCALAR, ScopeType.PIXEL); }
public void addSymbol(String name, SymbolType type, ScopeType scopeType) { if (scopes.isEmpty()) { throw new IllegalStateException("Called addSymbol before adding any scope levels"); } getTop().add(new Symbol(name, type, scopeType)); }
SymbolScopeStack { public void addSymbol(String name, SymbolType type, ScopeType scopeType) { if (scopes.isEmpty()) { throw new IllegalStateException("Called addSymbol before adding any scope levels"); } getTop().add(new Symbol(name, type, scopeType)); } }
SymbolScopeStack { public void addSymbol(String name, SymbolType type, ScopeType scopeType) { if (scopes.isEmpty()) { throw new IllegalStateException("Called addSymbol before adding any scope levels"); } getTop().add(new Symbol(name, type, scopeType)); } SymbolScopeStack(); }
SymbolScopeStack { public void addSymbol(String name, SymbolType type, ScopeType scopeType) { if (scopes.isEmpty()) { throw new IllegalStateException("Called addSymbol before adding any scope levels"); } getTop().add(new Symbol(name, type, scopeType)); } SymbolScopeStack(); void addLevel(); void addLevel(String label); SymbolScope dropLevel(); void addSymbol(String name, SymbolType type, ScopeType scopeType); boolean isEmpty(); int size(); boolean isDefined(String name); boolean isDefined(String name, SymbolType type); boolean isDefined(String name, ScopeType scopeType); Symbol findSymbol(String name); }
SymbolScopeStack { public void addSymbol(String name, SymbolType type, ScopeType scopeType) { if (scopes.isEmpty()) { throw new IllegalStateException("Called addSymbol before adding any scope levels"); } getTop().add(new Symbol(name, type, scopeType)); } SymbolScopeStack(); void addLevel(); void addLevel(String label); SymbolScope dropLevel(); void addSymbol(String name, SymbolType type, ScopeType scopeType); boolean isEmpty(); int size(); boolean isDefined(String name); boolean isDefined(String name, SymbolType type); boolean isDefined(String name, ScopeType scopeType); Symbol findSymbol(String name);  }