I read the dissertation [1] and the paper [2], but I'm not sure how to compute $H_{k}$.
$H_{k}$ is defined as:
$$H_{k}(\gamma) = \{ \alpha | \alpha \text{ is terminal,} |\alpha| = k \text{ and } \exists{\beta} \text{ such that } \gamma \overset{*}{\Rightarrow} \alpha\beta \}$$
The operation $\overset{*}{\Rightarrow}$ seems to be roughly defined as a recursive application of $\Rightarrow$:
Is really the goal here to generate every possible string of length $k$ reachable from the production rule?
Note: Although there are some other sources [3] stating the lookahead may not be necessary, I'm still curious to understand how it was initially intended to be computed.
- An efficient context-free parsing algorithm by Jay Earley (1968)
- An efficient context-free parsing algorithm by Jay Earley (CACM 1970)
- Practical Earley Parsing by John Ayock and R. Nigel Horspool (The Computer Journal vol45 no6 2002)