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.40 1997/04/23 04:14:30 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.41 1997/04/23 20:11:49 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:278:   %type <number> modifier   %type <number> modifier_list   %type <number> modifiers   %type <number> optional_dot_dot_dot   %type <number> optional_stars      /* The following symbos return type information */      %type <n> assoc_pair   %type <n> block + %type <n> failsafe_block   %type <n> block_or_semi   %type <n> break   %type <n> case   %type <n> catch   %type <n> catch_arg   %type <n> class   %type <n> comma_expr   %type <n> comma_expr2   %type <n> comma_expr_or_maxint   %type <n> comma_expr_or_zero
pike.git/src/language.yacc:585:    if(islocal($3) >= 0)    my_yyerror("Variable '%s' appears twice in argument list.",    $3->str);       add_local_name($3, pop_type());    }    ;      func_args: '(' arguments ')' { $$=$2; }    | '(' error ')' { $$=0; yyerrok; } +  | error { $$=0; yyerrok; }    ;      arguments: /* empty */ optional_comma { $$=0; }    | arguments2 optional_comma { $$=$1; }    ;      arguments2: new_arg_name { $$ = 1; }    | arguments2 ',' new_arg_name { $$ = $1 + 1; }    ;   
pike.git/src/language.yacc:796:    {    int e;    e=--(local_variables->current_number_of_locals);    free_string(local_variables->variable[e].name);    free_string(local_variables->variable[e].type);    }    $$=$3;    }    ;    + failsafe_block: block +  | error { $$=0; } +  ; +  +    local_name_list: new_local_name    | local_name_list ',' new_local_name { $$=mknode(F_ARG_LIST,$1,$3); }    ;      statements: { $$=0; }    | statements statement    {    $$=mknode(F_ARG_LIST,$1,mkcastnode(void_type_string,$2));    }    ;
pike.git/src/language.yacc:838:      lambda: F_LAMBDA    {    push_locals();    $<number>$=comp_stackp;       if(local_variables->current_return_type)    free_string(local_variables->current_return_type);    copy_shared_string(local_variables->current_return_type,any_type_string);    } -  func_args block +  func_args failsafe_block    {    struct pike_string *type;    char buf[40];    int f,e;    struct pike_string *name;       setup_fake_program();    fix_comp_stack($<number>2);       push_type(T_MIXED);