public static bool AcceptOperator(string Text, ref int Index, ref Operator Operator)
{
bool found = false;
int sindex = Index;
int maxlen = Math.Min(Operator.MaxOperatorLength, Text.Length - Index);
for (int t = 1; t <= maxlen; t++)
{
string optext = Text.Substring(sindex, t);
Operator op;
if (Operator.Map.TryGetValue(optext, out op))
{
Index = sindex + t;
Operator = op;
found = true;
}
}
return found;
}