{
ISyntaxTreeRequestResult syntaxTreeResult = getSyntaxTreeRequest().get();
FileNode rootNode = (FileNode)syntaxTreeResult.getAST();
if (rootNode == null)
{
return new EmbedFileScopeRequestResult(null);
}
startProfile(Operation.GET_FILESCOPE);
try
{
final IASScope fileScope = rootNode.getScope();
assert fileScope instanceof ASFileScope : "Expect ASFileScope as the top-level scope, but found " + fileScope.getClass();
return new EmbedFileScopeRequestResult((ASFileScope)fileScope);
}
finally
{
stopProfile(Operation.GET_FILESCOPE);
}