pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:181:   %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.163 2000/02/15 22:06:17 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.164 2000/02/17 01:15:22 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:660:    }    }    ;      def: modifiers type_or_error optional_stars F_IDENTIFIER push_compiler_frame0    '(' arguments close_paren_or_missing    {    int e;    /* construct the function type */    push_finished_type(compiler_frame->current_type); +  if ($3) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while(--$3>=0) push_type(T_ARRAY);       if(compiler_frame->current_return_type)    free_string(compiler_frame->current_return_type);    compiler_frame->current_return_type=compiler_pop_type();       push_finished_type(compiler_frame->current_return_type);       e=$7-1;    if(varargs)
pike.git/src/language.yacc:988:   soft_cast: '[' type ']'    {    struct pike_string *s=compiler_pop_type();    $$=mkstrnode(s);    free_string(s);    }    ;      type6: type | identifier_type ;    - type: type '*' { push_type(T_ARRAY); } + type: type '*' +  { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  push_type(T_ARRAY); +  }    | type2    ;    - type7: type7 '*' { push_type(T_ARRAY); } + type7: type7 '*' +  { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  push_type(T_ARRAY); +  }    | type4    ;      simple_type: type4    {    struct pike_string *s=compiler_pop_type();    $$=mkstrnode(s);   #ifdef PIKE_DEBUG    if ($$->u.sval.u.string != s) {    fatal("mkstrnode(%p:\"%s\") created node with %p:\"%s\"\n",
pike.git/src/language.yacc:1289:         name_list: new_name    | name_list ',' new_name    ;      new_name: optional_stars F_IDENTIFIER    {    struct pike_string *type;    push_finished_type(compiler_frame->current_type); +  if ($1) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while($1--) push_type(T_ARRAY);    type=compiler_pop_type();    define_variable($2->u.sval.u.string, type, current_modifiers);    free_string(type);    free_node($2);    }    | optional_stars bad_identifier {}    | optional_stars F_IDENTIFIER '='    {    struct pike_string *type;    push_finished_type(compiler_frame->current_type); -  +  if ($1) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while($1--) push_type(T_ARRAY);    type=compiler_pop_type();    if ((current_modifiers & ID_EXTERN) && (compiler_pass == 1)) {    yywarning("Extern declared variable has initializer.");    }    $<number>$=define_variable($2->u.sval.u.string, type,    current_modifiers & (~ID_EXTERN));    free_string(type);    }    expr0
pike.git/src/language.yacc:1336:    | optional_stars bad_identifier '=' expr0    {    free_node($4);    }    ;         new_local_name: optional_stars F_IDENTIFIER    {    push_finished_type($<n>0->u.sval.u.string); +  if ($1) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while($1--) push_type(T_ARRAY);    add_local_name($2->u.sval.u.string, compiler_pop_type(),0);    $$=mknode(F_ASSIGN,mkintnode(0),mklocalnode(islocal($2->u.sval.u.string),0));    free_node($2);    }    | optional_stars bad_identifier { $$=0; }    | optional_stars F_IDENTIFIER '=' expr0    {    push_finished_type($<n>0->u.sval.u.string); -  +  if ($1) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while($1--) push_type(T_ARRAY);    add_local_name($2->u.sval.u.string, compiler_pop_type(),0);    $$=mknode(F_ASSIGN,$4,mklocalnode(islocal($2->u.sval.u.string),0));    free_node($2);    }    | optional_stars bad_identifier '=' expr0    {    free_node($4);    $$=0;    }
pike.git/src/language.yacc:1625:    {    pop_compiler_frame();    }    ;      local_function2: optional_stars F_IDENTIFIER push_compiler_frame1    {    debug_malloc_touch(compiler_frame->current_return_type);       push_finished_type($<n>0->u.sval.u.string); +  if ($1) { +  yywarning("The *-syntax in types is obsolete. Use array instead."); +  }    while($1--) push_type(T_ARRAY);       if(compiler_frame->current_return_type)    free_string(compiler_frame->current_return_type);    compiler_frame->current_return_type=compiler_pop_type();    }    func_args failsafe_block    {    struct pike_string *type;    char buf[40];