-
balaskoa authored
Signed-off-by:
balaskoa <jeno.balasko@ericsson.com>
balaskoa authoredSigned-off-by:
balaskoa <jeno.balasko@ericsson.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
SigParam.cc 7.82 KiB
/******************************************************************************
* Copyright (c) 2000-2018 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Raduly, Csaba
*
******************************************************************************/
#include "SigParam.hh"
#include "Type.hh"
#include "CompilerError.hh"
namespace Common {
// =================================
// ===== SignatureParam
// =================================
SignatureParam::SignatureParam(param_direction_t p_d, Type *p_t,
Identifier *p_i)
: param_direction(p_d), param_type(p_t), param_id(p_i)
{
if (!p_t || !p_i) FATAL_ERROR("SignatureParam::SignatureParam()");
param_type->set_ownertype(Type::OT_SIG_PAR, this);
}
SignatureParam::~SignatureParam()
{
delete param_type;
delete param_id;
}
SignatureParam *SignatureParam::clone() const
{
FATAL_ERROR("SignatureParam::clone");
}
void SignatureParam::set_fullname(const string& p_fullname)
{
Node::set_fullname(p_fullname);
param_type->set_fullname(p_fullname);
}
void SignatureParam::set_my_scope(Scope *p_scope)
{
param_type->set_my_scope(p_scope);
}
void SignatureParam::dump(unsigned level) const
{
switch(param_direction) {
case PARAM_IN: DEBUG(level,"in"); break;
case PARAM_OUT: DEBUG(level,"out"); break;
case PARAM_INOUT: DEBUG(level,"inout");break;
default: FATAL_ERROR("SignatureParam::dump()"); break;
}
param_type->dump(level+1);
param_id->dump(level+2);
}
// =================================
// ===== SignatureParamList
// =================================
SignatureParamList::~SignatureParamList()