# HG changeset patch # User jwe # Date 754691076 0 # Node ID 4f8134fa54a9d4b8eb05feee3a993cb57fa2f6c9 # Parent 780cbbc57b7c315dc020729445e51846e9e87f11 [project @ 1993-11-30 20:24:36 by jwe] Initial revision diff -r 780cbbc57b7c -r 4f8134fa54a9 src/SLStack.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/SLStack.cc Tue Nov 30 20:24:36 1993 +0000 @@ -0,0 +1,145 @@ +// Template stack class -*- C++ -*- +/* + +Copyright (C) 1993 John W. Eaton + +This file is part of Octave. + +Octave 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, or (at your option) any +later version. + +Octave 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 Octave; see the file COPYING. If not, write to the Free +Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined (__GNUG__) && defined (USE_EXTERNAL_TEMPLATES) +#pragma implementation +#endif + +#include "SLStack.h" + +template +SLStack::SLStack (void) : p () +{ +} + +template +SLStack::SLStack (const SLStack& a) : p (a.p) +{ +} + +template +SLStack::~SLStack (void) +{ +} + +template +void +SLStack::push (const T& item) +{ + p.prepend (item); +} + +template +T +SLStack::pop (void) +{ + return p.remove_front (); +} + +template +T& +SLStack::top (void) +{ + return p.front (); +} + +template +void +SLStack::del_top (void) +{ + p.del_front (); +} + +template +void +SLStack::operator = (const SLStack& s) +{ + p = s.p; +} + +template +int +SLStack::empty (void) +{ + return p.empty (); +} + +template +int +SLStack::full (void) +{ + return 0; +} + +template +int +SLStack::length (void) +{ + return p.length (); +} + +template +int +SLStack::OK (void) +{ + return p.OK (); +} + +template +void +SLStack::clear (void) +{ + p.clear (); +} + +#ifdef __GNUG__ +#if defined (OCTAVE_SOURCE) && defined (USE_EXTERNAL_TEMPLATES) + +typedef SLStack slstack_type_int; +typedef SLStack slstack_type_p_char; + +#include "symtab.h" +typedef SLStack slstack_type_p_symbol_def; + +#include "token.h" +typedef SLStack slstack_type_p_token; + +#include "tree.h" +typedef SLStack slstack_type_p_tree_matrix; + +#include "unwind-prot.h" +typedef SLStack slstack_type_unwind_elem; + +#endif +#endif + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; page-delimiter: "^/\\*" *** +;;; End: *** +*/