pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:175:   %left F_LSH F_RSH   %left '+' '-'   %left '*' '%' '/'   %right F_NOT '~'   %nonassoc F_INC F_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.123 1999/09/18 09:21:20 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.124 1999/09/19 22:59:11 hubbe Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif      #include "interpret.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "las.h"   #include "interpret.h"
pike.git/src/language.yacc:416:    ref_push_string($1->u.sval.u.string);    ref_push_string($1->u.sval.u.string);    ref_push_string(lex.current_file);    SAFE_APPLY_MASTER("handle_inherit", 2);       if(sp[-1].type != T_PROGRAM)    my_yyerror("Couldn't cast string \"%s\" to program",    $1->u.sval.u.string->str);    free_node($1);    $$=mksvaluenode(sp-1); +  if($$->name) free_string($$->name);    add_ref( $$->name=sp[-2].u.string );    pop_stack();    }    | idents    {    if(last_identifier)    {    ref_push_string(last_identifier);    }else{    push_constant_text("");
pike.git/src/language.yacc:1259:    i=isidentifier($3->u.sval.u.string);    if(i<0)    {    low_start_new_program(new_program,0,0);    yyerror("Pass 2: program not defined!");    }else{    id=ID_FROM_INT(new_program, i);    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))    {    struct svalue *s; -  s=PROG_FROM_INT(new_program,i)->constants+id->func.offset; +  s=&PROG_FROM_INT(new_program,i)->constants[id->func.offset].sval;    if(s->type==T_PROGRAM)    {    low_start_new_program(s->u.program, $3->u.sval.u.string, $1);    }else{    yyerror("Pass 2: constant redefined!");    low_start_new_program(new_program, 0,0);    }    }else{    yyerror("Pass 2: class constant no longer constant!");    low_start_new_program(new_program, 0,0);
pike.git/src/language.yacc:1730:    node *tmp2;    tmp.type=T_MAPPING;   #ifdef __CHECKER__    tmp.subtype=0;   #endif /* __CHECKER__ */    if(last_identifier) free_string(last_identifier);    copy_shared_string(last_identifier, $3->u.sval.u.string);    tmp.u.mapping=get_builtin_constants();    tmp2=mkconstantsvaluenode(&tmp);    $$=index_node(tmp2, "predef", $3->u.sval.u.string); +  if(!$$->name) +  add_ref( $$->name=$3->u.sval.u.string );    free_node(tmp2);    free_node($3);    }    | F_PREDEF F_COLON_COLON bad_identifier    {    $$=mkintnode(0);    }    | F_IDENTIFIER F_COLON_COLON F_IDENTIFIER    {    if(last_identifier) free_string(last_identifier);