You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is less straightforward to get top-down parsing to handle rewrite rules since top-down parsers are guided by a map of productions to patterns. In the case of rewrite rules, these productions can potentially be expansions or dynamic, which would need to be matched against the pending production in a top-down parse. This is doable, but involves a potential inverse function/production analysis, or may turn into a hybrid top-down-bottom-up parse.
Actually, I think a rewrite can be performed top-down by backtracking to where the rewrite began. This may greatly simplify the parse algorithm if we can get it to reconsider all relevant decision branches when it does such a backtrack, and if we can get it to work with retroactive rules.
After thinking further, the original point remains valid. Being able to backtrack to handle a rewrite presupposes that the parser was able to recognize the rewrite rule at all, which in general is not the case without the aforementioned inverse function/production analysis, or equivalently manual language design that explicitly includes rewrite possibilities in top-down recognition. I don't think this is acceptable; it is still much easier to do the parse bottom-up and introduce stack-like semantics on top of that algorithm.
Current assertion:
Actually, I think a rewrite can be performed top-down by backtracking to where the rewrite began. This may greatly simplify the parse algorithm if we can get it to reconsider all relevant decision branches when it does such a backtrack, and if we can get it to work with retroactive rules.
Also: keep reading http://dotat.at/tmp/gll.pdf
The text was updated successfully, but these errors were encountered: