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

version» Context lines:

pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:194:       //! Create a new error handler.    //!    //! @param verbosity    //! Level of verbosity.    //!    //! @seealso    //! @[verbose]    protected void create(int(-1..1)|void verbosity)    { -  if (!zero_type(verbosity)) { +  if (!undefinedp(verbosity))    verbose = verbosity;    }   } - } +       //! This object implements an LALR(1) parser and compiler.   //!   //! Normal use of this object would be:   //!   //! @pre{   //! set_error_handler   //! {add_rule, set_priority, set_associativity}*   //! set_symbol_to_string   //! compile
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:623:       string cast_to_string()    {    return _sprintf();    }       //! Implements casting.    //!    //! @param type    //! Type to cast to. -  mixed cast(string type) +  protected mixed cast(string type)    {    if (type == "string")    return _sprintf(); -  error("Cast to %s not supported\n", type); +  return UNDEFINED;    }       /* Here come the functions that actually do some work */       //! Sets the priority of a terminal.    //!    //! @param terminal    //! Terminal to set the priority for.    //! @param pri_val    //! Priority; higher = prefer this terminal.
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:738:    } else {    used_by[symbol] = (< r >);    }    }    }       if (!(r->num_nonnullables)) {    /* This rule was nullable */    new_nullables->push(r->nonterminal);    -  while (new_nullables->ptr) { +  while (sizeof(new_nullables)) {    symbol = [int]new_nullables->pop();    report(NOTICE, "add_rule", "Nulling symbol %s",    symbol_to_string(symbol));    nullable[symbol] = 1;    if (used_by[symbol]) {    foreach (indices(used_by[symbol]), Rule r2) {    if (!(--r2->num_nonnullables)) {    new_nullables->push(r2->nonterminal);    }    }
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:869:       protected ADT.Stack item_stack;       protected void traverse_items(Item i,    function(int:void) conflict_func)    {    int depth;       item_stack->push(i);    -  i->counter = depth = item_stack->ptr; +  i->counter = depth = sizeof(item_stack);       foreach (indices(i->relation), Item i2) {    if (!i2->counter) {    traverse_items(i2, conflict_func);    }    if (i->counter > i2->counter) {    i->counter = i2->counter;    }       i->direct_lookahead |= i2->direct_lookahead;
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:1678:    "Shifting \"%s\", value \"%O\"", input, value);    value_stack->push(value);    state_stack->push(state);    state = [object(Kernel)]a;    } else {    /* ERROR */    if (input = "") {    /* At end of file */    lr_error |= ERROR_EOF;    -  if (value_stack->ptr != 1) { -  if (value_stack->ptr) { +  if (sizeof(value_stack) != 1) { +  if (sizeof(value_stack)) {    report(ERROR, "parse", "Bad state at EOF -- Throwing \"%O\"",    value_stack->pop());    state = [object(Kernel)]state_stack->pop();    continue;    } else {    report(ERROR, "parse", "Empty stack at EOF!");    return 0;    }    } else {    report(ERROR, "parse", "Bad state at EOF");