pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:164:   %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.81 1998/04/17 03:18:09 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.82 1998/04/17 17:13:37 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:933:    }    | optional_stars F_IDENTIFIER '=' error    {    free_node($2);    /* No yyerok here since we aren't done yet. */    }    ;      new_local_name2: F_IDENTIFIER    { +  add_ref($<n>0->u.sval.u.string);    add_local_name($1->u.sval.u.string, $<n>0->u.sval.u.string);    $$=mknode(F_ASSIGN,mkintnode(0),mklocalnode(islocal($1->u.sval.u.string)));    free_node($1);    }    | bad_identifier { $$=mkintnode(0); }    | F_IDENTIFIER '=' safe_expr0    { -  +  add_ref($<n>0->u.sval.u.string);    add_local_name($1->u.sval.u.string, $<n>0->u.sval.u.string);    $$=mknode(F_ASSIGN,$3, mklocalnode(islocal($1->u.sval.u.string)));    free_node($1);    }    | bad_identifier '=' safe_expr0 { $$=$3; }    ;         block:'{'    {
pike.git/src/language.yacc:1842:    }else{    (void)fprintf(stderr, "%s:%ld: %s\n",    lex.current_file->str,    (long)lex.current_line,    str);    fflush(stderr);    }   }      /* argument must be a shared string */ + /* Note that this function eats a reference to 'type' */   void add_local_name(struct pike_string *str,    struct pike_string *type)   {    reference_shared_string(str);    if (compiler_frame->current_number_of_locals == MAX_LOCAL)    {    yyerror("Too many local variables.");    }else {    compiler_frame->variable[compiler_frame->current_number_of_locals].type = type;    compiler_frame->variable[compiler_frame->current_number_of_locals].name = str;