| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifdef REV_INFO |
| 24 |
#ifndef lint |
| 25 |
static char rcsid[] = "$TOG: uilsymdump.c /main/6 1998/04/17 11:26:22 mgreess $" |
| 26 |
#endif |
| 27 |
#endif |
| 28 |
|
| 29 |
#include <uil/UilDef.h> |
| 30 |
#include <stdio.h> |
| 31 |
#include <ctype.h> |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
Uil_status_type MessageCB (); |
| 39 |
Uil_status_type StatusCB (); |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
FILE *source_file; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
int |
| 52 |
main(int argc, char *argv[]) |
| 53 |
{ |
| 54 |
Uil_command_type command_desc; |
| 55 |
Uil_compile_desc_type compile_desc; |
| 56 |
Uil_status_type return_status; |
| 57 |
int x = 1, y = 1; |
| 58 |
char *include_list[3]; |
| 59 |
char file_name[255], listing_name[255], uid_name[255]; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
printf("Enter file to be compiled (leave off the .uil): "); |
| 65 |
|
| 66 |
*file_name = '\0'; |
| 67 |
fgets (file_name, sizeof(file_name), stdin); |
| 68 |
if (strlen(file_name) && file_name[strlen(file_name)-1] == '\n') |
| 69 |
file_name[strlen(file_name)-1] = '\0'; |
| 70 |
|
| 71 |
strcpy (uid_name, file_name); strcat (uid_name, ".uid"); |
| 72 |
strcpy (listing_name, file_name); strcat (listing_name, ".lis"); |
| 73 |
strcat (file_name, ".uil"); |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
command_desc.resource_file = uid_name; |
| 79 |
command_desc.listing_file = listing_name; |
| 80 |
command_desc.include_dir_count = 2; |
| 81 |
command_desc.include_dir = (char **)include_list; |
| 82 |
command_desc.source_file = file_name; |
| 83 |
include_list[0] = "com:"; |
| 84 |
include_list[1] = "../include"; |
| 85 |
|
| 86 |
|
| 87 |
command_desc.listing_file_flag = 1; |
| 88 |
command_desc.resource_file_flag = 1; |
| 89 |
command_desc.machine_code_flag = 1; |
| 90 |
command_desc.report_info_msg_flag = 1; |
| 91 |
command_desc.report_warn_msg_flag = 1; |
| 92 |
command_desc.parse_tree_flag = 1; |
| 93 |
command_desc.status_update_delay = 400; |
| 94 |
|
| 95 |
return_status = Uil(&command_desc, &compile_desc, MessageCB, (char *)&x, |
| 96 |
StatusCB, (char *)&y); |
| 97 |
|
| 98 |
UilDumpSymbolTable( (sym_entry_type *)compile_desc.parse_tree_root ); |
| 99 |
return return_status; |
| 100 |
} |
| 101 |
|
| 102 |
Uil_status_type MessageCB( message_user_data, |
| 103 |
msg_number, |
| 104 |
msg_severity, |
| 105 |
msg_text, |
| 106 |
src_text, |
| 107 |
ptr_text, |
| 108 |
loc_text, |
| 109 |
message_summary) |
| 110 |
|
| 111 |
int *message_user_data; |
| 112 |
int msg_number; |
| 113 |
int msg_severity; |
| 114 |
char *msg_text; |
| 115 |
char *src_text; |
| 116 |
char *ptr_text; |
| 117 |
char *loc_text; |
| 118 |
unsigned int (*message_summary)[Uil_k_max_status+1]; |
| 119 |
|
| 120 |
{ |
| 121 |
printf ("Message(%d) -- %d-%d-%s\n %s\n %s\n %s\n", |
| 122 |
*message_user_data, msg_number, msg_severity, msg_text, |
| 123 |
src_text, ptr_text, loc_text); |
| 124 |
|
| 125 |
*message_user_data = *message_user_data + 1; |
| 126 |
return Uil_k_continue; |
| 127 |
} |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
Uil_status_type StatusCB( status_user_data, |
| 132 |
percent_complete, |
| 133 |
lines_processed, |
| 134 |
current_file, |
| 135 |
message_summary) |
| 136 |
|
| 137 |
int *status_user_data; |
| 138 |
unsigned int percent_complete; |
| 139 |
unsigned int lines_processed; |
| 140 |
char *current_file; |
| 141 |
unsigned int (*message_summary)[Uil_k_max_status+1]; |
| 142 |
|
| 143 |
{ |
| 144 |
printf("Status(%d) -- Percent: %d, Lines: %d, File: %s\n", |
| 145 |
*status_user_data, percent_complete, lines_processed, current_file); |
| 146 |
|
| 147 |
*status_user_data = *status_user_data + 1; |
| 148 |
return Uil_k_continue; |
| 149 |
} |
| 150 |
|