1 package antlr.collections;2 3 /* ANTLR Translator Generator4 * Project led by Terence Parr at http://www.jGuru.com5 * Software rights: http://www.antlr.org/RIGHTS.html6 *7 * $Id: //depot/code/org.antlr/main/main/antlr/collections/Stack.java#4 $8 */9 10 import java.util.NoSuchElementException ;11 12 /** A simple stack definition; restrictive in that you cannot13 * access arbitrary stack elements.14 *15 * @author Terence Parr16 * <a HREF=http://www.MageLang.com>MageLang Institute</a>17 */18 public interface Stack {19 public int height();20 21 public Object pop() throws NoSuchElementException ;22 23 public void push(Object o);24 25 public Object top() throws NoSuchElementException ;26 }27