///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2000-2014 Ericsson Telecom AB
+// Copyright (c) 2000-2015 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// =================================
// ===== IndexedTemplate
// =================================
+
+ IndexedTemplate::IndexedTemplate(const IndexedTemplate& p)
+ {
+ index = p.index->clone();
+ temp = p.temp->clone();
+ }
IndexedTemplate::IndexedTemplate(FieldOrArrayRef *p_i, Template *p_t)
{
IndexedTemplate *IndexedTemplate::clone() const
{
- FATAL_ERROR("IndexedTemplate::clone");
+ return new IndexedTemplate(*this);
}
void IndexedTemplate::set_fullname(const string& p_fullname)
// =================================
// ===== IndexedTemplates
// =================================
+
+ IndexedTemplates::IndexedTemplates(const IndexedTemplates& p)
+ : Node(p)
+ {
+ for (size_t i = 0; i < p.its_v.size(); i++) {
+ its_v.add(p.its_v[i]->clone());
+ }
+ }
IndexedTemplates::~IndexedTemplates()
{
IndexedTemplates *IndexedTemplates::clone() const
{
- FATAL_ERROR("IndexedTemplates::clone");
+ return new IndexedTemplates(*this);
}
void IndexedTemplates::set_fullname(const string& p_fullname)
name = p_n;
temp = p_t;
}
+
+ NamedTemplate::NamedTemplate(const NamedTemplate& p)
+ {
+ name = p.name->clone();
+ temp = p.temp->clone();
+ }
NamedTemplate::~NamedTemplate()
{
NamedTemplate *NamedTemplate::clone() const
{
- FATAL_ERROR("NamedTemplate::clone");
+ return new NamedTemplate(*this);
}
void NamedTemplate::set_fullname(const string& p_fullname)
Node::set_my_scope(p_scope);
temp->set_my_scope(p_scope);
}
+
+ void NamedTemplate::set_name_to_lowercase()
+ {
+ string new_name = name->get_name();
+ if (isupper(new_name[0])) {
+ new_name[0] = tolower(new_name[0]);
+ if (new_name[new_name.size() - 1] == '_') {
+ // an underscore is inserted at the end of the alternative name if it's
+ // a basic type's name (since it would conflict with the class generated
+ // for that type)
+ // remove the underscore, it won't conflict with anything if its name
+ // starts with a lowercase letter
+ new_name.replace(new_name.size() - 1, 1, "");
+ }
+ delete name;
+ name = new Identifier(Identifier::ID_NAME, new_name);
+ }
+ }
Template* NamedTemplate::extract_template()
{
// =================================
// ===== NamedTemplates
// =================================
+
+ NamedTemplates::NamedTemplates(const NamedTemplates& p)
+ : Node(p), checked(p.checked)
+ {
+ for (size_t i = 0; i < p.nts_v.size(); i++) {
+ NamedTemplate* nt = p.nts_v[i]->clone();
+ nts_v.add(nt);
+ if (checked) {
+ nts_m.add(p.nts_m.get_nth_key(i), nt);
+ }
+ }
+ }
NamedTemplates::~NamedTemplates()
{
NamedTemplates *NamedTemplates::clone() const
{
- FATAL_ERROR("NamedTemplates::clone");
+ return new NamedTemplates(*this);
}
void NamedTemplates::set_fullname(const string& p_fullname)