//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
namespace Ilog.Language.Parsing
{
/**
* This class is the type of objects used for token nodes in a dynamic
* parser. A dynamic token is a non-deterministic one that assume
* several choices of token, each trued in turn by a dynamic parser.
*
* @version Last modified on Tue May 31 12:59:17 2005 by hak
* @author Hassan Aït-Kaci
* @copyright © 2000 ILOG, S.A.
*/
public class DynamicToken : ParseNode, Util.TimeStamped
{
/**
* Constructs a dynamic token with the specified parse node.
*/
public DynamicToken (ParseNode node)
: base(node)
{
}
/**
* Constructs a dynamic token with the specified operator and
* parse node.
*/
public DynamicToken (Operator op, ParseNode node)
{
MakeOperator(op);
original = node;
SetSpan(original);
}
/**
* This is true for a dynamic token.
*/
internal override bool IsDynamic
{
get { return true; }
}
/**
* This dynamic token's time stamp.
*/
private long stamp;
public long TimeStamp
{
get { return stamp; }
set { stamp = value; }
}
/**
* This is the original parse node form of this dynamic token.
*/
private ParseNode original;
internal ParseNode Original
{
get { return original == null ? this : original; }
set { original = value; }
}
/**
* Changes this dynamic token to be the specified operator.
*/
public void MakeOperator (Operator op)
{
Symbol = op.SubCategory;
SValue = op.Name;
Operator = op;
}
}
// public string StringForm ()
// {
// return this + "/" + stamp +" [original = " + original + "]";
// }
// public override string ToString ()
// {
// return base.ToString()
// + " (stamp: " + stamp + ")"
// +" [original = " + original + "]"
// ;
// }
}