예제 #1
0
// ****************************************************************************
//  Constructor:  Symbol::Symbol
//
//  Purpose:
//    Creates a terminal from the token type, overriding the display
//    string with a known one.
//
//  Programmer:  Jeremy Meredith
//  Creation:    November 24, 2004
//
//  Modifications:
//    Jeremy Meredith, Wed Jun  8 17:08:35 PDT 2005
//    All symbols are now added to a dictionary instead of static members.
//
// ****************************************************************************
Symbol::Symbol(Dictionary &dict, int tt, const string &s)
    : type(Terminal), terminaltype(tt), displaystring(s)
{
    index = dict.AddTerminal(this);
}
예제 #2
0
// ****************************************************************************
//  Constructor:  Symbol::Symbol
//
//  Purpose:
//    Creates a terminal from the token type.
//
//  Programmer:  Jeremy Meredith
//  Creation:    April  5, 2002
//
//  Modifications:
//    Jeremy Meredith, Wed Jun  8 17:08:35 PDT 2005
//    All symbols are now added to a dictionary instead of static members.
//
// ****************************************************************************
Symbol::Symbol(Dictionary &dict, int tt)
    : type(Terminal), terminaltype(tt), displaystring(GetTokenTypeString(tt))
{
    index = dict.AddTerminal(this);
}