pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:149:   %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.21 1997/01/30 03:51:33 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.22 1997/02/07 01:04:01 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:359:    push_string(current_file);    SAFE_APPLY_MASTER("handle_inherit", 2);       if(sp[-1].type != T_PROGRAM)    my_yyerror("Couldn't cast program to string (%s)",$1->str);    }    | idents    {    push_string(make_shared_string(""));    resolv_constant($1); +  if(sp[-1].type == T_OBJECT) +  { +  struct program *p=sp[-1].u.object->prog; +  if(!p) +  { +  pop_stack(); +  push_int(0); +  }else{ +  p->refs++; +  pop_stack(); +  push_program(p); +  } +  }    if(sp[-1].type != T_PROGRAM)    {    yyerror("Illegal program identifier");    pop_stack();    push_int(0);    }    free_node($1);    }    ;   
pike.git/src/language.yacc:1152:    if((i=islocal($1))>=0)    {    $$=mklocalnode(i);    }else if((i=isidentifier($1))>=0){    $$=mkidentifiernode(i);    }else if(find_module_identifier($1)){    $$=mkconstantsvaluenode(sp-1);    pop_stack();    }else{    $$=0; -  if( get_master() ) +  if( get_master() && !num_parse_error)    {    reference_shared_string($1);    push_string($1);    reference_shared_string(current_file);    push_string(current_file);    SAFE_APPLY_MASTER("resolv", 2);       if(throw_value.type == T_STRING)    {    my_yyerror("%s",throw_value.u.string->str);