Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
7.2::
LR
LR.parser

Class LR.parser

Description

This object implements an LALR(1) parser and compiler.

Normal use of this object would be:

 {add_rule, set_priority, set_associativity}*
 set_symbol_to_string
 compile
 {parse}*
 




Variable grammar

mapping(int|string:array(rule)) grammar

Description

The grammar itself.


Variable start_state

kernel start_state

Description

The initial LR0 state.


Variable verbose

int verbose

Description

Verbosity level

0

None

1

Some



Variable error

int error

Description

Error code


Variable known_states

mapping(string:kernel) known_states

Description

LR0 states that are already known to the compiler.


Variable s_q

state_queue s_q

Description

Contains all states used. In the queue-part are the states that remain to be compiled.