_Core/Lang/Parser/TokenIterator.cs

(开头部分) 24KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComLib.Lang
{
    /// <summary>
    /// Iterates over a series of tokens in a script using a lexer.
    /// </summary>
    public class TokenIterator
    {
        private int _lastLineNumber;
        private int _lastCharPosition;
        private bool _isEnded;
        private Stack<int> _marks;
        private bool _isLLKEnabled = false;
        private int _LLK = -1;
        private int _tokenBatchMidPoint = -1;
        private int _tokenBatchMidPointIndex = -1;
        private Func<int, List<TokenData>> _tokensFetcher;
        private Action<int> _resetPosExecutor;
        private List<TokenData> _rewindBatch;
        

        /// <summary>
        /// The index position of the token in the current batch of tokens.
        /// </summary>
        protected int _currentBatchIndex;


        /// <summary>
        /// The index position of the token in the total tokens processed so far.
        /// </summary>
        protected int _currentIndex;


        /// <summary>
        /// The parsed tokens from the script
        /// </summary>
        public List<TokenData> TokenList;
        

        /// <summary>
        /// Last token parsed.
        /// </summary>
        public TokenData LastToken;


        /// <summary>
        /// The next token
        /// </summary>
        public TokenData NextToken;


        /// <summary>
        /// The path to the script.
        /// </summary>
        public string ScriptPath;

后面还有 619 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。