{
CompilationUnit u = s.getCompilationUnit();
if ((u != null) && u.hasTypeInfo)
{
ObjectValue frame = u.typeInfo;
for (QName topLevelDefinition : u.topLevelDefinitions)
{
String name = topLevelDefinition.getLocalPart().intern();
ObjectValue namespace = ascContext.getNamespace(topLevelDefinition.getNamespace().intern());
if (frame.hasName(ascContext, Tokens.GET_TOKEN, name, namespace))
{
int slotId = frame.getSlotIndex(ascContext, Tokens.GET_TOKEN, name, namespace);
Slot slot = frame.getSlot(ascContext, slotId);