Blame clients/uil/UilSarMod.c

Packit b099d7
/* 
Packit b099d7
 * Motif
Packit b099d7
 *
Packit b099d7
 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are free software; you can
Packit b099d7
 * redistribute them and/or modify them under the terms of the GNU
Packit b099d7
 * Lesser General Public License as published by the Free Software
Packit b099d7
 * Foundation; either version 2 of the License, or (at your option)
Packit b099d7
 * any later version.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are distributed in the hope that
Packit b099d7
 * they will be useful, but WITHOUT ANY WARRANTY; without even the
Packit b099d7
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Packit b099d7
 * PURPOSE. See the GNU Lesser General Public License for more
Packit b099d7
 * details.
Packit b099d7
 *
Packit b099d7
 * You should have received a copy of the GNU Lesser General Public
Packit b099d7
 * License along with these librararies and programs; if not, write
Packit b099d7
 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Packit b099d7
 * Floor, Boston, MA 02110-1301 USA
Packit b099d7
*/ 
Packit b099d7
/* 
Packit b099d7
 * HISTORY
Packit b099d7
*/ 
Packit b099d7
#ifdef REV_INFO
Packit b099d7
#ifndef lint
Packit b099d7
static char rcsid[] = "$TOG: UilSarMod.c /main/13 1997/03/12 15:21:36 dbl $"
Packit b099d7
#endif
Packit b099d7
#endif
Packit b099d7
Packit b099d7
#ifdef HAVE_CONFIG_H
Packit b099d7
#include <config.h>
Packit b099d7
#endif
Packit b099d7
Packit b099d7
Packit b099d7
/*
Packit b099d7
*  (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
Packit b099d7
Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FACILITY:
Packit b099d7
**
Packit b099d7
**      User Interface Language Compiler (UIL)
Packit b099d7
**
Packit b099d7
**  ABSTRACT:
Packit b099d7
**
Packit b099d7
**      This module contain the routines for processing the module construct.
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  INCLUDE FILES
Packit b099d7
**
Packit b099d7
**/
Packit b099d7
Packit b099d7
#include "UilDefI.h"
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  TABLE OF CONTENTS
Packit b099d7
**
Packit b099d7
*/
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  DEFINE and MACRO DEFINITIONS
Packit b099d7
**
Packit b099d7
**/
Packit b099d7
Packit b099d7
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  EXTERNAL VARIABLE DECLARATIONS
Packit b099d7
**
Packit b099d7
**/
Packit b099d7
Packit b099d7
extern   yystype			yylval;
Packit b099d7
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  GLOBAL VARIABLE DECLARATIONS
Packit b099d7
**
Packit b099d7
**/
Packit b099d7
Packit b099d7
externaldef(uil_comp_glbl) src_source_record_type
Packit b099d7
	*src_az_module_source_record;
Packit b099d7
externaldef(uil_comp_glbl) unsigned short int	
Packit b099d7
	*uil_urm_variant = NULL;
Packit b099d7
externaldef(uil_comp_glbl) unsigned short int
Packit b099d7
	*uil_arg_compr = NULL;
Packit b099d7
externaldef(uil_comp_glbl) unsigned short int
Packit b099d7
	*uil_reas_compr = NULL;
Packit b099d7
externaldef(uil_comp_glbl) unsigned short int
Packit b099d7
	*uil_widget_compr = NULL;
Packit b099d7
externaldef(uil_comp_glbl) unsigned short int
Packit b099d7
	*uil_child_compr = NULL;
Packit b099d7
Packit b099d7
/*
Packit b099d7
**
Packit b099d7
**  OWN VARIABLE DECLARATIONS
Packit b099d7
**
Packit b099d7
**/
Packit b099d7
Packit b099d7
unsigned int	module_clauses;
Packit b099d7
Packit b099d7
#define m_version_clause	(1<<0)
Packit b099d7
#define m_names_clause		(1<<1)
Packit b099d7
#define m_charset_clause	(1<<2)
Packit b099d7
#define m_objects_clause	(1<<3)
Packit b099d7
Packit b099d7
#define m_after_names		(m_charset_clause)
Packit b099d7
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**	This function initializes all static data structure for the semantic
Packit b099d7
**	action routines.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      uil_urm_variant
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      global variables are initialized 
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_initialize ()
Packit b099d7
Packit b099d7
{
Packit b099d7
int		i;	/* loop index */
Packit b099d7
Packit b099d7
/* BEGIN OSF Fix CR 5443 */
Packit b099d7
/* Initialize uil_sym_default_charset based on XmFALLBACK_CHARSET */
Packit b099d7
if (strcmp(XmFALLBACK_CHARSET, "ISO8859-1") != 0) /* Most common case. */
Packit b099d7
  for (i = 0; i < (int)charset_lang_table_max; i++)
Packit b099d7
    if (strcmp(XmFALLBACK_CHARSET, charset_lang_names_table[i]) == 0)
Packit b099d7
      {
Packit b099d7
	uil_sym_default_charset = charset_lang_codes_table[i];
Packit b099d7
	break;
Packit b099d7
      }
Packit b099d7
/* END OSF Fix CR 5443 */
Packit b099d7
Packit b099d7
/*
Packit b099d7
 * Allocate vectors for the variant and usage vectors if they are NULL,
Packit b099d7
 */
Packit b099d7
if ( uil_urm_variant == NULL )
Packit b099d7
    uil_urm_variant = (unsigned short int *)
Packit b099d7
	XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
Packit b099d7
if ( uil_arg_compr == NULL )
Packit b099d7
    uil_arg_compr = (unsigned short int *)
Packit b099d7
	XtMalloc(sizeof(unsigned short int)*(uil_max_arg+1));
Packit b099d7
if ( uil_reas_compr == NULL )
Packit b099d7
    uil_reas_compr = (unsigned short int *)
Packit b099d7
	XtMalloc(sizeof(unsigned short int)*(uil_max_reason+1));
Packit b099d7
if ( uil_widget_compr == NULL )
Packit b099d7
    uil_widget_compr = (unsigned short int *)
Packit b099d7
	XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
Packit b099d7
if ( uil_child_compr == NULL )
Packit b099d7
    uil_child_compr = (unsigned short int *)
Packit b099d7
	XtMalloc(sizeof(unsigned short int)*(uil_max_child+1));
Packit b099d7
/*
Packit b099d7
 **	Loop throught the array of object variants and set them all to NULL.
Packit b099d7
 */
Packit b099d7
for (i = 0; i
Packit b099d7
    uil_urm_variant[i] = 0;   
Packit b099d7
Packit b099d7
/*
Packit b099d7
 ** Initialize all compression vectors
Packit b099d7
 */
Packit b099d7
for ( i=0 ; i
Packit b099d7
    uil_arg_compr[i] = 0;
Packit b099d7
for ( i=0 ; i
Packit b099d7
    uil_reas_compr[i] = 0;
Packit b099d7
for ( i=0 ; i
Packit b099d7
    uil_widget_compr[i] = 0;
Packit b099d7
for ( i=0 ; i
Packit b099d7
    uil_child_compr[i] = 0;
Packit b099d7
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function creates the root entry node for the compilation.
Packit b099d7
**	The "root" entry is the root node of the symbol tree and is
Packit b099d7
**	what's passed back to the caller of the compiler.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      root_frame	ptr to root frame that will remain on the stack
Packit b099d7
**			throughout the compilation
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_root_entry		global pointer used thoughout the compilation
Packit b099d7
**	sym_az_curent_section_entry	global pointer used thoughout the compilation
Packit b099d7
**	src_az_first_source_record	global pointer to the source record list
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**	none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_create_root (root_frame)
Packit b099d7
Packit b099d7
yystype	    *root_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
    /*
Packit b099d7
    ** Allocate the symbol nodes
Packit b099d7
    */
Packit b099d7
Packit b099d7
    sym_az_root_entry = (sym_root_entry_type *)
Packit b099d7
		sem_allocate_node (sym_k_root_entry, sym_k_root_entry_size);
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Create a place holder entry (tail) and change the "current" section list to it.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    sym_az_current_section_entry = (sym_section_entry_type *) sem_allocate_node
Packit b099d7
			    ( sym_k_section_entry, sym_k_section_entry_size );
Packit b099d7
Packit b099d7
    sym_az_current_section_entry->header.b_type = sym_k_section_tail;
Packit b099d7
Packit b099d7
    sym_az_root_entry->sections = sym_az_current_section_entry;
Packit b099d7
    sym_az_root_entry->src_record_list = src_az_first_source_record;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save the file name and the expanded version of it.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    strcpy (sym_az_root_entry->file_name, Uil_cmd_z_command.ac_source_file);
Packit b099d7
    strcpy (sym_az_root_entry->full_file_name, src_az_source_file_table[0]->expanded_name);
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save the symbol node in the root frame.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    root_frame->b_tag = sar_k_root_frame;
Packit b099d7
    root_frame->b_type = sym_k_root_entry;
Packit b099d7
    root_frame->value.az_symbol_entry = (sym_entry_type *)sym_az_root_entry;
Packit b099d7
Packit b099d7
}
Packit b099d7
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function create the module entry symbol node for the compilation.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      target_frame	ptr to module frame that will remain on the stack
Packit b099d7
**			throughout the compilation
Packit b099d7
**	id_frame	ptr to token frame for the module name
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_root_entry	global that points to the root entry
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      sym_az_module_entry	global that points to module entry
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      set second line of the listing title
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_create_module(target_frame, id_frame, module_frame)
Packit b099d7
Packit b099d7
yystype	    *target_frame;
Packit b099d7
yystype	    *id_frame;
Packit b099d7
yystype	    *module_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
    sym_name_entry_type	    *name_entry;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **  Call standard routine to check name entry for id_frame.
Packit b099d7
    **	This routine handles font name, color names, etc used as ids
Packit b099d7
    */
Packit b099d7
Packit b099d7
    name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame );
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Allocate the module entry and fill it in
Packit b099d7
    */
Packit b099d7
Packit b099d7
    sym_az_module_entry = (sym_module_entry_type *)
Packit b099d7
	sem_allocate_node (sym_k_module_entry, sym_k_module_entry_size);
Packit b099d7
    sym_az_module_entry->obj_header.az_name = name_entry;
Packit b099d7
    _sar_save_source_pos (&sym_az_module_entry->header, module_frame);
Packit b099d7
Packit b099d7
    /* preserve module header comments */
Packit b099d7
    sar_assoc_comment ((sym_obj_entry_type *)sym_az_module_entry);  
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Hang the module entry off the root entry
Packit b099d7
    */
Packit b099d7
Packit b099d7
    sym_az_root_entry->module_hdr = sym_az_module_entry;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Have name entry point to the module entry too.  This stops the
Packit b099d7
    **	name from being reused to name another construct.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    name_entry->az_object = (sym_entry_type *) sym_az_module_entry;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save the source information about module name identifier
Packit b099d7
    */
Packit b099d7
Packit b099d7
    _sar_save_source_info ( &name_entry->header , module_frame , id_frame );
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Set up target frame
Packit b099d7
    */
Packit b099d7
Packit b099d7
    target_frame->b_tag = sar_k_module_frame;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Set up listing title
Packit b099d7
    */
Packit b099d7
Packit b099d7
    if (Uil_cmd_z_command.v_listing_file)
Packit b099d7
	sprintf(Uil_lst_c_title2, 
Packit b099d7
		"Module: %s", 
Packit b099d7
		name_entry->c_text );
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Set mask to no clauses seen
Packit b099d7
    */
Packit b099d7
Packit b099d7
    module_clauses = 0;
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function sets a version string for the module.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      value_frame	ptr to value frame for version string
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**	none
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      sym_az_module_entry	global that point to module entry
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      set up second line of the listing title
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_process_module_version (value_frame, start_frame)
Packit b099d7
Packit b099d7
yystype	    *value_frame;
Packit b099d7
yystype	    *start_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
    sym_value_entry_type    *value_entry;
Packit b099d7
Packit b099d7
    _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" );
Packit b099d7
Packit b099d7
    if ((module_clauses & m_version_clause) != 0)
Packit b099d7
	diag_issue_diagnostic
Packit b099d7
	    ( d_single_occur,
Packit b099d7
	      _sar_source_position( value_frame ),
Packit b099d7
	      "UIL", "module", "version", "clause"
Packit b099d7
	    );
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** FORWARD REFERENCING OF VERSION NO LONGER ALLOWED
Packit b099d7
    ** If it's not a forward reference, verify its length and stick a pointer
Packit b099d7
    ** to the value node of the version in the module entry.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    if ((value_frame->b_flags & sym_m_forward_ref) != 0)
Packit b099d7
      diag_issue_diagnostic(d_illegal_forward_ref,
Packit b099d7
			    _sar_source_position(value_frame),
Packit b099d7
			    "Module Version"
Packit b099d7
	    );
Packit b099d7
Packit b099d7
    else
Packit b099d7
	{
Packit b099d7
	value_entry = (sym_value_entry_type *) 
Packit b099d7
	    value_frame->value.az_symbol_entry;
Packit b099d7
Packit b099d7
	if (value_entry->w_length > 31)
Packit b099d7
	{
Packit b099d7
	    diag_issue_diagnostic
Packit b099d7
		( d_out_range,
Packit b099d7
		  _sar_source_position( value_frame ),
Packit b099d7
		  "version string",
Packit b099d7
		  "0..31 characters"
Packit b099d7
		);
Packit b099d7
Packit b099d7
    	    value_entry->w_length = 31;
Packit b099d7
	}
Packit b099d7
Packit b099d7
    sym_az_module_entry->az_version = value_entry;
Packit b099d7
	}
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save source info
Packit b099d7
    */
Packit b099d7
Packit b099d7
    _sar_save_source_info ( &sym_az_module_entry->az_version->header , start_frame , value_frame);
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	Set up listing title
Packit b099d7
    */
Packit b099d7
Packit b099d7
    if (Uil_cmd_z_command.v_listing_file)
Packit b099d7
	sprintf(Uil_lst_c_title2, 
Packit b099d7
		"Module: %s \t Version: %s", 
Packit b099d7
		sym_az_module_entry->obj_header.az_name->c_text,
Packit b099d7
		value_entry->value.c_value );
Packit b099d7
Packit b099d7
    module_clauses |= m_version_clause;
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function sets the case sensitivity of names for the module.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      token_frame	ptr to token frame for keyword sensitive or insensitive
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_module_entry	global which points to module entry
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      uil_v_case_sensitive	global which control case sensitivity of names
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_process_module_sensitivity (token_frame, start_frame)
Packit b099d7
Packit b099d7
yystype	    *token_frame;
Packit b099d7
yystype	    *start_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
    _assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" );
Packit b099d7
Packit b099d7
    if ((module_clauses & m_names_clause) != 0)
Packit b099d7
	diag_issue_diagnostic
Packit b099d7
	    ( d_single_occur,
Packit b099d7
	      _sar_source_position( token_frame ),
Packit b099d7
	      "UIL", "module", "names", "clause"
Packit b099d7
	    );
Packit b099d7
Packit b099d7
    if ((module_clauses & m_after_names) != 0)
Packit b099d7
	diag_issue_diagnostic
Packit b099d7
	    ( d_names,
Packit b099d7
	      _sar_source_position( token_frame )
Packit b099d7
	    );
Packit b099d7
Packit b099d7
    uil_v_case_sensitive = (token_frame->b_type == CASE_SENSITIVE);
Packit b099d7
Packit b099d7
    sym_az_module_entry->az_case_sense = (sym_value_entry_type *)
Packit b099d7
					 sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size);
Packit b099d7
Packit b099d7
    sym_az_module_entry->az_case_sense->header.b_type = uil_v_case_sensitive;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save source info
Packit b099d7
    */
Packit b099d7
Packit b099d7
    _sar_save_source_info ( &sym_az_module_entry->az_case_sense->header , start_frame , token_frame);
Packit b099d7
Packit b099d7
    /* let the keyword table know of the sensitivity change */
Packit b099d7
Packit b099d7
    key_initialize();
Packit b099d7
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **	The default for name sensitivity is SENSITIVE.
Packit b099d7
    **	At the point that this semantic routine is called, the only valid
Packit b099d7
    **  name seen so far is the module name.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    module_clauses |= m_names_clause;
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function sets the default charset for the module.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      token_frame	ptr to token frame for charset
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_module_entry	global pointer to the module entry
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      Uil_lex_l_user_default_charset
Packit b099d7
**	Uil_lex_az_charset_entry
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_process_module_charset(token_frame , start_frame)
Packit b099d7
Packit b099d7
yystype	    *token_frame;
Packit b099d7
yystype	    *start_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
    sym_value_entry_type	*value_entry;
Packit b099d7
Packit b099d7
    _assert( (token_frame->b_tag == sar_k_token_frame) ||
Packit b099d7
	     (token_frame->b_tag == sar_k_value_frame), "token or value frame missing" );
Packit b099d7
Packit b099d7
    if ((module_clauses & m_charset_clause) != 0)
Packit b099d7
	diag_issue_diagnostic
Packit b099d7
	    ( d_single_occur,
Packit b099d7
	      _sar_source_position( token_frame ),
Packit b099d7
	      "UIL", "module", "character_set", "clause"
Packit b099d7
	    );
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    **  There are two different ways that the charset info may be specified.
Packit b099d7
    **  If the charset_frame is a token frame, then we can just grab the
Packit b099d7
    **  token class and map it into a charset value.  If it is a value frame
Packit b099d7
    **  the it is the result of the CHARACTER_SET function and is a string
Packit b099d7
    **  value representing the character set.
Packit b099d7
    */
Packit b099d7
    switch (token_frame->b_tag)
Packit b099d7
    {
Packit b099d7
	case sar_k_token_frame:
Packit b099d7
	    {
Packit b099d7
	    key_keytable_entry_type	*az_keyword_entry;
Packit b099d7
	    az_keyword_entry = token_frame->value.az_keyword_entry;
Packit b099d7
Packit b099d7
	    Uil_lex_l_user_default_charset = az_keyword_entry->b_subclass;
Packit b099d7
Packit b099d7
	    value_entry = sem_create_value_entry (
Packit b099d7
				 token_frame->value.az_keyword_entry->at_name,
Packit b099d7
				 token_frame->value.az_keyword_entry->b_length, sym_k_char_8_value );
Packit b099d7
	    break;
Packit b099d7
	    }
Packit b099d7
     
Packit b099d7
	case sar_k_value_frame:
Packit b099d7
	    {
Packit b099d7
	    Uil_lex_l_user_default_charset = lex_k_userdefined_charset;
Packit b099d7
	    Uil_lex_az_charset_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
Packit b099d7
	    value_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
Packit b099d7
	    break;
Packit b099d7
	    }
Packit b099d7
    }
Packit b099d7
Packit b099d7
    /* If charset specified for module, then localized strings not allowed */
Packit b099d7
    Uil_lex_l_localized = FALSE;
Packit b099d7
    
Packit b099d7
    module_clauses |= m_charset_clause;
Packit b099d7
    sym_az_module_entry->az_character_set = value_entry;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save source info
Packit b099d7
    */
Packit b099d7
Packit b099d7
    _sar_save_source_info ( &value_entry->header , start_frame , token_frame);
Packit b099d7
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function saves the source record for the module header
Packit b099d7
**	for possible later use in the machine code listing.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      yylval		Current token information from the lexical analyzer
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**	src_az_module_source_record	source record for the module header
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_save_module_source ()
Packit b099d7
Packit b099d7
{
Packit b099d7
Packit b099d7
    src_az_module_source_record = yylval.az_source_record;
Packit b099d7
Packit b099d7
}
Packit b099d7
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**	This routine creates and saves a default object specification
Packit b099d7
**	for the module entry itself.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      object_frame	ptr to token frame for "OBJECT" 
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_module_entry	global pointer to the module entry
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_make_def_obj (object_frame)
Packit b099d7
Packit b099d7
yystype	    *object_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
sym_def_obj_entry_type	*def_obj_entry;
Packit b099d7
Packit b099d7
/*
Packit b099d7
 * Make def_obj entry and link into the chain headed in the module
Packit b099d7
 */
Packit b099d7
def_obj_entry = (sym_def_obj_entry_type *) sem_allocate_node
Packit b099d7
    (sym_k_def_obj_entry, sym_k_def_obj_entry_size);
Packit b099d7
_sar_save_source_pos (&def_obj_entry->header, object_frame);
Packit b099d7
def_obj_entry->next = sym_az_module_entry->az_def_obj;
Packit b099d7
sym_az_module_entry->az_def_obj = def_obj_entry;
Packit b099d7
Packit b099d7
}
Packit b099d7
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This function sets the default variants for objects which
Packit b099d7
**	are defined in the module.
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      type_frame	ptr to token frame for object type
Packit b099d7
**      variant_frame	ptr to token frame for variant
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      uil_gadget_variants	table to see if the gadget variant is supported
Packit b099d7
**      uil_urm_variant		table to see if the object type has been
Packit b099d7
**				specified previously
Packit b099d7
**	sym_az_module_entry	global pointing to the module entry
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**      uil_urm_variant		table to contain the default variant for this
Packit b099d7
**				object type.
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
**/
Packit b099d7
Packit b099d7
void	sar_process_module_variant  (obj_type_frame, variant_frame)
Packit b099d7
Packit b099d7
yystype	    *obj_type_frame;
Packit b099d7
yystype	    *variant_frame;
Packit b099d7
Packit b099d7
{
Packit b099d7
Packit b099d7
    unsigned int		obj_type, obj_variant;
Packit b099d7
    yystype			*source_frame;
Packit b099d7
    sym_def_obj_entry_type	*def_obj_entry;
Packit b099d7
Packit b099d7
    source_frame = & yylval;
Packit b099d7
Packit b099d7
    obj_type = obj_type_frame->value.az_keyword_entry->b_subclass;
Packit b099d7
    obj_variant = variant_frame->b_type;
Packit b099d7
Packit b099d7
/*  See if this object type has been specified before.  */
Packit b099d7
Packit b099d7
    if ( uil_urm_variant[obj_type] != 0 )
Packit b099d7
	{
Packit b099d7
	diag_issue_diagnostic
Packit b099d7
	    (d_supersede,
Packit b099d7
	     _sar_source_position ( source_frame ),
Packit b099d7
	     diag_object_text (obj_type),
Packit b099d7
	     diag_tag_text (obj_variant),
Packit b099d7
	     diag_tag_text (sym_k_module_entry),
Packit b099d7
	     "" );
Packit b099d7
	}
Packit b099d7
Packit b099d7
/*  See if this object type supports gadgets.  */
Packit b099d7
Packit b099d7
    if ( obj_variant == sym_k_gadget_entry )
Packit b099d7
	{
Packit b099d7
	if ( uil_gadget_variants[obj_type] == 0 )
Packit b099d7
	    {
Packit b099d7
	    diag_issue_diagnostic
Packit b099d7
		(d_gadget_not_sup,
Packit b099d7
		 _sar_source_position ( source_frame ),
Packit b099d7
		 diag_object_text (obj_type),
Packit b099d7
		 diag_object_text (obj_type) );
Packit b099d7
	    obj_variant = sym_k_widget_entry;
Packit b099d7
	    }
Packit b099d7
	}
Packit b099d7
Packit b099d7
/*  Save the default variant information  */
Packit b099d7
    uil_urm_variant[obj_type] = obj_variant;
Packit b099d7
Packit b099d7
/*
Packit b099d7
** get the latest def_obj entry and fill in
Packit b099d7
*/
Packit b099d7
    def_obj_entry = sym_az_module_entry->az_def_obj->next;
Packit b099d7
    def_obj_entry->b_object_info = obj_type;
Packit b099d7
    def_obj_entry->b_variant_info = obj_variant;
Packit b099d7
Packit b099d7
}
Packit b099d7

Packit b099d7
/*
Packit b099d7
**++
Packit b099d7
**  FUNCTIONAL DESCRIPTION:
Packit b099d7
**
Packit b099d7
**      This procedure saves source info for the various sections declaration
Packit b099d7
**	lists in the Uil file (i.e. value, identifier, procedure, object, and
Packit b099d7
**	list).
Packit b099d7
**
Packit b099d7
**  FORMAL PARAMETERS:
Packit b099d7
**
Packit b099d7
**      header_frame	ptr to token frame for the section declaration
Packit b099d7
**	section_type	integer describing what section this is
Packit b099d7
**
Packit b099d7
**  IMPLICIT INPUTS:
Packit b099d7
**
Packit b099d7
**      none
Packit b099d7
**
Packit b099d7
**  IMPLICIT OUTPUTS:
Packit b099d7
**
Packit b099d7
**	sym_az_root_entry	global pointer to the root entry
Packit b099d7
**
Packit b099d7
**  FUNCTION VALUE:
Packit b099d7
**
Packit b099d7
**      void
Packit b099d7
**
Packit b099d7
**  SIDE EFFECTS:
Packit b099d7
**
Packit b099d7
**	none
Packit b099d7
**
Packit b099d7
**--
Packit b099d7
*/
Packit b099d7
Packit b099d7
void	sar_save_section_source (header_frame, section_type)
Packit b099d7
Packit b099d7
yystype	    *header_frame;
Packit b099d7
int	    section_type;
Packit b099d7
Packit b099d7
{
Packit b099d7
    sym_section_entry_type	*section_entry;
Packit b099d7
Packit b099d7
    section_entry = (sym_section_entry_type *) sem_allocate_node
Packit b099d7
			( sym_k_section_entry, sym_k_section_entry_size );
Packit b099d7
Packit b099d7
    section_entry->header.b_type = section_type;
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Save source info
Packit b099d7
    */
Packit b099d7
Packit b099d7
    _sar_save_source_info ( &section_entry->header , header_frame, header_frame);
Packit b099d7
Packit b099d7
    /*
Packit b099d7
    ** Link this section into the current section list.
Packit b099d7
    */
Packit b099d7
Packit b099d7
    section_entry->next = (sym_entry_type *) sym_az_current_section_entry;
Packit b099d7
    section_entry->prev_section = sym_az_current_section_entry->prev_section;
Packit b099d7
    sym_az_current_section_entry = section_entry;
Packit b099d7
Packit b099d7
}