diff --git a/src/LR0.cpp b/src/LR0.cpp index 62175161..014e8c97 100644 --- a/src/LR0.cpp +++ b/src/LR0.cpp @@ -35,18 +35,11 @@ LR0::LR0 () } //////////////////////////////////////////////////////////////////////////////// -// Aho/Sethi/Ullman, p224 -// The sets-of-items construction: -// -// procedure items(G'); -// begin -// C := {closure ({[S' --> . S]})}; -// repeat -// for each set of items I in C and each grammar symbol X such that -// goto (I, X) is not empty and not in C do -// add goto (I, X) to C -// until no more sets of items can be added to C -// end +// Given a grammar: +// - Obtain the augmented grammar +// - Create the first state from the first augmented grammar rule +// - Expand the first state +// - Recursively create and expand all the other states void LR0::initialize (const Grammar& grammar) { // Obtain the augmented grammar.