File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,15 @@ <h3><a name="data-structures">Data Structures</a></h3>
8686
8787< code > < pre > LR0 : { Rule rule, Integer dot }
8888next_symbol(lr0) =
89- if(lr0.dot < lr0.rule.length) rule.production[rule .dot]</ pre > </ code >
89+ if(lr0.dot < lr0.rule.production. length) lr0. rule.production[lr0 .dot]</ pre > </ code >
9090
9191< p > In this implementation we never use complete LR(0) items: we always
9292promote them to a symbol so that all parse trees for a symbol will be
9393combined under one Earley item no matter which production they derive
9494from.</ p >
9595
9696< pre > < code > advance(lr0) =
97- if(lr0.dot == lr0.rule.length) lr0.rule.symbol
97+ if(lr0.dot == lr0.rule.production. length) lr0.rule.symbol
9898 else new LR0(lr0.rule, lr0.dot+1)</ code > </ pre >
9999
100100< p > Earley's algorithm works by keeping a table of all possible matches,
@@ -107,7 +107,7 @@ <h3><a name="data-structures">Data Structures</a></h3>
107107matches) or an LR(0) item (for partial matches) plus references to the
108108sets (and hence input positions) where the match starts and ends.</ p >
109109
110- < pre > < code > Item : { Symbol | LR0 : tag, Set start, Set end }
110+ < pre > < code > Item : { Symbol| LR0 tag, Set start, Set end }
111111
112112Set : {
113113 Grammar grammar,
You can’t perform that action at this time.
0 commit comments