%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <libintl.h>
#include <string.h>
#include <regexpr.h>
#include "iconv_tm.h"
#include "itmcomp.h"
#include "y.tab.h"
static itm_data_t *hexadecimal_data(int, char *);
static itm_data_t *name_data(int, char *);
static void filename_lineno(void);
static int at_name_to_token(char *);
%}
DECIMAL ([0-9]+)
ITMNAME (([^% \t\n\r])+"%"([^% \t\n\r])+)
%%
[ \t\n]+ ;
"//".*"\n" ;
}
^"#".*"\n" {
gettext("warning: "
"preprocess may be required\n"));
}
}
{DECIMAL} {
return (DECIMAL);
}
return (DECIMAL);
}
return (HEXADECIMAL);
}
return (ITMNAME);
}
}
return (MAPTYPE_NAME);
}
} else {
return (NAME);
}
}
"{" {return (CBO);}
"}" {return (CBC);}
"[" {return (SBO);}
"]" {return (SBC);}
"(" {return (PO);}
")" {return (PC);}
";" {return (SC);}
"," {return (COMMA);}
":" {return (COLON);}
"..." {return (ELLIPSES);}
"=" {return (ASSIGN);}
"||" {return (LOR);}
"&&" {return (LAND);}
"|" {return (OR);}
"^" {return (XOR);}
"&" {return (AND);}
"==" {return (EQ);}
"!=" {return (NE);}
"<" {return (LT);}
"<=" {return (LE);}
">" {return (GT);}
">=" {return (GE);}
"<<" {return (SHL);}
">>" {return (SHR);}
"+" {return (PLUS);}
"-" {return (MINUS);}
"*" {return (MUL);}
"/" {return (DIV);}
"%" {return (MOD);}
"!" {return (NOT);}
"~" {return (NEG);}
. { itm_error(
gettext("Unrecognized token '%1$c' \n"),
return (0);
}
%%
/*
* lexinit - starts the Lexical Analyzer off in the right start condition
*/
void
lexinit()
{
}
/* does this really need to be here? */
int
yywrap()
{
return (1);
}
void
yyerror(char *s)
{
extern int yylineno;
gettext("%1$s: file(%2$s) line(%3$d) last token(%4$s)\n"),
}
typedef struct {
char *name;
int token;
/*
* NOT: This table must be sorted alphabetically.
*/
static at_name_token_t at_table[] = {
"@automatic", MAPTYPE_AUTO,
"@binary", MAPTYPE_BINARY,
"@between", BETWEEN,
"@condition", CONDITION,
"@default", ITM_DEFAULT,
"@dense", MAPTYPE_DENSE,
"@direction", DIRECTION,
"@discard", DISCARD,
"@else", ITM_ELSE,
"@error", ERROR,
"@escapeseq", ESCAPESEQ,
"@false", ITM_FALSE,
"@hash", MAPTYPE_HASH,
"@identical", ITM_IDENTICAL,
"@if", ITM_IF,
"@in", ITM_IN,
"@index", MAPTYPE_INDEX,
"@init", ITM_INIT,
"@input", ITM_IN,
"@inputsize", ITM_INSIZE,
"@map", MAP,
"@maptype", MAPTYPE,
"@no_change_copy", ITM_IDENTICAL,
"@nop", NOP,
"@operation", OPERATION,
"@out", ITM_OUT,
"@output", ITM_OUT,
"@output_byte_length", RESULTLEN,
"@outputsize", ITM_OUTSIZE,
"@printchr", PRINTCHR,
"@printhd", PRINTHD,
"@printint", PRINTINT,
"@reset", RESET,
"@resultlen", RESULTLEN,
"@return", RETURN,
"@true", ITM_TRUE,
"automatic", MAPTYPE_AUTO,
"between", BETWEEN,
"binary", MAPTYPE_BINARY,
"break", BREAK,
"condition", CONDITION,
"default", ITM_DEFAULT,
"dense", MAPTYPE_DENSE,
"direction", DIRECTION,
"discard", DISCARD,
"else", ITM_ELSE,
"error", ERROR,
"escapeseq", ESCAPESEQ,
"false", ITM_FALSE,
"hash", MAPTYPE_HASH,
"if", ITM_IF,
"index", MAPTYPE_INDEX,
"init", ITM_INIT,
"input", ITM_IN,
"inputsize", ITM_INSIZE,
"map", MAP,
"maptype", MAPTYPE,
"no_change_copy", ITM_IDENTICAL,
"nop", NOP,
"operation", OPERATION,
"output", ITM_OUT,
"output_byte_length", RESULTLEN,
"outputsize", ITM_OUTSIZE,
"printchr", PRINTCHR,
"printhd", PRINTHD,
"printint", PRINTINT,
"reset", RESET,
"return", RETURN,
"true", ITM_TRUE,
};
int
at_name_to_token(char *s)
{
int high;
int mid;
int low;
int result;
sizeof (at_name_token_t));
if (result < 0) {
} else if (0 < result) {
} else { /* 0 == result */
}
}
return (0);
}
static itm_data_t *
{
char *binary;
int i, j;
int val;
int high;
int low;
int size;
/* size is assured to be multiple of 2 */
size /= 2;
if (size > MAXSEQUENCE) {
gettext(" specified sequence must be less than %$1d\n"),
return (NULL);
}
i = j = 0;
if (seqsize % 2 != 0) {
}
i++;
j++;
}
}
}
}
} else {
}
return (data);
}
static itm_data_t *
{
if (size > MAXNAMELENGTH) {
}
} else {
}
return (data);
}
static void
filename_lineno(void)
{
static char *re;
static char restr[] =
"^#[ \t]*\\([0-9]\\{1,\\}\\)[ \t]*\"\\(.*\\)\".*";
int match;
extern char *braslist[];
extern char *braelist[];
static char *filename;
int len;
int lineno;
gettext("REGEXP compile error\n"));
}
}
if (0 != match) {
}
}