hi everyone!!thanks for all the help that u gave!!
I'm porting a project from aix to linux RHEL5 system and i'm compiling all the code!!!
i'm doing well but now i'm stuck with those problems related to lex:
and i'm having this:
/usr/bin/lex -t ms_rmb_parser.l > __parser__l.c
"ms_rmb_parser.l", line 76: unrecognized rule
"ms_rmb_parser.l", line 82: unrecognized rule
"ms_rmb_parser.l", line 83: unrecognized rule
"ms_rmb_parser.l", line 97: unrecognized rule
"ms_rmb_parser.l", line 104: unrecognized rule
"ms_rmb_parser.l", line 105: unrecognized rule
"ms_rmb_parser.l", line 106: unrecognized rule
"ms_rmb_parser.l", line 110: unknown error processing section 1
"ms_rmb_parser.l", line 188: fatal parse error
make: *** [__parser__l.c] Erreur 1[/QUOTE]
i don't know what this mean because i'm a beginner in this!!
and that my .l file
Code:
/*******************************************************************************
* Project: ePOST/Open 2 *
* *
* File Name: ms_rmb_parser.l *
* *
* Subsystem: Mail Server *
* Module: Receive Mailbags (RMB) *
* *
* Description: This module contains the LEX specification for EPL file. *
* It used for parsing EPL Letters files from VM Mailbag *
* *
* Author: Paola Vinassa *
* *
* Created: *
********************************************************************************
* *
* Modification History *
* *
* Revision Date Who Modified Description *
* *
* 1.1 21 Jan 1998 EF Add storechone (TRC) *
*******************************************************************************/
%{
#include <stdio.h>
#include <ms_rmb.h>
#include <ms_rmb_parser.h>
#include "__parser__tab.h"
static void store_conv(void);
static void storechone(void);
static void store_afp(void);
static int store_channel(void);
static int store_eplb(char);
%}
%%
^\x5a..\xd3\xaf\x5f { store_afp(); return(t_IPS); }
^\x5a { store_afp(); return(t_AFP); }
^\xc5\xd7\xd3\xf1..........\xf0.* \
{ store_conv(); return(t_EPL1_S_E); }
^\xc5\xd7\xd3\xf1..........\xf2.* \
{ store_conv(); return(t_EPL1_M_E); }
^\xc5\xd7\xd3\xf2.* { store_conv(); return(t_EPL2_E); }
^\xc5\xd7\xd3\xd7.* { store_conv(); return(t_EPLP_E); }
^\xc5\xd7\xd3\xd4.* { store_conv(); return(t_EPLM_E); }
^\xf1.* { storechone(); return(t_CH1_E); }
^[\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3].* \
{ return( store_channel() ); }
^[\x40\xF0\x60\x4e].* \
{ storechone(); return(t_CH_NEUTRAL_E); }
^\xc5\xd7\xd3\xf4.* { store_conv(); return(t_EPL4_E); }
^\xc5\xd7\xd3\xf7.* { store_conv(); return(t_EPL7_E); }
^\xc5\xd7\xd3\xd1\x40\xd4\xc2\xc7\xd3\xc5\xe3.* \
{ store_conv(); return(t_EPLJMBGLET_E); }
^\xc5\xd7\xd3\xd1\x40\xd4\xc2\xc7\xc6\xc9\xd3\xc5.* \
{ store_conv(); return(t_EPLJMBGFILE_E); }
^\xc5\xd7\xd3\xd1\x40\xd4\xc2\xc7\xe2\xc5\xd9\xe5.* \
{ store_conv(); return(t_EPLJMBGSERV_E); }
^\xc5\xd7\xd3\xd1\x40\xd4\xc2\xc7\xd7\xc1\xc7\xc5.* \
{ store_conv(); return(t_EPLJMBGPAGE_E); }
\n { return(t_NL); }
. { printf("%X len %d\n", yytext[0], yyleng);
if (yytext[0] == 0x5a)
{ store_afp();
return (t_AFP);
} else return(t_ERR); }
%%
/* Removed rule EF 21/1/1998
^\xf1.* { storechone(); return(t_CH1_E); }
*/
static void storechone(void)
{
char c;
if(yyleng!=1)
{
memcpy(lineBuffer, yytext, yyleng);
lineBuffer[yyleng]='\0';
}
else
{
/* '\0' has been met */
memcpy(lineBuffer, yytext, yyleng);
while((c=input())!='\n')
{
lineBuffer[yyleng++]=c;
}
unput(c);
lineBuffer[yyleng]='\0';
}
mleng=yyleng;
}
static void store_conv(void)
{
char ascii_rec[1024];
memcpy(lineBuffer, yytext, yyleng);
lineBuffer[yyleng]='\0';
mleng=yyleng;
Convert_to_ASCII(yytext,ascii_rec,mleng);
ascii_rec[mleng] = NULL;
#ifdef DEBUG
printf("lineBuffer: #%s#\n", lineBuffer);
printf("ascii: #%s#\n", ascii_rec);
printf("mleng: %d\n", mleng);
#endif
}
/* AFP block management */
static void store_afp(void)
{
unsigned int i, nchar;
char c;
memcpy(lineBuffer, yytext, yyleng);
for ( ;yyleng < 6; yyleng++)
{
lineBuffer[yyleng]=input();
}
/*
lineBuffer[yyleng]=input();
yyleng++;
lineBuffer[yyleng]=input();
yyleng++;
*/
/* The bytes [1-2] contain the lenght of the record afp; */
/* the byte [1] is the most significant byte */
nchar = ((unsigned char)lineBuffer[1])*256 + (unsigned char)lineBuffer[2];
for( i=yyleng-1; i<nchar; i++)
{
c=input();
lineBuffer[yyleng]=c;
yyleng++;
}
mleng=yyleng;
#ifdef DEBUG
printf("lineBuffer: #%s#\n", lineBuffer);
printf("mleng: %d\n", mleng);
#endif
}
/* Channels management */
/* the recipient channel is 2 or the one in the customer profile */
int store_channel(void)
{
char ascii_rec[1024];
char c;
/* memcpy(lineBuffer, yytext, yyleng);
lineBuffer[yyleng]='\0';
mleng=yyleng;
Convert_to_ASCII(yytext,ascii_rec,mleng);
ascii_rec[mleng] = NULL;
*/
if(yyleng!=1)
{
memcpy(lineBuffer, yytext, yyleng);
lineBuffer[yyleng]='\0';
}
else
{
/* '\0' has been met */
memcpy(lineBuffer, yytext, yyleng);
while((c=input())!='\n')
{
lineBuffer[yyleng++]=c;
}
unput(c);
lineBuffer[yyleng]='\0';
}
mleng=yyleng;
#ifdef DEBUG
printf("lineBuffer: #%s#\n", lineBuffer);
printf("ascii: #%s#\n", ascii_rec);
printf("mleng: %d\n", mleng);
#endif
if(lineBuffer[0] == 0xF2)
return (t_CHX_REC_E);
else
return (t_CHX_NOREC_E);
}
i will be grateful if u help me figure this out!!!