JSScanner 类

定义

扫描 JScript 代码搜索单个代码单元或标记。Scans JScript code searching for individual units of code, or tokens. 此类属于扫描和分析类别。This class belongs to the scanning and parsing category.

此 API 支持产品基础结构,不能在代码中直接使用。

public ref class JSScanner sealed
public sealed class JSScanner
type JSScanner = class
Public NotInheritable Class JSScanner
继承
JSScanner

构造函数

JSScanner()

初始化 JSScanner 类的新实例。Initializes a new instance of the JSScanner class.

JSScanner(Context)

初始化 JSScanner 类的新实例,并指定要扫描的源代码。Initializes a new instance of the JSScanner class, specifying the source code to scan.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetCurrentLine()

获取代码中的当前行号。Gets the current line number in the code. 这是在扫描代码时移动的指针。This is a pointer that moves as the code is scanned.

GetCurrentPosition(Boolean)

获取代码字符串中的当前位置。Gets the current position in the code string. 这是在扫描代码时移动的指针。This is a pointer that moves as the code is scanned.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetNextToken()

扫描代码中的下一个标记。Scans for the next token in the code.

GetSourceCode()

获取与此扫描仪对象关联的源代码。Gets the source code that is associated with this scanner object.

GetStartLinePosition()

获取代码字符串中当前代码的第一行的开始位置。Gets the position in the code string where the first line of the current code starts. 代码的所有行都存储在单个字符串中。All lines of code are stored in a single string. 这是在扫描代码时移动的指针。This is a pointer that moves as the code is scanned.

GetStringLiteral()

获取一个已经过扫描并替换了其所有转义序列的字符串。Gets a string that has been scanned and had all its escape sequences replaced.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GotEndOfLine()

指示在扫描仪扫描或查看标记后是否到达了行尾。Indicates whether the end of a line was reached after the scanner scans or peeks for a token.

IsKeyword(JSToken)

确定指定的标记是否为 JScript 语言中的关键字。Determines whether the specified token is a keyword in the JScript language.

IsOperator(JSToken)

确定指定的标记是否为 JScript 语言中的运算符。Determines whether the specified token is an operator in the JScript language.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetAuthoringMode(Boolean)

设置一个标志,指示扫描仪是否在创作模式下运行。Sets a flag that indicates whether the scanner is operating in authoring mode.

SetSource(Context)

设置要扫描的源代码。Sets the source code to scan.

SkipMultiLineComment()

跳过跨越多行的注释,并使标识当前位置的指针在代码中前进。Skips a comment that spans multiple lines, and advances the pointers that identify the current position in the code.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅