Example #1
0
        public Token(PageLine line, int index, RawToken token)
        {
            Page  = line.Page;
            Line  = line;
            Index = index;

            ColumnStart = token.ColumnStart;
            ColumnEnd   = token.ColumnEnd;

            Type    = token.Type;
            Hints   = TokenHints.None;
            Content = token.Content;
        }
Example #2
0
        public Token FindPreviousToken()
        {
            if (Index - 1 > 0)
            {
                return(Line[Index - 1]);
            }

            PageLine line = Line.GetPreviousLine();

            while (line != null)
            {
                if (line.TokenCount > 0)
                {
                    return(line[line.TokenCount - 1]);
                }
                else
                {
                    line = line.GetPreviousLine();
                }
            }

            return(null);
        }
Example #3
0
        public Token FindNextToken()
        {
            if (Index + 1 < Line.TokenCount)
            {
                return(Line[Index + 1]);
            }

            PageLine line = Line.GetNextLine();

            while (line != null)
            {
                if (line.TokenCount > 0)
                {
                    return(line[0]);
                }
                else
                {
                    line = line.GetNextLine();
                }
            }

            return(null);
        }