AttributeListNode attributeList = AbstractSyntaxTreeUtil.generatePublicAttribute(nodeFactory);
IdentifierNode addEventListenerIdentifier = nodeFactory.identifier(ADD_EVENT_LISTENER, false);
FunctionNameNode functionName = nodeFactory.functionName(Tokens.EMPTY_TOKEN, addEventListenerIdentifier);
ParameterNode typeParameter =
AbstractSyntaxTreeUtil.generateParameter(nodeFactory, TYPE, STRING, false);
ParameterListNode parameterList = nodeFactory.parameterList(null, typeParameter);
ParameterNode listenerParameter =
AbstractSyntaxTreeUtil.generateParameter(nodeFactory, LISTENER, FUNCTION, false);
parameterList = nodeFactory.parameterList(parameterList, listenerParameter);
LiteralBooleanNode literalBoolean = nodeFactory.literalBoolean(false);
ParameterNode useCaptureParameter =
AbstractSyntaxTreeUtil.generateParameter(nodeFactory, USE_CAPTURE, BOOLEAN,
false, literalBoolean);
parameterList = nodeFactory.parameterList(parameterList, useCaptureParameter);
LiteralNumberNode literalNumber = nodeFactory.literalNumber(0);
ParameterNode priorityParameter =
AbstractSyntaxTreeUtil.generateParameter(nodeFactory, PRIORITY, INT,
false, literalNumber);
parameterList = nodeFactory.parameterList(parameterList, priorityParameter);
literalBoolean = nodeFactory.literalBoolean(false);
ParameterNode weakRefParameter =
AbstractSyntaxTreeUtil.generateParameter(nodeFactory, WEAK_REF, BOOLEAN,
false, literalBoolean);
parameterList = nodeFactory.parameterList(parameterList, weakRefParameter);
FunctionSignatureNode functionSignature = nodeFactory.functionSignature(parameterList, null);
functionSignature.void_anno = true;