pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:102:   %left TOK_LSH TOK_RSH   %left '+' '-'   %left '*' '%' '/'   %right TOK_NOT '~'   %nonassoc TOK_INC TOK_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.200 2000/07/10 18:21:33 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.201 2000/07/12 12:38:41 grubba 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:1956:    }    /* fprintf(stderr, "LANGUAGE.YACC: CLASS start\n"); */    if(Pike_compiler->compiler_pass==1)    {    if ($1 & ID_EXTERN) {    yywarning("Extern declared class definition.");    }    low_start_new_program(0, $3->u.sval.u.string,    $1,    &$<number>$); +  +  /* fprintf(stderr, "Pass 1: Program %s has id %d\n", +  $3->u.sval.u.string->str, Pike_compiler->new_program->id); */ +     if(lex.current_file)    {    store_linenumber(lex.current_line, lex.current_file);    debug_malloc_name(Pike_compiler->new_program, lex.current_file->str,    lex.current_line);    }    }else{    int i;    struct program *p;    struct identifier *id;
pike.git/src/language.yacc:1986:    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))    {    struct svalue *s;    s=&PROG_FROM_INT(Pike_compiler->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,    &$<number>$); +  +  /* fprintf(stderr, "Pass 2: Program %s has id %d\n", +  $3->u.sval.u.string->str, Pike_compiler->new_program->id); */ +     }else{    yyerror("Pass 2: constant redefined!");    low_start_new_program(Pike_compiler->new_program, 0,    $1,    &$<number>$);    }    }else{    yyerror("Pass 2: class constant no longer constant!");    low_start_new_program(Pike_compiler->new_program, 0,    $1,
pike.git/src/language.yacc:2629:    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);    copy_shared_string(Pike_compiler->last_identifier, $2->u.sval.u.string);       id = low_reference_inherited_identifier(inherit_state,    $1,    Pike_compiler->last_identifier,    SEE_STATIC);       if (id != -1) {    if (inherit_depth >= 0) { -  $$ = mkexternalnode(inherit_depth, id, -  ID_FROM_INT(inherit_state->new_program, id)); +  $$ = mkexternalnode(inherit_state->new_program, id);    } else {    $$ = mkidentifiernode(id);    }    } else if(ISCONSTSTR(Pike_compiler->last_identifier, "`->") ||    ISCONSTSTR(Pike_compiler->last_identifier, "`[]")) {    $$ = mknode(F_MAGIC_INDEX, mknewintnode($1),    mknewintnode(inherit_depth+1));    } else if(ISCONSTSTR(Pike_compiler->last_identifier, "`->=") ||    ISCONSTSTR(Pike_compiler->last_identifier, "`[]=")) {    $$ = mknode(F_MAGIC_SET_INDEX, mknewintnode($1),