package rebelsky.compiler.parser; import rebelsky.compiler.misc.Symbol; /** * Generic nonterminals for a parser. * * @author Samuel A. Rebelsky * @version 1.0 of October 2002 */ public class Nonterminal implements Symbol { // +--------+------------------------------------------------------------ // | Fields | // +--------+ /** The name of the nonterminal. */ private String name; // +--------------+------------------------------------------------------ // | Constructors | // +--------------+ /** * Build a new nonterminal with a particular name. */ public Nonterminal(String name) { this.name = name; } // Nonterminal(String) // +-----------+--------------------------------------------------------- // | Observers | // +-----------+ /** * Convert to a string for printing. */ public String toString() { return "<" + this.name + ">"; } // toString(0 } // class Nonterminal