pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:105:   %left TOK_LSH TOK_RSH   %left '+' '-'   %left '*' '%' '/'   %right TOK_NOT '~'   %nonassoc TOK_INC TOK_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.242 2001/04/01 15:40:23 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.243 2001/04/03 11:48:16 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:2431:    }    if($2) free_node($2);    }    ;      enum_def: /* EMPTY */    | simple_identifier enum_value    {    if ($1) {    add_constant($1->u.sval.u.string, Pike_sp-1, -  Pike_compiler->current_modifiers & ~ID_EXTERN); +  (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_LOCAL);    }    free_node($1);    /* Update the type. */    {    struct pike_type *current = pop_unfinished_type();    struct pike_type *new = get_type_of_svalue(Pike_sp-1);    struct pike_type *res = or_pike_types(new, current, 1);    free_type(current);    free_type(new);    type_stack_mark();
pike.git/src/language.yacc:2469:    type_stack_mark();    push_type(T_ZERO); /* Joined type so far. */    }    optional_identifier '{' enum_list end_block    {    struct pike_type *t = pop_unfinished_type();    pop_stack();    if ($4) {    ref_push_type_value(t);    add_constant($4->u.sval.u.string, Pike_sp-1, -  Pike_compiler->current_modifiers & ~ID_EXTERN); +  (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_LOCAL);    pop_stack();    free_node($4);    }    $$ = mktypenode(t);    free_type(t);    }    ;      typedef: modifiers TOK_TYPEDEF full_type simple_identifier ';'    {    struct pike_type *t = compiler_pop_type();       if ((Pike_compiler->current_modifiers & ID_EXTERN) &&    (Pike_compiler->compiler_pass == 1)) {    yywarning("Extern declared typedef.");    }       if ($4) {    ref_push_type_value(t);    add_constant($4->u.sval.u.string, Pike_sp-1, -  Pike_compiler->current_modifiers & ~ID_EXTERN); +  (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_LOCAL);    pop_stack();    free_node($4);    }    free_type(t);    }    ;      cond: TOK_IF    {    $<number>$=Pike_compiler->compiler_frame->current_number_of_locals;