mkctype_yacc.y revision 6da5aa940d1e163c6f244b5523c22d545bfb954b
%{
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <ctype.h>
#include <err.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "ldef.h"
#include "extern.h"
#include "runefile.h"
void yyerror(const char *s);
static void dump_tables(void);
static void cleanout(void);
const char *locale_file = "<stdout>";
_FileRuneLocale new_locale = { 0 };
static void usage(void);
%}
%union {
int i;
char *str;
}
%%
locale : /* empty */
| table
{ dump_tables(); }
;
;
sizeof(new_locale.encoding)); }
| VARIABLE
}
{ warnx("the INVALID keyword is deprecated"); }
{ if (debug)
warnx("this system does not support DIGITMAP");
}
;
{
$$->min = $1;
$$->max = $1;
$$->next = 0;
}
{
$$->min = $1;
$$->max = $3;
$$->next = 0;
}
{
$$->min = $2;
$$->max = $2;
$$->next = $1;
}
{
$$->min = $2;
$$->max = $4;
$$->next = $1;
}
;
{
$$->min = $2;
$$->max = $2;
$$->map = $3;
$$->next = 0;
}
{
$$->min = $3;
$$->max = $3;
$$->map = $4;
$$->next = $1;
}
{
$$->min = $2;
$$->max = $4;
$$->map = $6;
$$->next = 0;
}
{
$$->min = $3;
$$->max = $5;
$$->map = $7;
$$->next = $1;
}
;
%%
int debug;
static void
cleanout(void)
{
(void) unlink(locale_file);
}
int
{
int x;
switch(x) {
case 'd':
debug = 1;
break;
case 'o':
break;
default:
usage();
}
}
case 0:
break;
case 1:
break;
default:
usage();
}
for (x = 0; x < _CACHED_RUNES; ++x) {
}
sizeof(new_locale.magic));
(void) yyparse();
return(0);
}
static void
usage(void)
{
exit(1);
}
void
yyerror(const char *s)
{
}
static void *
{
if (!r)
return(r);
}
static uint32_t *
{
if (!r)
return(r);
}
static uint32_t *
{
if (!r)
return(r);
}
void
{
while (list) {
}
}
void
{
int32_t i;
rune_list *r;
if (flag)
else
}
return;
}
if (flag) {
for (i = 0; i < run; ++i)
}
return;
}
lr = r;
if (!r) {
/*
* We are off the end.
*/
if (flag) {
for (i = 0; i < run; ++i)
}
return;
}
/*
* We come before this range and we do not intersect it.
* We are not before the root node, it was checked before the loop
*/
if (flag) {
for (i = 0; i < run; ++i)
}
return;
}
/*
* At this point we have found that we at least intersect with
* the range pointed to by `r', we might intersect with one or
* more ranges beyond `r' as well.
*/
/*
* There are only two cases when we are doing case maps and
* our maps needn't have the same offset. When we are adjoining
* but not intersecting.
*/
return;
}
return;
}
}
/*
* Subset case.
*/
if (flag) {
}
return;
}
/*
* Superset case. Make him big enough to hold us.
* We might need to merge with the guy after him.
*/
if (flag) {
} else {
}
/*
* Our tail intersects his head.
*/
if (flag) {
} else {
}
return;
} else {
/*
* Our head intersects his tail.
* We might need to merge with the guy after him.
*/
if (flag) {
}
}
/*
* Okay, check to see if we grew into the next guy(s)
*/
if (flag) {
/*
* Good, we consumed all of him.
*/
} else {
/*
* "append" him on to the end of us.
*/
}
} else {
}
if (flag)
}
}
static void
dump_tables(void)
{
/*
* See if we can compress some of the istype arrays
*/
break;
}
}
}
for (x = 0; x < _CACHED_RUNES; ++x) {
if (r & _CTYPE_D) {
if (first_d < 0)
else if (x != curr_d + 1)
else if (x - first_d > 9)
else
curr_d++;
if (!(r & _CTYPE_X))
errx(1,
"error: DIGIT range is not a subset of XDIGIT range");
}
}
if (first_d < 0)
/*
* Fill in our tables. Do this in network order so that
* diverse machines have a chance of sharing data.
* (Machines like Crays cannot share with little machines due to
* word size. Sigh. We tried.)
*/
for (x = 0; x < _CACHED_RUNES; ++x) {
}
/*
* Count up how many ranges we will need for each of the extents.
*/
while (list) {
}
while (list) {
}
while (list) {
}
/*
* Okay, we are now ready to write the new locale file.
*/
/*
* PART 1: The _FileRuneLocale structure
*/
exit(1);
}
/*
* PART 2: The runetype_ext structures (not the actual tables)
*/
while (list) {
exit(1);
}
}
/*
* PART 3: The maplower_ext structures
*/
while (list) {
exit(1);
}
}
/*
* PART 4: The mapupper_ext structures
*/
while (list) {
exit(1);
}
}
/*
* PART 5: The runetype_ext tables
*/
while (list) {
exit(1);
}
}
}
/*
* PART 6: And finally the variable data
*/
if (new_locale.variable_len != 0 &&
exit(1);
}
exit(1);
}
if (!debug)
return;
if (new_locale.encoding[0])
if (variable)
for (x = 0; x < _CACHED_RUNES; ++x) {
else
if ((x & 0xf) == 0xf)
else
}
for (x = 0; x < _CACHED_RUNES; ++x) {
else
if ((x & 0xf) == 0xf)
else
}
for (x = 0; x < _CACHED_RUNES; ++x) {
if (r) {
if (isprint(x))
else
}
}
} else
if (r) {
}
}
}
}