pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:1:   /* -*- c -*-   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: language.yacc,v 1.455 2010/05/29 13:44:32 grubba Exp $ + || $Id$   */      %pure_parser      %token TOK_ARROW      /*    * Basic value pushing    */   %token TOK_CONSTANT TOK_FLOAT TOK_STRING
pike.git/src/language.yacc:2007:    {    unuse_modules(Pike_compiler->num_used_modules - $<number>1);    pop_local_variables($<number>2);    Pike_compiler->compiler_frame->last_block_level=$<number>4;    if ($5) COPY_LINE_NUMBER_INFO($5, $3);    free_node ($3);    $$=$5;    }    ;    + /* Node with line number info at $0. */   end_block: '}'    | TOK_LEX_EOF    {    yyerror("Missing '}'."); -  +  if ($<n>0) { +  low_yyreport(REPORT_ERROR, $<n>0->current_file, $<n>0->line_number, +  parser_system_string, 0, "Opening '{' was here."); +  }    yyerror("Unexpected end of file.");    }    ;      failsafe_block: block    | error { $$=0; }    | TOK_LEX_EOF { yyerror("Unexpected end of file."); $$=0; }    ;      /* Type at $-2 */
pike.git/src/language.yacc:2722:   optional_create_arguments: /* empty */ { $$ = 0; }    | '(' create_arguments close_paren_or_missing    {    /* NOTE: One more than the number of arguments, so that we   < * can detect the case of no parenthesis below. */    $$ = $2 + 1;    free_node($3);    }    ;    - failsafe_program: '{' program end_block + failsafe_program: '{' program { $<n>$ = NULL; } end_block    | error { yyerrok; }    | TOK_LEX_EOF    {    yyerror("End of file where program definition expected.");    }    ;      /* Modifiers at $0. */   class: TOK_CLASS line_number_info optional_identifier    {
pike.git/src/language.yacc:3092:       type_stack_mark();    push_type(T_ZERO); /* Joined type so far. */    }    optional_identifier '{'    {    push_int(-1); /* Previous value. */    $<n>$ = mkconstantsvaluenode(Pike_sp-1);    pop_stack();    } -  enum_list end_block +  enum_list { $<n>$ = NULL; } end_block    {    struct pike_type *t = pop_unfinished_type();    free_node($<n>5);    if ($3) {    ref_push_type_value(t);    add_constant($3->u.sval.u.string, Pike_sp-1,    (Pike_compiler->current_modifiers & ~ID_EXTERN) | ID_INLINE);    pop_stack();    free_node($3);    }