2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: label.c,v 1.8 1994/06/27 08:01:19 ceriel Exp $ */
6 /* L A B E L H A N D L I N G */
17 extern char options[];
19 enter_label(idf, defining)
20 register struct idf *idf;
22 /* The identifier idf is entered as a label. If it is new,
23 it is entered into the idf list with the largest possible
24 scope, i.e., on the lowest possible level.
25 If defining, the label comes from a label statement.
27 register struct def *def = idf->id_label;
30 if (defining && def->df_initialized)
31 error("redeclaration of label %s", idf->id_text);
34 stack_idf(idf, stack_level_of(L_LOCAL));
38 def->df_file = idf->id_file;
39 def->df_line = idf->id_line;
41 if (def->df_address == 0)
42 def->df_address = (arith) text_label();
44 def->df_initialized = 1;
48 register struct idf *idf;
50 /* The scope in which the label idf occurred is left.
52 if (!idf->id_label->df_initialized && !is_anon_idf(idf))
53 error("label %s not defined", idf->id_text);