public RTFToken ReadToken()
{
bolFirstTokenInGroup = false;
myLastToken = myCurrentToken;
if (myLastToken != null && myLastToken.Type == RTFTokenType.GroupStart)
{
bolFirstTokenInGroup = true;
}
myCurrentToken = myLex.NextToken( );
if( myCurrentToken == null || myCurrentToken.Type == RTFTokenType.Eof )
{
myCurrentToken = null;
return null;
}
intTokenCount++;
if (myCurrentToken.Type == RTFTokenType.GroupStart)
{
if (_LayerStack.Count == 0)
{
_LayerStack.Push(new RTFRawLayerInfo());
}
else
{
RTFRawLayerInfo info = _LayerStack.Peek();
_LayerStack.Push(info.Clone());
}
intLevel++;
}
else if (myCurrentToken.Type == RTFTokenType.GroupEnd)
{
if (_LayerStack.Count > 0)
{
_LayerStack.Pop();
}
intLevel--;
}
if (this.EnableDefaultProcess)
{
this.DefaultProcess();
}
//if (myTokenStack.Count > 0)
//{
// myCurrentToken.Parent = (RTFToken)myTokenStack[myTokenStack.Count - 1];
//}
//myTokenStack.Add( myCurrentToken );
return myCurrentToken ;
}