Esempio n. 1
0
 /// <summary>
 /// 使用词法单元的相关信息初始化 <see cref="Token{T}"/> 类的新实例。
 /// </summary>
 /// <param name="id">标识符。</param>
 /// <param name="text">文本。</param>
 /// <param name="start">起始位置。</param>
 /// <param name="end">结束位置。</param>
 public Token(T id, string text, SourcePosition start, SourcePosition end)
 {
     CommonExceptions.CheckSourceRange(start, end);
     Contract.EndContractBlock();
     this.id    = id;
     this.text  = text;
     this.start = start;
     this.end   = end;
 }