请输入您要查询的字词:

 

单词 bottom-up parsing
释义
bottom-up parsing

Computer
  • A strategy for parsing sentences of a context-free grammar that attempts to construct a parse tree beginning at the leaf nodes and working ‘bottom-up’ toward the root.

    Bottom-up (or shift-reduce) parsers work by ‘shifting’ symbols onto a stack until the top of the stack contains a right-hand side of a production. The stack is then ‘reduced’ by replacing the production’s right-hand side by its left-hand side. This process continues until the string has been ‘reduced’ to the start symbol of the grammar.

    The string of symbols to be replaced at each stage is called a handle. Bottom-up parsers that proceed from left to right in the input string must always replace the leftmost handle and, in so doing, they effectively construct a rightmost derivation sequence in reverse order. For example, a rightmost derivation of the string abcde might be

    SACDACdeAcdeabcde
    A bottom-up parser would construct this derivation in reverse, first reducing abcde to Acde, then to ACde, then to ACD, and finally to the start symbol S. The handle at each stage is respectively ab, c, de, and ACD.

    See also LR parsing, precedence parsing.


随便看

 

科学参考收录了60776条科技类词条,基本涵盖了常见科技类参考文献及英语词汇的翻译,是科学学习和研究的有利工具。

 

Copyright © 2000-2023 Sciref.net All Rights Reserved
京ICP备2021023879号 更新时间:2024/6/24 3:11:30