研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >BasicCursor
BasicCursor 类
用于基本光标的类。这将允许用户通过点击“下一个”或“上一个”来访问 AST 中的所有节点。
Signature:
export declare class BasicCursor extends Cursor
扩展: Cursor
构造函数
构造函数 |
修饰符 |
说明 |
(构造函数)() |
|
构造 BasicCursor 类的新实例 |
属性
方法
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-12。
[null,null,["最后更新时间 (UTC):2024-09-12。"],[[["The `BasicCursor` class enables navigation through the Abstract Syntax Tree (AST) of Blockly using pre-order traversal."],["It provides methods for moving to the next (`next`) and previous (`prev`) nodes in the AST."],["The `in` and `out` methods offer an alternative way to navigate, mirroring `next` and `prev` respectively."],["Users can define their navigation logic by overriding the `validNode_` method to specify which nodes should be traversed."],["`BasicCursor` extends the `Cursor` class and registers itself under the name \"basic\"."]]],["The `BasicCursor` class, extending `Cursor`, facilitates navigation through a Blockly Abstract Syntax Tree (AST). It utilizes pre-order traversal to enable users to move to the next or previous node. Key actions include `next()` and `prev()` methods to traverse the AST, and `in()` and `out()` which also move to the next or previous node, respectively. The `getNextNode_` and `getPreviousNode_` methods handle traversal logic. The `validNode_` method determines which nodes are traversed, skipping outputs, stacks and workspaces.\n"]]