pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:454:    ref_push_string(Pike_compiler->last_identifier);    }else{    push_empty_string();    }    $$=$1;       STACK_LEVEL_DONE(1);    }    ;    - /* NOTE: Pushes the resolved program on the stack. */ - program_ref: low_program_ref -  { -  STACK_LEVEL_START(0); -  -  resolv_program($1); -  free_node($1); -  -  STACK_LEVEL_DONE(1); -  } -  ; -  +    inherit_ref:    {    SET_FORCE_RESOLVE($<number>$);    }    low_program_ref    {    UNSET_FORCE_RESOLVE($<number>1);    $$ = $2;    }    ;
pike.git/src/language.yacc:1325:   /* Literal type. Value on type stack. */   basic_type:    TOK_FLOAT_ID { push_type(T_FLOAT); }    | TOK_VOID_ID { push_type(T_VOID); }    | TOK_MIXED_ID { push_type(T_MIXED); }    | TOK_AUTO_ID { push_type(T_ZERO); push_type(PIKE_T_AUTO); }    | TOK_STRING_ID opt_string_width {}    | TOK_INT_ID opt_int_range {}    | TOK_MAPPING_ID opt_mapping_type {}    | TOK_FUNCTION_ID opt_function_type {} -  | TOK_OBJECT_ID opt_object_type {} +  | TOK_OBJECT_ID opt_program_type {}    | TOK_PROGRAM_ID opt_program_type { push_type(T_PROGRAM); }    | TOK_ARRAY_ID opt_array_type { push_type(T_ARRAY); }    | TOK_MULTISET_ID opt_array_type { push_type(T_MULTISET); }    | TOK_ATTRIBUTE_ID '(' string_constant ',' full_type ')'    {    push_type_attribute($3->u.sval.u.string);    free_node($3);    }    | TOK_ATTRIBUTE_ID '(' string_constant error ')'    {
pike.git/src/language.yacc:1565:    yyerror("Expected integer range.");    }    ;      opt_string_width: opt_int_range    {    push_type(T_STRING);    }    ;    - opt_object_type: /* Empty */ { push_object_type(0, 0); } -  | { - #ifdef PIKE_DEBUG -  $<ptr>$ = Pike_sp; - #endif /* PIKE_DEBUG */ -  } -  '(' program_ref ')' -  { -  /* NOTE: On entry, there are two items on the stack: -  * Pike_sp-2: Name of the program reference (string). -  * Pike_sp-1: The resolved program (program|function|zero). -  */ -  struct program *p=program_from_svalue(Pike_sp-1); -  - #ifdef PIKE_DEBUG -  if ($<ptr>1 != (Pike_sp - 2)) { -  Pike_fatal("Unexpected stack depth: %p != %p\n", -  $<n>1, Pike_sp-2); -  } - #endif /* PIKE_DEBUG */ -  -  if(!p) { -  if (Pike_compiler->compiler_pass!=1) { -  my_yyerror("Not a valid program specifier: %S", Pike_sp[-2].u.string); -  } -  } -  push_object_type(0, p?(p->id):0); -  /* Attempt to name the type. */ -  if (TYPEOF(Pike_sp[-2]) == T_STRING) { -  push_type_name(Pike_sp[-2].u.string); -  } -  pop_n_elems(2); -  } -  ; -  +    opt_program_type: /* Empty */ { push_object_type(0, 0); }    | '(' full_type ')'    | '(' error ')'    {    push_object_type(0, 0);    yyerror("Invalid program subtype.");    }    ;      opt_function_type: '('