blockly > BasicCursor

BasicCursor class

Class for a basic cursor. This will allow the user to get to all nodes in the AST by hitting next or previous.

Signature:

export declare class BasicCursor extends Cursor 

Extends: Cursor

Constructors

Constructor Modifiers Description
(constructor)() Constructs a new instance of the BasicCursor class

Properties

Property Modifiers Type Description
registrationName

static

readonly

(not declared) Name used for registering a basic cursor.

Methods

Method Modifiers Description
getNextNode_(node, isValid) protected Uses pre order traversal to navigate the Blockly AST. This will allow a user to easily navigate the entire Blockly AST without having to go in and out levels on the tree.
getPreviousNode_(node, isValid) protected Reverses the pre order traversal in order to find the previous node. This will allow a user to easily navigate the entire Blockly AST without having to go in and out levels on the tree.
in() For a basic cursor we only have the ability to go next and previous, so in will also allow the user to get to the next node in the pre order traversal.
next() Find the next node in the pre order traversal.
out() For a basic cursor we only have the ability to go next and previous, so out will allow the user to get to the previous node in the pre order traversal.
prev() Find the previous node in the pre order traversal.
validNode_(node) protected Decides what nodes to traverse and which ones to skip. Currently, it skips output, stack and workspace nodes.