研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly > ASTNode > createStackNode
ASTNode.createStackNode() 方法
创建一个类型为栈的 AST 节点。堆栈(由其顶部块表示)是指与顶部块连接的所有块(包括顶部块)的集合。
Signature:
static createStackNode(topBlock: Block): ASTNode | null;
参数
参数 |
类型 |
说明 |
topBlock |
屏蔽 |
顶部块没有父级,可在 workspace.getTopBlocks() 返回的列表中找到。 |
返回:
ASTNode | null
类型为堆栈的 AST 节点,指向堆栈上的顶部块。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-08。
[null,null,["最后更新时间 (UTC):2024-11-08。"],[[["The `ASTNode.createStackNode()` method creates an AST node representing a stack of blocks in Blockly."],["A stack is defined by its top block, which has no parent and is connected to all other blocks in the stack."],["The method takes a top block as input and returns an AST node pointing to it, effectively representing the entire stack."],["If a valid top block is provided, the method returns an AST node of type stack; otherwise, it returns null."]]],["The `createStackNode()` method generates an Abstract Syntax Tree (AST) node representing a stack of blocks. It takes a `topBlock` (a block with no parent) as input. The method returns an `ASTNode` of type stack, which refers to the provided `topBlock`. A stack encompasses all blocks connected to the given `topBlock`. If successful, it returns a new `ASTNode`, otherwise null. The `topBlock` parameter's definition references `Block` class information.\n"]]