pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:149:   %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.43 1997/06/07 01:16:26 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.44 1997/08/03 09:55:07 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:535:    for(e=0; e<$6; e++)    {    if(!local_variables->variable[e].name ||    !local_variables->variable[e].name->len)    {    my_yyerror("Missing name for argument %d",e);    }    }       dooptcode($4, $9, $<string>8, $1); + #ifdef DEBUG +  if(recoveries && sp-evaluator_stack < recoveries->sp) +  fatal("Stack error (underflow)\n"); + #endif    }    if(local_variables->current_return_type)    {    free_string(local_variables->current_return_type);    local_variables->current_return_type=0;    }    free_all_local_names();    free_string($4);    free_string($<string>8);    }    | modifiers type_or_error name_list ';' {}    | inheritance {}    | import {}    | constant {}    | class { free_node($1); }    | error ';' { yyerrok; }    {    reset_type_stack(); -  if(num_parse_error>5) YYACCEPT; + /* if(num_parse_error>5) YYACCEPT; */    }    ;         optional_dot_dot_dot: F_DOT_DOT_DOT { $$=1; }    | /* empty */ { $$=0; }    ;      optional_identifier: F_IDENTIFIER    | /* empty */ { $$=0; }
pike.git/src/language.yacc:884:    type=pop_type();       sprintf(buf,"__lambda_%ld",    (long)fake_program.num_identifier_references);    name=make_shared_string(buf);       f=dooptcode(name,    mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0)),    type,    0); + #ifdef DEBUG +  if(recoveries && sp-evaluator_stack < recoveries->sp) +  fatal("Stack error (underflow)\n"); + #endif    free_string(name);    free_string(type);    comp_stackp=$<number>2;    pop_locals();    $$=mkidentifiernode(f);    }    ;      failsafe_program: '{' program '}'    | error { yyerrok; }
pike.git/src/language.yacc:1341:   string: low_string { $$=mkstrnode($1); free_string($1); } ;         %%      void yyerror(char *str)   {    extern int num_parse_error;    extern int cumulative_parse_error;    + #ifdef DEBUG +  if(recoveries && sp-evaluator_stack < recoveries->sp) +  fatal("Stack error (underflow)\n"); + #endif +     if (num_parse_error > 5) return;    num_parse_error++;    cumulative_parse_error++;       if ( get_master() )    {    sp->type = T_STRING;    copy_shared_string(sp->u.string, current_file);    sp++;    sp->type = T_INT;    sp->u.integer = current_line;    sp++;    sp->type = T_STRING;    sp->u.string = make_shared_string(str);    sp++;    SAFE_APPLY_MASTER("compile_error",3);    pop_stack(); -  + #ifdef DEBUG +  if(recoveries && sp-evaluator_stack < recoveries->sp) +  fatal("Stack error (underflow)\n"); + #endif    }else{    (void)fprintf(stderr, "%s:%ld: %s\n",    current_file->str,    (long)current_line,    str);    fflush(stderr);    }   }      /* argument must be a shared string (no need to free it) */