Пример #1
0
CAssemblerCommand* ElfRelocator::generateCtor(const std::wstring& ctorName)
{
	CAssemblerCommand* content = relocator->generateCtorStub(ctors);

	CDirectiveFunction* func = new CDirectiveFunction(ctorName,ctorName);
	func->setContent(content);
	return func;
}
Пример #2
0
CAssemblerCommand* parseDirectiveFunction(Parser& parser, int flags)
{
    std::vector<Expression> parameters;
    if (parser.parseExpressionList(parameters,1,1) == false)
        return nullptr;

    std::wstring name;
    if (parameters[0].evaluateIdentifier(name) == false)
        return nullptr;

    CDirectiveFunction* func = new CDirectiveFunction(name);
    CAssemblerCommand* seq = parser.parseCommandSequence(L'.', {L".endfunc",L".endfunction",L".func",L".function"});

    const std::wstring stringValue = parser.peekToken().getStringValue();
    if (stringValue == L".endfunc" ||
            stringValue == L".endfunction")
    {
        parser.eatToken();
    }

    func->setContent(seq);
    return func;
}