UilSarDef.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-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. * @OSF_COPYRIGHT@
  25. * COPYRIGHT NOTICE
  26. * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  27. * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  28. * the full copyright text.
  29. */
  30. /*
  31. * HISTORY
  32. */
  33. /* $XConsortium: UilSarDef.h /main/10 1995/07/14 09:36:55 drk $ */
  34. /*
  35. * (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  36. /*
  37. **++
  38. ** FACILITY:
  39. **
  40. ** User Interface Language Compiler (UIL)
  41. **
  42. ** ABSTRACT:
  43. **
  44. ** This include file defines the interface to the UIL parser.
  45. ** UIL uses YACC as its parsing tool.
  46. **
  47. **--
  48. **/
  49. #ifndef UilSarDef_h
  50. #define UilSarDef_h
  51. /*
  52. ** Format of a value on YACC value stack. This is also the form of a
  53. ** token created by the lexical analyzer.
  54. */
  55. #define sar_k_null_frame 0 /* tag for an epsilon production */
  56. #define sar_k_token_frame 1 /* tag for a token frame */
  57. #define sar_k_value_frame 2 /* tag for a value frame */
  58. #define sar_k_module_frame 3 /* tag for module frame */
  59. #define sar_k_object_frame 4 /* tag for object frame */
  60. #define sar_k_root_frame 5 /* tag for root frame */
  61. typedef struct
  62. {
  63. src_source_record_type *az_source_record; /* actual record where token exists */
  64. unsigned char b_source_pos; /* the character in az_source_record
  65. where this token begins */
  66. unsigned char b_source_end; /* the character in az_source_record
  67. where this token ends */
  68. unsigned char b_tag; /* tag of stack frame */
  69. unsigned char b_type; /* for tokens - token number
  70. for value - the data type */
  71. unsigned short b_flags; /* used by value */
  72. unsigned char b_direction; /* used by value */
  73. unsigned char b_charset; /* used by value */
  74. union
  75. {
  76. /* must be capable of holding a pointer */
  77. long l_integer; /* integer value*/
  78. sym_entry_type *az_symbol_entry; /* symbol entry */
  79. key_keytable_entry_type
  80. *az_keyword_entry; /* keyword entry */
  81. } value;
  82. } yystype;
  83. /*
  84. ** Macros for moving source information to and from parse stack frames
  85. */
  86. #define _sar_move_source_info( _target, _source ) \
  87. { \
  88. yystype *__target; \
  89. yystype *__source; \
  90. \
  91. __target = (_target); __source = (_source); \
  92. __target->az_source_record = __source->az_source_record;\
  93. __target->b_source_pos = __source->b_source_pos; \
  94. __target->b_source_end = __source->b_source_end; \
  95. }
  96. #define _sar_move_source_info_2( _target, _source ) \
  97. { \
  98. sym_entry_header_type *__target; \
  99. sym_entry_header_type *__source; \
  100. \
  101. __target = (_target); __source = (_source); \
  102. \
  103. __target->az_src_rec = __source->az_src_rec; \
  104. __target->b_src_pos = __source->b_src_pos; \
  105. __target->b_end_pos = __source->b_end_pos; \
  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. #define _sar_save_source_pos( _target, _src ) \
  120. { \
  121. sym_entry_header_type *__target; \
  122. XmConst yystype *__src; \
  123. \
  124. __target = (_target); __src = (_src); \
  125. \
  126. __target->az_src_rec = __src->az_source_record; \
  127. __target->b_src_pos = __src->b_source_pos; \
  128. __target->b_end_pos = __src->b_source_end; \
  129. }
  130. #define _sar_source_position( _source ) \
  131. _source->az_source_record, \
  132. _source->b_source_pos
  133. #define _sar_source_pos2( _source ) \
  134. _source->header.az_src_rec, \
  135. _source->header.b_src_pos
  136. #endif /* UilSarDef_h */
  137. /* DON'T ADD STUFF AFTER THIS #endif */