![]() ![]() ![]() Top- down parsers start from the root node (start symbol) and match the input string against the production rules to replace them (if matched). This parsing technique is regarded recursive as it uses context-free grammar which is recursive in nature. A form of recursive-descent parsing that does not require any back-tracking is known as predictive parsing. But the grammar associated with it (if not left factored) cannot avoid back-tracking. This parsing technique recursively parses the input to make a parse tree, which may or may not require back-tracking. It uses procedures for every terminal and non-terminal entity. Recursive descent is a top-down parsing technique that constructs the parse tree from the top and the input is read from left to right. The types of top-down parsing are depicted below: Recursive Descent Parsing We have learnt in the last chapter that the top-down parsing technique parses the input, and starts constructing a parse tree from the root node gradually moving down to the leaf nodes. Parsing can be defined as top-down or bottom-up based on how the parse-tree is constructed. In this chapter, we will learn the various types of parser construction methods available. In the previous chapter, we understood the basic concepts involved in parsing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |