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.89 1998/04/26 11:39:45 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.90 1998/04/27 10:00:27 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:200:   #endif /* YYDEBUG */   #endif         void add_local_name(struct pike_string *,struct pike_string *);      static int varargs;   static INT32 current_modifiers;   static struct pike_string *last_identifier=0;    - void fix_comp_stack(int sp) - { -  if(comp_stackp>sp) -  { -  yyerror("Compiler stack fixed."); -  comp_stackp=sp; -  }else if(comp_stackp<sp){ -  fatal("Compiler stack frame underflow."); -  } - } +     -  +    /*    * Kludge for Bison not using prototypes.    */   #ifndef __GNUC__   #ifndef __cplusplus   static void __yy_memcpy(char *to, char *from, int count);   #endif /* !__cplusplus */   #endif /* !__GNUC__ */      %}
pike.git/src/language.yacc:1031:    {    $$=mknode(F_DEFAULT,0,0); yyerror("Expected ':' after default.");    }    ;      continue: F_CONTINUE { $$=mknode(F_CONTINUE,0,0); } ;      lambda: F_LAMBDA    {    push_compiler_frame(); -  $<number>$=comp_stackp; +        if(compiler_frame->current_return_type)    free_string(compiler_frame->current_return_type);    copy_shared_string(compiler_frame->current_return_type,any_type_string);    }    func_args failsafe_block    {    struct pike_string *type;    char buf[40];    int f,e;    struct pike_string *name;    -  fix_comp_stack($<number>2); -  -  +     $4=mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0));    type=find_return_type($4);       if(type)    push_finished_type(type);    else    push_type(T_MIXED);       e=$3-1;    if(varargs)
pike.git/src/language.yacc:1086:    name=make_shared_string(buf);       f=dooptcode(name,    $4,    type,    ID_PRIVATE | ID_INLINE);       $$=mkidentifiernode(f);    free_string(name);    free_string(type); -  comp_stackp=$<number>2; +     pop_compiler_frame();    }    ;      failsafe_program: '{' program '}'    | error { yyerrok; }    ;      class: modifiers F_CLASS optional_identifier    {