1with Ada.Characters.Wide_Wide_Latin_1; 2with Ada.Integer_Wide_Wide_Text_IO; 3with Ada.Strings.Wide_Wide_Unbounded; 4with Ada.Wide_Wide_Text_IO; 5 6with misc_defs, misc, sym; 7use misc_defs; 8with Matreshka.Internals.Unicode.Ucd; 9with Unicode; 10with scanner.DFA; use scanner.DFA; 11with scanner.IO; use scanner.IO; 12package body scanner is 13 use Ada.Integer_Wide_Wide_Text_IO; 14 use Ada.Strings.Wide_Wide_Unbounded; 15 use Ada.Wide_Wide_Text_IO; 16 use Parser_Tokens; 17 use Unicode; 18 19 function "+" (Item : Wide_Wide_String) return Unbounded_Wide_Wide_String 20 renames To_Unbounded_Wide_Wide_String; 21 22beglin : boolean := false; 23i, bracelevel: integer; 24 25 function YYLex return Token is 26 toktype : Token; 27 didadef, indented_code : boolean; 28 cclval : Integer; 29 nmdefptr : Unbounded_Wide_Wide_String; 30 nmdef : Unbounded_Wide_Wide_String; 31 tmpbuf : Unbounded_Wide_Wide_String; 32 33 procedure ACTION_ECHO is 34 begin 35 Put (temp_action_file, YYText (1 .. YYLength)); 36 end ACTION_ECHO; 37 38 procedure MARK_END_OF_PROLOG is 39 begin 40 Put (temp_action_file, "%%%% end of prolog"); 41 New_Line (temp_action_file); 42 end MARK_END_OF_PROLOG; 43 44 --------------------- 45 -- Put_Back_String -- 46 --------------------- 47 48 procedure Put_Back_String 49 (Str : Unbounded_Wide_Wide_String; Start : Integer) is 50 begin 51 for J in reverse Start + 1 .. Length (Str) loop 52 unput (Element (Str, J)); 53 end loop; 54 end Put_Back_String; 55 56 function check_yylex_here return boolean is 57 begin 58 return yytext'length >= 2 59 and then ((yytext(1) = '#') and (yytext(2) = '#')); 60 end check_yylex_here; 61 62 function YYLex return Token is 63 64 subtype short is Integer range -32768..32767; 65 66 yy_act : Integer; 67 yy_c : short; 68 69 -- returned upon end-of-file 70 YY_END_TOK : constant Integer := 0; 71 YY_END_OF_BUFFER : constant := 84; 72 YY_JAMSTATE : constant := 331; 73 YY_FIRST_TEMPLATE : constant := 332; 74YY_Current_State : YY_State_Type; 75 INITIAL : constant YY_State_Type := 0; 76 SECT2 : constant YY_State_Type := 1; 77 SECT2PROLOG : constant YY_State_Type := 2; 78 SECT3 : constant YY_State_Type := 3; 79 PICKUPDEF : constant YY_State_Type := 4; 80 SC : constant YY_State_Type := 5; 81 CARETISBOL : constant YY_State_Type := 6; 82 NUM : constant YY_State_Type := 7; 83 QUOTE : constant YY_State_Type := 8; 84 FIRSTCCL : constant YY_State_Type := 9; 85 CCL : constant YY_State_Type := 10; 86 ACTION : constant YY_State_Type := 11; 87 RECOVER : constant YY_State_Type := 12; 88 BRACEERROR : constant YY_State_Type := 13; 89 ACTION_STRING : constant YY_State_Type := 14; 90yy_accept : constant array(0..331) of short := 91 ( 0, 92 0, 0, 0, 0, 0, 0, 82, 82, 0, 0, 93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95 84, 13, 6, 12, 10, 1, 11, 13, 13, 13, 96 9, 40, 31, 32, 25, 40, 39, 23, 40, 40, 97 40, 31, 21, 40, 40, 24, 83, 19, 82, 82, 98 15, 14, 16, 46, 83, 42, 43, 45, 47, 61, 99 62, 59, 58, 60, 48, 50, 49, 48, 54, 53, 100 54, 54, 56, 56, 56, 57, 67, 72, 71, 73, 101 67, 73, 68, 65, 66, 83, 17, 64, 63, 74, 102 103 76, 77, 78, 6, 12, 10, 1, 11, 0, 0, 104 2, 0, 7, 4, 5, 0, 9, 31, 32, 0, 105 28, 0, 0, 0, 79, 79, 79, 79, 27, 26, 106 27, 0, 31, 21, 0, 0, 35, 0, 0, 19, 107 18, 82, 82, 15, 14, 44, 45, 58, 80, 80, 108 80, 80, 51, 52, 55, 67, 0, 70, 0, 67, 109 68, 0, 17, 74, 75, 0, 7, 0, 0, 3, 110 0, 29, 0, 36, 0, 0, 0, 79, 0, 0, 111 27, 27, 38, 0, 0, 0, 35, 0, 30, 80, 112 0, 0, 67, 69, 0, 0, 8, 0, 0, 0, 113 114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116 0, 22, 0, 22, 0, 22, 0, 0, 0, 4, 117 0, 0, 0, 0, 0, 0, 79, 0, 0, 80, 118 34, 0, 0, 0, 0, 0, 79, 0, 0, 80, 119 0, 0, 0, 0, 0, 79, 0, 0, 80, 0, 120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 123 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 124 125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 0 129 ); 130 131type Secondary_Stage_Index is range 0 .. 16#FF#; 132type Primary_Stage_Index is range 0 .. 16#10FF#; 133type Secondary_Stage_Array is array (Secondary_Stage_Index) of Short; 134type Secondary_Stage_Array_Access is access constant Secondary_Stage_Array; 135yy_ec_0 : aliased constant Secondary_Stage_Array := 136 ( 137 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 138 3, 1, 4, 1, 1, 1, 1, 1, 1, 1, 139 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 140 1, 1, 5, 1, 6, 7, 8, 9, 1, 10, 141 11, 11, 11, 11, 12, 13, 11, 14, 15, 15, 142 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 143 16, 1, 17, 11, 1, 23, 24, 25, 26, 27, 144 28, 29, 30, 31, 32, 32, 32, 32, 33, 34, 145 35, 32, 36, 37, 38, 39, 32, 40, 41, 42, 146 32, 18, 19, 20, 21, 22, 1, 23, 24, 25, 147 148 26, 27, 28, 29, 30, 31, 32, 32, 32, 32, 149 33, 34, 35, 32, 36, 37, 38, 39, 32, 40, 150 41, 42, 32, 43, 44, 45, 1, 1, 1, 1, 151 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 152 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 153 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 154 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 155 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 156 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 157 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 158 159 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 160 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 161 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 162 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 163 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 164 1, 1, 1, 1, 1, 1 165 ); 166 167yy_ec_1 : aliased constant Secondary_Stage_Array := 168 ( 169 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 170 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 171 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 172 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 173 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 174 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 175 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 176 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 177 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 178 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 179 180 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 181 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 182 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 183 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 184 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 185 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 186 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 187 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 188 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 189 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 190 191 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 192 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 193 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 194 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 195 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 196 1, 1, 1, 1, 1, 1 197 ); 198 199yy_ec_base : constant 200 array (Primary_Stage_Index) of Secondary_Stage_Array_Access := 201 ( 0 => yy_ec_0'Access, others => yy_ec_1'Access); 202 203function yy_ec (Item : Wide_Wide_Character) return short is 204 Code : constant Integer := Wide_Wide_Character'Pos (Item); 205 Group : constant Primary_Stage_Index := 206 Primary_Stage_Index (Code / 256); 207 Offset : constant Secondary_Stage_Index := 208 Secondary_Stage_Index (Code mod 256); 209 210begin 211 return yy_ec_base (Group) (Offset); 212end yy_ec; 213yy_meta : constant array(0..45) of short := 214 ( 0, 215 1, 2, 3, 2, 2, 4, 1, 1, 1, 5, 216 1, 1, 6, 5, 7, 1, 1, 1, 8, 9, 217 1, 10, 11, 11, 11, 11, 11, 11, 10, 10, 218 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 219 10, 10, 5, 1, 12 220 ); 221 222yy_base : constant array(0..385) of short := 223 ( 0, 224 0, 45, 89, 132, 1244, 1243, 1242, 1241, 107, 111, 225 176, 0, 1222, 1221, 114, 115, 125, 136, 144, 149, 226 153, 219, 239, 0, 1237, 1236, 116, 119, 282, 283, 227 1238, 1248, 221, 1248, 0, 290, 1248, 1232, 278, 1221, 228 0, 1248, 294, 1248, 1248, 96, 1248, 1217, 1211, 275, 229 338, 382, 1248, 1220, 1215, 1248, 1222, 0, 1221, 1248, 230 0, 119, 1248, 1248, 1248, 1248, 1202, 0, 1248, 1248, 231 1248, 1248, 1205, 1248, 1248, 1248, 1248, 81, 1248, 1248, 232 285, 1206, 1248, 0, 290, 1248, 0, 1248, 1248, 139, 233 1205, 1248, 0, 1248, 1248, 1212, 1248, 1248, 1248, 0, 234 235 1248, 1248, 0, 225, 1248, 0, 304, 1248, 1201, 1210, 236 1248, 1205, 0, 1171, 1248, 1205, 0, 386, 1248, 1166, 237 1248, 1141, 214, 296, 1248, 1152, 1121, 0, 0, 1248, 238 430, 1150, 474, 1248, 1149, 309, 0, 1156, 1155, 0, 239 1248, 1154, 1248, 0, 328, 1248, 0, 1127, 1248, 1126, 240 1097, 0, 1248, 1248, 1248, 0, 294, 1248, 0, 518, 241 0, 1114, 1248, 0, 1248, 1103, 0, 1079, 1098, 1248, 242 1097, 1248, 1031, 1248, 216, 373, 549, 1038, 139, 0, 243 0, 0, 1248, 1033, 315, 323, 0, 1039, 1248, 1026, 244 364, 0, 0, 1248, 577, 1021, 1248, 987, 983, 381, 245 246 378, 607, 977, 980, 0, 999, 993, 987, 951, 943, 247 0, 923, 943, 383, 385, 387, 621, 907, 886, 0, 248 920, 1248, 885, 1248, 879, 1248, 835, 833, 0, 1248, 249 853, 461, 395, 635, 819, 802, 0, 682, 665, 0, 250 1248, 398, 463, 649, 676, 672, 0, 659, 657, 0, 251 402, 465, 663, 652, 646, 1248, 638, 632, 1248, 469, 252 471, 404, 638, 624, 626, 610, 474, 476, 610, 607, 253 597, 604, 479, 486, 581, 297, 577, 474, 580, 583, 254 567, 559, 557, 538, 538, 541, 546, 585, 587, 1248, 255 537, 536, 1248, 484, 484, 591, 594, 466, 459, 448, 256 257 391, 618, 632, 404, 398, 396, 384, 493, 589, 368, 258 319, 286, 301, 660, 620, 284, 254, 634, 202, 136, 259 646, 144, 131, 673, 100, 81, 675, 77, 75, 678, 260 1248, 705, 717, 729, 741, 753, 765, 777, 789, 801, 261 813, 825, 832, 843, 855, 862, 873, 885, 897, 909, 262 921, 933, 945, 952, 963, 975, 987, 999, 1008, 1015, 263 1026, 1038, 1050, 1062, 1074, 1086, 1092, 1103, 1114, 1126, 264 1132, 1143, 1149, 1154, 1159, 1170, 1182, 1194, 1200, 1205, 265 1210, 1215, 1220, 1225, 1230 266 ); 267 268yy_def : constant array(0..385) of short := 269 ( 0, 270 331, 331, 332, 332, 333, 333, 334, 334, 335, 335, 271 331, 11, 336, 336, 337, 337, 338, 338, 339, 339, 272 340, 340, 331, 23, 341, 341, 336, 336, 342, 342, 273 331, 331, 331, 331, 343, 331, 331, 344, 345, 331, 274 346, 331, 331, 331, 331, 331, 331, 331, 347, 348, 275 331, 349, 331, 331, 331, 331, 350, 351, 352, 331, 276 353, 331, 331, 331, 331, 331, 331, 354, 331, 331, 277 331, 331, 331, 331, 331, 331, 331, 348, 331, 331, 278 355, 356, 331, 357, 348, 331, 358, 331, 331, 359, 279 358, 331, 360, 331, 331, 361, 331, 331, 331, 362, 280 281 331, 331, 363, 331, 331, 343, 331, 331, 331, 344, 282 331, 331, 364, 331, 331, 365, 346, 331, 331, 366, 283 331, 331, 347, 347, 331, 331, 331, 367, 368, 331, 284 331, 331, 349, 331, 331, 366, 369, 370, 350, 351, 285 331, 352, 331, 353, 331, 331, 354, 331, 331, 331, 286 331, 371, 331, 331, 331, 358, 359, 331, 359, 331, 287 360, 361, 331, 362, 331, 372, 364, 331, 365, 331, 288 366, 331, 331, 331, 347, 347, 347, 331, 331, 373, 289 368, 131, 331, 331, 370, 366, 369, 370, 331, 331, 290 331, 374, 160, 331, 160, 372, 331, 331, 331, 347, 291 292 347, 177, 331, 331, 375, 376, 377, 378, 331, 331, 293 379, 331, 331, 347, 347, 347, 177, 331, 331, 380, 294 376, 331, 377, 331, 378, 331, 331, 331, 381, 331, 295 331, 347, 347, 177, 331, 331, 382, 331, 331, 383, 296 331, 347, 347, 177, 331, 331, 384, 331, 331, 385, 297 347, 347, 177, 331, 331, 331, 331, 331, 331, 347, 298 347, 347, 331, 331, 331, 331, 347, 347, 331, 331, 299 331, 331, 347, 347, 331, 331, 331, 331, 347, 347, 300 331, 331, 331, 331, 331, 331, 347, 347, 347, 331, 301 331, 331, 331, 331, 331, 347, 347, 331, 331, 331, 302 303 331, 347, 347, 331, 331, 331, 331, 347, 347, 331, 304 331, 331, 331, 347, 347, 331, 331, 347, 331, 331, 305 347, 331, 331, 347, 331, 331, 347, 331, 331, 347, 306 0, 331, 331, 331, 331, 331, 331, 331, 331, 331, 307 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 308 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 309 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 310 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 311 331, 331, 331, 331, 331 312 ); 313 314yy_nxt : constant array(0..1293) of short := 315 ( 0, 316 32, 33, 34, 33, 33, 32, 32, 32, 32, 32, 317 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 318 32, 35, 35, 35, 35, 35, 35, 35, 35, 35, 319 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 320 35, 35, 32, 32, 32, 32, 36, 37, 36, 36, 321 32, 38, 32, 39, 32, 32, 32, 40, 32, 32, 322 32, 32, 32, 32, 32, 32, 41, 41, 41, 41, 323 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 324 41, 41, 41, 41, 41, 41, 41, 32, 32, 32, 325 43, 44, 43, 43, 45, 126, 46, 121, 121, 47, 326 327 121, 284, 47, 281, 48, 329, 49, 50, 62, 63, 328 62, 62, 62, 63, 62, 62, 71, 71, 98, 128, 329 145, 98, 145, 145, 328, 72, 72, 76, 73, 73, 330 77, 51, 47, 52, 53, 52, 52, 45, 76, 46, 331 54, 77, 47, 78, 55, 47, 65, 48, 158, 49, 332 50, 65, 56, 326, 78, 65, 80, 159, 74, 74, 333 99, 80, 81, 99, 82, 84, 325, 81, 203, 82, 334 323, 85, 86, 204, 51, 47, 64, 64, 65, 64, 335 64, 64, 64, 64, 64, 64, 64, 66, 64, 64, 336 64, 64, 67, 64, 64, 64, 64, 68, 68, 68, 337 338 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 339 68, 68, 68, 68, 68, 68, 68, 68, 64, 64, 340 64, 65, 104, 105, 104, 104, 104, 105, 104, 104, 341 200, 84, 124, 174, 124, 174, 322, 85, 86, 87, 342 87, 88, 87, 87, 89, 87, 87, 87, 90, 87, 343 87, 91, 92, 87, 87, 87, 87, 87, 87, 87, 344 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 345 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 346 93, 94, 87, 95, 101, 101, 113, 102, 102, 126, 347 320, 107, 108, 107, 107, 118, 119, 118, 118, 150, 348 349 103, 103, 109, 158, 126, 107, 108, 107, 107, 127, 350 175, 172, 159, 128, 114, 123, 109, 189, 115, 151, 351 319, 186, 317, 152, 127, 172, 284, 207, 128, 145, 352 176, 145, 145, 282, 177, 208, 283, 120, 129, 129, 353 316, 129, 129, 129, 129, 129, 129, 129, 129, 129, 354 129, 129, 130, 129, 129, 129, 129, 129, 129, 131, 355 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 356 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 357 129, 129, 129, 133, 134, 133, 133, 118, 119, 118, 358 118, 124, 174, 209, 135, 214, 124, 174, 210, 124, 359 360 174, 124, 174, 124, 174, 124, 174, 215, 281, 233, 361 313, 232, 216, 124, 174, 201, 124, 174, 312, 251, 362 124, 174, 124, 174, 311, 136, 310, 260, 307, 120, 363 181, 181, 243, 181, 181, 181, 181, 181, 181, 181, 364 181, 181, 182, 181, 182, 181, 181, 181, 181, 181, 365 181, 182, 182, 182, 182, 182, 182, 182, 182, 182, 366 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 367 182, 182, 181, 181, 183, 133, 134, 133, 133, 124, 368 174, 124, 174, 124, 174, 306, 135, 124, 174, 124, 369 174, 261, 124, 174, 124, 174, 305, 124, 174, 267, 370 371 252, 242, 273, 304, 124, 174, 268, 280, 274, 279, 372 285, 124, 174, 286, 301, 314, 300, 136, 193, 193, 373 194, 193, 193, 195, 193, 193, 193, 195, 193, 193, 374 193, 195, 193, 193, 193, 193, 193, 193, 193, 195, 375 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 376 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 377 195, 193, 195, 202, 124, 174, 299, 124, 174, 298, 378 295, 202, 202, 202, 202, 202, 202, 195, 195, 294, 379 195, 195, 293, 195, 195, 195, 292, 195, 195, 195, 380 214, 195, 195, 195, 195, 195, 195, 195, 124, 174, 381 382 291, 124, 174, 124, 174, 124, 174, 124, 174, 124, 383 174, 290, 124, 174, 284, 315, 297, 287, 281, 288, 384 195, 217, 289, 302, 303, 278, 296, 277, 276, 217, 385 217, 217, 217, 217, 217, 234, 124, 174, 124, 174, 386 275, 318, 272, 234, 234, 234, 234, 234, 234, 244, 387 124, 174, 124, 174, 271, 308, 270, 244, 244, 244, 388 244, 244, 244, 253, 124, 174, 269, 266, 265, 309, 389 321, 253, 253, 253, 253, 253, 253, 262, 124, 174, 390 324, 264, 263, 258, 257, 262, 262, 262, 262, 262, 391 262, 124, 174, 124, 174, 327, 124, 174, 255, 330, 392 393 287, 254, 249, 248, 287, 42, 42, 42, 42, 42, 394 42, 42, 42, 42, 42, 42, 42, 57, 57, 57, 395 57, 57, 57, 57, 57, 57, 57, 57, 57, 59, 396 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 397 59, 61, 61, 61, 61, 61, 61, 61, 61, 61, 398 61, 61, 61, 65, 65, 65, 65, 65, 65, 65, 399 65, 65, 65, 65, 65, 70, 70, 70, 70, 70, 400 70, 70, 70, 70, 70, 70, 70, 75, 75, 75, 401 75, 75, 75, 75, 75, 75, 75, 75, 75, 79, 402 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 403 404 79, 83, 83, 83, 83, 83, 83, 83, 83, 83, 405 83, 83, 83, 96, 96, 96, 96, 96, 96, 96, 406 96, 96, 96, 96, 96, 100, 100, 100, 100, 100, 407 100, 100, 100, 100, 100, 100, 100, 106, 106, 246, 408 245, 106, 106, 110, 110, 110, 110, 110, 110, 110, 409 110, 110, 110, 110, 110, 112, 112, 112, 112, 112, 410 112, 112, 112, 112, 112, 112, 112, 117, 117, 241, 411 239, 117, 117, 123, 123, 238, 123, 123, 123, 123, 412 123, 226, 123, 123, 123, 125, 125, 224, 125, 125, 413 125, 125, 125, 125, 125, 125, 125, 132, 132, 132, 414 415 132, 132, 132, 132, 132, 132, 132, 132, 132, 139, 416 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 417 139, 141, 222, 236, 141, 141, 141, 141, 141, 141, 418 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 419 142, 142, 142, 142, 142, 144, 144, 235, 144, 144, 420 144, 144, 144, 144, 144, 144, 144, 147, 147, 231, 421 230, 147, 147, 149, 149, 228, 149, 149, 149, 149, 422 149, 149, 149, 149, 149, 153, 153, 227, 153, 153, 423 153, 153, 153, 153, 153, 153, 153, 155, 155, 226, 424 155, 155, 155, 155, 155, 224, 155, 155, 155, 156, 425 426 156, 222, 219, 218, 156, 156, 156, 156, 157, 157, 427 213, 157, 157, 157, 157, 157, 157, 157, 157, 157, 428 161, 161, 212, 197, 161, 161, 162, 162, 162, 162, 429 162, 162, 162, 162, 162, 162, 162, 162, 164, 164, 430 149, 189, 164, 164, 164, 206, 164, 164, 164, 164, 431 165, 165, 125, 165, 165, 165, 165, 165, 165, 165, 432 165, 165, 167, 167, 199, 167, 167, 167, 167, 167, 433 167, 167, 167, 167, 169, 169, 169, 169, 169, 169, 434 169, 169, 169, 169, 169, 169, 171, 171, 171, 171, 435 171, 171, 171, 171, 171, 171, 171, 171, 180, 172, 436 437 170, 198, 180, 181, 181, 197, 181, 181, 181, 181, 438 181, 181, 181, 181, 187, 187, 163, 187, 187, 187, 439 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, 440 188, 188, 188, 188, 188, 188, 188, 188, 192, 191, 441 190, 148, 192, 196, 196, 196, 196, 196, 196, 196, 442 196, 196, 196, 196, 196, 205, 143, 140, 189, 205, 443 211, 185, 184, 179, 211, 220, 178, 173, 172, 220, 444 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 445 221, 221, 223, 223, 223, 223, 223, 223, 223, 223, 446 223, 223, 223, 223, 225, 225, 225, 225, 225, 225, 447 448 225, 225, 225, 225, 225, 225, 229, 170, 168, 166, 449 229, 237, 111, 116, 163, 237, 240, 160, 154, 148, 450 240, 247, 146, 143, 140, 247, 250, 138, 137, 124, 451 250, 256, 122, 116, 111, 256, 259, 331, 97, 97, 452 259, 69, 69, 60, 60, 58, 58, 31, 331, 331, 453 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 454 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 455 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 456 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 457 331, 331, 331 458 459 ); 460 461yy_chk : constant array(0..1293) of short := 462 ( 0, 463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 466 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 467 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 472 3, 3, 3, 3, 3, 78, 3, 46, 46, 3, 473 474 46, 329, 3, 328, 3, 326, 3, 3, 9, 9, 475 9, 9, 10, 10, 10, 10, 15, 16, 27, 78, 476 62, 28, 62, 62, 325, 15, 16, 17, 15, 16, 477 17, 3, 3, 4, 4, 4, 4, 4, 18, 4, 478 4, 18, 4, 17, 4, 4, 19, 4, 90, 4, 479 4, 20, 4, 323, 18, 21, 19, 90, 15, 16, 480 27, 20, 19, 28, 19, 21, 322, 20, 179, 20, 481 320, 21, 21, 179, 4, 4, 11, 11, 11, 11, 482 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 483 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 484 485 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 486 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 487 11, 22, 33, 33, 33, 33, 104, 104, 104, 104, 488 175, 22, 123, 123, 175, 175, 319, 22, 22, 23, 489 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 490 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 491 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 492 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 493 23, 23, 23, 23, 29, 30, 39, 29, 30, 50, 494 317, 36, 36, 36, 36, 43, 43, 43, 43, 81, 495 496 29, 30, 36, 157, 85, 107, 107, 107, 107, 50, 497 124, 136, 157, 50, 39, 124, 107, 185, 39, 81, 498 316, 136, 313, 81, 85, 186, 312, 185, 85, 145, 499 124, 145, 145, 276, 124, 186, 276, 43, 51, 51, 500 311, 51, 51, 51, 51, 51, 51, 51, 51, 51, 501 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 502 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 503 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 504 51, 51, 51, 52, 52, 52, 52, 118, 118, 118, 505 118, 176, 176, 191, 52, 200, 201, 201, 191, 200, 506 507 200, 214, 214, 215, 215, 216, 216, 201, 310, 216, 508 307, 215, 201, 233, 233, 176, 242, 242, 306, 242, 509 251, 251, 262, 262, 305, 52, 304, 251, 301, 118, 510 131, 131, 233, 131, 131, 131, 131, 131, 131, 131, 511 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 512 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 513 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 514 131, 131, 131, 131, 131, 133, 133, 133, 133, 232, 515 232, 243, 243, 252, 252, 300, 133, 260, 260, 261, 516 261, 252, 267, 267, 268, 268, 299, 273, 273, 260, 517 518 243, 232, 267, 298, 274, 274, 261, 274, 268, 273, 519 278, 308, 308, 278, 295, 308, 294, 133, 160, 160, 520 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 521 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 522 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 523 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 524 160, 160, 160, 177, 287, 287, 292, 177, 177, 291, 525 286, 177, 177, 177, 177, 177, 177, 195, 195, 285, 526 195, 195, 284, 195, 195, 195, 283, 195, 195, 195, 527 287, 195, 195, 195, 195, 195, 195, 195, 279, 279, 528 529 282, 280, 280, 288, 288, 289, 289, 309, 309, 296, 530 296, 281, 297, 297, 277, 309, 289, 279, 275, 280, 531 195, 202, 280, 296, 297, 272, 288, 271, 270, 202, 532 202, 202, 202, 202, 202, 217, 302, 302, 315, 315, 533 269, 315, 266, 217, 217, 217, 217, 217, 217, 234, 534 303, 303, 318, 318, 265, 302, 264, 234, 234, 234, 535 234, 234, 234, 244, 321, 321, 263, 258, 257, 303, 536 318, 244, 244, 244, 244, 244, 244, 253, 314, 314, 537 321, 255, 254, 249, 248, 253, 253, 253, 253, 253, 538 253, 324, 324, 327, 327, 324, 330, 330, 246, 327, 539 540 314, 245, 239, 238, 330, 332, 332, 332, 332, 332, 541 332, 332, 332, 332, 332, 332, 332, 333, 333, 333, 542 333, 333, 333, 333, 333, 333, 333, 333, 333, 334, 543 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, 544 334, 335, 335, 335, 335, 335, 335, 335, 335, 335, 545 335, 335, 335, 336, 336, 336, 336, 336, 336, 336, 546 336, 336, 336, 336, 336, 337, 337, 337, 337, 337, 547 337, 337, 337, 337, 337, 337, 337, 338, 338, 338, 548 338, 338, 338, 338, 338, 338, 338, 338, 338, 339, 549 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 550 551 339, 340, 340, 340, 340, 340, 340, 340, 340, 340, 552 340, 340, 340, 341, 341, 341, 341, 341, 341, 341, 553 341, 341, 341, 341, 341, 342, 342, 342, 342, 342, 554 342, 342, 342, 342, 342, 342, 342, 343, 343, 236, 555 235, 343, 343, 344, 344, 344, 344, 344, 344, 344, 556 344, 344, 344, 344, 344, 345, 345, 345, 345, 345, 557 345, 345, 345, 345, 345, 345, 345, 346, 346, 231, 558 228, 346, 346, 347, 347, 227, 347, 347, 347, 347, 559 347, 225, 347, 347, 347, 348, 348, 223, 348, 348, 560 348, 348, 348, 348, 348, 348, 348, 349, 349, 349, 561 562 349, 349, 349, 349, 349, 349, 349, 349, 349, 350, 563 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 564 350, 351, 221, 219, 351, 351, 351, 351, 351, 351, 565 351, 351, 351, 352, 352, 352, 352, 352, 352, 352, 566 352, 352, 352, 352, 352, 353, 353, 218, 353, 353, 567 353, 353, 353, 353, 353, 353, 353, 354, 354, 213, 568 212, 354, 354, 355, 355, 210, 355, 355, 355, 355, 569 355, 355, 355, 355, 355, 356, 356, 209, 356, 356, 570 356, 356, 356, 356, 356, 356, 356, 357, 357, 208, 571 357, 357, 357, 357, 357, 207, 357, 357, 357, 358, 572 573 358, 206, 204, 203, 358, 358, 358, 358, 359, 359, 574 199, 359, 359, 359, 359, 359, 359, 359, 359, 359, 575 360, 360, 198, 196, 360, 360, 361, 361, 361, 361, 576 361, 361, 361, 361, 361, 361, 361, 361, 362, 362, 577 190, 188, 362, 362, 362, 184, 362, 362, 362, 362, 578 363, 363, 178, 363, 363, 363, 363, 363, 363, 363, 579 363, 363, 364, 364, 173, 364, 364, 364, 364, 364, 580 364, 364, 364, 364, 365, 365, 365, 365, 365, 365, 581 365, 365, 365, 365, 365, 365, 366, 366, 366, 366, 582 366, 366, 366, 366, 366, 366, 366, 366, 367, 171, 583 584 169, 168, 367, 368, 368, 166, 368, 368, 368, 368, 585 368, 368, 368, 368, 369, 369, 162, 369, 369, 369, 586 369, 369, 369, 369, 369, 369, 370, 370, 370, 370, 587 370, 370, 370, 370, 370, 370, 370, 370, 371, 151, 588 150, 148, 371, 372, 372, 372, 372, 372, 372, 372, 589 372, 372, 372, 372, 372, 373, 142, 139, 138, 373, 590 374, 135, 132, 127, 374, 375, 126, 122, 120, 375, 591 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, 592 376, 376, 377, 377, 377, 377, 377, 377, 377, 377, 593 377, 377, 377, 377, 378, 378, 378, 378, 378, 378, 594 595 378, 378, 378, 378, 378, 378, 379, 116, 114, 112, 596 379, 380, 110, 109, 96, 380, 381, 91, 82, 73, 597 381, 382, 67, 59, 57, 382, 383, 55, 54, 49, 598 383, 384, 48, 40, 38, 384, 385, 31, 26, 25, 599 385, 14, 13, 8, 7, 6, 5, 331, 331, 331, 600 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 601 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 602 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 603 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 604 331, 331, 331 605 606 ); 607 608 609 -- copy whatever the last rule matched to the standard output 610 611 procedure ECHO is 612 begin 613 if Ada.Wide_Wide_Text_IO.Is_Open (User_Output_File) then 614 Ada.Wide_Wide_Text_IO.Put (User_Output_File, YYText); 615 616 else 617 Ada.Wide_Wide_Text_IO.Put (YYText); 618 end if; 619 end ECHO; 620 621 -- enter a start condition. 622 -- Using procedure requires a () after the ENTER, but makes 623 -- everything much neater. 624 625 procedure ENTER (State : Integer) is 626 begin 627 YY_Start := 1 + 2 * State; 628 end ENTER; 629 pragma Inline (ENTER); 630 631 -- action number for EOF rule of a given start state 632function YY_STATE_EOF(state : Integer) return Integer is 633begin 634 return YY_END_OF_BUFFER + state + 1; 635end YY_STATE_EOF; 636pragma Inline (YY_STATE_EOF); 637 638-- return all but the first 'n' matched characters back to the input stream 639procedure yyless(n : Integer) is 640begin 641 yy_cp := yy_bp + n; 642 yy_c_buf_p := yy_cp; 643 YY_DO_BEFORE_ACTION; -- set up yytext again 644end yyless; 645pragma Inline (yyless); 646 647-- redefine this if you have something you want each time. 648procedure YY_USER_ACTION is 649begin 650 null; 651end; 652pragma Inline (YY_USER_ACTION); 653 654 -- yy_get_previous_state - get the state just before the EOB char 655 -- was reached 656 657 function YY_Get_Previous_State return YY_State_Type is 658 YY_Current_State : YY_State_Type; 659 YY_C : Short; 660 Index : Integer; 661 Code : Wide_Wide_Character; 662 yy_bp : integer := yytext_ptr; 663begin 664 yy_current_state := yy_start; 665 if Previous (yy_ch_buf, yy_bp) = Ada.Characters.Wide_Wide_Latin_1.LF then 666 yy_current_state := yy_current_state + 1; 667 end if; 668 669 declare 670 yy_cp : integer := yytext_ptr; 671 672 begin 673 while yy_cp < yy_c_buf_p loop 674 Index := yy_cp; 675 676 Index := yy_cp; 677 Next (yy_ch_buf, Index, Code); 678 yy_c := yy_ec(Code); 679 if (yy_accept(yy_current_state) /= 0 ) then 680 yy_last_accepting_state := yy_current_state; 681 yy_last_accepting_cpos := yy_cp; 682 end if; 683 while ( yy_chk(yy_base(yy_current_state) + yy_c) /= yy_current_state ) loop 684 yy_current_state := yy_def(yy_current_state); 685 if yy_current_state >= YY_FIRST_TEMPLATE then 686 yy_c := yy_meta(yy_c); 687 end if; 688 end loop; 689 yy_current_state := yy_nxt(yy_base(yy_current_state) + yy_c); 690 yy_cp := Index; 691 end loop; 692 end; 693 694 return yy_current_state; 695end yy_get_previous_state; 696 697 procedure YYRestart (Input_File : Ada.Wide_Wide_Text_IO.File_Type) is 698 begin 699 Open_Input (Ada.Wide_Wide_Text_IO.Name (Input_File)); 700 end YYRestart; 701 702 Index : Integer; 703 Code : Wide_Wide_Character; 704 705 begin -- of YYLex 706<<new_file>> 707 -- This is where we enter upon encountering an end-of-file and 708 -- yywrap() indicating that we should continue processing 709 710 if ( yy_init ) then 711 if ( yy_start = 0 ) then 712 yy_start := 1; -- first start state 713 end if; 714 715 -- we put in the '\n' and start reading from [1] so that an 716 -- initial match-at-newline will be true. 717 718 yy_ch_buf.data (0) := Ada.Characters.Wide_Wide_Latin_1.LF; 719 yy_n_chars := 1; 720 721 -- we always need two end-of-buffer characters. The first causes 722 -- a transition to the end-of-buffer state. The second causes 723 -- a jam in that state. 724 725 yy_ch_buf.data (yy_n_chars) := YY_END_OF_BUFFER_CHAR; 726 yy_ch_buf.data (yy_n_chars + 1) := YY_END_OF_BUFFER_CHAR; 727 728 yy_eof_has_been_seen := false; 729 730 yytext_ptr := 1; 731 yy_c_buf_p := yytext_ptr; 732 yy_init := false; 733 end if; -- yy_init 734 735 loop -- loops until end-of-file is reached 736 737 738 yy_cp := yy_c_buf_p; 739 740 -- yy_bp points to the position in yy_ch_buf of the start of the 741 -- current run. 742 yy_bp := yy_cp; 743 yy_current_state := yy_start; 744 if Previous (yy_ch_buf, yy_bp) = Ada.Characters.Wide_Wide_Latin_1.LF then 745 yy_current_state := yy_current_state + 1; 746 end if; 747 loop 748 Index := yy_cp; 749 Next (yy_ch_buf, Index, Code); 750 yy_c := yy_ec(Code); 751 if (yy_accept(yy_current_state) /= 0 ) then 752 yy_last_accepting_state := yy_current_state; 753 yy_last_accepting_cpos := yy_cp; 754 end if; 755 while ( yy_chk(yy_base(yy_current_state) + yy_c) /= yy_current_state ) loop 756 yy_current_state := yy_def(yy_current_state); 757 if yy_current_state >= YY_FIRST_TEMPLATE then 758 yy_c := yy_meta(yy_c); 759 end if; 760 end loop; 761 yy_current_state := yy_nxt(yy_base(yy_current_state) + yy_c); 762 yy_cp := Index; 763 exit when yy_current_state = YY_JAMSTATE; 764 end loop; 765 yy_cp := yy_last_accepting_cpos; 766 yy_current_state := yy_last_accepting_state; 767 768<<next_action>> 769 yy_act := yy_accept(yy_current_state); 770 YY_DO_BEFORE_ACTION; 771 YY_USER_ACTION; 772 773 if Aflex_Debug then 774 -- output acceptance info. for (-d) debug mode 775 776 Ada.Wide_Wide_Text_IO.Put 777 (Ada.Wide_Wide_Text_IO.Standard_Error, 778 "--accepting rule #" ); 779 Ada.Wide_Wide_Text_IO.Put 780 (Ada.Wide_Wide_Text_IO.Standard_Error, 781 Integer'Wide_Wide_Image (YY_Act)); 782 Ada.Wide_Wide_Text_IO.Put_Line 783 (Ada.Wide_Wide_Text_IO.Standard_Error, 784 "(""" & yytext & """)"); 785 end if; 786 787 788<<do_action>> -- this label is used only to access EOF actions 789 case yy_act is 790 when 0 => -- must backtrack 791 yy_cp := yy_last_accepting_cpos; 792 yy_current_state := yy_last_accepting_state; 793 794 goto next_action; 795 796 797 798 when 1 => 799--# line 47 "scanner.l" 800 indented_code := true; 801 802 when 2 => 803--# line 48 "scanner.l" 804 linenum := linenum + 1; ECHO; 805 -- treat as a comment; 806 807 808 when 3 => 809--# line 51 "scanner.l" 810 linenum := linenum + 1; ECHO; 811 812 when 4 => 813--# line 52 "scanner.l" 814 return ( SCDECL ); 815 816 when 5 => 817--# line 53 "scanner.l" 818 return ( XSCDECL ); 819 820 when 6 => 821--# line 55 "scanner.l" 822 return ( WHITESPACE ); 823 824 when 7 => 825--# line 57 "scanner.l" 826 827 sectnum := 2; 828 misc.line_directive_out; 829 ENTER(SECT2PROLOG); 830 return ( SECTEND ); 831 832 833 when 8 => 834--# line 64 "scanner.l" 835 836 Put (Standard_Error, "old-style lex command at line "); 837 Put (Standard_Error, Linenum); 838 Put (Standard_Error, "ignored:"); 839 New_Line (Standard_Error ); 840 Put (Standard_Error, Unicode.HT ); 841 Put (Standard_Error, YYText (1 .. YYLength)); 842 Linenum := Linenum + 1; 843 844 845 when 9 => 846--# line 74 "scanner.l" 847 848 nmstr := +YYText (1 .. YYLength); 849 didadef := false; 850 ENTER(PICKUPDEF); 851 852 853 when 10 => 854--# line 80 "scanner.l" 855 nmstr := +YYText (1 .. YYLength); 856 return NAME; 857 858 859 when 11 => 860--# line 83 "scanner.l" 861 linenum := linenum + 1; 862 -- allows blank lines in section 1; 863 864 865 when 12 => 866--# line 86 "scanner.l" 867 linenum := linenum + 1; return Newline; 868 869 when 13 => 870--# line 87 "scanner.l" 871 misc.synerr( "illegal character" );ENTER(RECOVER); 872 873 when 14 => 874--# line 89 "scanner.l" 875 null; 876 -- separates name and definition; 877 878 879 when 15 => 880--# line 93 "scanner.l" 881 882 nmdef := +YYText (1 .. YYLength); 883 884 i := length (nmdef); 885 while i >= 1 loop 886 if Element (nmdef, i) /= ' ' 887 and Element (nmdef, i) /= Unicode.HT 888 then 889 exit; 890 end if; 891 i := i - 1; 892 end loop; 893 894 sym.ndinstal (nmstr, Unbounded_Slice (nmdef, 1, i)); 895 didadef := true; 896 897 898 when 16 => 899--# line 110 "scanner.l" 900 901 if ( not didadef ) then 902 misc.synerr( "incomplete name definition" ); 903 end if; 904 ENTER(0); 905 linenum := linenum + 1; 906 907 908 when 17 => 909--# line 118 "scanner.l" 910 linenum := linenum + 1; 911 ENTER(0); 912 nmstr := +YYText (1 .. YYLength); 913 return NAME; 914 915 916 when 18 => 917yy_cp := yy_cp - 1; 918yy_c_buf_p := yy_cp; 919YY_DO_BEFORE_ACTION; -- set up yytext again 920--# line 124 "scanner.l" 921 922 linenum := linenum + 1; 923 ACTION_ECHO; 924 MARK_END_OF_PROLOG; 925 ENTER(SECT2); 926 927 928 when 19 => 929--# line 131 "scanner.l" 930 linenum := linenum + 1; ACTION_ECHO; 931 932when YY_END_OF_BUFFER +SECT2PROLOG + 1 933 => 934--# line 133 "scanner.l" 935 MARK_END_OF_PROLOG; 936 return End_Of_Input; 937 938 939 when 21 => 940--# line 137 "scanner.l" 941 linenum := linenum + 1; 942 -- allow blank lines in sect2; 943 944 -- this rule matches indented lines which 945 -- are not comments. 946 when 22 => 947--# line 142 "scanner.l" 948 949 misc.synerr("indented code found outside of action"); 950 linenum := linenum + 1; 951 952 953 when 23 => 954--# line 147 "scanner.l" 955 ENTER(SC); return ( '<' ); 956 957 when 24 => 958--# line 148 "scanner.l" 959 return ( '^' ); 960 961 when 25 => 962--# line 149 "scanner.l" 963 ENTER(QUOTE); return ( '"' ); 964 965 when 26 => 966yy_cp := yy_bp + 1; 967yy_c_buf_p := yy_cp; 968YY_DO_BEFORE_ACTION; -- set up yytext again 969--# line 150 "scanner.l" 970 ENTER(NUM); return ( '{' ); 971 972 when 27 => 973--# line 151 "scanner.l" 974 ENTER(BRACEERROR); 975 976 when 28 => 977yy_cp := yy_bp + 1; 978yy_c_buf_p := yy_cp; 979YY_DO_BEFORE_ACTION; -- set up yytext again 980--# line 152 "scanner.l" 981 return ( '$' ); 982 983 when 29 => 984--# line 154 "scanner.l" 985 continued_action := true; 986 linenum := linenum + 1; 987 return Newline; 988 989 990 when 30 => 991--# line 159 "scanner.l" 992 linenum := linenum + 1; ACTION_ECHO; 993 994 when 31 => 995--# line 161 "scanner.l" 996 997 -- this rule is separate from the one below because 998 -- otherwise we get variable trailing context, so 999 -- we can't build the scanner using -f,F 1000 1001 bracelevel := 0; 1002 continued_action := false; 1003 ENTER(ACTION); 1004 return Newline; 1005 1006 1007 when 32 => 1008yy_cp := yy_cp - 1; 1009yy_c_buf_p := yy_cp; 1010YY_DO_BEFORE_ACTION; -- set up yytext again 1011--# line 172 "scanner.l" 1012 1013 bracelevel := 0; 1014 continued_action := false; 1015 ENTER(ACTION); 1016 return Newline; 1017 1018 1019 when 33 => 1020--# line 179 "scanner.l" 1021 linenum := linenum + 1; return Newline; 1022 1023 when 34 => 1024--# line 181 "scanner.l" 1025 return ( EOF_OP ); 1026 1027 when 35 => 1028--# line 183 "scanner.l" 1029 1030 sectnum := 3; 1031 ENTER(SECT3); 1032 return ( End_Of_Input ); 1033 -- to stop the parser 1034 1035 1036 when 36 => 1037--# line 190 "scanner.l" 1038 1039 1040 nmstr := +YYText (1 .. YYLength); 1041 1042 -- check to see if we've already encountered this ccl 1043 cclval := sym.ccllookup (nmstr); 1044 if ( cclval /= 0 ) then 1045 yylval := cclval; 1046 cclreuse := cclreuse + 1; 1047 return ( PREVCCL ); 1048 else 1049 -- we fudge a bit. We know that this ccl will 1050 -- soon be numbered as lastccl + 1 by cclinit 1051 sym.cclinstal (nmstr, lastccl + 1); 1052 1053 -- push back everything but the leading bracket 1054 -- so the ccl can be rescanned 1055 1056 Put_Back_String (nmstr, 1); 1057 1058 ENTER(FIRSTCCL); 1059 return ( '[' ); 1060 end if; 1061 1062 1063 when 37 => 1064--# line 215 "scanner.l" 1065 1066 declare 1067 Image : constant Wide_Wide_String := YYText; 1068 1069 begin 1070 YYLVal := 1071 Matreshka.Internals.Unicode.Ucd.Boolean_Properties'Pos 1072 (Matreshka.Internals.Unicode.Ucd.Boolean_Properties'Wide_Wide_Value 1073 (Image (Image'First + 3 .. Image'Last - 1))) + 1; 1074 1075 if Image (Image'First + 1) = 'P' then 1076 YYLVal := -YYLVal; 1077 end if; 1078 1079 return PROP; 1080 end; 1081 1082 1083 when 38 => 1084--# line 233 "scanner.l" 1085 1086 nmstr := +YYText (1 .. YYLength); 1087 -- chop leading and trailing brace 1088 tmpbuf := Unbounded_Slice (+yytext (1 .. YYLength), 1089 2, YYLength - 1); 1090 1091 nmdefptr := sym.ndlookup (tmpbuf); 1092 if nmdefptr = Null_Unbounded_Wide_Wide_String then 1093 misc.synerr( "undefined {name}" ); 1094 else 1095 -- push back name surrounded by ()'s 1096 unput(')'); 1097 Put_Back_String (nmdefptr, 0); 1098 unput('('); 1099 end if; 1100 1101 1102 when 39 => 1103--# line 250 "scanner.l" 1104 tmpbuf := +YYText (1 .. YYLength); 1105 case Element (tmpbuf, 1) is 1106 when '/' => return '/'; 1107 when '|' => return '|'; 1108 when '*' => return '*'; 1109 when '+' => return '+'; 1110 when '?' => return '?'; 1111 when '.' => return '.'; 1112 when '(' => return '('; 1113 when ')' => return ')'; 1114 when others => 1115 Misc.Aflex_Error ("error in aflex case"); 1116 end case; 1117 1118 1119 when 40 => 1120--# line 264 "scanner.l" 1121 tmpbuf := +YYText (1 .. YYLength); 1122 yylval := Wide_Wide_Character'Pos (Element (tmpbuf, 1)); 1123 return CHAR; 1124 1125 1126 when 41 => 1127--# line 268 "scanner.l" 1128 linenum := linenum + 1; return Newline; 1129 1130 when 42 => 1131--# line 271 "scanner.l" 1132 return ( ',' ); 1133 1134 when 43 => 1135--# line 272 "scanner.l" 1136 ENTER(SECT2); return ( '>' ); 1137 1138 when 44 => 1139yy_cp := yy_bp + 1; 1140yy_c_buf_p := yy_cp; 1141YY_DO_BEFORE_ACTION; -- set up yytext again 1142--# line 273 "scanner.l" 1143 ENTER(CARETISBOL); return ( '>' ); 1144 1145 when 45 => 1146--# line 274 "scanner.l" 1147 nmstr := +YYText (1 .. YYLength); 1148 return NAME; 1149 1150 1151 when 46 => 1152--# line 277 "scanner.l" 1153 misc.synerr( "bad start condition name" ); 1154 1155 when 47 => 1156--# line 279 "scanner.l" 1157 ENTER(SECT2); return ( '^' ); 1158 1159 when 48 => 1160--# line 282 "scanner.l" 1161 tmpbuf := +YYText (1 .. YYLength); 1162 yylval := Wide_Wide_Character'Pos (Element (tmpbuf, 1)); 1163 return CHAR; 1164 1165 1166 when 49 => 1167--# line 286 "scanner.l" 1168 ENTER(SECT2); return ( '"' ); 1169 1170 when 50 => 1171--# line 288 "scanner.l" 1172 1173 misc.synerr( "missing quote" ); 1174 ENTER(SECT2); 1175 linenum := linenum + 1; 1176 return ( '"' ); 1177 1178 1179 when 51 => 1180yy_cp := yy_bp + 1; 1181yy_c_buf_p := yy_cp; 1182YY_DO_BEFORE_ACTION; -- set up yytext again 1183--# line 296 "scanner.l" 1184 ENTER(CCL); return ( '^' ); 1185 1186 when 52 => 1187yy_cp := yy_bp + 1; 1188yy_c_buf_p := yy_cp; 1189YY_DO_BEFORE_ACTION; -- set up yytext again 1190--# line 297 "scanner.l" 1191 return ( '^' ); 1192 1193 when 53 => 1194--# line 298 "scanner.l" 1195 ENTER(CCL); yylval := Wide_Wide_Character'Pos('-'); return ( CHAR ); 1196 1197 when 54 => 1198--# line 299 "scanner.l" 1199 ENTER(CCL); 1200 tmpbuf := +YYText (1 .. YYLength); 1201 yylval := Wide_Wide_Character'Pos (Element (tmpbuf, 1)); 1202 return CHAR; 1203 1204 1205 when 55 => 1206yy_cp := yy_bp + 1; 1207yy_c_buf_p := yy_cp; 1208YY_DO_BEFORE_ACTION; -- set up yytext again 1209--# line 305 "scanner.l" 1210 return ( '-' ); 1211 1212 when 56 => 1213--# line 306 "scanner.l" 1214 tmpbuf := +YYText (1 .. YYLength); 1215 yylval := Wide_Wide_Character'Pos (Element (tmpbuf, 1)); 1216 return CHAR; 1217 1218 1219 when 57 => 1220--# line 310 "scanner.l" 1221 ENTER(SECT2); return ( ']' ); 1222 1223 when 58 => 1224--# line 313 "scanner.l" 1225 1226 yylval := misc.myctoi (+YYText (1 .. YYLength)); 1227 return ( NUMBER ); 1228 1229 1230 when 59 => 1231--# line 318 "scanner.l" 1232 return ( ',' ); 1233 1234 when 60 => 1235--# line 319 "scanner.l" 1236 ENTER(SECT2); return ( '}' ); 1237 1238 when 61 => 1239--# line 321 "scanner.l" 1240 1241 misc.synerr( "bad character inside {}'s" ); 1242 ENTER(SECT2); 1243 return ( '}' ); 1244 1245 1246 when 62 => 1247--# line 327 "scanner.l" 1248 1249 misc.synerr( "missing }" ); 1250 ENTER(SECT2); 1251 linenum := linenum + 1; 1252 return ( '}' ); 1253 1254 1255 when 63 => 1256--# line 335 "scanner.l" 1257 misc.synerr( "bad name in {}'s" ); ENTER(SECT2); 1258 1259 when 64 => 1260--# line 336 "scanner.l" 1261 misc.synerr( "missing }" ); 1262 linenum := linenum + 1; 1263 ENTER(SECT2); 1264 1265 1266 when 65 => 1267--# line 341 "scanner.l" 1268 bracelevel := bracelevel + 1; 1269 1270 when 66 => 1271--# line 342 "scanner.l" 1272 bracelevel := bracelevel - 1; 1273 1274 when 67 => 1275--# line 343 "scanner.l" 1276 ACTION_ECHO; 1277 1278 when 68 => 1279--# line 344 "scanner.l" 1280 ACTION_ECHO; 1281 1282 when 69 => 1283--# line 345 "scanner.l" 1284 linenum := linenum + 1; ACTION_ECHO; 1285 1286 when 70 => 1287--# line 346 "scanner.l" 1288 ACTION_ECHO; 1289 -- character constant; 1290 1291 1292 when 71 => 1293--# line 350 "scanner.l" 1294 ACTION_ECHO; ENTER(ACTION_STRING); 1295 1296 when 72 => 1297--# line 352 "scanner.l" 1298 1299 linenum := linenum + 1; 1300 ACTION_ECHO; 1301 if ( bracelevel = 0 ) then 1302 New_Line (Temp_Action_File); 1303 ENTER(SECT2); 1304 end if; 1305 1306 1307 when 73 => 1308--# line 360 "scanner.l" 1309 ACTION_ECHO; 1310 1311 when 74 => 1312--# line 362 "scanner.l" 1313 ACTION_ECHO; 1314 1315 when 75 => 1316--# line 363 "scanner.l" 1317 ACTION_ECHO; 1318 1319 when 76 => 1320--# line 364 "scanner.l" 1321 linenum := linenum + 1; ACTION_ECHO; 1322 1323 when 77 => 1324--# line 365 "scanner.l" 1325 ACTION_ECHO; ENTER(ACTION); 1326 1327 when 78 => 1328--# line 366 "scanner.l" 1329 ACTION_ECHO; 1330 1331 when 79 => 1332--# line 369 "scanner.l" 1333 1334 yylval := 1335 Unicode_Character'Pos 1336 (Misc.MYESC (+YYText (1 .. YYLength))); 1337 1338 return CHAR; 1339 1340 1341 when 80 => 1342--# line 377 "scanner.l" 1343 1344 yylval := 1345 Unicode_Character'Pos 1346 (misc.myesc (+YYText (1 .. YYLength))); 1347 ENTER(CCL); 1348 return ( CHAR ); 1349 1350 1351 when 81 => 1352--# line 385 "scanner.l" 1353 1354 declare 1355 Image : constant Wide_Wide_String := YYText; 1356 1357 begin 1358 YYLVal := 1359 Matreshka.Internals.Unicode.Ucd.Boolean_Properties'Pos 1360 (Matreshka.Internals.Unicode.Ucd.Boolean_Properties'Wide_Wide_Value 1361 (Image (Image'First + 3 .. Image'Last - 1))) + 1; 1362 1363 if Image (Image'First + 1) = 'P' then 1364 YYLVal := -YYLVal; 1365 end if; 1366 1367 ENTER(CCL); 1368 1369 return PROP; 1370 end; 1371 1372 1373 when 82 => 1374--# line 406 "scanner.l" 1375 if ( check_yylex_here ) then 1376 return End_Of_Input; 1377 else 1378 ECHO; 1379 end if; 1380 1381 1382 when 83 => 1383--# line 412 "scanner.l" 1384raise AFLEX_SCANNER_JAMMED; 1385 when YY_END_OF_BUFFER + INITIAL + 1 1386 | YY_END_OF_BUFFER + SECT2 + 1 1387 | YY_END_OF_BUFFER + SECT3 + 1 1388 | YY_END_OF_BUFFER + PICKUPDEF + 1 1389 | YY_END_OF_BUFFER + SC + 1 1390 | YY_END_OF_BUFFER + CARETISBOL + 1 1391 | YY_END_OF_BUFFER + NUM + 1 1392 | YY_END_OF_BUFFER + QUOTE + 1 1393 | YY_END_OF_BUFFER + FIRSTCCL + 1 1394 | YY_END_OF_BUFFER + CCL + 1 1395 | YY_END_OF_BUFFER + ACTION + 1 1396 | YY_END_OF_BUFFER + RECOVER + 1 1397 | YY_END_OF_BUFFER + BRACEERROR + 1 1398 | YY_END_OF_BUFFER + ACTION_STRING + 1 1399 => 1400 return End_Of_Input; 1401 1402 when YY_END_OF_BUFFER => 1403 yytext_ptr := yy_bp; 1404 1405 case yy_get_next_buffer is 1406 when EOB_ACT_END_OF_FILE => 1407 begin 1408 if yywrap then 1409 -- note: because we've taken care in 1410 -- yy_get_next_buffer() to have set up yytext, 1411 -- we can now set up yy_c_buf_p so that if some 1412 -- total hoser (like aflex itself) wants 1413 -- to call the scanner after we return the 1414 -- End_Of_Input, it'll still work - another 1415 -- End_Of_Input will get returned. 1416 1417 yy_c_buf_p := yytext_ptr; 1418 yy_act := YY_STATE_EOF ((yy_start - 1) / 2); 1419 1420 goto do_action; 1421 1422 else 1423 -- start processing a new file 1424 1425 yy_init := true; 1426 1427 goto new_file; 1428 end if; 1429 end; 1430 1431 when EOB_ACT_RESTART_SCAN => 1432 yy_c_buf_p := yytext_ptr; 1433 1434 when EOB_ACT_LAST_MATCH => 1435 yy_c_buf_p := yy_n_chars; 1436 yy_current_state := yy_get_previous_state; 1437 1438 yy_cp := yy_c_buf_p; 1439 yy_bp := yytext_ptr; 1440 1441 goto next_action; 1442 end case; -- case yy_get_next_buffer() 1443 1444 when others => 1445 Ada.Wide_Wide_Text_IO.Put ("action # "); 1446 Ada.Wide_Wide_Text_IO.Put (Integer'Wide_Wide_Image (yy_act)); 1447 Ada.Wide_Wide_Text_IO.New_Line; 1448 1449 raise AFLEX_INTERNAL_ERROR; 1450 end case; -- case (yy_act) 1451 end loop; -- end of loop waiting for end of file 1452 end YYLex; 1453--# line 412 "scanner.l" 1454 begin 1455 if (call_yylex) then 1456 toktype := YYLex; 1457 call_yylex := false; 1458 return toktype; 1459 end if; 1460 1461 if eofseen then 1462 toktype := End_Of_Input; 1463 1464 else 1465 toktype := YYLex; 1466 end if; 1467 1468 -- this tracing code allows easy tracing of aflex runs 1469 1470 if trace then 1471 New_Line (Standard_Error); 1472 Put (Standard_Error, "toktype = :"); 1473 Put (Standard_Error, Token'Wide_Wide_Image (toktype)); 1474 Put_line (Standard_Error, ":"); 1475 end if; 1476 1477 if toktype = End_Of_Input then 1478 eofseen := true; 1479 1480 if sectnum = 1 then 1481 misc.synerr( "unexpected EOF" ); 1482 sectnum := 2; 1483 toktype := SECTEND; 1484 1485 elsif sectnum = 2 then 1486 sectnum := 3; 1487 toktype := SECTEND; 1488 end if; 1489 end if; 1490 1491 if trace then 1492 if ( beglin ) then 1493 Put (Standard_Error, Num_Rules + 1); 1494 Put (Standard_Error, Unicode.HT); 1495 Beglin := False; 1496 end if; 1497 1498 case toktype is 1499 when '<' | '>'|'^'|'$'|'"'|'['|']'|'{'|'}'|'|'|'('| 1500 ')'|'-'|'/'|'?'|'.'|'*'|'+'|',' => 1501 Put (Standard_Error, Token'Wide_Wide_Image (Toktype)); 1502 1503 when NEWLINE => 1504 New_Line (Standard_Error); 1505 if sectnum = 2 then 1506 beglin := true; 1507 end if; 1508 1509 when SCDECL => 1510 Put (Standard_Error, "%s"); 1511 1512 when XSCDECL => 1513 Put (Standard_Error, "%x"); 1514 1515 when WHITESPACE => 1516 Put (Standard_Error, " "); 1517 1518 when SECTEND => 1519 Put_Line (Standard_Error, "%%"); 1520 1521 -- we set beglin to be true so we'll start 1522 -- writing out numbers as we echo rules. aflexscan() has 1523 -- already assigned sectnum 1524 1525 if sectnum = 2 then 1526 beglin := true; 1527 end if; 1528 1529 when NAME => 1530 Put (Standard_Error, '''); 1531 Put (Standard_Error, YYText); 1532 Put (Standard_Error, '''); 1533 1534 when CHAR => 1535 if ( (yylval < Wide_Wide_Character'Pos (' ')) or 1536 (yylval = Wide_Wide_Character'Pos (Unicode.DEL)) ) 1537 then 1538 Put (Standard_Error, '\'); 1539 Put (Standard_Error, YYLVal); 1540 Put (Standard_Error, '\'); 1541 1542 else 1543 Put (Standard_Error, Token'Wide_Wide_Image (toktype)); 1544 end if; 1545 1546 when NUMBER => 1547 Put (Standard_Error, YYLVal); 1548 1549 when PREVCCL => 1550 Put (Standard_Error, '['); 1551 Put (Standard_Error, YYLVal); 1552 Put (Standard_Error, ']'); 1553 1554 when End_Of_Input => 1555 Put (Standard_Error, "End Marker"); 1556 1557 when others => 1558 Put (Standard_Error, "Something weird:"); 1559 Put_Line (Standard_Error, Token'Wide_Wide_Image (toktype)); 1560 end case; 1561 end if; 1562 1563 return toktype; 1564 end YYLex; 1565end scanner; 1566