Extracted from Pike v7.3 release 14 at 2002-02-15.
pike.roxen.com
[Top]
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(object(rule))) LR.parser()->grammar

Description

The grammar itself.


Variable start_state

object(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:object(kernel)) LR.parser()->known_states

Description

LR0 states that are already known to the compiler.


Variable s_q

object(state_queue) LR.parser()->s_q

Description

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