IMXMLTagAttributeData attribute,
MXMLNodeInfo info)
{
super.initializeFromAttribute(builder, attribute, info);
final FlexProject project = builder.getProject();
final Workspace workspace = builder.getWorkspace();
final Collection<ICompilerProblem> problems = builder.getProblems();
setSourcePath(attribute.getParent().getParent().getFileSpecification().getPath());
final int startOffsetLocal = attribute.getValueStart();
final ASFileScope fileScope = builder.getFileScope();
final OffsetLookup offsetLookup = fileScope.getOffsetLookup();
assert offsetLookup != null : "Expected OffsetLookup on FileScope.";
final String filePath = getContainingFilePath();
final int[] absoluteOffsets =
offsetLookup.getAbsoluteOffset(filePath, startOffsetLocal);
final int startOffsetAbsolute = absoluteOffsets[0];
final IncludeHandler includeHandler =
IncludeHandler.createForASTBuilding(builder.getFileSpecificationGetter(), filePath, startOffsetLocal, startOffsetAbsolute);
includeHandler.setProjectAndCompilationUnit(project, builder.getCompilationUnit());
final String scriptFragment = attribute.getRawValue();
if (scriptFragment.isEmpty())
{
MXMLEmptyEventHandlerProblem problem = new MXMLEmptyEventHandlerProblem(attribute);
problems.add(problem);
}
final ScopedBlockNode node = ASParser.parseFragment2(
scriptFragment,
filePath,
0,
attribute.getValueLine(),
attribute.getValueColumn(),
problems,
workspace,
builder.getFileNode(),
scope,
project.getProjectConfigVariables(),
EnumSet.of(PostProcessStep.CALCULATE_OFFSETS, PostProcessStep.POPULATE_SCOPE),
true, //follow includes
includeHandler);
builder.getFileNode().updateIncludeTreeLastModified(includeHandler.getLastModified());
processHandlerCode(builder, Collections.singletonList(node));