01: package org.acm.seguin.pmd.symboltable;
02:
03: import java.util.Collections;
04: import java.util.Map;
05:
06: public class GlobalScope extends AbstractScope implements Scope {
07:
08: public ClassScope getEnclosingClassScope() {
09: throw new RuntimeException(
10: "getEnclosingClassScope() called on GlobalScope");
11: }
12:
13: public void addDeclaration(MethodNameDeclaration decl) {
14: throw new RuntimeException(
15: "addMethodDeclaration() called on GlobalScope");
16: }
17:
18: public Map getUnusedVariableDeclarations() {
19: return Collections.EMPTY_MAP;
20: }
21:
22: public void addDeclaration(VariableNameDeclaration decl) {
23: }
24:
25: public boolean contains(NameOccurrence occ) {
26: return false;
27: }
28:
29: public NameDeclaration addVariableNameOccurrence(NameOccurrence occ) {
30: return null;
31: }
32:
33: public String toString() {
34: return "GlobalScope:" + super .glomNames();
35: }
36:
37: protected NameDeclaration findVariableHere(NameOccurrence occ) {
38: return null;
39: }
40:
41: }
|