Branch: Tag:

2002-05-23

2002-05-23 15:14:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now strict types clean.

Rev: lib/modules/Parser.pmod/LR.pmod/module.pmod:1.5

1:   /* -  * $Id: module.pmod,v 1.4 2002/05/22 16:45:36 grubba Exp $ +  * $Id: module.pmod,v 1.5 2002/05/23 15:14:48 grubba Exp $    *    * A BNF-grammar in Pike.    * Compiles to a LALR(1) state-machine.
12:   /*! LALR(1) parser generator    */    - // #pragma strict_types + #pragma strict_types      /*    * Defines
397:       items = symbol_items[symbol];    if (items) { -  array(int) item_ids = map(sort(indices(items)->item_id), +  array(int) item_ids = [array(int)]map(sort(indices(items)->item_id),    `+, 1);    string kernel_hash = sprintf("%@4c", item_ids);   
1601:       if (stringp(func = r->action)) {    if (action_object) { -  func = action_object[r->action]; +  func = [string|function]action_object[r->action];    if (!functionp(func)) {    if (!func) {    werror("Missing action \"%s\" in object\n",
1623:    }    if (func) {    if (sizeof(r->symbols)) { -  value_stack->push(([function]func)(@value_stack->pop(sizeof(r->symbols)))); +  value_stack->push(([function(mixed ...:mixed)]func) +  (@[array(mixed)]value_stack-> +  pop(sizeof(r->symbols))));    state = ([array(Kernel)]state_stack->pop(sizeof(r->symbols)))[0];    } else {    value_stack->push(r->action());
1683:    } else {    lr_error |= ERROR_SYNTAX;    -  werror("Error: Bad input: \""+input+"\"(\""+value+"\")\n"); +  werror("Error: Bad input: %O(%O)\n", input, value);    }    }    break; /* Break out of the inner while(1) to read more input. */