{
final ArrayList<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
final ArrayList<ITag> linkingTags = new ArrayList<ITag>();
// link main definition
final CacheStoreKeyBase key = SWFCache.createKey(swc, library.getPath());
final ITagContainer tags = getProject().getWorkspace().getSWCManager().getSWFCache().get(key);
final DoABCTag doABC = SWFCache.findDoABCTagByName(tags, script.getName());
if (doABC == null)
throw new NullPointerException("can not find DoABC tag: " + script.getName());
startProfile(Operation.GET_SWF_TAGS);
linkingTags.add(doABC);
// link assets for all the definitions in this script
final HashMap<String, ICharacterTag> assetTags = new LinkedHashMap<String, ICharacterTag>();
for (final String defQName : script.getDefinitions())
{
final CacheStoreKeyBase assetCacheKey = AssetTagCache.createKey(swc, library.getPath(), script, defQName);
final AssetTagCache.AssetTagCacheValue assetCacheValue = getProject().getWorkspace().getSWCManager().getAssetTagCache().get(assetCacheKey);
if (assetCacheValue.assetTag != null)
{
linkingTags.add(assetCacheValue.assetTag);
linkingTags.addAll(assetCacheValue.referredTags);