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 24 /* 25 **++ 26 ** FACILITY: 27 ** 28 ** User Interface Language Compiler (UIL) 29 ** 30 ** ABSTRACT: 31 ** 32 ** This include file defines the interface to the UIL parser. 33 ** UIL uses YACC as its parsing tool. 34 ** 35 **-- 36 **/ 37 38 #ifndef UilSarDef_h 39 #define UilSarDef_h 40 41 42 43 /* 44 ** Format of a value on YACC value stack. This is also the form of a 45 ** token created by the lexical analyzer. 46 */ 47 48 #define sar_k_null_frame 0 /* tag for an epsilon production */ 49 #define sar_k_token_frame 1 /* tag for a token frame */ 50 #define sar_k_value_frame 2 /* tag for a value frame */ 51 #define sar_k_module_frame 3 /* tag for module frame */ 52 #define sar_k_object_frame 4 /* tag for object frame */ 53 #define sar_k_root_frame 5 /* tag for root frame */ 54 55 typedef struct 56 { 57 src_source_record_type *az_source_record; /* actual record where token exists */ 58 unsigned char b_source_pos; /* the character in az_source_record 59 where this token begins */ 60 unsigned char b_source_end; /* the character in az_source_record 61 where this token ends */ 62 unsigned char b_tag; /* tag of stack frame */ 63 unsigned char b_type; /* for tokens - token number 64 for value - the data type */ 65 unsigned short b_flags; /* used by value */ 66 unsigned char b_direction; /* used by value */ 67 unsigned char b_charset; /* used by value */ 68 union 69 { 70 /* must be capable of holding a pointer */ 71 long l_integer; /* integer value*/ 72 sym_entry_type *az_symbol_entry; /* symbol entry */ 73 key_keytable_entry_type 74 *az_keyword_entry; /* keyword entry */ 75 } value; 76 } yystype; 77 78 79 /* 80 ** Macros for moving source information to and from parse stack frames 81 */ 82 83 #define _sar_move_source_info( _target, _source ) \ 84 { \ 85 yystype *__target; \ 86 yystype *__source; \ 87 \ 88 __target = (_target); __source = (_source); \ 89 __target->az_source_record = __source->az_source_record;\ 90 __target->b_source_pos = __source->b_source_pos; \ 91 __target->b_source_end = __source->b_source_end; \ 92 } 93 94 #define _sar_move_source_info_2( _target, _source ) \ 95 { \ 96 sym_entry_header_type *__target; \ 97 sym_entry_header_type *__source; \ 98 \ 99 __target = (_target); __source = (_source); \ 100 \ 101 __target->az_src_rec = __source->az_src_rec; \ 102 __target->b_src_pos = __source->b_src_pos; \ 103 __target->b_end_pos = __source->b_end_pos; \ 104 } 105 106 107 #define _sar_save_source_info( _target, _src_beg, _src_end ) \ 108 { \ 109 sym_entry_header_type *__target; \ 110 XmConst yystype *__src_end; \ 111 \ 112 __target = (_target); \ 113 __src_end = (_src_end); \ 114 \ 115 __target->az_src_rec = __src_end->az_source_record; \ 116 __target->b_src_pos = __src_end->b_source_pos; \ 117 __target->b_end_pos = __src_end->b_source_end; \ 118 } 119 120 #define _sar_save_source_pos( _target, _src ) \ 121 { \ 122 sym_entry_header_type *__target; \ 123 XmConst yystype *__src; \ 124 \ 125 __target = (_target); __src = (_src); \ 126 \ 127 __target->az_src_rec = __src->az_source_record; \ 128 __target->b_src_pos = __src->b_source_pos; \ 129 __target->b_end_pos = __src->b_source_end; \ 130 } 131 132 #define _sar_source_position( _source ) \ 133 _source->az_source_record, \ 134 _source->b_source_pos 135 136 #define _sar_source_pos2( _source ) \ 137 _source->header.az_src_rec, \ 138 _source->header.b_src_pos 139 140 141 142 #endif /* UilSarDef_h */ 143 /* DON'T ADD STUFF AFTER THIS #endif */ 144