{
startProfile(Operation.GET_SEMANTIC_PROBLEMS);
final Collection<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
Map<ITag, ITag> extraTags = new HashMap<ITag, ITag>();
FXGSymbolClass symbolClass = null;
FileNode fileNode = null;
ASProjectScope projectScope = getProject().getScope();
try
{
FXGSyntaxTreeRequestResult syntaxTreeResult = (FXGSyntaxTreeRequestResult)getSyntaxTreeRequest().get();
IFXGNode tree = syntaxTreeResult.getRootNode();
FlexFXG2SWFTranscoder transcoder = new FlexFXG2SWFTranscoder(getProject());
transcoder.setResourceResolver(new FXGFileResolver(FilenameUtils.getFullPath(getRootFileSpecification().getPath())));
symbolClass = transcoder.transcode(tree,
Multiname.getPackageNameForQName(qname), Multiname.getBaseNameForQName(qname), extraTags, problems);
//Add dependencies to the classes required by the FXG processed by this compilation unit
for (ITypeDefinition definition : transcoder.getDependencies())
{
getProject().addDependency(this, projectScope.getCompilationUnitForDefinition(definition),
DependencyType.EXPRESSION, definition.getQualifiedName());
}
StringBuilder sb = new StringBuilder(symbolClass.getGeneratedSource());
if (symbolClass.getAdditionalSymbolClasses() != null)
{
for (FXGSymbolClass symbol : symbolClass.getAdditionalSymbolClasses())
{
sb.append(symbol.getGeneratedSource());
}
}