1-- Copyright (c) 1990 Regents of the University of California. 2-- All rights reserved. 3-- 4-- This software was developed by John Self of the Arcadia project 5-- at the University of California, Irvine. 6-- 7-- Redistribution and use in source and binary forms are permitted 8-- provided that the above copyright notice and this paragraph are 9-- duplicated in all such forms and that any documentation, 10-- advertising materials, and other materials related to such 11-- distribution and use acknowledge that the software was developed 12-- by the University of California, Irvine. The name of the 13-- University may not be used to endorse or promote products derived 14-- from this software without specific prior written permission. 15-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 19-- TITLE miscellaneous aflex routines 20-- AUTHOR: John Self (UCI) 21-- DESCRIPTION 22-- NOTES contains functions used in various places throughout aflex. 23-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/miscS.a,v 1.9 90/01/12 15:20:19 self Exp Locker: self $ 24with Ada.Strings.Unbounded; 25with Ada.Strings.Wide_Wide_Unbounded; 26with Ada.Wide_Wide_Text_IO; 27 28with MISC_DEFS; 29with Unicode; 30 31package Misc is 32 33 use Ada.Strings.Unbounded; 34 use MISC_DEFS; 35 36 procedure ACTION_OUT; 37 procedure BUBBLE(V : in INT_PTR; 38 N : in INTEGER); 39 function CLOWER(C : in INTEGER) return INTEGER; 40 41 procedure CSHELL 42 (V : in out Unicode_Character_Array; 43 N : Integer); 44 -- cshell - shell sort a character array in increasing order 45 -- 46 -- description 47 -- does a shell sort of the first n elements of array v. 48 -- 49 -- passed 50 -- v - array to be sorted 51 -- n - number of elements of v to be sorted 52 53 procedure DATAEND; 54 55 procedure DATAFLUSH (File : Ada.Wide_Wide_Text_IO.File_Type); 56 procedure DATAFLUSH; 57 58 function Aflex_Get_Time 59 return Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; 60 -- aflex_gettime - return current time 61 62 procedure Aflex_Error 63 (Msg : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String); 64 procedure Aflex_Error (Msg : Wide_Wide_String); 65 -- aflexerror - report an error message and terminate 66 -- overloaded function, one for vstring, one for string. 67 68-- function ALL_UPPER(STR : in VSTRING) return BOOLEAN; 69-- function ALL_LOWER(STR : in VSTRING) return BOOLEAN; 70 71 procedure Aflex_Fatal 72 (Msg : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String); 73 procedure Aflex_Fatal (Msg : Wide_Wide_String); 74 -- aflexfatal - report a fatal error message and terminate 75 -- overloaded function, one for vstring, one for string. 76 77 procedure LINE_DIRECTIVE_OUT; 78 procedure LINE_DIRECTIVE_OUT 79 (OUTPUT_FILE_NAME : Ada.Wide_Wide_Text_IO.File_Type); 80 81 procedure MK2DATA 82 (File : Ada.Wide_Wide_Text_IO.File_Type; 83 Value : Integer); 84 85 procedure MKDATA(VALUE : in INTEGER); 86 function MYCTOI 87 (NUM_ARRAY : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String) 88 return INTEGER; 89 90 function MYESC 91 (ARR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String) 92 return Unicode.Unicode_Character; 93 -- myesc - return character corresponding to escape sequence 94 95 function OTOI 96 (STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String) 97 return Wide_Wide_Character; 98 99 function Readable_Form (C : Wide_Wide_Character) return Unbounded_String; 100 101 procedure SYNERR (STR : Wide_Wide_String); 102 103 procedure TRANSITION_STRUCT_OUT(ELEMENT_V, ELEMENT_N : in INTEGER); 104 function SET_YY_TRAILING_HEAD_MASK(SRC : in INTEGER) return INTEGER; 105 function CHECK_YY_TRAILING_HEAD_MASK(SRC : in INTEGER) return INTEGER; 106 function SET_YY_TRAILING_MASK(SRC : in INTEGER) return INTEGER; 107 function CHECK_YY_TRAILING_MASK(SRC : in INTEGER) return INTEGER; 108 function ISLOWER(C : in CHARACTER) return BOOLEAN; 109 function ISUPPER(C : in CHARACTER) return BOOLEAN; 110 function ISDIGIT(C : in CHARACTER) return BOOLEAN; 111 function TOLOWER(C : in INTEGER) return INTEGER; 112 113 function Basename 114 return Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; 115 -- Basename - find the basename of a file 116 117end Misc; 118