3 ms·
I think when we talk about "unbounded lookahead," it means the lookahead can't be bounded by any constant. A common type of parser is called LR(1), meaning it c
by assbuttbuttass 4y ago
I think when we talk about "unbounded lookahead," it means the lookahead can't be bounded by any constant. A common type of parser is called LR(1), meaning it can only lookahead by 1 character.[0]
The advantage of only looking ahead by a constant is that parsing can be done in linear time. For a backtracking parser, you have to look ahead by up to n characters each time, leading to a quadratic runtime in the worst case.
[0] https://en.m.wikipedia.org/wiki/LR_parser https://en.m.wikipedia.org/wiki/LR_parser
- somishere 4y agoThanks for the explanation/link, appreciate it. I'll reserve my cynicism of using this as a reasoning to hold-up progress.