Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

entry_token.cc

/*
 * Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */
#include <lttoolbox/entry_token.h>


00022 EntryToken::EntryToken()
{
}

00026 EntryToken::~EntryToken()
{
  destroy();
}

00031 EntryToken::EntryToken(EntryToken const &e)
{
  copy(e);
}

EntryToken &
00037 EntryToken::operator =(EntryToken const &e)
{
  if(this != &e)
  {
    destroy();
    copy(e);
  }
 
  return *this;
}

void
00049 EntryToken::copy(EntryToken const &e)
{
  type = e.type;
  leftSide = e.leftSide;
  rightSide = e.rightSide;
  parName = e.parName;
  myregexp = e.myregexp;
}  

void
00059 EntryToken::destroy()
{
}

void
00064 EntryToken::setParadigm(wstring const &np)
{
  parName = np;
  type = paradigm;
}

void
00071 EntryToken::setSingleTransduction(list<int> const &pi, list<int> const &pd)
{
  leftSide = pi;
  rightSide = pd;
  type = single_transduction;
}

void
00079 EntryToken::setRegexp(wstring const &r)
{
  myregexp = r;
  type = regexp;
}

bool
00086 EntryToken::isParadigm() const
{
  return type == paradigm;
}

bool
00092 EntryToken::isSingleTransduction() const
{
  return type == single_transduction;
}

bool
00098 EntryToken::isRegexp() const
{
  return type == regexp;
}

wstring const &
00104 EntryToken::paradigmName() const
{
  return parName;
}

list<int> const &
00110 EntryToken::left() const
{
  return leftSide;
}

list<int> const & 
00116 EntryToken::right() const
{
  return rightSide;
}

wstring const &
00122 EntryToken::regExp() const
{
  return myregexp;
}

Generated by  Doxygen 1.6.0   Back to index