Skip to content

T_Cyjb_Text_ParserNode_1

CYJB edited this page Mar 23, 2024 · 7 revisions

ParserNode(T) 类

表示语法节点。

继承层次

System.Object
  Cyjb.Text.ParserNode(T)
Namespace: Cyjb.Text
Assembly: Cyjb.Compilers.Runtime (in Cyjb.Compilers.Runtime.dll) Version: 1.0.20+d347ea0351607fb282fdf60a5301f9cccb3ab27e

语法

C#

public sealed class ParserNode<T>
where T : struct, new()

类型参数

 

T
语法节点标识符的类型,一般是一个枚举类型。
  The ParserNode(T) type exposes the following members.

构造函数

 

名称 说明
公共方法 ParserNode(T)(Token(T)) 使用指定的词法单元初始化 ParserNode(T) 类的新实例。
公共方法 ParserNode(T)(T, TextSpan) 使用指定的语法节点信息初始化 ParserNode(T) 类的新实例。
  Back to Top

属性

 

名称 说明
公共属性 ContainsError 获取当前语法节点是否包含错误。
公共属性 IsMissing 获取当前语法节点是否是由错误恢复逻辑生成的。
公共属性 Kind 获取语法节点的类型。
公共属性 SkippedTokens 获取当前语法节点前被跳过的词法单元列表。
公共属性 Span 获取语法节点的范围。
公共属性 Text 获取语法节点的文本(仅终结符包含文本,非终结符为空字符串)。
公共属性 Value 获取语法节点的值。
  Back to Top

方法

 

名称 说明
公共方法 Equals Determines whether the specified object is equal to the current object. (继承自 Object。)
公共方法 GetHashCode Serves as the default hash function. (继承自 Object。)
公共方法 GetType Gets the Type of the current instance. (继承自 Object。)
公共方法 ToString 返回当前对象的字符串表示形式。 (重写 Object.ToString().)
  Back to Top

参见

Reference

Cyjb.Text 命名空间

Clone this wiki locally