Extracted from Pike v7.8 release 866 at 2016-11-06.
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)) LR.parser.grammar

Description

The grammar itself.


Variable start_state

kernel LR.parser.start_state

Description

The initial LR0 state.


Variable verbose

int LR.parser.verbose

Description

Verbosity level

0

None

1

Some



Variable error

int LR.parser.error

Description

Error code


Variable known_states

mapping(string:kernel) LR.parser.known_states

Description

LR0 states that are already known to the compiler.


Variable s_q

state_queue LR.parser.s_q

Description

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