view anagram/support/agcstack.h @ 1:60d3ca9d3f6b

Fix stupid bug in help2html.
author David A. Holland
date Tue, 12 Aug 2008 00:13:42 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * AnaGram, A System for Syntax Directed Programming
 * Copyright 1997-2002 Parsifal Software. All Rights Reserved.
 * See the file COPYING for license and usage terms.
 *
 * agcstack.h - character stack
 */

#ifndef AGCSTACK_H
#define AGCSTACK_H

#include "agstack.h"
#include "agstring.h"


class AgCharStack : public AgStack<char> {
public:
  AgCharStack()
    : AgStack<char>()
  {}
  AgCharStack(const int c)
    : AgStack<char>((char) c)
  {}
  AgCharStack(const AgCharStack &s)
    : AgStack<char>(s)
  {}
  AgCharStack &push(const char *s);
  AgCharStack &push(const unsigned char *s) {
    return push((const char *) s);
  }
  AgCharStack &push(const char *s, unsigned n);
  AgCharStack &push(const unsigned char *s, unsigned n) {
    return push((const char *)s, n);
  }

  AgCharStack &operator << (AgString s);
  AgCharStack &operator << (const char *s);

  AgCharStack &operator << (int c) {
    push((char) c);
    return *this;
  }

  AgCharStack &push(const AgString &s) {
    (*this) << s;
    return *this;
  }

  AgCharStack &push(const int c) {
    AgStack<char>::push((char) c);
    return *this;
  }

  AgString popString(unsigned n);
  AgString popString();
};


#endif /* AGCSTACK_H */