%{ CODE HEADER /* * The Termprocessor Kimwitu * * Copyright (c) 1991 University of Twente, Dept TIOS. * All rights reserved. * */ %} /* * useocc.k */ %{ #if ! (defined(lint) || defined(SABER) || defined(CODECENTER)) static char useocc_kAccesSid[] = "@(#)$Id: useocc.k,v 1.12 1996/10/14 11:12:31 belinfan Rel $"; #endif %} /***************************************************************************/ %{ KC_TYPES_HEADER #include "useocc.h" %} void v_useoccuroperator( id ) ID id; { (void) f_useoccuroperator( id ); } boolean f_useoccuroperator( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPredefinedOperator( *, *): { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined operator (it's predefined, you're not supposed to use those):", id ))); return False;} ITUserOperator( *, * ): { return True; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined operator", id ))); return False; } } } } } void v_warnifnotvariable( id ) ID id; { (void) f_warnifnotvariable( id ); } boolean f_warnifnotvariable( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPatternVariable( *, * ), ITUnknown(): { return False; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "variable expected:", id ))); return True; } } } } } void v_useoccurphylum( id ) ID id; { (void) f_useoccurphylum( id ); } boolean f_useoccurphylum( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPredefinedBigatomPhylum( * ), ITPredefinedPhylum( * ): { return True;} ITUserPhylum( * ): { return True;} default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined phylum", id ))); return False; } } } } } void v_useoccurlistphylum( id ) ID id; { (void) f_useoccurlistphylum( id ); } boolean f_useoccurlistphylum( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITUserPhylum( pd ): { with( pd ) { PhylumDeclaration( *, *, Emptyproductionblock(), * ): { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined list phylum (the productionblock is empty):", id ))); return False; } PhylumDeclaration( *, *, ListAlternatives( *, * ), * ): { return True; } PhylumDeclaration( *, *, NonlistAlternatives( * ), * ): { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined list phylum (it's a non-list phylum):", id ))); return False; } PhylumDeclaration( *, *, PredefinedAlternatives( * ), * ): { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined list phylum (it's a predefined phylum):", id ))); return False; } } } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined list phylum", id ))); return False; } } } } } void v_useoccuruviewname( id ) ID id; { (void) f_useoccuruviewname( id ); } boolean f_useoccuruviewname( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPredefinedUView(): { return True; } ITUserUView(): { return True; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined unparse view:", id ))); return False; } } } } } void v_useoccurrviewname( id ) ID id; { (void) f_useoccurrviewname( id ); } boolean f_useoccurrviewname( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPredefinedRView(): { return True; } ITUserRView(): { return True; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined rewrite view:", id ))); return False; } } } } } void v_useoccurstorageclass( id ) ID id; { (void) f_useoccurstorageclass( id ); } boolean f_useoccurstorageclass( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPredefinedStorageClass(): { return True; } ITStorageClass(): { return True; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined storage class:", id ))); return False; } } } } } void v_useoccurpatternvariable( id ) ID id; { (void) f_useoccurpatternvariable( id ); } boolean f_useoccurpatternvariable( id ) ID id; { with( id ) { Id( uid ): { with( uid->type ) { ITPatternVariable( *, * ): { return True; } default: { v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1tID( "undefined pattern variable:", id ))); return False; } } } } }