parse.y (41568) | parse.y (43940) |
---|---|
1%{ 2/*- 3 * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua> 4 * at Electronni Visti IA, Kiev, Ukraine. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1%{ 2/*- 3 * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua> 4 * at Electronni Visti IA, Kiev, Ukraine. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $Id: parse.y,v 1.10 1997/06/30 11:24:18 charnier Exp $ | 28 * $Id: parse.y,v 1.11 1998/12/06 22:58:17 archie Exp $ |
29 */ 30 31#include <err.h> 32#include <stdarg.h> 33#include <stdio.h> 34#include <string.h> 35#include <stdlib.h> 36#include <unistd.h> --- 42 unchanged lines hidden (view full) --- 79 | substitute 80 | order 81; 82charmap : DEFN CHAR { 83 strcpy(charmap_table[$2], $1); 84} 85; 86substitute : SUBSTITUTE STRING WITH STRING { | 29 */ 30 31#include <err.h> 32#include <stdarg.h> 33#include <stdio.h> 34#include <string.h> 35#include <stdlib.h> 36#include <unistd.h> --- 42 unchanged lines hidden (view full) --- 79 | substitute 80 | order 81; 82charmap : DEFN CHAR { 83 strcpy(charmap_table[$2], $1); 84} 85; 86substitute : SUBSTITUTE STRING WITH STRING { |
87 strcpy(__collate_substitute_table[$2[0]], $4); | 87 u_char ch = $2[0]; 88 89 if (strchr($4, ch) != NULL) 90 yyerror("Char 0x%02x substitution is recursive", ch); 91 strcpy(__collate_substitute_table[ch], $4); |
88} 89; 90order : ORDER order_list { 91 FILE *fp; 92 int ch; 93 94 for (ch = 0; ch < UCHAR_MAX + 1; ch++) | 92} 93; 94order : ORDER order_list { 95 FILE *fp; 96 int ch; 97 98 for (ch = 0; ch < UCHAR_MAX + 1; ch++) |
95 if (!__collate_char_pri_table[ch].prim) 96 yyerror("Char 0x%02x not present", ch); | 99 if ( !__collate_char_pri_table[ch].prim 100 && __collate_substitute_table[ch][0] == ch 101 && __collate_substitute_table[ch][1] == '\0' 102 ) 103 yyerror("Char 0x%02x not found", ch); |
97 98 fp = fopen(out_file, "w"); 99 if(!fp) 100 err(EX_UNAVAILABLE, "can't open destination file %s", 101 out_file); 102 103 strcpy(__collate_version, COLLATE_VERSION); 104 fwrite(__collate_version, sizeof(__collate_version), 1, fp); --- 189 unchanged lines hidden --- | 104 105 fp = fopen(out_file, "w"); 106 if(!fp) 107 err(EX_UNAVAILABLE, "can't open destination file %s", 108 out_file); 109 110 strcpy(__collate_version, COLLATE_VERSION); 111 fwrite(__collate_version, sizeof(__collate_version), 1, fp); --- 189 unchanged lines hidden --- |