1 /*
2  * Motif
3  *
4  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22 */
23 #ifdef REV_INFO
24 #ifndef lint
25 static char rcsid[] = "$TOG: UilSarMod.c /main/13 1997/03/12 15:21:36 dbl $"
26 #endif
27 #endif
28 
29 #ifdef HAVE_CONFIG_H
30 #include <config.h>
31 #endif
32 
33 
34 /*
35 **++
36 **  FACILITY:
37 **
38 **      User Interface Language Compiler (UIL)
39 **
40 **  ABSTRACT:
41 **
42 **      This module contain the routines for processing the module construct.
43 **
44 **--
45 **/
46 
47 
48 /*
49 **
50 **  INCLUDE FILES
51 **
52 **/
53 
54 #include "UilDefI.h"
55 
56 /*
57 **
58 **  TABLE OF CONTENTS
59 **
60 */
61 
62 /*
63 **
64 **  DEFINE and MACRO DEFINITIONS
65 **
66 **/
67 
68 
69 
70 /*
71 **
72 **  EXTERNAL VARIABLE DECLARATIONS
73 **
74 **/
75 
76 extern   yystype			yylval;
77 
78 
79 /*
80 **
81 **  GLOBAL VARIABLE DECLARATIONS
82 **
83 **/
84 
85 externaldef(uil_comp_glbl) src_source_record_type
86 	*src_az_module_source_record;
87 externaldef(uil_comp_glbl) unsigned short int
88 	*uil_urm_variant = NULL;
89 externaldef(uil_comp_glbl) unsigned short int
90 	*uil_arg_compr = NULL;
91 externaldef(uil_comp_glbl) unsigned short int
92 	*uil_reas_compr = NULL;
93 externaldef(uil_comp_glbl) unsigned short int
94 	*uil_widget_compr = NULL;
95 externaldef(uil_comp_glbl) unsigned short int
96 	*uil_child_compr = NULL;
97 
98 /*
99 **
100 **  OWN VARIABLE DECLARATIONS
101 **
102 **/
103 
104 unsigned int	module_clauses;
105 
106 #define m_version_clause	(1<<0)
107 #define m_names_clause		(1<<1)
108 #define m_charset_clause	(1<<2)
109 #define m_objects_clause	(1<<3)
110 
111 #define m_after_names		(m_charset_clause)
112 
113 
114 /*
115 **++
116 **  FUNCTIONAL DESCRIPTION:
117 **
118 **	This function initializes all static data structure for the semantic
119 **	action routines.
120 **
121 **  FORMAL PARAMETERS:
122 **
123 **      none
124 **
125 **  IMPLICIT INPUTS:
126 **
127 **      none
128 **
129 **  IMPLICIT OUTPUTS:
130 **
131 **      uil_urm_variant
132 **
133 **  FUNCTION VALUE:
134 **
135 **      void
136 **
137 **  SIDE EFFECTS:
138 **
139 **      global variables are initialized
140 **
141 **--
142 **/
143 
sar_initialize()144 void	sar_initialize ()
145 
146 {
147 int		i;	/* loop index */
148 
149 /* BEGIN OSF Fix CR 5443 */
150 /* Initialize uil_sym_default_charset based on XmFALLBACK_CHARSET */
151 if (strcmp(XmFALLBACK_CHARSET, "ISO8859-1") != 0) /* Most common case. */
152   for (i = 0; i < (int)charset_lang_table_max; i++)
153     if (strcmp(XmFALLBACK_CHARSET, charset_lang_names_table[i]) == 0)
154       {
155 	uil_sym_default_charset = charset_lang_codes_table[i];
156 	break;
157       }
158 /* END OSF Fix CR 5443 */
159 
160 /*
161  * Allocate vectors for the variant and usage vectors if they are NULL,
162  */
163 if ( uil_urm_variant == NULL )
164     uil_urm_variant = (unsigned short int *)
165 	XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
166 if ( uil_arg_compr == NULL )
167     uil_arg_compr = (unsigned short int *)
168 	XtMalloc(sizeof(unsigned short int)*(uil_max_arg+1));
169 if ( uil_reas_compr == NULL )
170     uil_reas_compr = (unsigned short int *)
171 	XtMalloc(sizeof(unsigned short int)*(uil_max_reason+1));
172 if ( uil_widget_compr == NULL )
173     uil_widget_compr = (unsigned short int *)
174 	XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
175 if ( uil_child_compr == NULL )
176     uil_child_compr = (unsigned short int *)
177 	XtMalloc(sizeof(unsigned short int)*(uil_max_child+1));
178 /*
179  **	Loop throught the array of object variants and set them all to NULL.
180  */
181 for (i = 0; i<uil_max_object+1; i++)
182     uil_urm_variant[i] = 0;
183 
184 /*
185  ** Initialize all compression vectors
186  */
187 for ( i=0 ; i<uil_max_arg+1 ; i++ )
188     uil_arg_compr[i] = 0;
189 for ( i=0 ; i<uil_max_reason+1 ; i++ )
190     uil_reas_compr[i] = 0;
191 for ( i=0 ; i<uil_max_object+1 ; i++ )
192     uil_widget_compr[i] = 0;
193 for ( i=0 ; i<uil_max_child+1 ; i++ )
194     uil_child_compr[i] = 0;
195 
196 }
197 
198 /*
199 **++
200 **  FUNCTIONAL DESCRIPTION:
201 **
202 **      This function creates the root entry node for the compilation.
203 **	The "root" entry is the root node of the symbol tree and is
204 **	what's passed back to the caller of the compiler.
205 **
206 **  FORMAL PARAMETERS:
207 **
208 **      root_frame	ptr to root frame that will remain on the stack
209 **			throughout the compilation
210 **
211 **  IMPLICIT INPUTS:
212 **
213 **      none
214 **
215 **  IMPLICIT OUTPUTS:
216 **
217 **	sym_az_root_entry		global pointer used thoughout the compilation
218 **	sym_az_curent_section_entry	global pointer used thoughout the compilation
219 **	src_az_first_source_record	global pointer to the source record list
220 **
221 **  FUNCTION VALUE:
222 **
223 **      void
224 **
225 **  SIDE EFFECTS:
226 **
227 **	none
228 **
229 **--
230 **/
231 
sar_create_root(root_frame)232 void	sar_create_root (root_frame)
233 
234 yystype	    *root_frame;
235 
236 {
237     /*
238     ** Allocate the symbol nodes
239     */
240 
241     sym_az_root_entry = (sym_root_entry_type *)
242 		sem_allocate_node (sym_k_root_entry, sym_k_root_entry_size);
243 
244     /*
245     ** Create a place holder entry (tail) and change the "current" section list to it.
246     */
247 
248     sym_az_current_section_entry = (sym_section_entry_type *) sem_allocate_node
249 			    ( sym_k_section_entry, sym_k_section_entry_size );
250 
251     sym_az_current_section_entry->header.b_type = sym_k_section_tail;
252 
253     sym_az_root_entry->sections = sym_az_current_section_entry;
254     sym_az_root_entry->src_record_list = src_az_first_source_record;
255 
256     /*
257     ** Save the file name and the expanded version of it.
258     */
259 
260     strcpy (sym_az_root_entry->file_name, Uil_cmd_z_command.ac_source_file);
261     strcpy (sym_az_root_entry->full_file_name, src_az_source_file_table[0]->expanded_name);
262 
263     /*
264     ** Save the symbol node in the root frame.
265     */
266 
267     root_frame->b_tag = sar_k_root_frame;
268     root_frame->b_type = sym_k_root_entry;
269     root_frame->value.az_symbol_entry = (sym_entry_type *)sym_az_root_entry;
270 
271 }
272 
273 
274 /*
275 **++
276 **  FUNCTIONAL DESCRIPTION:
277 **
278 **      This function create the module entry symbol node for the compilation.
279 **
280 **  FORMAL PARAMETERS:
281 **
282 **      target_frame	ptr to module frame that will remain on the stack
283 **			throughout the compilation
284 **	id_frame	ptr to token frame for the module name
285 **
286 **  IMPLICIT INPUTS:
287 **
288 **	sym_az_root_entry	global that points to the root entry
289 **
290 **  IMPLICIT OUTPUTS:
291 **
292 **      sym_az_module_entry	global that points to module entry
293 **
294 **  FUNCTION VALUE:
295 **
296 **      void
297 **
298 **  SIDE EFFECTS:
299 **
300 **      set second line of the listing title
301 **
302 **--
303 **/
304 
sar_create_module(target_frame,id_frame,module_frame)305 void	sar_create_module(target_frame, id_frame, module_frame)
306 
307 yystype	    *target_frame;
308 yystype	    *id_frame;
309 yystype	    *module_frame;
310 
311 {
312     sym_name_entry_type	    *name_entry;
313 
314     /*
315     **  Call standard routine to check name entry for id_frame.
316     **	This routine handles font name, color names, etc used as ids
317     */
318 
319     name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame );
320 
321     /*
322     **	Allocate the module entry and fill it in
323     */
324 
325     sym_az_module_entry = (sym_module_entry_type *)
326 	sem_allocate_node (sym_k_module_entry, sym_k_module_entry_size);
327     sym_az_module_entry->obj_header.az_name = name_entry;
328     _sar_save_source_pos (&sym_az_module_entry->header, module_frame);
329 
330     /* preserve module header comments */
331     sar_assoc_comment ((sym_obj_entry_type *)sym_az_module_entry);
332 
333     /*
334     ** Hang the module entry off the root entry
335     */
336 
337     sym_az_root_entry->module_hdr = sym_az_module_entry;
338 
339     /*
340     **	Have name entry point to the module entry too.  This stops the
341     **	name from being reused to name another construct.
342     */
343 
344     name_entry->az_object = (sym_entry_type *) sym_az_module_entry;
345 
346     /*
347     ** Save the source information about module name identifier
348     */
349 
350     _sar_save_source_info ( &name_entry->header , module_frame , id_frame );
351 
352     /*
353     **	Set up target frame
354     */
355 
356     target_frame->b_tag = sar_k_module_frame;
357 
358     /*
359     **	Set up listing title
360     */
361 
362     if (Uil_cmd_z_command.v_listing_file)
363 	sprintf(Uil_lst_c_title2,
364 		"Module: %s",
365 		name_entry->c_text );
366 
367     /*
368     **	Set mask to no clauses seen
369     */
370 
371     module_clauses = 0;
372 }
373 
374 /*
375 **++
376 **  FUNCTIONAL DESCRIPTION:
377 **
378 **      This function sets a version string for the module.
379 **
380 **  FORMAL PARAMETERS:
381 **
382 **      value_frame	ptr to value frame for version string
383 **
384 **  IMPLICIT INPUTS:
385 **
386 **	none
387 **
388 **  IMPLICIT OUTPUTS:
389 **
390 **      sym_az_module_entry	global that point to module entry
391 **
392 **  FUNCTION VALUE:
393 **
394 **      void
395 **
396 **  SIDE EFFECTS:
397 **
398 **      set up second line of the listing title
399 **
400 **--
401 **/
402 
sar_process_module_version(value_frame,start_frame)403 void	sar_process_module_version (value_frame, start_frame)
404 
405 yystype	    *value_frame;
406 yystype	    *start_frame;
407 
408 {
409     sym_value_entry_type    *value_entry = NULL;
410 
411     _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" );
412 
413     if ((module_clauses & m_version_clause) != 0)
414 	diag_issue_diagnostic
415 	    ( d_single_occur,
416 	      _sar_source_position( value_frame ),
417 	      "UIL", "module", "version", "clause"
418 	    );
419 
420     /*
421     ** FORWARD REFERENCING OF VERSION NO LONGER ALLOWED
422     ** If it's not a forward reference, verify its length and stick a pointer
423     ** to the value node of the version in the module entry.
424     */
425 
426     if ((value_frame->b_flags & sym_m_forward_ref) != 0)
427       diag_issue_diagnostic(d_illegal_forward_ref,
428 			    _sar_source_position(value_frame),
429 			    "Module Version"
430 	    );
431 
432     else
433 	{
434 	value_entry = (sym_value_entry_type *)
435 	    value_frame->value.az_symbol_entry;
436 
437 	if (value_entry->w_length > 31)
438 	{
439 	    diag_issue_diagnostic
440 		( d_out_range,
441 		  _sar_source_position( value_frame ),
442 		  "version string",
443 		  "0..31 characters"
444 		);
445 
446     	    value_entry->w_length = 31;
447 	}
448 
449     sym_az_module_entry->az_version = value_entry;
450 	}
451 
452     /*
453     ** Save source info
454     */
455 
456     _sar_save_source_info ( &sym_az_module_entry->az_version->header , start_frame , value_frame);
457 
458     /*
459     **	Set up listing title
460     */
461 
462     if (Uil_cmd_z_command.v_listing_file)
463 	sprintf(Uil_lst_c_title2,
464 		"Module: %s \t Version: %s",
465 		sym_az_module_entry->obj_header.az_name->c_text,
466 		value_entry->value.c_value );
467 
468     module_clauses |= m_version_clause;
469 }
470 
471 /*
472 **++
473 **  FUNCTIONAL DESCRIPTION:
474 **
475 **      This function sets the case sensitivity of names for the module.
476 **
477 **  FORMAL PARAMETERS:
478 **
479 **      token_frame	ptr to token frame for keyword sensitive or insensitive
480 **
481 **  IMPLICIT INPUTS:
482 **
483 **	sym_az_module_entry	global which points to module entry
484 **
485 **  IMPLICIT OUTPUTS:
486 **
487 **      uil_v_case_sensitive	global which control case sensitivity of names
488 **
489 **  FUNCTION VALUE:
490 **
491 **      void
492 **
493 **  SIDE EFFECTS:
494 **
495 **      none
496 **
497 **--
498 **/
499 
sar_process_module_sensitivity(token_frame,start_frame)500 void	sar_process_module_sensitivity (token_frame, start_frame)
501 
502 yystype	    *token_frame;
503 yystype	    *start_frame;
504 
505 {
506     _assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" );
507 
508     if ((module_clauses & m_names_clause) != 0)
509 	diag_issue_diagnostic
510 	    ( d_single_occur,
511 	      _sar_source_position( token_frame ),
512 	      "UIL", "module", "names", "clause"
513 	    );
514 
515     if ((module_clauses & m_after_names) != 0)
516 	diag_issue_diagnostic
517 	    ( d_names,
518 	      _sar_source_position( token_frame )
519 	    );
520 
521     uil_v_case_sensitive = (token_frame->b_type == CASE_SENSITIVE);
522 
523     sym_az_module_entry->az_case_sense = (sym_value_entry_type *)
524 					 sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size);
525 
526     sym_az_module_entry->az_case_sense->header.b_type = uil_v_case_sensitive;
527 
528     /*
529     ** Save source info
530     */
531 
532     _sar_save_source_info ( &sym_az_module_entry->az_case_sense->header , start_frame , token_frame);
533 
534     /* let the keyword table know of the sensitivity change */
535 
536     key_initialize();
537 
538 
539     /*
540     **	The default for name sensitivity is SENSITIVE.
541     **	At the point that this semantic routine is called, the only valid
542     **  name seen so far is the module name.
543     */
544 
545     module_clauses |= m_names_clause;
546 }
547 
548 /*
549 **++
550 **  FUNCTIONAL DESCRIPTION:
551 **
552 **      This function sets the default charset for the module.
553 **
554 **  FORMAL PARAMETERS:
555 **
556 **      token_frame	ptr to token frame for charset
557 **
558 **  IMPLICIT INPUTS:
559 **
560 **	sym_az_module_entry	global pointer to the module entry
561 **
562 **  IMPLICIT OUTPUTS:
563 **
564 **      Uil_lex_l_user_default_charset
565 **	Uil_lex_az_charset_entry
566 **
567 **  FUNCTION VALUE:
568 **
569 **      void
570 **
571 **  SIDE EFFECTS:
572 **
573 **      none
574 **
575 **--
576 **/
577 
sar_process_module_charset(token_frame,start_frame)578 void	sar_process_module_charset(token_frame , start_frame)
579 
580 yystype	    *token_frame;
581 yystype	    *start_frame;
582 
583 {
584     sym_value_entry_type	*value_entry = NULL;
585 
586     _assert( (token_frame->b_tag == sar_k_token_frame) ||
587 	     (token_frame->b_tag == sar_k_value_frame), "token or value frame missing" );
588 
589     if ((module_clauses & m_charset_clause) != 0)
590 	diag_issue_diagnostic
591 	    ( d_single_occur,
592 	      _sar_source_position( token_frame ),
593 	      "UIL", "module", "character_set", "clause"
594 	    );
595 
596     /*
597     **  There are two different ways that the charset info may be specified.
598     **  If the charset_frame is a token frame, then we can just grab the
599     **  token class and map it into a charset value.  If it is a value frame
600     **  the it is the result of the CHARACTER_SET function and is a string
601     **  value representing the character set.
602     */
603     switch (token_frame->b_tag)
604     {
605 	case sar_k_token_frame:
606 	    {
607 	    key_keytable_entry_type	*az_keyword_entry;
608 	    az_keyword_entry = token_frame->value.az_keyword_entry;
609 
610 	    Uil_lex_l_user_default_charset = az_keyword_entry->b_subclass;
611 
612 	    value_entry = sem_create_value_entry (
613 				 token_frame->value.az_keyword_entry->at_name,
614 				 token_frame->value.az_keyword_entry->b_length, sym_k_char_8_value );
615 	    break;
616 	    }
617 
618 	case sar_k_value_frame:
619 	    {
620 	    Uil_lex_l_user_default_charset = lex_k_userdefined_charset;
621 	    Uil_lex_az_charset_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
622 	    value_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
623 	    break;
624 	    }
625     }
626 
627     /* If charset specified for module, then localized strings not allowed */
628     Uil_lex_l_localized = FALSE;
629 
630     module_clauses |= m_charset_clause;
631     sym_az_module_entry->az_character_set = value_entry;
632 
633     /*
634     ** Save source info
635     */
636 
637     _sar_save_source_info ( &value_entry->header , start_frame , token_frame);
638 
639 }
640 
641 /*
642 **++
643 **  FUNCTIONAL DESCRIPTION:
644 **
645 **      This function saves the source record for the module header
646 **	for possible later use in the machine code listing.
647 **
648 **  FORMAL PARAMETERS:
649 **
650 **      none
651 **
652 **  IMPLICIT INPUTS:
653 **
654 **      yylval		Current token information from the lexical analyzer
655 **
656 **  IMPLICIT OUTPUTS:
657 **
658 **	src_az_module_source_record	source record for the module header
659 **
660 **  FUNCTION VALUE:
661 **
662 **      void
663 **
664 **  SIDE EFFECTS:
665 **
666 **      none
667 **
668 **--
669 **/
670 
sar_save_module_source()671 void	sar_save_module_source ()
672 
673 {
674 
675     src_az_module_source_record = yylval.az_source_record;
676 
677 }
678 
679 
680 /*
681 **++
682 **  FUNCTIONAL DESCRIPTION:
683 **
684 **	This routine creates and saves a default object specification
685 **	for the module entry itself.
686 **
687 **  FORMAL PARAMETERS:
688 **
689 **      object_frame	ptr to token frame for "OBJECT"
690 **
691 **  IMPLICIT INPUTS:
692 **
693 **      none
694 **
695 **  IMPLICIT OUTPUTS:
696 **
697 **	sym_az_module_entry	global pointer to the module entry
698 **
699 **  FUNCTION VALUE:
700 **
701 **      void
702 **
703 **  SIDE EFFECTS:
704 **
705 **      none
706 **
707 **--
708 **/
709 
sar_make_def_obj(object_frame)710 void	sar_make_def_obj (object_frame)
711 
712 yystype	    *object_frame;
713 
714 {
715 sym_def_obj_entry_type	*def_obj_entry;
716 
717 /*
718  * Make def_obj entry and link into the chain headed in the module
719  */
720 def_obj_entry = (sym_def_obj_entry_type *) sem_allocate_node
721     (sym_k_def_obj_entry, sym_k_def_obj_entry_size);
722 _sar_save_source_pos (&def_obj_entry->header, object_frame);
723 def_obj_entry->next = sym_az_module_entry->az_def_obj;
724 sym_az_module_entry->az_def_obj = def_obj_entry;
725 
726 }
727 
728 
729 /*
730 **++
731 **  FUNCTIONAL DESCRIPTION:
732 **
733 **      This function sets the default variants for objects which
734 **	are defined in the module.
735 **
736 **  FORMAL PARAMETERS:
737 **
738 **      type_frame	ptr to token frame for object type
739 **      variant_frame	ptr to token frame for variant
740 **
741 **  IMPLICIT INPUTS:
742 **
743 **      uil_gadget_variants	table to see if the gadget variant is supported
744 **      uil_urm_variant		table to see if the object type has been
745 **				specified previously
746 **	sym_az_module_entry	global pointing to the module entry
747 **
748 **  IMPLICIT OUTPUTS:
749 **
750 **      uil_urm_variant		table to contain the default variant for this
751 **				object type.
752 **
753 **  FUNCTION VALUE:
754 **
755 **      void
756 **
757 **  SIDE EFFECTS:
758 **
759 **      none
760 **
761 **--
762 **/
763 
sar_process_module_variant(obj_type_frame,variant_frame)764 void	sar_process_module_variant  (obj_type_frame, variant_frame)
765 
766 yystype	    *obj_type_frame;
767 yystype	    *variant_frame;
768 
769 {
770 
771     unsigned int		obj_type, obj_variant;
772     yystype			*source_frame;
773     sym_def_obj_entry_type	*def_obj_entry;
774 
775     source_frame = & yylval;
776 
777     obj_type = obj_type_frame->value.az_keyword_entry->b_subclass;
778     obj_variant = variant_frame->b_type;
779 
780 /*  See if this object type has been specified before.  */
781 
782     if ( uil_urm_variant[obj_type] != 0 )
783 	{
784 	diag_issue_diagnostic
785 	    (d_supersede,
786 	     _sar_source_position ( source_frame ),
787 	     diag_object_text (obj_type),
788 	     diag_tag_text (obj_variant),
789 	     diag_tag_text (sym_k_module_entry),
790 	     "" );
791 	}
792 
793 /*  See if this object type supports gadgets.  */
794 
795     if ( obj_variant == sym_k_gadget_entry )
796 	{
797 	if ( uil_gadget_variants[obj_type] == 0 )
798 	    {
799 	    diag_issue_diagnostic
800 		(d_gadget_not_sup,
801 		 _sar_source_position ( source_frame ),
802 		 diag_object_text (obj_type),
803 		 diag_object_text (obj_type) );
804 	    obj_variant = sym_k_widget_entry;
805 	    }
806 	}
807 
808 /*  Save the default variant information  */
809     uil_urm_variant[obj_type] = obj_variant;
810 
811 /*
812 ** get the latest def_obj entry and fill in
813 */
814     def_obj_entry = sym_az_module_entry->az_def_obj->next;
815     def_obj_entry->b_object_info = obj_type;
816     def_obj_entry->b_variant_info = obj_variant;
817 
818 }
819 
820 /*
821 **++
822 **  FUNCTIONAL DESCRIPTION:
823 **
824 **      This procedure saves source info for the various sections declaration
825 **	lists in the Uil file (i.e. value, identifier, procedure, object, and
826 **	list).
827 **
828 **  FORMAL PARAMETERS:
829 **
830 **      header_frame	ptr to token frame for the section declaration
831 **	section_type	integer describing what section this is
832 **
833 **  IMPLICIT INPUTS:
834 **
835 **      none
836 **
837 **  IMPLICIT OUTPUTS:
838 **
839 **	sym_az_root_entry	global pointer to the root entry
840 **
841 **  FUNCTION VALUE:
842 **
843 **      void
844 **
845 **  SIDE EFFECTS:
846 **
847 **	none
848 **
849 **--
850 */
851 
sar_save_section_source(header_frame,section_type)852 void	sar_save_section_source (header_frame, section_type)
853 
854 yystype	    *header_frame;
855 int	    section_type;
856 
857 {
858     sym_section_entry_type	*section_entry;
859 
860     section_entry = (sym_section_entry_type *) sem_allocate_node
861 			( sym_k_section_entry, sym_k_section_entry_size );
862 
863     section_entry->header.b_type = section_type;
864 
865     /*
866     ** Save source info
867     */
868 
869     _sar_save_source_info ( &section_entry->header , header_frame, header_frame);
870 
871     /*
872     ** Link this section into the current section list.
873     */
874 
875     section_entry->next = (sym_entry_type *) sym_az_current_section_entry;
876     section_entry->prev_section = sym_az_current_section_entry->prev_section;
877     sym_az_current_section_entry = section_entry;
878 
879 }
880