blockly > BasicCursor > getPreviousNode_
طريقة BasicCursor.getPreviousNode_()
يعكس التنقّل بترتيب تصاعدي للعثور على العقدة السابقة. سيتيح ذلك للمستخدم التنقل بسهولة في AST بالكامل في Blockly بدون الحاجة إلى الانتقال إلى المستويات في الشجرة والخروج منها.
Signature:
protected getPreviousNode_(node: ASTNode | null, isValid: (p1: ASTNode | null) => boolean): ASTNode | null;
المعلمات
المَعلمة |
النوع |
الوصف |
عقدة |
ASTNode | null |
الموضع الحالي في AST |
isValid |
(p1: ASTNode | null) => boolean |
دالة true/false اعتمادًا على ما إذا كان يجب اجتياز العقدة المحددة. |
المرتجعات:
ASTNode | null
العقدة السابقة في الاجتياز أو خالية إذا لم توجد أي عقدة سابقة.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-11-08 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-11-08 (حسب التوقيت العالمي المتفَّق عليه)"],[[["`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"]]