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.360 2005/10/14 08:43:04 grubba Exp $ + || $Id: language.yacc,v 1.361 2005/12/31 03:35:45 nilsson Exp $   */      %pure_parser      %token TOK_ARROW      /*    * Basic value pushing    */   %token TOK_CONSTANT TOK_FLOAT TOK_STRING
pike.git/src/language.yacc:427:       resolv_program($1);    free_node($1);       STACK_LEVEL_DONE(1);    }    ;      facet: TOK_FACET TOK_IDENTIFIER ':' idents ';'    { + #ifdef WITH_FACETS    struct object *o;    if (Pike_compiler->compiler_pass == 1) {    if (Pike_compiler->new_program->facet_class == PROGRAM_IS_FACET_CLASS) {    yyerror("A class can only belong to one facet.");    }    else {    resolv_constant($4);    if (Pike_sp[-1].type == T_OBJECT) {    /* FIXME: Object subtypes! */    o = Pike_sp[-1].u.object;    ref_push_string($2->u.sval.u.string);    push_int(Pike_compiler->new_program->id);    push_int(Pike_compiler->new_program->facet_class); -  safe_apply_low3(o, find_identifier("add_facet_class",o->prog), 3, -  "Failed to add facet class to system."); +  safe_apply_low2(o, find_identifier("add_facet_class",o->prog), 3, 0);    if (Pike_sp[-1].type == T_INT &&    Pike_sp[-1].u.integer >= 0) {    Pike_compiler->new_program->facet_class = PROGRAM_IS_FACET_CLASS;    Pike_compiler->new_program->facet_index = Pike_sp[-1].u.integer;    add_ref(Pike_compiler->new_program->facet_group = o);    }    else    yyerror("Could not add facet class to system.");    pop_stack();    }    else    yyerror("Invalid facet group specifier.");    pop_stack();    }    }    free_node($2);    free_node($4); -  + #else +  yyerror("No support for facets."); + #endif    }    ;    -  +    inherit_ref:    {    SET_FORCE_RESOLVE($<number>$);    }    low_program_ref    {    UNSET_FORCE_RESOLVE($<number>1);    $$ = $2;    }    ;
pike.git/src/language.yacc:486:    if (($1 & ID_EXTERN) && (Pike_compiler->compiler_pass == 1)) {    yywarning("Extern declared inherit.");    }    if($3 && !(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE))    {    struct pike_string *s=Pike_sp[-1].u.string;    if($4) s=$4->u.sval.u.string;    compiler_do_inherit($3,$1,s);    }    + #ifdef WITH_FACETS    /* If this is a product class, check that all product classes in its    * facet-group inherit from all facets */    if($3 && Pike_compiler->compiler_pass == 2) {    if (Pike_compiler->new_program->facet_class==PROGRAM_IS_PRODUCT_CLASS){    if (!Pike_compiler->new_program->facet_group)    yyerror("Product class without facet group.");    else {    safe_apply(Pike_compiler->new_program->facet_group,    "product_classes_checked", 0);    if (Pike_sp[-1].type == T_INT &&    Pike_sp[-1].u.integer == 0) {    pop_stack(); -  safe_apply_low3(Pike_compiler->new_program->facet_group, +  safe_apply_low2(Pike_compiler->new_program->facet_group,    find_identifier    ("check_product_classes",    Pike_compiler->new_program->facet_group->prog), -  0, -  "Error in some product classes"); +  0, o);    }    pop_stack();    }    }    } -  + #endif    if($4) free_node($4);    pop_stack();    if ($3) free_node($3);    }    | modifiers TOK_INHERIT inherit_ref error ';'    {    if ($3) free_node($3);    pop_stack();    yyerrok;    }