pike.git / lib / modules / Parser.pmod / LR.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:1:   /* -  * $Id: module.pmod,v 1.8 2002/05/24 15:35:15 grubba Exp $ +  * $Id: module.pmod,v 1.9 2002/06/12 19:28:58 jhs Exp $    *    * A BNF-grammar in Pike.    * Compiles to a LALR(1) state-machine.    *    * Henrik Grubbström 1996-11-24    */      #pike __REAL_VERSION__      /*! LALR(1) parser generator
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:503:    }    }       static string _sprintf()    {    return sprintf("%{%s\n%}", items);    }    }       //! This is a queue, which keeps the elements even after they are retrieved. -  static class State_queue { +  static class StateQueue {       //! Index of the head of the queue.    int head;       //! Index of the tail of the queue.    int tail;       //! The queue itself.    array(Kernel) arr = allocate(64);   
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:863:    (intp(r->symbols[0]))) {    state->closure([int]r->symbols[0]);    }    }    }    return state;    }       //! Contains all states used.    //! In the queue section are the states that remain to be compiled. -  State_queue s_q; +  StateQueue s_q;       static ADT.Stack item_stack;       static void traverse_items(Item i,    function(int:void) conflict_func)    {    int depth;       item_stack->push(i);   
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:1299:   #endif /* LR_PROFILE */       //! Compiles the grammar into a parser, so that parse() can be called.    int compile()    {    int lr_error = 0; /* No error yet */    int state_no = 0; /* DEBUG INFO */    Kernel state;    multiset(int|string) symbols, conflicts;    -  s_q = State_queue(); +  s_q = StateQueue();    s_q->push(first_state());       /* First make LR(0) states */       LR_GAUGE("LR0", {    while (state = s_q->next()) {       report(NOTICE, "compile", "Compiling state %d:\n%s", state_no++,    state_to_string(state) + "\n");