Ejemplo n.º 1
0
void FunctionNode::Read(Reader& reader)
{
    specifiers = reader.ReadSpecifiers();
    bool hasReturnTypeExpr = reader.ReadBool();
    if (hasReturnTypeExpr)
    {
        returnTypeExpr.reset(reader.ReadNode());
        returnTypeExpr->SetParent(this);
    }
    groupId.reset(reader.ReadFunctionGroupIdNode());
    groupId->SetParent(this);
    templateParameters.Read(reader);
    templateParameters.SetParent(this);
    parameters.Read(reader);
    parameters.SetParent(this);
    bool hasConstraint = reader.ReadBool();
    if (hasConstraint)
    {
        constraint.reset(reader.ReadWhereConstraintNode());
        constraint->SetParent(this);
    }
    bool hasBody = reader.ReadBool();
    if (hasBody)
    {
        body.reset(reader.ReadCompoundStatementNode());
        body->SetParent(this);
    }
}
Ejemplo n.º 2
0
void TemplateParameterNode::Read(Reader& reader)
{
    id.reset(reader.ReadIdentifierNode());
    id->SetParent(this);
    bool hasDefaultTemplateArgument = reader.ReadBool();
    if (hasDefaultTemplateArgument)
    {
        defaultTemplateArgument.reset(reader.ReadNode());
        defaultTemplateArgument->SetParent(this);
    }
}