Skip to content
Snippets Groups Projects
Commit cb3ee584 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Made the start_state variable visible.

Rev: lib/modules/LR.pmod/parser.pike:1.14
parent 308680d6
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: parser.pike,v 1.13 1998/11/15 00:07:32 grubba Exp $ * $Id: parser.pike,v 1.14 1998/11/15 02:27:12 grubba Exp $
* *
* A BNF-grammar in Pike. * A BNF-grammar in Pike.
* Compiles to a LALR(1) state-machine. * Compiles to a LALR(1) state-machine.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
//. //.
//. File: parser.pike //. File: parser.pike
//. RCSID: $Id: parser.pike,v 1.13 1998/11/15 00:07:32 grubba Exp $ //. RCSID: $Id: parser.pike,v 1.14 1998/11/15 02:27:12 grubba Exp $
//. Author: Henrik Grubbström (grubba@infovav.se) //. Author: Henrik Grubbström (grubba@infovav.se)
//. //.
//. Synopsis: LALR(1) parser and compiler. //. Synopsis: LALR(1) parser and compiler.
...@@ -305,7 +305,9 @@ static private mapping(mixed : multiset(object(rule))) begins = ([]); ...@@ -305,7 +305,9 @@ static private mapping(mixed : multiset(object(rule))) begins = ([]);
*/ */
static private mapping(int : multiset(object(rule))) used_by = ([]); static private mapping(int : multiset(object(rule))) used_by = ([]);
static private object(kernel) start_state; //. + start_state
//. The initial LR0 state.
object(kernel) start_state;
//. + verbose //. + verbose
//. Verbosity level //. Verbosity level
...@@ -1308,11 +1310,8 @@ int compile() ...@@ -1308,11 +1310,8 @@ int compile()
/* Calculate Look-ahead for all items in look-back set */ /* Calculate Look-ahead for all items in look-back set */
foreach (indices(i->relation), object(item) lookback) { i->direct_lookahead=`|(i->direct_lookahead,
/* Add Follow(i2) to the lookahead-set */ @indices(i->relation)->direct_lookahead);
i->direct_lookahead |= lookback->direct_lookahead;
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment