001    /*
002    // $Id: Symbol.java 3 2009-05-11 08:11:57Z jhyde $
003    // Clapham generates railroad diagrams to represent computer language grammars.
004    // Copyright (C) 2008-2009 Julian Hyde
005    // Copyright (c) 2005 Stefan Schoergenhumer, Markus Dopler
006    //
007    // This program is free software; you can redistribute it and/or modify it
008    // under the terms of the GNU General Public License as published by the Free
009    // Software Foundation; either version 2 of the License, or (at your option)
010    // any later version approved by The Eigenbase Project.
011    //
012    // This program is distributed in the hope that it will be useful,
013    // but WITHOUT ANY WARRANTY; without even the implied warranty of
014    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015    // GNU General Public License for more details.
016    //
017    // You should have received a copy of the GNU General Public License
018    // along with this program; if not, write to the Free Software
019    // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
020    */
021    package net.hydromatic.clapham.graph;
022    
023    /**
024     * TODO:
025     *
026     * @author jhyde
027     * @version $Id: Symbol.java 3 2009-05-11 08:11:57Z jhyde $
028     * @since Jul 30, 2008
029     */
030    public class Symbol {
031    
032        public final NodeType typ;         // t, nt
033            public final String   name;        // symbol name
034            public Graph    graph;       // nt: to first node of syntax graph
035    
036            public Symbol(NodeType typ, String name) {
037                    if (name.length() == 0) {
038                            System.out.println("empty token not allowed");
039                name = "???";
040                    }
041                    this.typ = typ;
042            this.name = name;
043            }
044    }
045    
046    // End Symbol.java