パーサーの実施

最近コンパイラーの作成方法を考えています。LR(1)のパーサーは文法に従って左から右へ入力を処理するし文法の変数を右から左へ引き出す。
An interesting aspect of LR(1) parsing is the utilization of the viable prefix. This is the prefix seen so far in the input such that, given another token which is to follow the non-terminal and a non-terminal's production (with position of the parse marked by a dot), we can judge whether a future reduction will be possible. (excised from Stanford CS143 handout) For example [A->u.v,a] is valid with viable prefix of alpha, if alpha=bu and a is the first element of w or $, where some rightmost derivation S=>*buvw exists.