Content deleted Content added
Rescuing 1 sources and tagging 0 as dead. #IABot (v2.0beta) |
Steamerandy (talk | contribs) →Interpretation of a grammar: Fixed typo Tags: Mobile edit Mobile app edit Android app edit |
||
Line 22:
Note that a nonterminal-function may succeed without actually consuming any input, and this is considered an outcome distinct from failure.
A nonterminal ''A'' defined by a rule of the form ''A'' ← ε always succeeds without consuming any input, regardless of the input string
A nonterminal ''A'' defined by a rule of the form ''A'' ← ''BC/D'' first [[recursion|recursively]] invokes nonterminal ''B'', and if ''B'' succeeds, invokes ''C'' on the remainder of the input string left unconsumed by ''B''. If both ''B'' and ''C'' succeed, then ''A'' in turn succeeds and consumes the same total number of input characters that ''B'' and ''C'' together did. If either ''B'' or ''C'' fails, however, then ''A'' [[backtracking|backtracks]] to the original point in the input string where it was first invoked, and then invokes ''D'' on that original input string, returning whatever result ''D'' produces.
|