pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:149:   %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.23 1997/02/11 07:09:11 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.24 1997/02/14 04:45:57 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:216:    char *str;    unsigned short type;    struct node_s *n;    struct efun *efun;   }      %type <fnum> F_FLOAT      %type <string> F_IDENTIFIER   %type <string> F_STRING - %type <string> cast simple_type + %type <string> cast + %type <string> simple_type   %type <string> low_string   %type <string> optional_identifier   %type <string> optional_rename_inherit   %type <string> string_constant      %type <number> F_ARRAY_ID   %type <number> F_BREAK   %type <number> F_CASE   %type <number> F_CATCH   %type <number> F_CONTINUE
pike.git/src/language.yacc:622:   modifiers: modifier_list { $$=current_modifiers=$1; } ;      modifier_list: /* empty */ { $$ = 0; }    | modifier modifier_list { $$ = $1 | $2; }    ;      optional_stars: optional_stars '*' { $$=$1 + 1; }    | /* empty */ { $$=0; }    ;    - cast: '(' type ')' { $$=pop_type(); } ; + cast: '(' type ')' { $$=pop_type(); } +  ;      type: type '*' { push_type(T_ARRAY); }    | type2    ;      simple_type: type2 { $$=pop_type(); } -  +  ;      type2: type2 '|' type3 { push_type(T_OR); }    | type3    ;      type3: F_INT_ID { push_type(T_INT); }    | F_FLOAT_ID { push_type(T_FLOAT); }    | F_STRING_ID { push_type(T_STRING); }    | F_PROGRAM_ID { push_type(T_PROGRAM); }    | F_VOID_ID { push_type(T_VOID); }
pike.git/src/language.yacc:826:    | do    | for    | switch    | case    | default    | return ';'    | block {}    | foreach    | break ';'    | continue ';' -  | error ';' { $$=0; } +  | error ';' { reset_type_stack(); $$=0; }    | ';' { $$=0; }    ;         break: F_BREAK { $$=mknode(F_BREAK,0,0); } ;   default: F_DEFAULT ':' { $$=mknode(F_DEFAULT,0,0); } ;   continue: F_CONTINUE { $$=mknode(F_CONTINUE,0,0); } ;      lambda: F_LAMBDA    {
pike.git/src/language.yacc:1041:    $$ = mknode(F_ARG_LIST,mkcastnode(void_type_string,$1),$3);    }    ;      expr00: expr0    | '@' expr0 { $$=mknode(F_PUSH_ARRAY,$2,0); };      expr0: expr01    | expr4 '=' expr0 { $$=mknode(F_ASSIGN,$3,$1); }    | expr4 assign expr0 { $$=mknode($2,$1,$3); } -  | error assign expr01 { $$=0; } +  | error assign expr01 { $$=0; reset_type_stack(); }    ;      expr01: expr1 { $$ = $1; }    | expr1 '?' expr01 ':' expr01 { $$=mknode('?',$1,mknode(':',$3,$5)); }    ;      assign: F_AND_EQ { $$=F_AND_EQ; }    | F_OR_EQ { $$=F_OR_EQ; }    | F_XOR_EQ { $$=F_XOR_EQ; }    | F_LSH_EQ { $$=F_LSH_EQ; }