blockly > BasicCursor > getPreviousNode_
BasicCursor.getPreviousNode_() yöntemi
Önceki düğümü bulmak için ön sipariş traversal'ini tersine çevirir. Bu sayede kullanıcı, ağaçtaki seviyeler arasında geçiş yapmak zorunda kalmadan Blockly AST'nin tamamında kolayca gezinebilir.
İmza:
protected getPreviousNode_(node: ASTNode | null, isValid: (p1: ASTNode | null) => boolean): ASTNode | null;
Parametreler
Parametre |
Tür |
Açıklama |
düğüm |
ASTNode | null |
AST'deki geçerli konum. |
isValid |
(p1: ASTNode | null) => boolean |
Belirtilen düğümün taranıp taranmayacağına bağlı olarak doğru/yanlış değerini döndüren bir işlev. |
Şunu döndürür:
ASTNode | null
Gezinmedeki önceki düğüm veya önceki düğüm yoksa null.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-11-08 UTC.
[null,null,["Son güncelleme tarihi: 2024-11-08 UTC."],[[["`getPreviousNode_()` enables reverse pre-order traversal of the Blockly AST for efficient navigation."],["It utilizes a provided validation function (`isValid`) to determine traversable nodes."],["The method returns the previous node encountered or null if none exists."],["This functionality simplifies navigation by allowing users to move seamlessly through the AST without complex level management."]]],["The `getPreviousNode_` method of the `BasicCursor` class reverses a pre-order traversal to locate the preceding node within a Blockly AST (Abstract Syntax Tree). It accepts the current AST node and a validity function. It then returns the immediately previous node in the traversal or `null` if none exists. This enables simplified navigation through the AST without needing to move up and down tree levels.\n"]]