@Test void testParent() { var parentScope = new Scope(null); assertEquals(parentScope.createChild().getParent(), parentScope); }
public Scope createChild() { return new Scope(this); }
Scope { public Scope createChild() { return new Scope(this); } }
Scope { public Scope createChild() { return new Scope(this); } Scope(Scope parent); }
Scope { public Scope createChild() { return new Scope(this); } Scope(Scope parent); Local declareLocalVariable(String name, Type type); Local getLocalVariable(String name); ArrayInfo declareArray(String name, PrimitiveType type); ArrayInfo declareArray(int index, String name, PrimitiveType type); ArrayInfo getArray(String name); Scope createChild(); }
Scope { public Scope createChild() { return new Scope(this); } Scope(Scope parent); Local declareLocalVariable(String name, Type type); Local getLocalVariable(String name); ArrayInfo declareArray(String name, PrimitiveType type); ArrayInfo declareArray(int index, String name, PrimitiveType type); ArrayInfo getArray(String name); Scope createChild();  }